Skip to main content

getBlockTransactionCount

Callable

  • getBlockTransactionCount<ReturnFormat>(web3Context: Web3Context<EthExecutionAPI, any>, block?: string | number | bigint | Buffer | ArrayBuffer | Uint8Array, returnFormat: ReturnFormat): Promise<NumberTypes[ReturnFormat[number]]>

  • Type parameters

    Parameters

    Returns Promise<NumberTypes[ReturnFormat[number]]>

    The number of transactions in the provided block.

    web3.eth.getBlockTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);
    > 1n

    web3.eth.getBlockTransactionCount(
    "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
    { number: FMT_NUMBER.NUMBER , bytes: FMT_BYTES.HEX }
    ).then(console.log);
    > 1