For the complete documentation index, see llms.txt. This page is also available as Markdown.

Report Transaction Failure

Report failures on signing or sending the transaction

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.

If you are using Rango Public Test Api Key for testing the API, make sure to use "https://public-api.rango.exchange" for endpoint calls. If you have access to a Private API Key, you must use "https://api.rango.exchange"

await rango.reportFailure({
    requestId: '2823418f-9e18-4110-8d36-b569b0af025e'
    eventType: 'SEND_TX_FAILED',
    reason: 'Transaction is underpriced.'
})
const response = await axios.post(
  'https://public-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'
    }
  }
);
Report TX Failure Swagger

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.

Last updated