Multi-party exchanges of HBAR, fungible HTS tokens, and NFT serials, composed step by step locally and executed as one Hedera transfer transaction (Documentation Index
Fetch the complete documentation index at: https://docs.hedera.com/llms.txt
Use this file to discover all available pages before exploring further.
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.Swap name.
Destination account (account ID or alias).
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.Key manager for resolving credentials (defaults to config).
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.Swap name.
Destination account.
Fungible token ID or imported alias.
Amount in display units unless you append
t for base units (consistent with other token commands).Source account (defaults to operator).
Key manager (defaults to config).
Swap Add NFT
Swap Add NFT
Append one or more NFT serial transfers (same token, comma-separated serials).Examples
Swap name.
Destination account.
NFT token ID or imported alias.
Comma-separated serial numbers (for example
1,2,3).Source account (defaults to operator).
Key manager (defaults to config).
Swap Execute
Swap Execute
Build the Example
TransferTransaction, sign with every required from key, submit, and on success delete the swap from state.Swap to execute (must contain at least one transfer).
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
Remove the named swap from state without submitting a transaction.Example
Swap to 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.