getBlockByNumber method

Tries to fetch a block given its number. It has an option to include the transactions in the block, which defaults to false. Note that this function will only fetch blocks that are part of the main chain.

Params

ParameterTypeRequired
blockNumbernumberYes
includeBodybooleanYes

Result

PropertyTypeRequired
hashstringYes
sizenumberYes
batchnumberYes
epochnumberYes
networkstringYes
versionnumberYes
numbernumberYes
timestampnumberYes
parentHashstringYes
seedstringYes
extraDatanumber[]Yes
stateHashstringYes
bodyHashstringYes
historyHashstringYes
transactionsany[]No
additionalFieldsobjectYes

Code Examples

Copy page
Create issue