Squid Dev Documentation
  • Getting Started
    • Overview
    • Get an Integrator ID
    • Integrator Quickstart
  • Widget Integration
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Vite Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect Fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
    • Upgrade Your Widget
  • API & SDK Integration
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • Key Concepts
      • Route Request Parameters
      • Get a route
      • Execute the route
      • 🪝Hooks
        • How do hooks work
        • Build a preHook
        • Build a postHook
        • Using the full ERC20 or Native balance in a call
        • ❗Transfer the remainder to the user
        • Get a route and execute as normal
      • Express
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
    • Coral: Intent Swaps
      • Integrating Coral
    • NEW: Bitcoin and Solana
  • Adding Tokens
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Circle's EURC Integration Guide
  • Migration
    • Squid v2 vs Squid v1
    • v1 -> v2 Migration
  • Additional Resources
    • Contracts
    • Squid v1 Docs
      • SDK
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Understanding the route response
        • Execute your swap or call
        • Get Route Status
        • Contract calls
          • Code example
          • Creating a ContractCall object
          • Contract call types
          • Approving ERC20s in our multicall
          • Transferring the remainder to a user
        • Collect Fees
          • Fee collector contract addresses
        • Working example!
      • API
        • integratorId
        • API playground
        • Base URLs
        • Get supported tokens and chains
        • Get a route
        • Checking the status of a transaction
        • Error codes
          • V2 API
      • Cosmos
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Cosmos route response
        • Execute your swap or call on Cosmos
        • Get Route Status
        • Cosmos custom calls
        • Working cosmos example!
        • Fallback Addresses
    • Additional Dev Resources
      • Choose How To Integrate Squid
      • Squid x Tenderly
      • Testnet or Mainnet?
      • Understanding Gas Payments
      • Supported Chains and Tokens
      • Request a new supported token
      • Liquidity Sources
        • axlASSET Liquidity
      • Integrator type specific docs
        • DEXs
        • Aggregators
        • NFTs
      • Setting up an EVM signer
      • Setting up Cosmos signer
      • Contract addresses
      • SDK easter eggs
        • Setting toAmount
        • getAllBalances
        • Advanced set up
        • Manually approve a route
        • Manually approve an ERC20
      • Whitelist a token
      • Security & Audits
        • Security
        • Audits
        • Axelar
      • Get an integrator-id
    • Architecture
      • FAQ
      • Liquidity model
      • Architecture
      • General message passing (GMP)
      • Transaction times and fees
      • Fallback behaviour on failed transactions
      • Axelar
    • Brand Assets
      • "Powered by Squid" Policy
    • Audits & Security
    • Contact
  • Changelog
    • SDK
      • v1.3
      • v1.2
    • API
      • v1.9
      • v1.8
      • v1.7
      • v1.6
  • Old v2 Documentation (Deprecated)
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Theme Customization
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
      • Stake widget
        • Installing the Widget
        • Configuration
        • Importing The widget
    • Quick Start
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • Key Concepts
      • Route Request Parameters
      • Get a route
      • Execute the route
      • 🪝Hooks
        • How do hooks work
        • Build a preHook
        • Build a postHook
        • Using the full ERC20 or Native balance in a call
        • ❗Transfer the remainder to the user
        • Add your hooks to a route request, or widget
        • Get a route and execute as normal
      • Boost
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
Powered by GitBook
On this page
  1. API & SDK Integration
  2. API

Get Route Status

PreviousCross-chain NFT Purchase ExampleNextSDK

Last updated 1 month ago

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


// Function to get the status of the transaction using Squid API
const getStatus = async (params: any) => {
  try {
    const result = await axios.get("https://v2.api.squidrouter.com/v2/status", {
      params: {
        transactionId: params.transactionId,
        requestId: params.requestId,
        fromChainId: params.fromChainId,
        toChainId: params.toChainId,
      },
      headers: {
        "x-integrator-id": integratorId,
      },
    });
    return result.data;
  } catch (error) {
    if (error.response) {
      console.error("API error:", error.response.data);
    }
    console.error("Error with parameters:", params);
    throw error;
  }
};

Request Param:

Property
Description

transactionId

Transaction hash from the transaction submitted to the source chain.

Request Headers:

Property
Description

x-integrator-id

Response Param:

Property
Description

id

transaction hash

status

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

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:

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

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

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

You can also access the to monitor your transaction 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",
}
{
  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",
}
{
  SUCCESS = "success",
  NEEDS_GAS = "needs_gas",
  ONGOING = "ongoing",
  PARTIAL_SUCCESS = "partial_success",
  NOT_FOUND = "not_found",
}
AxelarScan API
Axelar GMP block explorer
form