L0vdL0vd

erigon_getLogsByHash

Returns the logs of every transaction in a block, grouped per transaction.

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

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

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

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    null,
    null
  ]
}

Длинные массивы и hex-строки в примере сокращены.

Параметры и свой эндпоинт

Параметры

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

Возвращает

array One entry per transaction: its logs, or null if it emitted none.

addressstring
Contract that emitted the log.
topicsarray
Up to four indexed topics; topic 0 is the event signature hash.
datastring
Non-indexed event arguments, ABI-encoded.
blockNumberstring
Block number, hex.
transactionHashstring
Hash of the transaction that emitted the log.
logIndexstring
Position of the log in the block, hex.
removedboolean
true if the log was removed by a reorg.

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

Get every log of a block grouped by transaction, so you know which transaction emitted what without fetching receipts.

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

Index i holds the logs of transaction i, or null when that transaction emitted none.

Советы

  • Combine with eth_getBlockByHash to line up logs with transactions.

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