L0vdL0vd

eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block, by number.

归档 · 可查询任意历史区块

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockTransactionCountByNumber","params":["0x1208a5f"]}'

响应示例

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xae"
}
参数与您的端点

参数

blockstring必填
Block number in hex (e.g. "0x1208a5f") or a tag: "latest", "safe", "finalized", "earliest" or "pending". L0vd endpoints run archive nodes, so any historical block works.

返回值

string Transaction count, hex.

适用场景

Count the transactions in a block without downloading them, e.g. to size a backfill or chart activity.

如何解读结果

Hex integer: 0xae = 174 transactions in block 18,908,895.

提示

  • Cheaper than eth_getBlockByNumber when only the count matters.

相关方法