How recovery works
Every swap finishes in two steps, a swap and then a claim. Swap explains why. Recovery starts with the original trade: you check its history and status before deciding whether a claim is still needed. In the app, Shield Wallet keeps the data that connects a swap to your wallet, so your history and any unfinished claims appear whenever that wallet is connected. With the SDKs or CLI, your trading tools retain that data. Reopening it allows you to find unfinished trades after a restart. A transaction ID helps you check what happened, but it does not replace the secret data needed to claim.In the app
Before you startYou’ll need: Shield Wallet connected to Shield Swap, using the same account that made the trade.Check a swap
- Open Portfolio.
- Select History.
Finish a pending claim
- Open Portfolio.
- Select Pending Claims.
- Select Claim in the row for the swap.
- In Review collection, check the transaction details, then select Confirm.
- Approve the request in Shield Wallet.
Troubleshooting
Read account history
Prerequisites: Use the same account and network that submitted the swap. These examples use the mainnet clients from Setup, with the original recovery store or journal reopened. For a testnet trade with saved recovery data, reopen its testnet store and set--network testnet in CLI commands.The Quickstart SDK snippets keep recovery data in memory. If that session is still open, continue with its original client or shield_swap_client and handle in the claim step. Creating a new file store does not copy that session’s recovery data.An empty SDK store does not restore saved claim data. The TypeScript examples use client and its identities store; Python uses dex with its original journal attached. Run CLI commands from the account directory used for the trade.- TypeScript
- Python
- CLI
Reconciliation matches your saved recovery data against transaction history. It can fill in missing swap IDs and claim results so you can distinguish completed trades from outputs still waiting to be claimed.
records contains your stored history, including swapId, status, and any saved handle or claim. pending.swaps lists outputs still present on chain; each has a swapId and a claimable flag indicating whether the store contains a usable handle.Both pagination options are optional integers. maxPages limits this search to 40 pages; omitting it allows the full history walk. pageSize sets calls per page, from 1 to 50, and defaults to 50.If result.complete is false, raise or omit maxPages to search farther back. pending.unresolvable lists stored identities whose swap IDs remain unknown. Even a complete history search cannot establish the outcome of a transaction still awaiting confirmation.Establish the original outcome
A transaction can succeed even when your application stops waiting for it. Use the original swap and claim transaction IDs with the transaction lookup before submitting anything else.A missing pending-output entry on chain can mean the swap has not finalized or its output has already been claimed. The accepted transactions and returned records let you distinguish these cases. Failures and recovery covers unresolved transactions and scanner delays.
Claim one pending output
Prerequisites: Your original mainnet account and recovery store from Read account history, and an accepted swap whose output remains unclaimed. ReplaceSWAP_ID with that swap’s ID from history, including its field suffix.- TypeScript
- Python
- CLI
Find the original swap’s handle in the store. The check below stops if its output is absent or the data needed to claim is missing:
claim.transactionId identifies the claim transaction. claim.amountOut is the received output and claim.amountRemaining is refunded input, both as base-unit bigint values.