Get Route Status
This method aims to provide the status of the transaction
Get Route Status
Squid combines Axelar's infrastructure as well as bespoke on-chain analytics to provide status of cross-chain transactions. You can access this status using the getStatus
method on our SDK.
You can also check completion of most cross chain transactions on Squid by copying the transaction hash into AxelarScan. Note, for some Cosmos transactions and others in the future this will not work.
Usage
const status = await squid.getStatus({
transactionId,
requestId,
integratorId,
fromChainId,
toChainId,
quoteId, // Including the quote ID will enable us to share volume stats with your integrator ID
})
Request Parameters
transactionId
string
Yes
The transaction hash
requestId
string
No
The request ID (legacy parameter)
integratorId
string
Yes
Your integrator ID
fromChainId
string
Yes
The source chain ID
toChainId
string
Yes
The destination chain ID
quoteId
string
Yes
The quote ID from the route response. Passing this parameter will enable volume and token activity sharing with integrators in the near future
bridgeType
string
no
Getting Quote ID from Route Response
The quoteId
can be found at the top level of the route response. Including this parameter in status requests will enable volume and specific token activity sharing with integrators in the near future:
{
"route": {
"quoteId": "6f388be5205ee044cd7fd5047a4ce72e"
}
}
Understanding squidTransactionStatus
The most important response param is squidTransactionStatus
. This param will tell you what to show the user. There are 6 possible states:
{
SUCCESS = "success",
NEEDS_GAS = "needs_gas",
ONGOING = "ongoing",
PARTIAL_SUCCESS = "partial_success",
NOT_FOUND = "not_found",
REFUND = "refund"
}
SUCCESS
This indicates the transaction has completed on all chains. Whether a single chain, 2 chain or 3 chain call, the swap, stake, NFT purchase, bridge etc. has completed without any reversions and the user has received the intended funds.
NEEDS_GAS
This state is specific for Axelar transactions. If the gas price has spiked on the destination chain and execution cannot complete, Squid will return this status. The best user flow in this case is to send the user to Axelarscan to view the paused transaction.
ONGOING
There is nothing wrong, nothing to do, just relax and wait. The transaction should have an estimatedRouteDuration
in seconds that you can read from the /route
response. We generally recommend contacting support after either 15 minutes has passed, or double the estimatedRouteDuration
, whichever is larger.
PARTIAL_SUCCESS
This status indicates that the transaction has completed some of its steps. Currently, there is only one case that could cause this state. In the future there will be many, but we will provide more metadata around the PARTIAL_SUCCESS
. For now, this is what has happened:
The source chain transaction successfully executed, along with any swaps or contract calls.
The destination chain transaction has executed, but reverted during execution. This is usually due to slippage on volatile assets, but if you are trying to buy an NFT or do some cross-chain staking, then it could indicate that the custom hook had a failure.
If there is a partial success, the user will have received the bridged token in their wallet on the destination chain. In most cases this is axlUSDC.
NOT_FOUND
The Squid API cannot find an on-chain record of the transaction. This is usually due to our various services or service providers not having indexed the completed transaction. This state is often returned for 5-10 seconds after the transaction was executed, while chain indexing occurs.
This should not persist after maximum a few minutes (some chains such as Filecoin take a very long time to index, and for block inclusion). If it does, then get in touch with us on Discord.
REFUND
This status is specific to failed Coral routes. When a Coral transaction fails, the funds are automatically refunded on the source chain. This is the default behavior for Coral routes when passing the user's address as the fromAddress
.
How Coral refunds work:
Funds are always transferred from the
msg.sender
on the source chain (this could be the user for direct calls to Coral, or a smart contract like Multicall)When refunded, funds are sent to the
order.fromAddress
which is encoded to the user, not the callerThe
fromAddress
from the route request is used as theorder.fromAddress
for refundsThis ensures that even if the transaction was initiated through a smart contract, the refund goes to the actual user
How to Share Block Explorer Links
Generally, the best thing to do is to share https://axelarscan.io/gmp/<txHash>
with a user.
With the caveat that if you are doing a transaction between two Cosmos chains, this link may not be correct. For now we simply recommend you always using this approach, we are upgrading our status capability and the status endpoint will always return the correct block explorer link to share.
Response Parameters
The response includes detailed information about both source and destination chains, transaction URLs, timing data, and the current status.
Example Response
{
"id": "0x7591aa38d646ac26b57f7235836cb7e7b63a32534bdd2e5dcecf06136744a94d",
"status": "success",
"gasStatus": "",
"isGMPTransaction": false,
"axelarTransactionUrl": "",
"fromChain": {
"transactionId": "0x7591aa38d646ac26b57f7235836cb7e7b63a32534bdd2e5dcecf06136744a94d",
"blockNumber": "339763809",
"callEventStatus": "",
"callEventLog": [],
"chainData": {
"id": "42161",
"chainId": "42161",
"networkIdentifier": "arbitrum",
"chainName": "Chain 42161",
"axelarChainName": "Arbitrum",
"type": "evm",
"networkName": "Arbitrum",
"nativeCurrency": {
"name": "Arbitrum",
"symbol": "ETH",
"decimals": 18,
"icon": "https://raw.githubusercontent.com/axelarnetwork/axelar-docs/main/public/images/chains/arbitrum.svg"
},
"chainIconURI": "https://raw.githubusercontent.com/0xsquid/assets/main/images/webp128/chains/arbitrum.webp",
"blockExplorerUrls": [
"https://arbiscan.io/"
],
"swapAmountForGas": "2000000",
"sameChainSwapsSupported": true,
"compliance": {
"trmIdentifier": "arbitrum"
},
"boostSupported": true,
"enableBoostByDefault": true,
"rpcList": [
"https://arb1.arbitrum.io/rpc"
],
"visible": true,
"chainNativeContracts": {
"wrappedNativeToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"ensRegistry": "",
"multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
"usdcToken": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8"
},
"feeCurrencies": [],
"currencies": [],
"features": []
},
"transactionUrl": "https://arbiscan.io/tx/0x7591aa38d646ac26b57f7235836cb7e7b63a32534bdd2e5dcecf06136744a94d"
},
"toChain": {
"transactionId": "0x4579e4df67994f4b1790d51c1586cbe79048dafd9c69467de1ecc887b4a25186",
"blockNumber": "30616439",
"callEventStatus": "",
"callEventLog": [],
"chainData": {
"id": "8453",
"chainId": "8453",
"networkIdentifier": "base",
"chainName": "Chain 8453",
"axelarChainName": "base",
"type": "evm",
"networkName": "Base",
"nativeCurrency": {
"name": "Base",
"symbol": "ETH",
"decimals": 18,
"icon": "https://raw.githubusercontent.com/axelarnetwork/axelar-docs/main/public/images/chains/base.svg"
},
"chainIconURI": "https://raw.githubusercontent.com/0xsquid/assets/main/images/chains/base.svg",
"blockExplorerUrls": [
"https://basescan.org/"
],
"swapAmountForGas": "2000000",
"sameChainSwapsSupported": true,
"boostSupported": true,
"enableBoostByDefault": true,
"rpcList": [
"https://developer-access-mainnet.base.org"
],
"visible": true,
"chainNativeContracts": {
"wrappedNativeToken": "0x4200000000000000000000000000000000000006",
"ensRegistry": "",
"multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
"usdcToken": "0x66627F389ae46D881773B7131139b2411980E09E"
},
"feeCurrencies": [],
"currencies": [],
"features": [],
"axelarFeeMultiplier": 150
},
"transactionUrl": "https://basescan.org/tx/0x4579e4df67994f4b1790d51c1586cbe79048dafd9c69467de1ecc887b4a25186"
},
"timeSpent": {
"total": 2
},
"routeStatus": [
{
"chainId": "42161",
"txHash": "0x7591aa38d646ac26b57f7235836cb7e7b63a32534bdd2e5dcecf06136744a94d",
"status": "success",
"action": "send"
},
{
"chainId": "8453",
"txHash": "0x4579e4df67994f4b1790d51c1586cbe79048dafd9c69467de1ecc887b4a25186",
"status": "success",
"action": "call"
}
],
"squidTransactionStatus": "success"
}
Last updated