chain_subscribeNewHeads
Retrieves the best header via subscription.
For clients that require regular updates of the most important or "best" block headers as they are added to the blockchain, the chain_subscribeNewHeads RPC technique is invaluable. With no need for repetitive manual queries, this subscription-based method offers timely header data—essential for applications needing the most recent blockchain information.
Example Request and Result for chain_subscribeNewHeads method
In this section, we provide an illustrative example of a request made to retrieve details contents using the chain_subscribeNewHeads
method. Additionally, we present the resulting response containing information about getting the best header using WS subscription.
Parameters
Fields | Type | Description |
---|---|---|
subscription | string | Allows the client to manage the subscription |
The example in this section uses a non-existing project id.
Make sure you replace it with your Vara Mainnet endpoint when issuing the API calls.
Don't have a project id? Here's a straightforward guide on how to obtain one!
Retrieves the best header via subscription
POST
wss://vara-mainnet.blastapi.io/<project-id>
Request Body
Name | Type | Description |
---|---|---|
subscription | string | [] |
Curl Request example
Last updated