Skip to main content
Plasma API method that returns information about a block by block hash.

Parameters

  • data — the hash of the block
  • boolean — if true, returns full transaction objects; if false, returns only transaction hashes

Response

  • object — a block object, or null when no block was found

eth_getBlockByHash code examples

const { JsonRpcProvider } = require("ethers");

const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");

async function call() {
  const result = await provider.send("eth_getBlockByHash", []);
  console.log(result);
}

call();