Skip to main content

eth_getBlockByNumber

Returns information about a block by number.

Params

(2)

1. block_number (required)

(any of)
string<hex>

2. return_full_txns (required)

boolean

Result

(MonadEthGetBlock)
difficulty
string
extraData
string
gasLimit
string
gasUsed
string
hash
string or null
logsBloom
string
miner
string
nonce
any
number
any
parentHash
string
receiptsRoot
string
sha3Uncles
string
size
any
stateRoot
string
timestamp
string
transactions
array
transactionsRoot
string
uncles
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",
"nonce": null,
"number": null,
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"size": null,
"stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x0",
"transactions": [],
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"uncles": []
}

Params

block_number

return_full_txns


Request

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