根据 txhash 查询跨链兑换最终交易状态。
GET https://www.okx.com/api/v5/dex/cross-chain/status
参数 | 类型 | 必传 | 描述 |
---|---|---|---|
hash | String | 是 | 源链 Hash 地址 |
chainId | String | 否 | 源链 ID (如1 : Ethereum,更多可查看链 ID 列表)) |
参数 | 类型 | 必传 | 描述 |
---|---|---|---|
fromChainId | String | 是 | 源链 ID (如1 : Ethereum,更多可查看链 ID 列表) |
toChainId | String | 是 | 目标链 ID (如66 : Ethereum,更多可查看链 ID 列表) |
fromTxHash | String | 是 | 源链交易 Hash |
toTxHash | String | 否 | 目标链交易 Hash |
fromAmount | String | 是 | 询价币种的兑换数量 (数量包含精度,如 1.00 USDT 则为 1000000 ) |
fromTokenAddress | String | 是 | 询价币种合约地址 (如0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE ) |
toAmount | String | 否 | 目标币种的兑换数量 (数量包含精度,如 1.00 USDT 则为 1000000 ) |
toTokenAddress | String | 是 | 目标币种合约地址 (如0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 )| |
errorMsg | String | 否 | 错误信息 |
bridgeHash | String | 是 | 目标链跨链桥交易 Hash |
refundTokenAddress | String | 否 | 退款币种的合约地址 |
sourceChainGasfee | String | 是 | 源链兑换实际消耗的gas fee |
crossChainFee | Object | 是 | 跨链桥实际收取的费用 |
symbol | String | 是 | 跨链桥币种symbol |
address | String | 是 | 跨链桥币种地址 |
amount | String | 是 | 跨链桥收取的数量 |
crossChainInfo | Object | 是 | 跨链桥的信息 |
memo | String | 否 | /build-tx 中携带的自定义参数 |
destinationChainGasfee | String | 是 | 目标链兑换实际消耗的gas fee |
detailStatus | String | 是 | WAITING (订单处理中) FROM_SUCCESS (源链订单成功) FROM_FAILURE (源链订单失败) BRIDGE_PENDING (跨链桥订单执行中) BRIDGE_SUCCESS (跨链桥订单成功) SUCCESS (跨链兑换订单成功) REFUND (跨链失败,订单退款) |
status | String | 是 | PENDING (跨链执行中) SUCCESS (跨链成功) 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",
"toAmount": 25300000000000,
"errorMsg": "",
"toTxHash": "0x94ec8deac0d114b1c4ef09e0f29689dc53fd9e66de822e2059b9ad078c1ae1e8",
"fromTxHash": "0xa917f8c0ff8dd4b7bdf2eac4d54be40f7a7d4a06a517c6c590ea9a9bd99f40ba",
"refundTokenAddress": "",
"sourceChainGasfee":"0.2"
"destinationChainGasfee":"0.1"
"crossChainFee": {
"symbol":"usdt",
"address":"0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f",
"amount":"2.3",
}
"detailStatus": "SUCCESS",
"status": "SUCCESS"
}
]
}