Multichain
Search…
⌃K

API

This section explains the Multichain api and how to interact with it. This api organizes data about bridge pairs, router contracts ,tx status and more.
There are two api endpoints you can use:
  1. 1.
    To query token and router contract information.
  2. 2.
    To query cross-chain tx status

Token Information End point:

You can replace "all" with a specific chain id. Such as: https://bridgeapi.anyswap.exchange/v4/tokenlistv4/1
Get all chain ids list from this endpoint: https://bridgeapi.anyswap.exchange/data/bridgeChainInfo

Architecture:

Multichain Router has three parts:
  • Underlying token address: it's the native token you're bridging.
  • anyToken contract: it's a wrapped LP token for the native token, used as a liquidity pool to hold the native token.
  • Router contract: The contract you interact with for cross-chain swaps.
Sample Response and Explanation:
{
  "chainId" : "chainId", // Source Chain ID
  "address": "address", //  token address
  "name": "name", // token name
  "symbol": "symbol", // token symbol
  "decimals": "decimals", // token decimals
  "price" : "price",  // token price
  "logoUrl" : "logoUrl", // token logo url
  "tokenType": "tokenType", // This is either "NATIVE" for native gas token or "TOKEN" for all other tokens
  "destChains": { // An object with all possible destination chains as keys.
    "chainId": { // Destination Chain ID
      "key": { // Unique hash for each pair
        "address": "address", // Destination token address
        "name": "name", // Destination token name
        "symbol": "symbol", // Destination token symbol
        "decimals": "decimals", // Destination token decimals
        "anytoken": { // Destination anytoken information
          "address": "address", //
          "symbol": "symbol", //
          "decimals": "decimals", //
        },
        "fromanytoken": { // Source Chain anytoken information
          "address": "address", //
          "symbol": "symbol", //
          "decimals": "decimals", //
        },
        "underlying": { // Destination underlying information, if it doesn't exist, return false.
          "address": "address", //
          "symbol": "symbol", //
          "decimals": "decimals", //
        },
        "type": "type", // The type of bridge tx. It would say router for most tokens. And it'd say swapin or swapout for older V2 setup.
        "router": "router", // router address. The address you interace with.
        "tokenid": "tokenid", // tokenid
        "routerABI": "routerABI", // The abi and function you cal to bridge this token.
        "isLiquidity": "isLiquidity", // If liquidity is needed.
        "isApprove": "isApprove", // Is approval needed.
        "isFromLiquidity": "isFromLiquidity", // Is source chain liquidity shown on frontend.
 
        "BigValueThreshold": "BigValueThreshold", // Big value threshold. It'd take longer over this threshold.
        "MaximumSwap": "MaximumSwap", // Maximum amount to bridge
        "MaximumSwapFee": "MaximumSwapFee", //
        "MinimumSwap": "MinimumSwap", // Minimal amount to bridge. Lower than this won't be processed.
        "MinimumSwapFee": "MinimumSwapFee", //
        "SwapFeeRatePerMillion": "SwapFeeRatePerMillion", // % of fee. 0.1 means 0.1% fee of the total amount.
 
        "pairid": "pairid", // pairid
        "DepositAddress": "DepositAddress", // Deposit address for older V2 bridge setup.
        "BaseFeePercent": "BaseFeePercent", // Fee percentage for V2 bridge.
        "sortId": "sortId", //
        "chainId": "chainId", // chainId
        "tokenType": "tokenType", // token type.
      }
    }
  }
}

Tx Status Endpoint:

Code
Status
3
ExceedLimit (LessThenMinAmount)
8
Confirming
9
Swapping
10
Success
12
BigAmount(Wait24hours)
14
Failure