Installation

Or use without installing:

ankara init

Scaffold a new Ankara Chain project interactively.
What it does:
  • Prompts for network, project name, and private key
  • Creates ankara.config.json with network settings
  • Creates .env with your private key (gitignored)
  • Prints next steps
Example:
Output files:

ankara deploy-factory

Deploy the on-chain TokenFactory contract to your configured network.
Requirements:
  • ankara.config.json must exist (run ankara init first)
  • PRIVATE_KEY must be set in .env
  • Wallet must have enough native tokens to cover gas
What it does:
  • Deploys the TokenFactory contract
  • Registers all 6 asset template implementations
  • Writes factoryAddress to ankara.config.json
Example output:

ankara deploy

Deploy a new RWA token from a template via interactive prompts.
Options: Requirements:
  • factoryAddress must be set in ankara.config.json
Interactive prompts by template:
Token name, symbol, asset ID, country code, GPS location, area (sq m), soil type, irrigation type, crop history, state/region, valuation USD
Token name, symbol, asset ID, country code, commodity type, quantity (kg), grade, warehouse ID, warehouse location, harvest season, valuation USD
Token name, symbol, asset ID, country code, property ID, property type, location address, total area (sq m), occupancy status, rental yield (bps), valuation USD
Token name, symbol, asset ID, country code, invoice number, debtor reference, face value USD, discount rate (bps), days until due, currency
Token name, symbol, asset ID, country code, credit type, verification body ref, vintage year, quantity CO2e (tonnes), project location, project type
Token name, symbol, asset ID, country code, license number, mineral type, concession area, area (hectares), license expiry (days from now), issuing authority, royalty rate (bps)
Example:
The deployment result is saved to ankara.config.json under deployments.

ankara mint

Mint tokens to a recipient address.
Interactive prompts:
  • Token address (or pick from saved deployments)
  • Recipient wallet address
  • Amount to mint

ankara status

Check the status of a deployed token.
Reads from ankara.config.json and queries the chain for:
  • Token name, symbol, total supply
  • Asset status (DRAFT / ACTIVE / SUSPENDED / REDEEMED / EXPIRED)
  • Metadata version

NFT Commands

ankara deploy-nft

Deploy an ERC-721 NFT asset record via interactive prompts.
Requirements:
  • nftFactoryAddress must be set in ankara.config.json
Interactive prompts:
  • Template picker: farmland-nft, real-estate-nft, mining-rights-nft, commodity-vault-nft
  • Collection name, symbol, asset ID, country code
Metadata fields are deployed as empty/zero placeholders — update them post-deploy via the SDK or a direct contract call. The deployment result is saved to ankara.config.json under deployments.

ankara transfer

Transfer ERC-20 tokens or ERC-721 NFTs to a recipient. Auto-detects the token standard via ERC-165 (supportsInterface) — no --type flag needed.
Interactive prompts:
  • Contract address
  • If ERC-721: recipient address, token ID
  • If ERC-20: recipient address, amount (in token units)

Multi-Token / Pool Commands

These commands operate on the ERC-1155 layer (MultiTokenFactory, CommodityBatchToken, PoolVault, ManualOracle).

ankara deploy-batch

Deploy a CommodityBatchToken (ERC-1155 warehouse receipt contract) via interactive prompts.
Requirements:
  • multiTokenFactoryAddress must be set in ankara.config.json
Interactive prompts:
  • Warehouse name, country code, base IPFS URI, warehouse ID, warehouse location

ankara deploy-pool

Deploy a PoolVault (multi-asset ERC-20 fund) via interactive prompts.
Requirements:
  • multiTokenFactoryAddress must be set in ankara.config.json
Interactive prompts:
  • Pool name, symbol, asset ID, country code
  • Oracle address (leave blank for none)
  • Management fee in basis points (default 50 = 0.5%/yr)

ankara register-batch

Register a new commodity batch on an already-deployed CommodityBatchToken contract.
Interactive prompts:
  • Contract address, batch ID, commodity type, quantity (kg), grade classification, harvest season, origin country, valuation USD, expiry (unix timestamp)

ankara batch-mint

Mint ERC-1155 commodity batch tokens to a recipient.
Interactive prompts:
  • Contract address, batch ID, recipient address, amount

ankara deposit

Approve and deposit an ERC-20 token into a PoolVault.
What it does:
  1. Prompts for the vault address, token address, and amount
  2. Sends an approve() transaction for the vault to spend the token
  3. Calls vault.deposit(token, amount)

ankara withdraw

Withdraw from a PoolVault by burning pool tokens.
Interactive prompts:
  • Vault address, amount of pool tokens to burn

ankara pool-status

Show NAV, AUM, accepted tokens, and fee info for a PoolVault.
Options: Reports: name/symbol, total supply, NAV per token, total AUM, management fee (bps), oracle address, last fee accrual timestamp, and the list of accepted deposit tokens.

ankara oracle-set

Set a token’s USD price on a ManualOracle contract.
Interactive prompts:
  • Oracle address, token address, price in USD (e.g. 1.50)

Escrow Commands

Commands for the MilestoneEscrow / EscrowFactory contracts — tranche-based, dual-approval payments with an optional arbiter and a timelock fallback. See Escrow for the on-chain mechanics.

ankara deploy-escrow

Deploy a MilestoneEscrow for tranche-based diaspora payments via interactive prompts.
Requirements:
  • escrowFactoryAddress must be set in ankara.config.json
Interactive prompts:
  • Payer address (funds the escrow), payee address (receives released funds)
  • Arbiter address (optional — leave blank for none)
  • Stablecoin address (must be whitelisted on the EscrowFactory)
  • Timelock in days (default 7)
  • Number of milestones, then an amount + description per milestone
The deployment result is saved to ankara.config.json under deployments.

ankara escrow-fund

Approve and deposit the full agreed amount into a MilestoneEscrow. Payer only.
What it does:
  1. Prompts for the escrow address
  2. Reads the escrow’s token and total amount
  3. Sends an approve() transaction, then calls fund()

ankara escrow-deliver

Mark a milestone as delivered. Payee only.
Interactive prompts:
  • Escrow address, milestone ID (0-indexed)

ankara escrow-approve

Approve a delivered milestone, releasing funds to the payee. Payer only.
Interactive prompts:
  • Escrow address, milestone ID (0-indexed)

ankara escrow-dispute

Raise a dispute on a delivered milestone. Payer or payee.
Interactive prompts:
  • Escrow address, milestone ID (0-indexed)

ankara escrow-resolve

Resolve a disputed milestone. Arbiter only.
Interactive prompts:
  • Escrow address, milestone ID (0-indexed)
  • Resolution: release funds to payee, or refund to payer

ankara escrow-claim-timelock

Force-release a delivered, non-disputed milestone once the timelock has elapsed. Callable by anyone.
Interactive prompts:
  • Escrow address, milestone ID (0-indexed)

ankara escrow-status

Show status, balances, and milestones for a MilestoneEscrow.
Options: Reports: payer, payee, arbiter, token, total amount, funded/cancelled flags, remaining balance, and every milestone’s amount, status, and delivery timestamp.

Ramp Commands (on-ramp / off-ramp)

Commands for fiat↔token flows. The off-chain half always uses ManualRampProvider (a reference implementation for dev/testing) — swap in a real provider adapter (Yellow Card, Flutterwave, Transak, etc.) in your own integration. The on-chain half (RampSettlement) is optional; see On-Ramp / Off-Ramp for the full design.

ankara deploy-ramp-settlement

Deploy a RampSettlement contract for fiat on/off-ramp flows via interactive prompts.
Requirements:
  • rampSettlementFactoryAddress must be set in ankara.config.json
Interactive prompts:
  • Treasury address (receives settled off-ramp deposits)
The deployment result is saved to ankara.config.json under deployments.

ankara ramp-quote

Get a fiat↔token quote.
Interactive prompts:
  • Direction (on-ramp / off-ramp), fiat currency, token symbol, country code, amount (fiat or token units)

ankara onramp-initiate

Start an on-ramp session (fiat → tokens) with the ramp provider.
Interactive prompts:
  • Fiat amount, fiat currency, token symbol, recipient wallet address, country code
Prints a session/reference string and a payment URL. Does not mint any tokens — once the fiat payment is confirmed, mint the recipient’s tokens via your existing deploy/mint commands, then run ankara onramp-record.

ankara onramp-record

Record an on-chain attestation that an on-ramp mint happened. SETTLER_ROLE only.
Interactive prompts:
  • RampSettlement address, reference string (from onramp-initiate, or any consistent ID), recipient address, minted token address, amount
Does not move funds — this only writes a verifiable on-chain record after the mint has already happened.

ankara offramp-initiate

Start an off-ramp session (tokens → fiat): deposits tokens into RampSettlement custody and starts a provider payout session.
What it does:
  1. Starts a payout session with the ramp provider
  2. Sends an approve() transaction for the settlement contract to spend the token
  3. Calls initiateOffRamp() on the settlement contract, depositing the tokens into custody
Interactive prompts:
  • RampSettlement address, token address, amount, fiat currency, payout account number, bank code (leave blank for mobile money), country code

ankara offramp-confirm

Confirm an off-ramp fiat payout, releasing custodied tokens to the treasury. SETTLER_ROLE only.
Interactive prompts:
  • RampSettlement address, reference string (from offramp-initiate)

ankara offramp-refund

Refund a custodied off-ramp deposit to the original depositor if the fiat payout failed. MANAGER_ROLE only.
Interactive prompts:
  • RampSettlement address, reference string (from offramp-initiate)

ankara ramp-status

Show the on-chain off-ramp deposit / on-ramp record for a reference.
Options: Reports the treasury address, plus (if present for the given reference) the off-ramp deposit’s depositor/token/amount/status and the on-ramp record’s recipient/token/amount/status.

Config File: ankara.config.json

Generated by ankara init and updated by deploy commands:
nftFactoryAddress, multiTokenFactoryAddress, escrowFactoryAddress, and rampSettlementFactoryAddress are only required for the commands in their respective sections above (NFT, multi-token/pool, escrow, and ramp commands) — ankara init only writes factoryAddress by default.
ankara.config.json is gitignored by default — it contains your deployment addresses and network config. Commit it intentionally if you want to track deployments in version control.

Environment Variables