Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/api-derive/chain/index.ts>getHeader

Package publishing for deno.land/x/polkadot
Go to Latest
function getHeader
import { getHeader } from "https://deno.land/x/polkadot@0.2.16/api-derive/chain/index.ts";

Examples

const { author, number } = await api.derive.chain.getHeader('0x123...456');

console.log(`block #${number} was authored by ${author}`);

Parameters

instanceId: string
  • A block hash as U8 array or string.

Returns

(blockHash: Uint8Array | string) => Observable<HeaderExtended>

An array containing the block header and the block author