DEX API

查询交易状态#

根据 txhash 查询跨链兑换最终交易状态。

请求地址#

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

请求参数#

参数类型必传描述
hashString源链 Hash 地址
chainIdString源链 ID (如1: Ethereum,更多可查看链 ID 列表))

响应参数#

参数类型必传描述
fromChainIdString源链 ID (如1: Ethereum,更多可查看链 ID 列表)
toChainIdString目标链 ID (如66: Ethereum,更多可查看链 ID 列表)
fromTxHashString源链交易 Hash
toTxHashString目标链交易 Hash
fromAmountString询价币种的兑换数量 (数量包含精度,如 1.00 USDT 则为 1000000)
fromTokenAddressString询价币种合约地址 (如0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
toAmountString目标币种的兑换数量 (数量包含精度,如 1.00 USDT 则为 1000000)
toTokenAddressString目标币种合约地址 (如0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)|
errorMsgString错误信息
bridgeHashString目标链跨链桥交易 Hash
refundTokenAddressString退款币种的合约地址
sourceChainGasfeeString源链兑换实际消耗的gas fee
crossChainFeeObject跨链桥实际收取的费用
symbolString跨链桥币种symbol
addressString跨链桥币种地址
amountString跨链桥收取的数量
crossChainInfoObject跨链桥的信息
memoString/build-tx 中携带的自定义参数
destinationChainGasfeeString目标链兑换实际消耗的gas fee
detailStatusStringWAITING (订单处理中)
FROM_SUCCESS (源链订单成功)
FROM_FAILURE (源链订单失败)
BRIDGE_PENDING (跨链桥订单执行中)
BRIDGE_SUCCESS (跨链桥订单成功)
SUCCESS (跨链兑换订单成功)
REFUND (跨链失败,订单退款)
statusStringPENDING (跨链执行中)
SUCCESS (跨链成功)
FAILURE (跨链失败)

请求示例#

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'

响应示例#

200
{
  "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"

    }
  ]
}