getBlockHeaderByHash

Kadena RPC

Overview

The /chain/{chain}/header/{blockHash} endpoint allows querying a block header by its hash. This is useful for developers looking to verify blocks or inspect block attributes without the need for the entire block's data.

Parameters

NameTypeRequiredDescription
apiVersionstringYesVersion of Kadena API "0.0"
nodeVersionenumYes"test-singleton" "development" "mainnet01" "testnet04"
chainstringYesThe specific chain ID from which to retrieve the header.
blockHashstringYesThe hash of the block whose header is being requested.

Returns

A successful call to this endpoint returns the requested block header. The header can be returned in various formats, including JSON, base64 encoded, or binary.

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/kadena-mainnet/{api_key}/chainweb/{apiVersion}/{nodeVersion}/chain/{chain}/header/{blockHash}' \
--header 'Content-Type: application/json'
// yarn add @tatumio/tatum

import { TatumSDK, Kadena, Network } from "@tatumio/tatum";

const tatum = await TatumSDK.init<Kadena>({ network: Network.KADENA_MAINNET });

const blockHeader = await tatum.kadena.getBlockHeaderByHash({
  network: {
    apiVersion: "0.0",
    nodeVersion: "mainnet01",
    chain: "0", // Example chain ID
  },
  blockHash: "your_block_hash_here",
});

console.log(blockHeader);

await tatum.destroy(); // Destroy Tatum SDK - needed for stopping background jobs