Check the final status of the cross-chain swap according to transaction hash.
GET https://www.okx.com/api/v5/dex/cross-chain/status
Parameter | Type | Required | Description |
---|---|---|---|
hash | String | Yes | Hash address of the source chain |
chainId | String | No | Source chain ID (e.g., 1 for Ethereum. See Chain IDs) |
Parameter | Type | Required | Description |
---|---|---|---|
fromChainId | String | Yes | Source chain ID (e.g., 1 for Ethereum. See Chain IDs) |
toChainId | String | Yes | Destination chain ID (e.g., 1 for Ethereum. See Chain IDs) |
fromTxHash | String | Yes | Transaction hash of source chain |
toTxHash | String | No | Transaction hash of destination chain |
fromAmount | String | Yes | fromAmount: 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 ) |
fromTokenAddress | String | Yes | The contract address of a token you want to send (e.g.,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ) |
toAmount | String | Yes | The 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 ) |
toTokenAddress | String | Yes | The contract address of a token you want to receive (e.g.,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 ) |
errorMsg | String | No | Error message |
bridgeHash | String | Yes | Transaction hash of bridge |
refundTokenAddress | String | No | Contract address of refund token |
sourceChainGasfee | String | Yes | Actual cost of the gas fee of the source-chain swap |
crossChainFee | Object | yes | Actual fee charged by the cross-chain bridges |
symbol | String | Yes | The symbol of cross-chain |
address | String | Yes | The address of cross-chain |
amount | String | Yes | The amount of cross-chain fee |
crossChainInfo | Object | Yes | the cross-chain info |
memo | String | NO | The customized parameters that are carried in /build-tx |
destinationChainGasfee | String | Yes | Actual cost of the gas fee of the destination-chain swap |
detailStatus | String | Yes | WAITING (Order processing) FROM_SUCCESS (Source swap success) FROM_FAILURE (Source swap failure) BRIDGE_PENDING (Bridge pending) BRIDGE_SUCCESS (Bridge success) SUCCESS (Order success) REFUND (Order failure, refund) |
status | String | Yes | PENDING (Order pending) SUCCESS (Order success) FAILURE (Order failure) |
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'
{
"code":0,
"msg":"",
"data": [
{
"bridgeHash": "0x94ec8deac0dxxxb1c4ef09e0f29689xxxxfd9e66de822e2059bxxxx78c1ae1e8",
"fromChainId": "109",
"toChainId": "110",
"fromAmount": 10000000000000,
"toAmount": 25300000000000,
"errorMsg": "",
"toTxHash": "0x94ec8deac0d114b1c4ef09e0f29689dc53fd9e66de822e2059b9ad078c1ae1e8",
"fromTxHash": "0xa917f8c0ff8dd4b7bdf2eac4d54be40f7a7d4a06a517c6c590ea9a9bd99f40ba",
"refundTokenAddress": "",
"detailStatus": "SUCCESS",
"status": "SUCCESS"
}
]
}