ACTIVITY_TYPE_EXECUTE_SWAP_V3 returns a swapRequestId. Query get_swap_status with it to observe the full lifecycle — including failures that occur before broadcast, such as pre-flight simulation failures. Same-chain, cross-chain, and EVM ↔ SVM swaps share the same query and the same response shape; provider-specific state machines are normalized to three states: PENDING, COMPLETED, FAILED.
Lifecycle model
Turnkey normalizes swap lifecycle to three states across same-chain and cross-chain routes:- PENDING: still in flight. Broadcast pending, origin transaction not yet included, or (cross-chain) destination-side execution not yet settled.
- COMPLETED: the user received the destination asset. Terminal, happy path.
- FAILED: the swap will not fill as intended. Terminal. Same-chain
FAILEDcomes from the origin send-transaction only. Cross-chainFAILEDcan appear before refund fields exist.
bridge_pending, delayed, submitted, and so on) collapse into PENDING on purpose. PENDING means wait. COMPLETED means the output landed. FAILED means read error and, for cross-chain, keep polling if refund is absent.
Query get_swap_status
Queryget_swap_status with:
string
required
The organization that executed the swap: the same organization the execute activity was submitted against, parent or sub-organization.
string
required
The handle returned by
ACTIVITY_TYPE_EXECUTE_SWAP_V3, e.g. sha256:9a80031c2def....cURL
JavaScript
Response fields
status: normalized state.PENDING,COMPLETED, orFAILED.swapKind:SAME_CHAINorCROSS_CHAIN. Set at execute time; does not change.provider: the provider that executed the swap. Always present.inputToken,outputToken,inputAmount: echoed from the execute intent.originTxHash: origin-chain transaction hash. Present once the swap is broadcast, for both same-chain and cross-chain routes.destinationTxHashes: array of destination-chain transaction hashes onCOMPLETED. Cross-chain only.destinationAddress: address that receives the output asset. For EVM ↔ SVM this is thedestinationAddressyou set on quote and execute. For same-protocol routes it is the swapping wallet.outputAmount: actual amount received, onCOMPLETED. May lag thestatustransition by seconds while the monitor fetches the final settled amount.refund: present on cross-chainFAILEDwhen funds moved and came back. Containsasset(CAIP-19),amount(raw onchain units), and optionaltxHash. Omitted for origin failures and same-chain swaps. See What FAILED means.error: present onFAILED. Containsreason(ORIGIN_TRANSACTION_FAILEDorPROVIDER_FILL_FAILED),message(human-readable detail),originTxError(decoded revert detail, origin failures only), andproviderReason(provider-specific detail, fill failures only). See What FAILED means.updatedAt: last observed state change, as a Unix timestamp in milliseconds (stringified).
Same-chain vs. cross-chain differences
The response shape is identical. Two behaviors differ in practice:- Timing. Same-chain swaps reach a terminal state within roughly one block time of the origin chain. Cross-chain swaps can take tens of seconds to several minutes depending on the route. Each quote’s
estimatedTimeSecondsis the per-swap estimate. - Field population.
destinationTxHashesis populated only for cross-chainCOMPLETEDswaps. Same-chain outcomes are fully described byoriginTxHash: onCOMPLETED, that transaction delivered the output; onFAILED, either the transaction reverted or — iforiginTxHashis absent — the swap failed before broadcast and nothing moved onchain. Same-chainFAILEDnever includesrefundorPROVIDER_FILL_FAILED.
swapKind (SAME_CHAIN or CROSS_CHAIN) tells you which model applies. Branch on it client-side only where the difference matters — for example, showing a bridge-progress state for cross-chain PENDING — and otherwise treat both kinds uniformly through the three-state model.
What FAILED means
Same-chain and cross-chainFAILED are not the same event.
- Same-chain.
FAILEDcomes from the origin send-transaction only.error.reasonisORIGIN_TRANSACTION_FAILED. The response never includesrefundorPROVIDER_FILL_FAILED. - Cross-chain.
FAILEDcan come from the origin send-transaction (ORIGIN_TRANSACTION_FAILED) or from a provider fill failure after origin success (PROVIDER_FILL_FAILED).FAILEDcan appear before refund fields exist. Keep polling if you needrefund.PENDINGmeans the destination leg can still fill — it does not mean a refund is in flight.
FAILED, two fields together describe the outcome:
error.reason— why it failed:ORIGIN_TRANSACTION_FAILED(the origin transaction failed pre-flight simulation or reverted onchain) orPROVIDER_FILL_FAILED(the origin transaction succeeded but the provider could not fill).error.messageand, for origin failures,error.originTxErrorcarry the decoded detail, including the full revert chain.refund— present on cross-chainFAILEDwhen funds moved and came back:refund.asset(CAIP-19),refund.amount(raw onchain units), and optionalrefund.txHash. The refunded asset can differ from the original input if the route included an origin-side swap, and it lands on the origin chain.
If the user still wants the swap, re-quote — with the refunded asset as the new input where a refund occurred. Caveats worth surfacing to end users:
- A refund is reduced by refund gas and any origin-side swap losses; it will not equal the original input.
- A re-swap is a new swap: new quote, new fees, new slippage.
- If the original destination was another chain, the re-swap is again cross-chain.
Polling cadence
- Same-chain: poll every ~1 second while
PENDING. Typically settles within one block time. - Cross-chain: poll every 5 to 10 seconds while
PENDING. Settlement can take from tens of seconds to several minutes depending on route.
Next steps
- End-to-end example: full flow from enable to confirmation.
- Execute a swap: request semantics that generate the poll handle.