Skip to main content

eth_getBlockByNumber

POST

Fetches block information by block number.
param[0]
blockNumberOrTagstringrequired
Specifies the block to query. Pass a hexadecimal block number or a block tag.Unlike Ethereum, TRON supports only a limited set of tags.
  • latest: The most recent block.
  • earliest: The oldest available block.
param[1]
includeTransactionsbooleanrequired
When true, an array of transaction objects is returned; when false, an array of transaction hashes is returned.
Responses
numberstring
The block number, hex-encoded.
hashstring
The block hash. Its leading 8 characters encode the block height.
parentHashstring
The hash of the previous block.
transactionsRootstring
The merkle root of the transactions in the block.
stateRootstring
The state tree root. TRON does not provide this value and returns an empty value (0x).
receiptsRootstring
The receipts tree root. TRON has no counterpart, so it is filled with zeros.
minerstring
The address of the Super Representative (SR) that produced the block.
logsBloomstring
The Bloom filter used to search event logs.
sizestring
The block size in bytes, hex-encoded.
gasLimitstring
The maximum total energy allowed for the block.
gasUsedstring
The total energy consumed in the block.
timestampstring
The block creation time in UNIX epoch seconds, hex-encoded.
transactionsarray
The list of transactions included in the block.When the second request parameter is false, an array of transaction hashes is returned; when true, an array of transaction objects is returned.
difficultystring
The mining difficulty. TRON does not use proof of work, so it is always 0x0.
totalDifficultystring
The cumulative difficulty. TRON does not use proof of work, so it is always 0x0.
noncestring
The proof-of-work nonce. TRON has no counterpart, so it is filled with zeros.
mixHashstring
The proof-of-work mix hash. TRON has no counterpart, so it is filled with zeros.
sha3Unclesstring
The hash of the uncle list. TRON has no uncles, so it is filled with zeros.
unclesarray
The list of uncle blocks. TRON has no uncles, so it is always an empty array.
extraDatastring
Extra data included in the block. TRON returns an empty value (0x).
baseFeePerGasstring
The EIP-1559 base fee. TRON has no counterpart, so it is always 0x0.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByNumber",
"params": [
"0x51e8875",
false
]
}'