L0vdL0vd

eth_getBlockTransactionCountByHash

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

Архив · Работает на любом прошлом блоке

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

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xae"
}
Параметры и свой эндпоинт

Параметры

blockHashstringобязательный
32-byte block hash.

Возвращает

string Transaction count, hex.

Когда использовать

Count the transactions in a block identified by hash.

Как читать ответ

Hex integer, or null if the block is unknown.

Советы

  • Use the hash variant when you work from stored block hashes to stay correct across reorgs.

Связанные методы