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. Main API - Multi Step
  3. API Reference

Check Transaction Status

Track the status of the transaction for the current step

PreviousCreate TransactionNextCheck Approve Transaction Status

Last updated 8 months ago

Was this helpful?

Check Status API

After the user signs a transaction in his wallet, you should periodically call this endpoint to check the status of the transaction.

const transaction = await rango.checkStatus({
    requestId: "b3a12c6d-86b8-4c21-97e4-809151dd4036", // bestRoute.requestId
    step: 1,
    txId: "0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5"
})
const response = await axios.post(
  'https://api.rango.exchange/tx/check-status',
  {
    'requestId': 'b3a12c6d-86b8-4c21-97e4-809151dd4036',
    'txId': '0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5',
    'step': 1
  },
  {
    params: {
      'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
    },
    headers: {
      'content-type': 'application/json'
    }
  }
);
curl --request POST \
     --url 'https://api.rango.exchange/tx/check-status?apiKey=c6381a79-2817-4602-83bf-6a641a409e32' \
     --header 'content-type: application/json' \
     --data '
{
  "requestId": "b3a12c6d-86b8-4c21-97e4-809151dd4036",
  "txId": "0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5",
  "step": 1
}
'
  • 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 best route endpoint.

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

  • step * Number

    • Description: The current step number in a multi-step route, starting from 1.

    • Example: 1

  • txId * String

    • Description: Transaction hash returned by wallet

    • Example: 0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5

export type CheckTxStatusRequest = {
  requestId: string
  step: number
  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.

  • timestamp

    • Description: The timestamp of the executed transaction. Beware that timestamp can be null even if the status is successful or failed, e.g. 1690190660000

  • extraMessage

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

  • outputAmount

    • Description: The human readable output amount for the transaction, e.g. 0.28.

  • outputToken

    • Description: The output token for this step.

  • newTx

    • Description: if a transaction needs more than one-step transaction to be signed by the user, the next step transaction will be returned in this field. It's only used for the Voyager bridge at the moment, and you could simply avoid swappers with this requirement by passing disableMultiStepTx equals to true in get best route method

  • diagnosisUrl

  • explorerUrl

    • Description: List of explorer URLs for the transactions that happened in this step.

  • referrals

    • Description: List of referral reward for the dApp and Rango.

  • steps

    • Description: In certain special cases (specifically for the Wormhole Bridge), the user must sign multiple transactions for a step to be successful. In these instances, you can use the steps data to display the internal steps of a single swap to the user for informational purposes.

export type TransactionStatusResponse = {
  status: TransactionStatus | null
  timestamp: number | null
  extraMessage: string | null
  outputAmount: string | null
  outputToken: Token | null
  outputType: null | 'REVERTED_TO_INPUT' | 'MIDDLE_ASSET_IN_SRC' | 'MIDDLE_ASSET_IN_DEST' | 'DESIRED_OUTPUT'
  newTx: Transaction | null
  diagnosisUrl: string | null
  explorerUrl: SwapExplorerUrl[] | null
  referrals: TransactionStatusReferral[] | null
  steps: SwapperStatusStep[] | null
}

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

export type SwapExplorerUrl = {
  description: string | null
  url: string
}

export type TransactionStatusReferral = {
  blockChain: string
  address: string | null
  symbol: string
  decimals: number
  amount: string
}

export type SwapperStatusStep = {
  name: string
  state: 'PENDING' | 'CREATED' | 'WAITING' | 'SIGNED' | 'SUCCESSED' | 'FAILED'
  current: boolean
}
{
  "status": "success",
  "extraMessage": null,
  "failedType": null,
  "timestamp": 1725780628000,
  "outputAmount": "0.001961697012221780",
  "explorerUrl": [
    {
      "url": "https://lineascan.build/tx/0xac125a7cc5fa1b99888b406bad06f5e5db29eb0aa24bcce7004a4108ac68dd0f",
      "description": "Swap"
    }
  ],
  "referrals": [
    {
      "amount": "3000000000000",
      "blockChain": "LINEA",
      "symbol": "ETH",
      "address": null,
      "decimals": 18,
      "type": "RANGO"
    },
    {
      "amount": "2000000000000",
      "blockChain": "LINEA",
      "symbol": "ETH",
      "address": null,
      "decimals": 18,
      "type": "AFFILIATE"
    }
  ],
  "newTx": null,
  "diagnosisUrl": null,
  "steps": null,
  "outputToken": {
    "blockchain": "LINEA",
    "symbol": "EZETH",
    "image": "https://tokens.pancakeswap.finance/images/linea/0x2416092f143378750bb29b79eD961ab195CcEea5.png",
    "address": "0x2416092f143378750bb29b79ed961ab195cceea5",
    "usdPrice": 2328.63,
    "decimals": 18,
    "name": null,
    "isPopular": false,
    "isSecondaryCoin": false,
    "coinSource": null,
    "coinSourceUrl": null,
    "supportedSwappers": []
  },
  "outputType": "DESIRED_OUTPUT",
  "bridgeExtra": {
    "requireRefundAction": false,
    "srcTx": "0xac125a7cc5fa1b99888b406bad06f5e5db29eb0aa24bcce7004a4108ac68dd0f",
    "destTx": null
  },
  "error": null,
  "errorCode": null,
  "traceId": null
}

This endpoint is not suitable for checking approve transaction and it is only for the main transaction. For checking approval transaction status, please .

Description: In some special cases (e.g. Wormhole), the user should follow some steps outside Rango to get its assets back (to refund). You could show this link to the user to help him. Sample value:

🦎
⚙️
https://rango.exchange/diagnosis/wormhole?iframe=1
check this section
Check TX Statusrango-exchange
Check Transaction Status Swagger
Logo