Portal para programadores
Tema

Get Block Details#

Get the block details of the chains.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, XLAYER
heightStringYesBlock height

Response Parameters#

ParameterTypeDescription
chainFullNameStringThe full name of the blockchain network, e.g. X Layer
chainShortNameStringThe abbreviated name of the blockchain network, e.g. XLAYER
hashStringBlock hash
heightStringBlock height
validatorStringValidator
blockTimeStringThe Unix timestamp for when the block was validated, in milliseconds format, e.g., 1597026383085.
amountStringAmount of the transaction
txnCountStringThe number of normal transactions contained in the block
txnInternalStringThe number of internal transactions contained in the block
blockSizeStringBlock size, measured in bytes
mineRewardStringBlock reward, block revenue is equal to mineReward + totalFee
totalFeeStringThe sum of all fees in the block, in the currency of the fee
feeSymbolStringFee currency
ommerBlockStringThe number of ommer blocks
merkleRootHashStringMerkle root hash
gasUsedStringActual amount of gas used
gasLimitStringGas limit
gasAvgPriceStringGas avg price, in OKB
stateStringDifferent block states: "pending" indicates that confirmation is currently in progress, "done" indicates completion.
burntStringDestruction fee amount
minerStringThe miner's address Hash that packs the block
difficultyStringDifficulty when packing the block
nonceStringIn PoW blockchains, nonce is used to describe mining difficulty
confirmStringConfirmed block count
tipsStringThe maximum gas price that the transaction initiator is willing to pay to prioritize their transaction for inclusion in a block by miners
baseFeePerGasStringBasic fee per Gas, in OKB

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/block/block-fills?chainShortName=xlayer&height=31118669' \
--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": [
        {
            "chainFullName": "X Layer",
            "chainShortName": "XLAYER",
            "hash": "0xb697649cd67e790749dee213a430e40c109565d7cc76db631032330365ab4550",
            "height": "31118669",
            "validator": "0x610de9141a2c51a9a9624278aa97fbe54b27c102",
            "blockTime": "1755483959000",
            "txnCount": "4",
            "amount": "0",
            "blockSize": "1594",
            "mineReward": "0.000958705000023418",
            "totalFee": "0.000958705000023418",
            "feeSymbol": "OKB",
            "ommerBlock": "0",
            "merkleRootHash": "0x3c1ef0615fa4de876c768f0cc76ccc375f1b2ccf38335853581470566407d130",
            "gasUsed": "958705",
            "gasLimit": "0",
            "gasAvgPrice": "0.000000001",
            "state": "",
            "burnt": "0",
            "txnInternal": "67",
            "miner": "0x610de9141a2c51a9a9624278aa97fbe54b27c102",
            "difficuity": "0",
            "nonce": "0",
            "tips": "0",
            "confirm": "3537",
            "baseFeePerGas": "0"
        }
    ]
}