Module

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

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

Examples

api.derive.chain.subscribeNewHeads((header) => {
  console.log(`block #${header.number} was authored by ${header.author}`);
});

Parameters

instanceId: string

Returns

A header with the current header (including extracted author)