Tracking Status
After a swap transaction is broadcast, you need to track its completion on the destination chain. Rubic SDK provides both a direct status method and a higher-level polling helper.getStatusExtended
Fetches the current status of a cross-chain transaction in a single request.Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Trade ID from the swap / swapBest response |
srcTxHash | string | (see below) | Source chain transaction hash |
When issrcTxHashrequired?
- Decentralized providers (bridges, on-chain DEXes): both
idandsrcTxHashare required- Deposit-based providers (ChangeNOW, Exolix, etc.): only
idis needed
Example
Response: StatusResponseInterface
| Field | Type | Description |
|---|---|---|
status | TransactionStatus | Current status (see table below) |
destinationTxHash | string | null | Destination chain tx hash (available on SUCCESS) |
destinationNetworkTitle | string | null | Human-readable destination chain name |
destinationNetworkChainId | number | null | Destination chain ID |
Transaction statuses
| Status | Terminal | Description |
|---|---|---|
PENDING | Transaction received, waiting for confirmation | |
LONG_PENDING | Taking longer than expected, still processing | |
WAITING_FOR_TRUSTLINE | Waiting for XRP/Stellar trustline to be established | |
WAITING_FOR_REFUND_TRUSTLINE | Waiting for trustline before a refund can be issued | |
SUCCESS | ✅ | Swap completed successfully |
READY_TO_CLAIM | ✅ | Funds ready to claim on destination (manual claim needed) |
FAIL | ✅ | Transaction failed |
REVERT | ✅ | Transaction was reverted |
REVERTED | ✅ | Transaction was reverted (provider-specific variant) |
NOT_FOUND | ✅ | Transaction not found (invalid ID or too early) |
INDETERMINATE | ✅ | Status cannot be determined |
waitForStatus
A built-in polling helper that callsgetStatusExtended on an interval until a terminal status is reached.
Options
| Field | Type | Default | Description |
|---|---|---|---|
interval | number | 3000 | Polling interval in ms |
timeout | number | 300_000 | Max wait time in ms before rejecting with Error('Polling timeout') |
onStatusUpdate | (status) => void | — | Callback fired on every poll, including intermediate statuses |
Example — basic usage
Example — with all options
Example — handling all outcomes
Example — deposit-based providers (no srcTxHash)
READY_TO_CLAIM — Arbitrum Bridge
Whenstatus === 'READY_TO_CLAIM', the swap used the Arbitrum Bridge and requires a manual on-chain claim on the destination chain. Use claim() to build the claim transaction: