Parameters
quantity or tag— the block number in hex format or block tag (latest,earliest,pending,safe,finalized)
Response
quantity— the number of transactions in the block
quantity or tag — the block number in hex format or block tag (latest, earliest, pending, safe, finalized)quantity — the number of transactions in the blocketh_getBlockTransactionCountByNumber code examplesconst { JsonRpcProvider } = require("ethers");
const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");
async function call() {
const result = await provider.send("eth_getBlockTransactionCountByNumber", [
"latest"
]);
console.log(result);
}
call();
Was this page helpful?