Checking the status of a transaction

Squid extends the AxelarScan API in order to give details on the status of cross-chain transactions.

const getStatus = async (transactionId) => {
    const result = await axios.get('https://testnet.api.0xsquid.com/v1/status', {
        params: {
            transactionId
        },
        headers: {
            "x-integrator-id": "your-integrator-id",
        }
    });
    return result.data;
}

Request Param:

PropertyDescription

transactionId

Transaction hash from the transaction submitted to the source chain.

Request Headers:

PropertyDescription

x-integrator-id

Integrator Id for squid to keep track of partners, complete the form to acquire it

Response Param:

PropertyDescription

id

transaction hash

status

Transaction status from Axelarscan: As per Axelarscan, possible status response are outlined below:

{
  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",
}

For non-GMP or send token type transaction, it returns status as 'sent'.

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

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",
}

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

Example:

{
  "status": true,
  "data": {
    "id": "0x217dcec2405ada6a29ad1d19632000a4ac304c156db2832cb5c90e6ac190fa87_0_2",
    "status": "destination_executed",
    "gasStatus": "gas_paid_enough_gas",
    "isGMPTransaction": true,
    "fromChain": {
      "transactionId": "0x217dcec2405ada6a29ad1d19632000a4ac304c156db2832cb5c90e6ac190fa87",
      "blockNumber": 14551699,
      "callEventStatus": "",
      "callEventLog": []
    },
    "toChain": {
      "transactionId": "0x0a5797c28f49763b1f448949493d03c138fd6b99834057e3a6da79df26fa4df2",
      "blockNumber": 28573721,
      "callEventStatus": "CrossMulticallExecuted",
      "callEventLog": [
        {
          "contractAddress": "0xC3468a191Fe51815b26535ED1F82C1f79e6Ec37D",
          "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": ["0xedb7c675f2e070c850cf680621b0c78720fd0a9296b8ef1e7de329e609a8845e"]
          }
        }
      ]
    },
    "error": {}
  }
}

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

Last updated