Get Block List#
Get the block list information of the chains, and only return nearly 10,000 block list data.
Request Path#
GET
https://web3.okx.com/api/v5/xlayer/block/block-listRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainShortName | String | Yes | The abbreviated name of the blockchain network, e.g, XLAYER |
| height | String | No | Height |
| limit | String | No | The number of results returned per request. The maximum is 100. The default is 20. |
| page | String | No | Page |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| page | String | Current page number |
| limit | String | The amount of data |
| totalPage | String | Total number of pages |
| chainFullName | String | The full name of the blockchain network, e.g. X Layer |
| chainShortName | String | The abbreviated name of the blockchain network, e.g. XLAYER |
| blockList | Array | Block list |
| > hash | String | Block hash |
| > height | String | Block height |
| > validator | String | Validator |
| > blockTime | String | The Unix timestamp for when the block was validated, in milliseconds format, e.g., 1597026383085. |
| > txnCount | String | The number of transactions contained in the block |
| > blockSize | String | Block size. The unit is: bytes |
| > mineReward | String | Block reward, block revenue is equal to mineReward + totalFee |
| > totalFee | String | The sum of all fees in the block, in the currency of the fee |
| > feeSymbol | String | Fee currency |
| > avgFee | String | Average transaction fee |
| > ommerBlock | String | The number of ommer blocks |
| > gasUsed | String | Actual amount of gas used |
| > gasLimit | String | Gas limit |
| > gasAvgPrice | String | Gas avg price |
| > state | String | Different block states:"pending" indicates that confirmation is currently in progress"done" indicates completion. |
| > burnt | String | Destruction fee amount |
Request Example#
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'
Response Example#
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": ""
}
]
}
]
}
