Skip to main content
If your swap went through but the output has not arrived, the output is waiting for its claim and you can collect it. A timeout, a closed window, or a restart does not undo the trade. This page helps you check what happened to a swap and finish it, in the Shield Swap app or with the SDKs or CLI.

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.

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.
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.
Stored claim amounts use base units. Resolve the token’s decimals before displaying received output or refunded input. Account history serves a different purpose from the pool trade feed, which reports public market activity rather than your account’s recovery state.

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. Replace SWAP_ID with that swap’s ID from history, including its field suffix.
Check that no earlier claim for this swap is still pending. Run one claim worker for the swap so separate processes do not submit competing claims.
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.
After the claim is accepted, check your spendable funds. Use Verify swap settlement when you need to match the claim to its exact output record.

Retain recovery data

Your recovery store contains secret claim data as well as transaction history. Keep a protected backup with your account, and preserve it while investigating an unfinished swap. Resetting identity counters or deleting the journal can remove data needed to recover the trade. Raw handles and journal events do not belong in application logs.If the store is damaged or a transaction remains unresolved, keep a protected copy. The public transaction ID, network, SDK version, and stage where the operation stopped can help with investigation without exposing claim secrets.

Next Steps

Verify the completed trade

Verify swap settlement shows how to confirm both transactions and match the claim to the funds received.

Continue from packaged examples

The TypeScript recovery example explains how to reuse its account and saved handles. The Python recovery example covers its journal and recovery requirements. Follow their recovery instructions for an existing trade; rerunning a first-swap program starts a new one.