查询区块交易列表#
获取指定区块里的交易列表。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/block/transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| height | String | 是 | 区块高度 |
| protocolType | String | 否 | 不同类型的交易 普通交易:transaction 内部交易:internal 20代币:token_20 721代币:token_721 1155代币:token_1155 10代币:token_10 默认是transaction |
| limit | String | 否 | 返回条数,默认返回最近的20条,最多100条 |
| page | String | 否 | 页码 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| blockList | Array | 交易列表 |
| > txid | String | 交易哈希 |
| > methodId | String | 方法 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块 |
| > transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > from | String | 发送方地址 |
| > isFromContract | Bol | From地址是否是合约地址 |
| > isToContract | Bol | To地址是否是合约地址 |
| > to | String | 接收方地址 |
| > amount | String | 交易数量 |
| > transactionSymbol | String | 交易数量对应的币种 |
| > txfee | String | 手续费 |
| > state | String | 交易状态 success:成功 fail:失败 pending:等待确认 |
| > tokenId | String | NFT的ID |
| > tokenContractAddress | String | 代币合约地址 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/block/transaction-list?chainShortName=xlayer&height=31118669&limit=1' \
--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": [
{
"page": "1",
"limit": "1",
"totalPage": "4",
"chainFullName": "X Layer",
"chainShortName": "XLAYER",
"blockList": [
{
"txid": "0xc2ff505188032d2aee7b5debeac40fdc54bed3f25dfded07093aebb74dbd7841",
"methodId": "0xa53711f9",
"blockHash": "0xb697649cd67e790749dee213a430e40c109565d7cc76db631032330365ab4550",
"height": "31118669",
"transactionTime": "1755483959000",
"from": "0x2aff4f126e0c44a565583edbf512be316e13883f",
"isFromContract": false,
"isToContract": true,
"to": "0x47fc11bbe1fef8f07d5797f3b2b43345417603bd",
"amount": "0",
"transactionSymbol": "OKB",
"txfee": "0.000274528",
"state": "success",
"tokenId": "",
"tokenContractAddress": ""
}
]
}
]
}
