DEX API
Get transaction status

Get transaction status#

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

Request address#

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

Request param#

ParameterTypeRequiredDescription
hashStringYesHash address of the source chain
chainIdIntegerNoSource chain ID (e.g., 1 for Ethereum. See Chain IDs)

Response param#

ParameterTypeRequiredDescription
fromChainIdIntegerYesSource chain ID (e.g., 1 for Ethereum. See Chain IDs)
toChainIdIntegerYesDestination chain ID (e.g., 1 for Ethereum. See Chain IDs)
fromTxHashStringYesTransaction hash of source chain
toTxHashStringNoTransaction hash of destination chain
toAmountStringNoThe amount of token to be bought
errorMsgStringNoError message
bridgeHashStringYesTransaction hash of bridge
sourceChainGasfeeStringYesActual cost of the gas fee of the source-chain swap
crossChainFeeObjectyesActual fee charged by the cross-chain bridges
symbolStringYesThe symbol of cross-chain
addressStringYesThe address of cross-chain
amountStringYesThe amount of cross-chain fee
destinationChainGasfeeStringYesActual cost of the gas fee of the destination-chain swap
detailStatusStringYesWAITING (Order processing)
FROM_SUCCESS (Source swap success)
BRIDGE_PENDING (Bridge pending)
SUCCESS (Order success)
REFUND (Refund order)
FAILURE (Order failed)
statusStringYesPENDING (Order pending)
SUCCESS (Order success)
FAILURE (Order failure)
REFUND (Order failure, refund)

Request example#

shell
curl --location --request GET 'https://www.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",
        "fromChainId": 109,
        "toChainId": 110,
        "toAmount": 25300000000000,
        "errorMsg": "",
        "toTxHash": "0x94ec8deac0d114b1c4ef09e0f29689dc53fd9e66de822e2059b9ad078c1ae1e8",
        "fromTxHash": "0xa917f8c0ff8dd4b7bdf2eac4d54be40f7a7d4a06a517c6c590ea9a9bd99f40ba",
        "detailStatus": "SUCCESS",
        "status": "SUCCESS"
     }
  ]
}