GeezerVison is showing github.com — stellar token: typed SEP-41 + SAC client · Issue #2620 · stellar/stellar-cli
stellar token: typed SEP-41 + SAC client #2620DescriptionPart 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
-
stellar token transfer --id native --to <dst> --amount <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.
- Issued-asset transfer succeeds with a deployed SAC + trustlines; returns the deploy-pointer error when the SAC is missing; returns the named trustline error when the trustline is missing.
-
mint / set-admin / clawback / set-authorized against an administered SAC each return a decoded receipt.
-
balance / allowance return decimal-aware values; name / symbol / decimals return metadata.
Dependencies
Builds on the structured-output/CLI-API task for receipt + error shapes. Activityjanewang commented on Jul 8, 2026
Marcelo suggested --type=sep41 to switch between different token types (to be defined)
github-actions commented on Oct 7, 2026 This issue is stale because it has been assigned for 90 days with no activity. fnando commented on Oct 7, 2026 Everything on this list has been implemented.
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|