Get Route Status

This method aims to provide the status of the transaction

Squid Combines Axelar's infrastructure as well as some 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.

Type: #getstatus

const status = await squid.getStatus({
    transactionId,
    requestId,
    integratorId,
    fromChainId,
    toChainId,
})

Request Param:

PropertyDescription

transactionId

Transaction hash from the transaction submitted to the source chain.

requestId (optional)

Unique request id returned in getRoute response param, e.g. 340c79f3-4f63-4d72-a6e6-3b70edfd3fe3

integratorId (optional)

Unique Integrator Id for integration e.g. squid-swap-widget

fromChainId

From chain identifier

toChainId

To chain identifier

The most important response param is squidTransactionStatus

This param will tell you what to show the user. There are 5 possible states:

{
  SUCCESS = "success",
  NEEDS_GAS = "needs_gas",
  ONGOING = "ongoing",
  PARTIAL_SUCCESS = "partial_success",
  NOT_FOUND = "not_found"
}

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.

Generally, the best thing to do is to share https://axelarscan.io/gm/<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 Param:

PropertyDescription

id

transaction hash

status

Transaction status from Axelarscan:

Our status endpoint aggregates AxelarScan's GMP and token transfer responses.

Depending on transaction type, possible responses are as below: GMP responses for status

{
  SRC_GATEWAY_CALLED = "source_gateway_called",
  DEST_GATEWAY_APPROVED = "destination_gateway_approved",
  DEST_EXECUTED = "destination_executed",
  EXPRESS_EXECUTED = "express_executed",
  DEST_ERROR = "error",
  ERROR_FETCHING_STATUS = "error_fetching_status",
}

Token transfer responses for status:

{
    ASSET_SENT = "asset_sent",
    BATCH_SIGNED = "batch_signed",
    VOTED = "voted",
    EXECUTED = "executed"
}

gasStatus

Transaction gas status returned from AxelarScan. The possible gas status response are:

  {
    GAS_UNPAID = "gas_unpaid",
    GAS_PAID = "gas_paid",
    GAS_PAID_NOT_ENOUGH_GAS = "gas_paid_not_enough_gas",
    GAS_PAID_ENOUGH_GAS = "gas_paid_enough_gas",
  }

isGMPTransaction

Returns true if the transaction is a GMP transaction, false if it is a bridge transfer

fromChain.transactionId

Chain ID of fromChain

fromChain.blockNumber

Transaction block number on fromChain

fromChain.callEventStatus

SquidMulticall contract event status relating to transactionId on fromChain

fromChain.callEventLog

SquidMulticall event logs for transactionId on fromChain

toChain.transactionId

Transaction hash on toChain

toChain.blockNumber

Transaction block number on toChain

toChain.callEventStatus

Latest SquidMulticall event status on toChain

toChain.callEventLog

SquidMulticall event logs on toChain

error

Error returned from Axelarscan GMP API

timeSpent

Time spent on transaction execution

requestId

Request Id passed into Get Route

integratorId

Integrator Id passed into GetRoute

squidTransactionStatus

Simplified status for transaction. It could be either of the value

{
  SUCCESS = "success",
  NEEDS_GAS = "needs_gas",
  ONGOING = "ongoing",
  PARTIAL_SUCCESS = "partial_success",
  NOT_FOUND = "not_found"
}

Example:

{
  "id": "0xb7792edf93d423037c6b3bb61074b1ef12ed8a1e93647e1610d231ff8c3802ff_1_22",
  "status": "destination_executed",
  "gasStatus": "gas_paid_enough_gas",
  "isGMPTransaction": true,
  "axelarTransactionUrl": "https://axelarscan.io/gmp/0xb7792edf93d423037c6b3bb61074b1ef12ed8a1e93647e1610d231ff8c3802ff",
  "fromChain": {
    "transactionId": "0xb7792edf93d423037c6b3bb61074b1ef12ed8a1e93647e1610d231ff8c3802ff",
    "blockNumber": 23830217,
    "callEventStatus": "",
    "callEventLog": [],
    "chainData": {
      "chainName": "Avalanche",
      "chainType": "evm",
      "rpc": "https://api.avax.network/ext/bc/C/rpc",
      "networkName": "Avalanche C-Chain",
      "chainId": 43114,
      "nativeCurrency": {
        "name": "Avalanche",
        "symbol": "AVAX",
        "decimals": 18,
        "icon": "https://assets.coingecko.com/coins/images/12559/small/coin-round-red.png?1604021818"
      },
      "chainIconURI": "https://axelarscan.io/logos/chains/avalanche.svg",
      "blockExplorerUrls": [
        "https://snowtrace.io/"
      ],
      "chainNativeContracts": {
        "wrappedNativeToken": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
        "ensRegistry": "0xa7eebb2926d22d34588497769889cbc2be0a5d97",
        "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
        "usdcToken": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
      },
      "axelarContracts": {
        "gateway": "0x5029C0EFf6C34351a0CEc334542cDb22c7928f78",
        "forecallable": ""
      },
      "squidContracts": {
        "squidRouter": "0xce16F69375520ab01377ce7B88f5BA8C48F8D666",
        "defaultCrosschainToken": "0xfaB550568C688d5D8A52C7d794cb93Edc26eC0eC",
        "squidMulticall": "0x28D04fD16B2D7b8c0FDAdb821E381b72fe3CC11e"
      },
      "estimatedRouteDuration": 90
    },
    "transactionUrl": "https://snowtrace.io/tx/0xb7792edf93d423037c6b3bb61074b1ef12ed8a1e93647e1610d231ff8c3802ff"
  },
  "toChain": {
    "transactionId": "0xb22c00d39971852f330d50e74e84e2d7d26a53f4b066edd67fbcf8d945586c18",
    "blockNumber": 2542604,
    "callEventStatus": "CrossMulticallExecuted",
    "callEventLog": [
      {
        "contractAddress": "0xce16F69375520ab01377ce7B88f5BA8C48F8D666",
        "args": {
          "eventFragment": {
            "name": "CrossMulticallExecuted",
            "anonymous": false,
            "inputs": [
              {
                "name": "payloadHash",
                "type": "bytes32",
                "indexed": true,
                "components": null,
                "arrayLength": null,
                "arrayChildren": null,
                "baseType": "bytes32",
                "_isParamType": true
              }
            ],
            "type": "event",
            "_isFragment": true
          },
          "name": "CrossMulticallExecuted",
          "signature": "CrossMulticallExecuted(bytes32)",
          "topic": "0x7c3aa10c5d96985be6de7d2e6fa79bdef95a95a9cb272f4113b3fe1ca89fedae",
          "args": [
            "0xfde523ed16736fe2a0bb26ed8dfa1e6e44c73da2ee81daabec62adeef3784225"
          ]
        }
      }
    ],
    "chainData": {
      "chainName": "Moonbeam",
      "chainType": "evm",
      "rpc": "https://rpc.api.moonbeam.network",
      "networkName": "Moonbeam Mainnet",
      "chainId": 1284,
      "nativeCurrency": {
        "name": "Moonbeam",
        "symbol": "GLMR",
        "decimals": 18,
        "icon": "https://assets.coingecko.com/coins/images/22459/small/glmr.png?1641880985"
      },
      "chainIconURI": "https://axelarscan.io/logos/chains/moonbeam.svg",
      "blockExplorerUrls": [
        "https://moonscan.io/"
      ],
      "chainNativeContracts": {
        "wrappedNativeToken": "0xAcc15dC74880C9944775448304B263D191c6077F",
        "ensRegistry": "",
        "multicall": "0x6477204E12A7236b9619385ea453F370aD897bb2",
        "usdcToken": "0x931715fee2d06333043d11f658c8ce934ac61d0c"
      },
      "axelarContracts": {
        "gateway": "0x4F4495243837681061C4743b74B3eEdf548D56A5",
        "forecallable": ""
      },
      "squidContracts": {
        "squidRouter": "0xce16F69375520ab01377ce7B88f5BA8C48F8D666",
        "defaultCrosschainToken": "0xCa01a1D0993565291051daFF390892518ACfAD3A",
        "squidMulticall": "0x28D04fD16B2D7b8c0FDAdb821E381b72fe3CC11e"
      },
      "estimatedRouteDuration": 150
    },
    "transactionUrl": "https://moonscan.io/tx/0xb22c00d39971852f330d50e74e84e2d7d26a53f4b066edd67fbcf8d945586c18"
  },
  "timeSpent": {
    "call_approved": 51,
    "total": 93,
    "approved_executed": 42
  },
  "error": {},
  "timeSpent": {"call_express_executed":30,"total":473},
  "requestId": "340c79f3-4f63-4d72-a6e6-3b70edfd3fe3",
  "integratorId": "squid-swap-widget",
  "squidTransactionStatus": "received"
}

You can also access the Axelar GMP block explorer to monitor your transaction status.

https://docs.axelar.dev/dev/monitor-recover/monitoring

Last updated