How to Check Status of a Transfer
The full API reference for our /status endpoint can be found in the API reference section.
In this section, we will cover the process of determining the status of ongoing token transfers and swaps.
If you have already reviewed our guide on how to transfer and swap tokens, you are familiar with the steps of initiating and submitting a transaction.
To fetch the execution status of a transfer, the /status endpoint can be queried.
In the case of a cross-chain transfer, the txHash, userAddress, fromChainId, toChainId and bridge parameters need to be set.
const getStatus = async (bridgeName, fromChainId, toChainId, txHash, userAddress) => {
const result = await axios.get('https://swap.prod.swing.xyz', {
txHash: txHash, // transaction hash
userAddress: userAddress, // user's wallet address
bridge: bridgeName, // bridge name
fromChainId: fromChainId, // optional: sending chain id
toChainId: toChainId // optional: receiving chain i
});
return result.data;
}
The result will look like the following:
{
"needClaim": false,
"status": "Completed",
"refundReason": "",
"txId": "0x57d23138e7a303463bf20aa8d60d60da25101dc967efa93d73babfc43938179e73",
"txStartedTimestamp": 1651483767,
"fromChainId": 1,
"fromChainSlug": "ethereum",
"fromChainTxHash": "0x57d23138e7a303463bf20aa8d62d60da25201dc967efa93d73babfc43938179e",
"fromTokenAddress": "0x0000000000000000000000000000000000000000",
"fromAmount": "129207499932118534",
"toChainId": 137,
"toChainSlug": "polygon",
"toChainTxHash": "0x4c123bf70a1a6f3e411f93f85960ee94e84ba88e04fadd403a579ddc88cee750",
"toTokenAddress": "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
"toAmount": "129207499932118534"
}