查询区块列表#
获取区块列表信息,仅返回近1万条区块列表数据。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/block/block-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| height | String | 是 | 区块高度 |
| limit | String | 否 | 每一页返回的条数,默认返回最近的20条,最多100条 |
| page | String | 否 | 页码 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| blockList | Array | 交易列表 |
| > hash | String | 块hash |
| > height | String | 区块高度 |
| > validator | String | 出块者/超级节点/验证人 |
| > blockTime | String | 出块时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > txnCount | String | 该区块包含的交易条数 |
| > blockSize | String | 区块大小,单位是:bytes |
| > mineReward | String | 区块奖励,块收益等于mineReward+totalFee |
| > totalFee | String | 该区块所有手续费总和 |
| > feeSymbol | String | 手续费币种 |
| > avgFee | String | 每笔交易平均手续费 |
| > ommerBlock | String | 叔块数量 |
| > gasUsed | String | gas消耗 |
| > gasLimit | String | gas限额 |
| > gasAvgPrice | String | gas均价 |
| > state | String | 块状态 确认中:pending确认完成:done |
| > burnt | String | 销毁手续费数量 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/block/block-list?chainShortName=xlayer&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": "10000",
"chainFullName": "X Layer",
"chainShortName": "XLAYER",
"blockList": [
{
"hash": "0x70d4e7c0ddc5993ded572728e02761c0a10ccae28f3133b43dfbad3bb0aa6fd4",
"height": "31122982",
"validator": "0x610de9141a2c51a9a9624278aa97fbe54b27c102",
"blockTime": "1755486326000",
"txnCount": "12",
"blockSize": "2497",
"mineReward": "0.00200257336085162",
"totalFee": "0.00200257336085162",
"feeSymbol": "OKB",
"avgFee": "0.000166881113404302",
"ommerBlock": "0",
"gasUsed": "1947524",
"gasLimit": "0",
"gasAvgPrice": "0.000000001028266332",
"state": "",
"burnt": ""
}
]
}
]
}
