Check Transaction Status
Track Status of Transaction
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'Check Transaction Status Request
requestId* StringDescription: The unique ID which is generated in the swap endpoint.
Example:
b3a12c6d-86b8-4c21-97e4-809151dd4036
txId* StringDescription: Transaction hash that wallet returned.
Example:
0xfa88b705a5b4049adac7caff50c887d9600ef023ef1a937f8f8b6f44e90042b5
export type StatusRequest = {
requestId: string
txId: string
}Check Transaction Status Response
statusDescription: Status of the transaction, while the status is
running(ornull), the client should retry until it turns intosuccessorfailed.
errorDescription: A message in case of failure, that could be shown to the user.
outputDescription: 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_OUTPUTWhen 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 intendedDESIRED_OUTPUTtoken as part of the output.REVERTED_TO_INPUTIf 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_SRCIf the dex step succeeded but the bridge step failed because of slippage or lack of liquidity or ...MIDDLE_ASSET_IN_DESTIf the [dex]+bridge step succeeded but, the last dex step failed because of slippage.
explorerUrlDescription: List of explorer URLs for the transactions of this swap. Including inbound transaction link, outbound transaction link and etc.
diagnosisUrlDescription: 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.
bridgeDataDescription: 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"
}
}Last updated
Was this helpful?