钱包 API
按订单 Id 查交易详情

按订单 Id 查交易详情#

根据 orderId 查询某个交易的详情,支持查询 EVM 和 UTXO 模型网络的交易详情,需要指定钱包账户唯一标识 accountId。

请求路径#

GET https://www.okx.com/api/v5/wallet/post-transaction/transaction-detail-by-ordid

请求参数#

ParameterTypeRequiredDescription
orderIdStringYes交易唯一标识

响应参数#

ParameterTypeDescription
chainIndexString链唯一标识
accountIdString账户唯一标识符
fromAddrStringFrom 地址,支持多个地址,逗号分隔
toAddrStringTo 地址,支持多个地址,逗号分隔
serviceChargeStringgasPrice * gasLimit,表示手续费总值,以主网币最小单位传参,例如 ETH wei
txHashString交易哈希
txAmountString转账主链币金额,以主链币的最小单位传参,例如 EVM 链,换算成 wei 数量传入
txStatusString交易状态:
1: 排队中
2: 成功
3: 失败
tokenAddressString代币地址
extJsonObject扩展参数
>gasLimitStringgasLimit
>nonceStringnonce
>gasPriceStringgasPrice

请求示例#

shell
curl --location --request GET 'https://www.okx.com/api/v5/wallet/post-transaction/transaction-detail-by-ordid?orderId=592051a92a744627022955be929ecb5c9e777705&chainIndex=1' \
--header 'Content-Type: application/json' \
--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
以 ETH 为例

{
    "code": "0",
    "msg": "success",
    "data": [
        {
            "chainIndex": "1",
            "accountId": "c79e7775-9e78-4a2d-b27f-9021f3bf5fca",
            "fromAddr": "0x238193be9e80e68eace3588b45d8cf4a7eae0fa3",
            "toAddr": "0x238193be9e80e68eace3588b45d8cf4a7eae0fa3",
            "txHash": "0xc401ffcd2a2b4b1db42ce68dfde8e63c0a1e9653484efb2873dbf5d0cbeb227a",
            "txAmount": "10000000000000",
            "tokenAddress": "",
            "txStatus": "1",
            "extJson": {
                "gasLimit": "21040",
                "feeRate": "1997620912"
            }
        }
    ]
}