Skip to main content

eth_getBlockByNumber

Returns information about a block by number.

Params

(2)

1. Block (required)

(one of)
string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$

2. Hydrated transactions (required)

boolean

Result

(Block information)
parentHash
string
required
Match pattern:
^0x[0-9a-f]{64}$
sha3Uncles
string
required
Match pattern:
^0x[0-9a-f]{64}$
miner
string
required
Match pattern:
^0x[0-9,a-f,A-F]{40}$
stateRoot
string
required
Match pattern:
^0x[0-9a-f]{64}$
transactionsRoot
string
required
Match pattern:
^0x[0-9a-f]{64}$
receiptsRoot
string
required
Match pattern:
^0x[0-9a-f]{64}$
logsBloom
string
required
Match pattern:
^0x[0-9a-f]{512}$
difficulty
string
Match pattern:
^0x[0-9a-f]*$
number
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
gasLimit
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
gasUsed
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
timestamp
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
extraData
string
required
Match pattern:
^0x[0-9a-f]*$
mixHash
string
required
Match pattern:
^0x[0-9a-f]{64}$
nonce
string
required
Match pattern:
^0x[0-9a-f]{16}$
totalDifficulty
string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
baseFeePerGas
string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
withdrawalsRoot
string
Match pattern:
^0x[0-9a-f]{64}$
size
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
transactions
required
withdrawals
array[Validator withdrawal]
index
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]{0,15})|0$
validatorIndex
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]{0,15})|0$
address
string
required
Match pattern:
^0x[0-9,a-f,A-F]{40}$
amount
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]{0,31})|0$
uncles
array[string]
required

Params

Block

Hydrated transactions


Request

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