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
  • Report Failure API
  • Report Failure Request

Was this helpful?

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

Report Transaction Failure

Report failures on signing or sending the transaction

PreviousGet Token BalanceNextGet Direct Tokens

Last updated 9 months ago

Was this helpful?

Report Failure API

Use it when the user rejects the transaction in the wallet or the wallet fails to handle the transaction. Calling this endpoint is not required, but is useful for reporting and we recommend calling it.

await rango.reportFailure({
    requestId: '2823418f-9e18-4110-8d36-b569b0af025e'
    eventType: 'SEND_TX_FAILED',
    reason: 'Transaction is underpriced.'
})
const response = await axios.post(
  'https://api.rango.exchange/basic/report-tx',
  {
    'requestId': '2823418f-9e18-4110-8d36-b569b0af025e',
    'eventType': 'SEND_TX_FAILED',
    'reason': 'Transaction is underpriced.'
  },
  {
    params: {
      'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
    },
    headers: {
      'content-type': 'application/json'
    }
  }
);
curl --request POST \
     --url 'https://api.rango.exchange/basic/report-tx?apiKey=c6381a79-2817-4602-83bf-6a641a409e32' \
     --header 'content-type: application/json' \
     --data '
{
  "requestId": "2823418f-9e18-4110-8d36-b569b0af025e",
  "eventType": "SEND_TX_FAILED",
  "reason": "Transaction is underpriced."
}
'

It's an optional action and does not affect the flow of swap, but it can help us improve our API and also accurately measure failures rates of transactions for each dApp.

Report Failure Request

  • requestId* String

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

  • eventType* String

    • Description: Type of failure.

    • Possible values are:

      FETCH_TX_FAILED, USER_REJECT, USER_CANCEL, CALL_WALLET_FAILED, SEND_TX_FAILED, CLIENT_UNEXPECTED_BEHAVIOUR, TX_EXPIRED, INSUFFICIENT_APPROVE

  • reason* String

    • Description: Failure reason

  • tags Object

    • Description: An optional dictionary of pre-defined tags. Current allowed tags are wallet and errorCode.

export type ReportTransactionRequest = {
  requestId: string
  eventType: APIErrorCode
  reason?: string
  tags?: { wallet?: string; errorCode?: string }
}

export type APIErrorCode =
  | 'TX_FAIL'
  | 'TX_EXPIRED'
  | 'FETCH_TX_FAILED'
  | 'USER_REJECT'
  | 'USER_CANCEL'
  | 'USER_CANCELED_TX'
  | 'CALL_WALLET_FAILED'
  | 'SEND_TX_FAILED'
  | 'CALL_OR_SEND_FAILED'
  | 'TX_FAILED_IN_BLOCKCHAIN'
  | 'CLIENT_UNEXPECTED_BEHAVIOUR'
  | 'INSUFFICIENT_APPROVE'
🦄
⚙️
Report Failed TXrango-exchange
Report TX Failure Swagger
Logo