Skip to main content

/blocks/head REST API Endpoint

Returns the most recently finalized block.

Updated on
Sep 2, 2024

/blocks/head REST API Endpoint

Path Parameters

Query Parameters

finalized
boolean
A boolean representing whether or not to get the finalized head. If it is not set the value defaults to true. When set to false it will attempt to get the newest known block, which may not be finalized.
eventDocs
boolean
When set to `true`, every event will have an extra `docs` property with a string of the events documentation.
extrinsicDocs
boolean
When set to `true`, every extrinsic will have an extra `docs` property with a string of the extrinsics documentation.
noFees
boolean
When set to `true`, the fee won't be calculated for the extrinsics.
decodedXcmMsgs
boolean
When set to `true`, this will show the decoded XCM messages within the extrinsics of the requested block.
paraId
string
When it is set, this will return only the decoded XCM messages for the specified origin Parachain Id (originParaId). To activate this functionality, ensure that the `decodedXcmMsgs` parameter is set to true.

Returns

number
string
The block number
hash
string
The unique identifier of the block
parentHash
string
The hash of the previous block in the chain
stateRoot
string
The root of the state trie after the block's execution
extrinsicRoot
string
The root of the Merkle tree containing all extrinsics in the block
authorId
string
The identifier of the block author or the validator who created this block
logs
array
An array of log items associated with the block. Each log entry contains:
type
string
The type of log
index
string
An index or identifier for the log
value
string
The log's content or value
onInitialize
object
The events triggered during the block's initialization phase. It contains:
events
array
An array of event objects triggered on initialization. Each event contains:
method
string
The method or event name
data
string
An array of data associated with the event.
extrinsics
array
An array of extrinsics included in the block. Each extrinsic contains:
method
object
The pallet and method associated with the extrinsic
pallet
string
The pallet (module) name
method
string
The method being called in the extrinsic
signature
object
The signature object which contains the following fields:
signature
string
The cryptographic signature.
signer
string
The account or entity that signed the extrinsic
nonce
string
The nonce of the transaction, used to ensure the uniqueness of each transaction from a given account
args
object
The arguments passed to the extrinsic method
tip
string
Any tip attached to the transaction to prioritize it
hash
string
The hash of the extrinsic
info
object
The info object which contains the following fields:
weight
object
The weight object which contains the following fields:
refTime
string
The reference time used to calculate the weight
proofSize
string
The size of the proof associated with the extrinsic
class
string
The class of the transaction
partialFee
string
The partial fee associated with the transaction
kind
string
The kind of extrinsic
era
object
The era object which contains the following fields:
mortalEra
string
It represents the lifespan of the extrinsic in blocks.
events
array
Events triggered by this extrinsic
method
string
The event method name
data
string
The data associated with the event
success
boolean
Indicates whether the extrinsic was successfully executed
paysFee
boolean
Indicates whether the fee for the extrinsic was paid
onFinalize
object
The onFinalize object which contains the following fields:
events
array
An array of event objects triggered on finalization.
method
string
The event method name
data
string
The data associated with the event
finalized
boolean
A boolean indicating whether the block has been finalized
decodedXcmMsgs
object
The decodedXcmMsgs object which contains the following fields:
horizontalMessages
array
An array of horizontalMessages
originParaId
string
The ID of the originating parachain
destinationParaId
string
The ID of the destination parachain
data
object
The data associated with the message
downwardMessages
array
The messages sent from the relay chain to a parachain.
sentAt
string
The block number at which the message was sent
msg
string
The message content
data
object
The data associated with the message.
upwardMessages
array
Messages sent from a parachain to the relay chain
originParaId
string
The ID of the originating parachain
data
object
The data associated with the message.
Request
1
curl --location 'https://docs-demo.dot-mainnet.quiknode.pro/blocks/head?finalized=true&eventDocs=false&extrinsicDocs=false&noFees=false&decodedXcmMsgs=false' \
2
--header 'Accept: application/json'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free