chain_getFinalizedHead
Returns the hash of the most recent parachain block that GRANDPA finalized. Rely on this hash when your application must anchor compliance proofs or credential state to an immutable block.
Parameters
This method does not take any parameters.
Returns
Field | Type | Description |
---|---|---|
result | string | Hex-encoded hash of the latest finalized block. |
Request Example
{
"jsonrpc": "2.0",
"method": "chain_getFinalizedHead",
"params": [],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"result": "0x12dbd70ed24bffa8ecf8a0ac1a3ab639cdb4ce462f32fbfa33f33017dae6a604",
"id": 1
}
Quick Start
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-manta-atlantic-mainnet.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
const finalizedHash = await api.rpc.chain.getFinalizedHead();
const finalizedBlock = await api.rpc.chain.getBlock(finalizedHash);
console.log('Finalized block number', finalizedBlock.block.header.number.toNumber());
Operational Tips
- Use finalized hashes when generating audit trails for zkSBT issuance and revocation events.
- Compare the latest head from
chain_getHeader
with the finalized head to monitor finality lag. - If you need continuous updates, subscribe using
chain_subscribeFinalizedHeads
.