Before you start
Install Node.js 22 or later, which includes npm. These commands always use testnet, regardless of the network selected in the docs.1. Install the CLI
0.11.1.
Create .gitignore:
.shield-swap/testnet/. Keep that directory between sessions and out of source control.
2. Create and fund the account
CLI reports NEEDS_INVITE_CODE
CLI reports NEEDS_INVITE_CODE
CLI 0.11.1 still prints this message when
/referral/status returns has_access: false. In the current API, this field reports terms acceptance. Referral-code redemption does not grant access.Run shield-swap setup --network testnet again to sign in with a new challenge. If the message continues, check the API endpoint saved in .shield-swap/testnet/state.json and any SHIELD_SWAP_API_URL override. An older or custom deployment can have different access rules.shield-swap setup --network testnet to continue with the saved account.
Use an existing testnet account
Use an existing testnet account
Instead of Do not paste the key into a command or commit the file. You can also set
--new, save your private key to a file outside this project and pass its path:SHIELD_SWAP_PRIVATE_KEY in your shell. The CLI does not automatically load .env files.ASK_NEXT_ACTION menu for agent integrations. You can skip that menu and continue with the balance check and quote below.
Setup prints Account ... is ready on testnet and lists token balances. Check that the private column contains at least 1 USDCx:
3. Quote and review
--execute, the command only prepares a quote. Check the following before submitting:
The default slippage is 0.5% (50 basis points). To change it, add
--slippage with a basis-point value. --amount takes a decimal token amount, such as 1 or 1.5.
In v0.11.1, the CLI stops before submission if the output estimate is missing or unusable, or the minimum output is zero. If no route is available, run shield-swap pools --network testnet to find a tradeable pair.
4. Submit and claim
Use the same arguments and add--execute:
5. Verify settlement
Save the swap transaction ID, claim transaction ID, swap ID, and received amount printed by the command. Use the public testnet explorer API to check both transactions independently, replacing the placeholders with your IDs:"status": "accepted" in both responses. A transaction ID, HTTP 200, or successful CLI exit alone doesn’t confirm settlement. If a result is missing or the request fails, check again before submitting another trade. See Transaction lookup results for help with rejected or unavailable results.
Check your updated balances:
0.006 + received ETH. Use the amount you actually received; it can differ from the quote estimate.
The scanner can lag behind the confirmed claim. If ETH is not visible yet, wait and check again. See Missing output records if the delay persists.
Run the settlement verifier with your saved CLI account to check the exact output. It confirms that both transactions belong to the same swap and that swap_outputs[swap_id] is absent. It also matches a decrypted, unspent ETH record to the claim’s commitment and received amount. These checks don’t submit a transaction.
History says claimed but reports zero settled swaps
History says claimed but reports zero settled swaps
In v0.11.1, history can show a
claimed row and an all-settled message, yet report zero settled swaps and leave out the received amount. This can happen when the local history has no recorded claim. Check the accepted claim and its matching output record to confirm settlement. Don’t submit another claim to fix the display.Finish an interrupted swap
Do not runswap --execute again to recover a trade. Inspect the existing swap:
SWAP_ID with its ID from history:
Next steps
- Build with an SDK to add swaps to an application or bot.
- Trader workflow explains the full swap and claim lifecycle.