Part of the Improve Agent UX for Wallets epic.
Summary
Add stellar token, a typed SEP-41 + SAC client. Each subcommand is a thin wrapper over the existing contract invoke pipeline with token-aware argument parsing, asset/contract resolution, and decimal-aware amount formatting. Because the underlying call is a contract invocation, every state-changing subcommand inherits the full pipeline (simulate → auth-entry signing → tx signing → fee-bump → submit → poll) and returns a decoded receipt. Sane default are included for settings like the transaction fee.
Subcommands
| Group |
Subcommands |
| Transfer |
transfer, transfer-from |
| Read |
balance, allowance, name, symbol, decimals |
| Allowance |
approve |
| Supply |
burn, burn-from |
| SAC admin |
mint, set-admin, clawback, set-authorized |
Target resolution
--id C… or an alias targets any SEP-41/SAC contract directly, reusing UnresolvedContract from config/alias.rs.
- Special-case
native — --id native resolves the native SAC.
- Reuse
contract id asset resolution + utils::contract_id_hash_from_asset; asset parsing in tx/builder/asset.rs.
- SEP-41 reference implementation:
cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs.
New files
cmd/soroban-cli/src/commands/token/{mod.rs, transfer.rs, balance.rs, approve.rs, allowance.rs, burn.rs, mint.rs, admin.rs, args.rs} — subcommands plus shared resolution/formatting in args.rs.
Error paths
- SAC not deployed → structured error pointing at
contract deploy asset.
- Missing trustline / authorization → named error; provisioning left to a skill using
tx new change_trust.
Acceptance criteria
Dependencies
Builds on the structured-output/CLI-API task for receipt + error shapes.
Part of the Improve Agent UX for Wallets epic.
Summary
Add
stellar token, a typed SEP-41 + SAC client. Each subcommand is a thin wrapper over the existingcontract invokepipeline with token-aware argument parsing, asset/contract resolution, and decimal-aware amount formatting. Because the underlying call is a contract invocation, every state-changing subcommand inherits the full pipeline (simulate → auth-entry signing → tx signing → fee-bump → submit → poll) and returns a decoded receipt. Sane default are included for settings like the transaction fee.Subcommands
transfer,transfer-frombalance,allowance,name,symbol,decimalsapproveburn,burn-frommint,set-admin,clawback,set-authorizedTarget resolution
--id C…or an alias targets any SEP-41/SAC contract directly, reusingUnresolvedContractfromconfig/alias.rs.native—--id nativeresolves the native SAC.contract id assetresolution +utils::contract_id_hash_from_asset; asset parsing intx/builder/asset.rs.cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs.New files
cmd/soroban-cli/src/commands/token/{mod.rs, transfer.rs, balance.rs, approve.rs, allowance.rs, burn.rs, mint.rs, admin.rs, args.rs}— subcommands plus shared resolution/formatting inargs.rs.Error paths
contract deploy asset.tx new change_trust.Acceptance criteria
stellar token transfer --id native --to <dst> <amt>on testnet resolves the SAC, simulates, signs, submits, polls, and returns a JSON receipt with tx hash + decoded result — no caller-supplied seq/fee.mint/set-admin/clawback/set-authorizedagainst an administered SAC each return a decoded receipt.balance/allowancereturn decimal-aware values;name/symbol/decimalsreturn metadata.Dependencies
Builds on the structured-output/CLI-API task for receipt + error shapes.