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
  • API Endpoint
  • Code Example
  • Request Parameters
  • Request Headers
  • Response Parameters
  • Example Response
  1. API & SDK Integration
  2. API

Get Route Status

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

API Endpoint

GET https://v2.api.squidrouter.com/v2/status

Code Example

// 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,
        quoteId: params.quoteId, // New optional parameter
      },
      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 Parameters

Parameter
Type
Required
Description

transactionId

string

Yes

Transaction hash from the transaction submitted to the source chain

fromChainId

string

Yes

The source chain ID

toChainId

string

Yes

The destination chain ID

requestId

string

No

The request ID (legacy parameter)

quoteId

string

No

The quote ID from the route response. Passing this parameter will enable volume and token activity sharing with integrators in the near future

Getting Quote ID from Route Response

The quoteId can be found at the top level of the route response:

{
    "route": {
        "quoteId": "6f388be5205ee044cd7fd5047a4ce72e"
    }
}

Request Headers

Header
Description

x-integrator-id

Response Parameters

Parameter
Type
Description

id

string

Transaction hash

status

string

Transaction status from Axelarscan (see status values below)

gasStatus

string

Transaction gas status returned from Axelarscan (see gas status values below)

isGMPTransaction

boolean

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

squidTransactionStatus

string

Simplified status for transaction (see squid transaction status values below)

axelarTransactionUrl

string

URL to view the transaction on Axelarscan

fromChain.transactionId

string

Transaction hash on the source chain

fromChain.blockNumber

number

Transaction block number on source chain

fromChain.callEventStatus

string

SquidMulticall contract event status relating to transactionId on source chain

fromChain.callEventLog

array

SquidMulticall event logs for transactionId on source chain

fromChain.chainData

object

Complete chain configuration and contract addresses for source chain

fromChain.transactionUrl

string

Block explorer URL for the source chain transaction

toChain.transactionId

string

Transaction hash on destination chain

toChain.blockNumber

number

Transaction block number on destination chain

toChain.callEventStatus

string

Latest SquidMulticall event status on destination chain

toChain.callEventLog

array

SquidMulticall event logs on destination chain

toChain.chainData

object

Complete chain configuration and contract addresses for destination chain

toChain.transactionUrl

string

Block explorer URL for the destination chain transaction

timeSpent

object

Timing breakdown showing time spent in different phases of the transaction

error

object

Error returned from Axelarscan GMP API

requestId

string

The request ID associated with the transaction

integratorId

string

The integrator ID associated with the transaction

Squid Transaction Status Values

Simplified status for transaction. There are 6 possible states:

{
  SUCCESS = "success",
  NEEDS_GAS = "needs_gas", 
  ONGOING = "ongoing",
  PARTIAL_SUCCESS = "partial_success",
  NOT_FOUND = "not_found",
  REFUND_STATUS = "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_STATUS

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 caller

  • The fromAddress from the route request is used as the order.fromAddress for refunds

  • This ensures that even if the transaction was initiated through a smart contract, the refund goes to the actual user

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"
}
PreviousCross-chain NFT Purchase ExampleNextSDK

Last updated 8 days ago

Integrator ID for Squid to keep track of partners, complete the to acquire it

form