Skip to main content

eth_getBlockByNumber

Returns information about a block by number.

Params

(2)

1. block_number (required)

(any of)
integer
>= 0

2. return_full_txns (required)

boolean

Result

(MonadEthGetBlock)
hash
string
parentHash
string
sha3Uncles
string
miner
string
stateRoot
string
transactionsRoot
string
receiptsRoot
string
logsBloom
string
difficulty
string
number
string
gasLimit
string
gasUsed
string
timestamp
string
extraData
string
mixHash
string
nonce
string
uncles
array
transactions
array

Example

Request

await window.ethereum.request({
"method": "eth_getBlockByNumber",
"params": []
});

Result

{
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x0",
"gasUsed": "0x0",
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"timestamp": "0x0",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}

Params

block_number

return_full_txns


Request

await window.ethereum.request({
"method": "eth_getBlockByNumber",
"params": [
null,
null
]
});