getSwapStatus
Gets the current status of a swap transaction by its on-chain transaction hash. Use this to poll for completion after callingexecuteSwapTransaction.
Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
txHash | string | The on-chain transaction hash from executeSwapTransaction. |
from | object (optional) | Source chain details. |
from.chain | Chain | The source chain (e.g., 'EVM', 'SOL'). |
from.networkId | string | The source network ID. |
to | object (optional) | Destination chain details. |
to.chain | Chain | The destination chain. |
to.networkId | string | The destination network ID. |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<SwapStatusResponse> - The swap status:
Status Values
| Status | Description |
|---|---|
PENDING | Swap is in progress |
DONE | Swap completed successfully |
FAILED | Swap failed |
Substatus Values
When pending:| Substatus | Description |
|---|---|
WAIT_SOURCE_CONFIRMATIONS | Waiting for source chain confirmations |
WAIT_DESTINATION_TRANSACTION | Waiting for destination chain transaction |
BRIDGE_NOT_AVAILABLE | Bridge temporarily unavailable |
CHAIN_NOT_AVAILABLE | Chain temporarily unavailable |
REFUND_IN_PROGRESS | Refund is being processed |
UNKNOWN_ERROR | Unknown pending error |
| Substatus | Description |
|---|---|
COMPLETED | Fully completed |
PARTIAL | Partially completed |
REFUNDED | Funds were refunded |
| Substatus | Description |
|---|---|
INSUFFICIENT_ALLOWANCE | Token approval was insufficient |
INSUFFICIENT_BALANCE | Wallet had insufficient funds |
OUT_OF_GAS | Transaction ran out of gas |
EXPIRED | Swap route expired |
SLIPPAGE_EXCEEDED | Slippage tolerance was exceeded |
UNKNOWN_FAILED_ERROR | Unknown failure |
Examples
Poll until complete
Cross-chain status check
Related
executeSwapTransaction- Execute the swap on-chaingetSwapQuote- Get a swap quote