eth_getBlockTransactionCountByNumber - Ethereum

Shows you the number of transactions that have proceeded in this block after you enter its number

How to Use the eth_getBlockTransactionCountByNumber Method

Parameters

BLOCK PARAMETER [necessary] - a block number, or one of the following strings ("latest", "earliest" or "pending"). Check the default block parameter for more information.

What you receive

BLOCK TRANSACTION COUNT - a hex code of the integer representing the number of transactions in the provided block an integer that shows the number of transactions for the needed block encoded in the HEX format.

Sample

Here is a typical appliance example.

Call

curl https://eth-mainnet.rpcfast.com/?api_key=<key> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["latest"],"id":0}'

Outcome

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x50"
}

Last updated