Rango Docs
API SwaggerWidget PlaygroundAppWebsite
  • 👋Welcome to Rango
  • 🏠Introduction
  • 💁How It Works
  • ✅Integrations
  • ⚖️Rango vs. Competitors
  • 🔐Security
  • 🛣️Roadmap
  • 🦎Tokenomics
  • 💰Airdrop
  • ❓FAQ
  • 🐞Bug Bounty
  • API Integration
    • 🔡Terminology
    • 🚄API Key & Rate Limits
    • 🤝Choosing the Right API
    • 🦄Basic API - Single Step
      • 🛝API Flow
      • ⚙️API Reference
        • Get Blockchains & Tokens
        • Get Quote
        • Create Transaction (Swap)
        • Check Transaction Status
        • Check Approve Transaction Status
        • Get Address Assets & Balances
        • Get Token Balance
        • Report Transaction Failure
        • Get Direct Tokens
        • Get Custom Token
        • Message Passing
      • 🎓Tutorial
        • 🍰SDK Example
      • 💰Monetization
      • 🎹Sample Transactions
      • ✅Integration Checklist
    • 🦎Main API - Multi Step
      • 🛝API Flow
      • ⚙️API Reference
        • Get Blockchains & Tokens
        • Get Best Route
        • Get All Possible Routes
        • Confirm Route
        • Create Transaction
        • Check Transaction Status
        • Check Approve Transaction Status
        • Report Transaction Failure
        • Get Custom Token
        • Get Address Token Balance
      • 🎓Tutorial
        • 🍰SDK Example
      • 💰Monetization
      • 🎹Sample Transactions
  • ℹ️API Troubleshooting
  • Technical Docs
    • 🍔Swap Aggregation
    • 💰Monetization
    • ⛽Fee Structure
    • ⛽Network Fees and Gas Estimates
    • ⌛Stuck Transactions
  • Widget Integration
    • 🧩Overview
    • 🎇Quick Start
    • ⚙️Customization
    • 💰Monetization
    • 🛣️React Router
    • 🎵Events
    • 💳External Wallets
  • Smart Contracts
    • 👩‍💼Architecture
    • 🔎Audit Reports
    • 🏗️Deployment Addresses
    • 📩Message Passing
  • Ask for Integration
    • 🙋‍♂️DEXs & DEX Aggregators
    • 📱Rango Mobile SDK
  • Useful Links
    • Twitter
    • Discord Server
    • TG Announcements
    • TG Group
  • Terms of Use
  • Privacy policy
Powered by GitBook
On this page
  • Check Status API
  • Check Transaction Status Request
  • Check Transaction Status Response

Was this helpful?

  1. API Integration
  2. Basic API - Single Step
  3. API Reference

Check Transaction Status

Track Status of Transaction

PreviousCreate Transaction (Swap)NextCheck Approve Transaction Status

Last updated 10 months ago

Was this helpful?

Check Status API

After that user signed a transaction on his/her wallet, you should call this endpoint periodically to see what's the status of that transaction.

const response = await rango.status({
    requestId: 'b3a12c6d-86b8-4c21-97e4-809151dd4036',
    txId: '0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5',
})
const response = await axios.get('https://api.rango.exchange/basic/status', {
  params: {
    'requestId': 'b3a12c6d-86b8-4c21-97e4-809151dd4036',
    'txId': '0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5',
    'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
  }
});
curl --request GET \
     --url 'https://api.rango.exchange/basic/status?requestId=b3a12c6d-86b8-4c21-97e4-809151dd4036&txId=0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'
  • This endpoint is not suitable for checking approval transaction and it is only for the original transaction. For checking approval transaction status, please check this section.

  • In on-chain transactions, you could also check transaction status by checking transaction receipt (via RPC) if you prefer. But in cross-chain swaps (e.g. bridges), you could use this method to make sure outbound transaction (transaction on destination chain) succeeds without any problem.

Check Transaction Status Request

  • requestId * String

    • Description: The unique ID which is generated in the swap endpoint.

    • Example: b3a12c6d-86b8-4c21-97e4-809151dd4036

  • txId * String

    • Description: Transaction hash that wallet returned.

    • Example: 0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5

export type StatusRequest = {
  requestId: string
  txId: string
}

Check Transaction Status Response

  • status

    • Description: Status of the transaction, while the status is running (or null), the client should retry until it turns into success or failed.

  • error

    • Description: A message in case of failure, that could be shown to the user.

  • output

    • Description: The output asset and amount, could be different from the destination asset in case of failures or refunds. In the context of a cross-chain swap, the process combines up to three transactions ([dex]+bridge+[dex]) into a single transaction. Consequently, several scenarios could arise if a user ends up receiving a token that differs from their initial expectation. These are possible cases for output.type:

      • DESIRED_OUTPUT When your transaction status is marked as successful, it indicates that the bridge or swap process has been successfully completed, and the user has received the intended DESIRED_OUTPUT token as part of the output.

      • REVERTED_TO_INPUT If user transaction reverted on first dex step, transaction will be reverted on the blockchain and user will receive back the input token.

      • MIDDLE_ASSET_IN_SRC If the dex step succeeded but the bridge step failed because of slippage or lack of liquidity or ...

      • MIDDLE_ASSET_IN_DEST If the [dex]+bridge step succeeded but, the last dex step failed because of slippage.

  • explorerUrl

    • Description: List of explorer URLs for the transactions of this swap. Including inbound transaction link, outbound transaction link and etc.

  • diagnosisUrl

    • Description: If a transaction becomes stuck within a bridge, requiring user intervention to initiate a refund through the bridge's user interface, we offer a diagnosis URL. This URL directs the user to a guide detailing the steps they need to take in order to successfully refund their tokens from the route underlying protocol.

    • Example: https://rango.exchange/diagnosis/wormhole?iframe=1

  • bridgeData

    • Description: Status of bridge. At the moment, this field is only filled when we have a bridge/swap transaction between two EVM chains. (e.g. from Polygon to Avax) It contains both data of inbound and outbound transactions/tokens.

export type StatusResponse = {
  status: TransactionStatus | null
  error: string | null
  output: StatusOutput | null
  explorerUrl: SwapExplorerUrl[] | null
  diagnosisUrl: string | null
  bridgeData: BridgeData | null
}

export enum TransactionStatus {
  FAILED = 'failed',
  RUNNING = 'running',
  SUCCESS = 'success',
}

export type StatusOutput = {
  amount: string
  receivedToken: Token
  type:
  | 'REVERTED_TO_INPUT'
  | 'MIDDLE_ASSET_IN_SRC'
  | 'MIDDLE_ASSET_IN_DEST'
  | 'DESIRED_OUTPUT'
}

export type Token = {
  blockchain: string
  chainId: string | null
  address: string | null
  symbol: string
  name: string | null
  decimals: number
  image: string
  blockchainImage: string
  usdPrice: number | null
  isPopular: boolean
  supportedSwappers: string[]
}

export type BridgeData = {
  srcChainId: number
  srcTxHash: string | null
  srcToken: string | null
  srcTokenAmt: string
  srcTokenDecimals: number
  srcTokenPrice: string | null
  destChainId: number
  destTxHash: string | null
  destToken: string | null
  destTokenAmt: string | null
  destTokenDecimals: number
  destTokenPrice: string | null
}
{
  "status": "success",
  "error": null,
  "diagnosisUrl": null,
  "explorerUrl": [
    {
      "url": "https://arbiscan.io/tx/0xf25f22c8dec8512c179c723e9d4c494ac35b991f6f4a9b0c10e63ac94d059f81",
      "description": "Inbound"
    },
    {
      "url": "https://basescan.org/tx/0x676d7120d941588340a7ef76287cc9d3ad846be0cdcc30609472a10b30c171b2",
      "description": "Outbound"
    }
  ],
  "output": {
    "amount": "50914691310462592",
    "receivedToken": {
      "blockchain": "BASE",
      "symbol": "ETH",
      "name": null,
      "isPopular": false,
      "chainId": "8453",
      "address": null,
      "decimals": 18,
      "image": "https://rango.vip/tokens/ALL/ETH.png",
      "blockchainImage": null,
      "usdPrice": null,
      "supportedSwappers": [
        
      ]
    },
    "type": "DESIRED_OUTPUT"
  },
  "bridgeData": {
    "srcChainId": 42161,
    "srcTxHash": "0xf25f22c8dec8512c179c723e9d4c494ac35b991f6f4a9b0c10e63ac94d059f81",
    "srcToken": null,
    "srcTokenAmt": "51000000000000000",
    "srcTokenDecimals": 18,
    "srcTokenPrice": "2609.9",
    "destChainId": 8453,
    "destTxHash": "0x676d7120d941588340a7ef76287cc9d3ad846be0cdcc30609472a10b30c171b2",
    "destToken": null,
    "destTokenDecimals": 18,
    "destTokenAmt": "50914691310462592",
    "destTokenPrice": "2609.9"
  }
}

🦄
⚙️
Check TX Statusrango-exchange
Check Transaction Status Swagger
Logo