L0vdL0vd

erigon_getLogsByHash

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

Archive · Works on any past block

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"]}'

Example response

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

Long arrays and hex strings are shortened in this example.

Params and your endpoint

Parameters

blockHashstringrequired
32-byte block hash.

Returns

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.

When to use it

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

How to read the result

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

Tips

  • Combine with eth_getBlockByHash to line up logs with transactions.

Related methods