Skip to main content

Error format

Branch on error, a stable code. details is human-readable and only present on 4xx responses.

Common errors

The pair’s terms changed since you read the card. Fetch GET /v2/swap/{type}/pairs again, show the new terms, and create with the new hash.
The request carried both X-Kaleido-Org-Key and an Authorization API key. Send one.
A cooperative claim or refund request had neither transaction (with index) nor signatureHash. Send the unsigned transaction; the maker computes the sighash.
The route needs the swap’s X-Swap-Auth header and it was missing or wrong. Use the swapAuth from the create response. If it is lost, recover it with POST /v2/swap/{id}/auth/challenge and POST /v2/swap/{id}/auth/recover.
An active swap already exists for this preimageHash. Use a new preimage for every swap.
The swap’s state does not allow it: for example a refund after the payout was committed, or a claim before the maker’s lockup exists. Read GET /v2/swap/{id} and act on the current status.
Rate limited, either per caller or by the rolling creation budget. Wait for Retry-After.
The maker has stopped taking new swaps. Swaps already in flight still settle. GET /v2/info shows the halt and its reason.
This maker has not enabled pay-through.
A dependency the route needs is unavailable, such as the node or a chain backend. Retry with backoff.

Swaps

The amount differed from expectedAmount, or the swap was funded with more than one transaction. Refund the lockup. For a chain swap, the maker may offer a re-quote instead.
Subscribe with {"op":"subscribe","channel":"swap.update","args":["<id>"]} after connecting, and send {"op":"ping"} periodically. Fall back to GET /v2/swap/{id} after a reconnect.
Pass the derivation path your keys actually use. Swap SDK keys are derived directly from the swap account xpub, so send "m"; the default path searches different keys.