eth
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the given block number.
Returns the number of transactions in a block matching the given block number.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | Block number as a hexadecimal string, or a block tag ("latest", "earliest", "pending"). |
Returns
string -- The number of transactions in the block as a hexadecimal string, or null if no block is found.
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": ["0x100"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
TRY IT
Notes
- Returns
nullif the specified block does not exist. - Early PulseChain blocks may have zero transactions.
- Useful for quickly determining block density without fetching the full block.
- The companion method
eth_getBlockTransactionCountByHashaccepts a block hash instead of a number.
