Skip to content

getPoSBlock

Get the PoS block information by block number or block hash.

Usage

example.ts
import { publicClient } from "./client";
 
const PoSBlock = await publicClient.getPoSBlock();

Returns

PoSBlock

Parameters

blockNumber (optional)

  • Type: bigint
const PoSBlock = await publicClient.getPoSBlock({
  blockNumber: 1n, 
});

blockTag (optional)

  • Type: latest_committed| latest_voted
  • Defaut: latest_voted
const PoSBlock = await publicClient.getPoSBlock({
  blockTag: "latest_voted",
});

blockHash (optional)

  • Type: Hash
const PoSBlock = await publicClient.getPoSBlock({
  blockHash: "0x...",
});

JSON-RPC Method

pos_getBlockByHash

pos_getBlockByNumber