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
fromAmountStringYesfromAmount: The input amount of a token to be sold (set in minimal divisible units, e.g., 1.00 USDT set as 1000000, 1.00 DAI set as 1000000000000000000)
fromTokenAddressStringYesThe contract address of a token you want to send (e.g.,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)
toAmountStringYesThe amount of token to be bought (set in minimal divisible units, e.g., 1.00 USDT set as 1000000, 1.00 DAI set as 1000000000000000000)
toTokenAddressStringYesThe contract address of a token you want to receive (e.g.,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
errorMsgStringNoError message
bridgeHashStringYesTransaction hash of bridge
refundTokenAddressStringNoContract address of refund token
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
crossChainInfoObjectYesthe cross-chain info
memoStringNOThe customized parameters that are carried in /build-tx
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",
        "refundTokenAddress": "",
        "detailStatus": "SUCCESS",
        "status": "SUCCESS"
     }
  ]
}