Trade API

Get Transaction Status#

Check the final status of the cross-chain swap according to transaction hash.

Request URL#

GET https://web3.okx.com/api/v5/dex/cross-chain/status

Request Parameters#

ParameterTypeRequiredDescription
hashStringYesHash address of the source chain
chainIndexStringNoSource chain ID. (e.g., 1 for Ethereum. See Chain IDs).
chainIdStringNoSource chain ID.
It will be deprecated in the future.

Response Parameters#

ParameterTypeDescription
fromChainIndexStringSource chain ID (e.g., 1 for Ethereum. See Chain IDs).
toChainIndexStringDestination chain ID (e.g., 1 for Ethereum. See Chain IDs).
fromChainIdStringSource chain ID
toChainIdStringTarget chain ID
fromTxHashStringSource chain transaction hash
toTxHashStringTarget chain transaction hash
fromAmountStringExchange amount of the quoted token (amount includes precision, e.g., 1.00 USDT would be 1000000)
fromTokenAddressStringContract address of the quoted token (e.g., 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
toAmountStringExchange amount of the target token (amount includes precision, e.g., 1.00 USDT would be 1000000)
toTokenAddressStringContract address of the target token (e.g., 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
errorMsgStringError message
bridgeHashStringCross-chain bridge transaction hash on the target chain
refundChainIdStringRefund chain ID
refundTokenAddressStringContract address of the refund token
refundTxHashStringRefund transaction hash
sourceChainGasfeeStringActual gas fee consumed on the source chain
crossChainFeeObjectActual fees charged by the cross-chain bridge
symbolStringSymbol of the cross-chain bridge token
addressStringAddress of the cross-chain bridge token
amountStringAmount charged by the cross-chain bridge
crossChainInfoObjectInformation about the cross-chain bridge
memoStringCustom parameter carried in /build-tx
destinationChainGasfeeStringActual gas fee consumed on the target chain
detailStatusStringWAITING (Order in process), FROM_SUCCESS (Source chain order successful), FROM_FAILURE (Source chain order failed), BRIDGE_PENDING (Cross-chain bridge order pending), BRIDGE_SUCCESS (Bridge order successful), SUCCESS (Cross-chain exchange order successful), REFUND (Cross-chain failed, order refunded)
statusStringPENDING (Cross-chain in progress), SUCCESS (Cross-chain successful), FAILURE (Cross-chain failed)

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/dex/cross-chain/status?hash=0x0922d94d3bb459d05f16c64ba4b71ec1138940ed552a701837dba2536893e7fc' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

Response Example#

200
{
  "code":0,
  "msg":"",
  "data": [
      {
        "bridgeHash": "0x94ec8deac0dxxxb1c4ef09e0f29689xxxxfd9e66de822e2059bxxxx78c1ae1e8",
        "fromChainIndex": "109",
        "toChainIndex": "110",
        "fromChainId": "109",
        "toChainId": "110",
        "fromAmount": 10000000000000,
        "toAmount": 25300000000000,
        "errorMsg": "",
        "toTxHash": "0x94ec8deac0d114b1c4ef09e0f29689dc53fd9e66de822e2059b9ad078c1ae1e8",
        "fromTxHash": "0xa917f8c0ff8dd4b7bdf2eac4d54be40f7a7d4a06a517c6c590ea9a9bd99f40ba",
        "refundTokenAddress": "",
        "detailStatus": "SUCCESS",
        "status": "SUCCESS"
     }
  ]
}