• RPC
  • Methods
  • Blockchain
  • Get Block By Number

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
includeBodybooleanNo

Result

PropertyTypeRequired
batchnumberYes
bodyHashstringYes
epochnumberYes
equivocationProofsobject[]No
extraDatanumber[]Yes
hashstringYes
historyHashstringYes
interlinkstring[]No
isElectionBlockbooleanNo
justificationunknownNo
networkstringYes
nextBatchInitialPunishedSetnumber[]No
numbernumberYes
parentElectionHashstringNo
parentHashstringYes
producerunknownNo
seedstringYes
sizenumberYes
slotsany[]No
stateHashstringYes
timestampnumberYes
transactionsany[]No
typestringYes
versionnumberYes

Code Examples

Copy page
Create issue