Skip to main content

chain_subscribeNewHeads RPC method

The chain_subscribeNewHeads RPC method is instrumental for clients needing continuous updates of the most significant or 'best' block headers as they are appended to the blockchain. This subscription-based approach provides timely header data, crucial for applications requiring the latest blockchain information without repetitive manual queries.


subscription string

Enables subscription management for header updates.


parentHash string

Hash of the preceding block's header.

number string

The number of the best header's block.

stateRoot string

State root hash for the best header.

extrinsicsRoot string

Root hash for the extrinsics in the best header.

digest object

Contains additional details and logs for the best header.

logs array

Log entries associated with the best header.

Code Examples

wscat -c wss://<API-KEY> \
# wait for connection