Portal deweloperski
Motyw

Get Block Details#

Get the details of a TradeZone block by block height.

Request Path#

GET
https://web3.okx.com/api/v5/xlayer/tz/block/block-fills

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, TRADE_ZONE
heightStringYesThe block height to query

Response Parameters#

ParameterTypeDescription
hashStringBlock hash
heightStringBlock height
previousBlockHashStringPrevious block hash
minerStringBlock producer address
blockTimeStringBlock time (ms)
sizeStringBlock size (bytes)
transactionCountStringNumber of transactions in the block
tokenTransferCountStringNumber of token transfers in the block
eventCountStringNumber of events in the block
transactionsRootStringTransactions Merkle root

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/tz/block/block-fills?chainShortName=TRADE_ZONE&height=21217618' \
--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": [
        {
            "hash": "0xdf8ad76a3fac0a8af9d8496bc68319a53dafe1e9c4965e0b34d0364c561f2cbd",
            "height": "21217618",
            "previousBlockHash": "0xe2f1e913924d73fbc1f7544e48ec469cbf0e3698b4c8e16d0ac297dcfbb83f43",
            "miner": "0x4d3b3c2eea46467131ecdf6bd4a8787612651408",
            "blockTime": "1779156763517",
            "size": "1814",
            "transactionCount": "4",
            "tokenTransferCount": "0",
            "eventCount": "4",
            "transactionsRoot": "0xf73bdc0c5fe8d927ffe205907b902e6ed15a49d3496e16fb75f85ba00ab4e4c5"
        }
    ]
}