CryptoTransfer). If the submission fails (for example insufficient balance), the saved swap stays in CLI state unless you swap delete it.
Swaps are stateful: nothing is submitted until
hcli swap execute. Inspecting local drafts does not hit the network. Use swap list, swap view, and hcli swap --help on your installed build.Typical workflow
Create a named swap, add each transfer you want, review, then executeLimits and behaviour
- Transfer entry cap: A single Hedera
TransferTransactionsupports at most 10 transfer entries. The CLI uses the same limit when you add steps. - HBAR and FT: Each
add-hbaroradd-ftstep counts as one entry. - NFTs: Each serial in
add-nft --serialscounts as one entry when capacity is checked for that command. - Atomicity: All entries are applied in one transaction — they succeed or fail together.
swap execute, every distinct source account (--from, operator by default) must be able to sign. The CLI collects the required keys when signing before submission. After a successful execute, that swap name is removed from CLI state automatically.
State storage
Draft swaps persist under your CLI state directory (see Overview), typically~/.hiero-cli/state/swap-storage.json, per network.
Full command reference
Swap Create
Swap Create
Swap Add HBAR
Swap Add HBAR
Append an HBAR transfer from Examples
--from (default: operator) to --to.Amount: plain value is in HBAR (for example
10). The suffix t means tinybars (for example 1000t).Source account:
accountId:privateKey, alias, account ID, or key reference. Defaults to the operator.Swap Add FT
Swap Add FT
Append a fungible HTS transfer. For display amounts (without Examples
t), decimals are resolved from the mirror node when you run the command.Amount in display units unless you append
t for base units (consistent with other token commands).Swap Add NFT
Swap Add NFT
Append one or more NFT serial transfers (same token, comma-separated serials).Examples
Swap Execute
Swap Execute
Swap List
Swap List
Summaries for all swaps stored for the current network (names, transfer counts, limits).Example
Swap View
Swap View
Full detail for one named swap stored in CLI state: memo, transfers (type HBAR / FT / NFT), from/to, and counts versus the protocol limit (10 entries per transaction).Example
Swap Delete
Swap Delete
Related
- Hedera semantics for moving value between several accounts in one transaction match the topic covered under Atomic swaps in the SDK documentation.
- The Batch plugin queues distinct inner transactions for HIP-551 atomic batch submission.
swapassembles oneCryptoTransfer. Use whichever matches your operational model.