Join AWS, Dust Labs & OrangeDAO at QuickPitch. Win $80k — Apply Today.

Contents

eth_getBlockTransactionCountByHash RPC Method

The API credit value for this method is 2 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. hash - string - The hash of the block

Returns:

  1. result - The number of transactions associated with a specific block, in hexadecimal value

Code Examples:

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  const txCount = await provider.send("eth_getBlockTransactionCountByHash", [
    "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b",
  ]);
  console.log(txCount);
})();
Ready to get started? Create a free account