批量查询交易明细#

通过交易哈希获取交易明细信息。

请求路径#

GET
https://web3.okx.com/api/v5/xlayer/transaction/transaction-multi

请求参数#

参数名类型是否必须描述
chainShortNameString公链缩写符号,例如 XLAYER
txIdString交易哈希,多笔交易以,分隔 最多20个txId

响应参数#

参数名类型描述
txIdString交易哈希
methodIdString方法
blockHashString区块哈希
heightString交易发生的区块
transactionTimeString交易时间;Unix时间戳的毫秒数格式,如 1597026383085
fromString发送方地址
toString接收方地址
isFromContractBolFrom地址是否是合约地址
isToContractBolTo地址是否是合约地址
amountString交易数量
symbolString交易数量对应的币种
nonceString发起者地址发起的第几笔交易
gasLimitStringgas限额
gasUsedStringgas消耗
gasPriceStringgas价格
txFeeString手续费
stateString交易状态: success 成功 fail 失败 pending 等待确认
transactionTypeString交易类型 0:原始交易类型 1:EIP2930 2:EIP1559

请求示例#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-multi?chainShortName=xlayer&txId=0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c' \
--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'

响应示例#

json
{
    "code": "0",
    "msg": "",
    "data": [
        {
            "txId": "0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c",
            "methodId": "",
            "blockHash": "0x3ad8f2db660966e4f5b1bc54fb16e7d10ce43d23831f3ded93f27b5f8e1fa343",
            "height": "31136282",
            "transactionTime": "1755493834000",
            "from": "0x55bd572ece54c253888f96bb1722fbc237c6936f",
            "to": "0xd6e86442e5227bd135cf656be48117d43ce92e3b",
            "isFromContract": false,
            "isToContract": false,
            "amount": "0.258308590014360608",
            "symbol": "OKB",
            "nonce": "6",
            "txFee": "0.000021",
            "gasPrice": "1000000000",
            "gasLimit": "21000",
            "gasUsed": "21000",
            "state": "success",
            "transactionType": "0"
        }
    ]
}