TokenFactory API as the EVM quickstart — only the config changes. By the end you will have a deployed Soroban token contract, minted fractional shares to a testnet account, and a working milestone escrow deal demonstrating Stellar’s on-chain payment primitive.
Prerequisites
- Node.js 18+ installed locally
- A Stellar testnet account with a secret key starting with
S... - Testnet XLM to pay Soroban transaction fees — get free XLM from the Stellar Friendbot
1
Install the SDK
Install the Ankara Chain TypeScript SDK:You can also run CLI commands without a global install using
npx:The Stellar adapter bundles
@stellar/stellar-sdk as a dependency. You do not need to install it separately — the SDK manages the Soroban RPC client and contract bindings internally.2
Initialize your project
Run the After the wizard completes, your project directory contains:Your Replace
ankara init wizard and select Stellar Testnet (Soroban) when prompted for a network:.env file will include:your_stellar_secret_seed_here with your actual Stellar testnet secret key (the one starting with S). The config file starts with just the network set:3
Set the Token Factory address
Unlike the EVM flow, you do not need to deploy your own factory contract for testnet — a shared factory is already deployed on Stellar Testnet. Set the factory address in The full set of live Stellar Testnet contract addresses is:
ankara.config.json to use it immediately.Update your config to match the live testnet deployments:If you need isolated factory contracts under your own deployer key — for example, to run a whitelisted identity verifier that only your app controls — you can deploy your own Soroban factories from the open-source contracts. See Stellar Contracts for instructions.
4
Deploy a token
Deploy a token using the same The interactive wizard prompts for asset metadata:The deployed contract ID (a Soroban
ankara deploy flow as EVM networks:C... address) is saved to ankara.config.json alongside your factory address. All six asset templates — Farmland, Commodity, Real Estate, Invoice, Carbon Credit, and Mining Rights — are available on Stellar with full feature parity with EVM.5
Mint tokens
Mint fractional token shares to a Stellar testnet account:The CLI reads your deployed token from
ankara.config.json, prompts for a recipient Stellar address (a G... public key), and the amount to mint. The Soroban token contract conforms to the SEP-41 fungible token interface, so any Stellar wallet or exchange that supports SEP-41 can hold and transfer the issued shares.6
Create a Milestone Escrow deal
The Ankara Chain The wizard prompts for payer, payee, token, and milestone amounts. For testnet demos, you can use the native XLM Stellar Asset Contract as the escrow token:The deployed escrow contract ID is saved to
MilestoneEscrow contract lets you structure payment deals tied to on-chain delivery confirmations — useful for tranche-based land purchase agreements, invoice financing draws, or commodity release schedules.Deploy an escrow contract using the CLI:ankara.config.json under deployments. The payer can then fund individual milestones, the payee marks them as delivered, and the arbiter (if set) resolves disputes — all on-chain via Soroban invocations.Using the SDK Directly
For programmatic use in your application — server-side scripts, backend APIs, or build pipelines — pass your Stellar secret key directly toTokenFactory. The adapter handles the Soroban RPC client, transaction signing, and result normalization:
DeployResult has the same shape as on EVM chains:
Browser / Freighter integration
In browser-based applications, you should never expose the Stellar secret key. Instead, pass astellarSigner — an object matching the Freighter wallet API shape — to avoid the raw seed ever touching application code:
stellarSigner and stellarSecretKey are mutually exclusive. If both are set, stellarSecretKey takes precedence — so never set both in the same config object.
Deploying a Milestone Escrow programmatically
Next Steps
Stellar Contracts
How Soroban contracts map to the same SDK API as EVM networks, and what Stellar-specific features are available.
EVM Quickstart
Deploy the same token on Polygon Amoy if you want to compare the EVM and Stellar flows side by side.
CLI Commands
Full reference for every
ankara command and flag, including Stellar-specific options.Escrow Contracts
Milestone-based escrow architecture, dispute resolution, and arbiter roles.