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

示例中较长的数组和十六进制字符串已截断。

参数与您的端点

参数

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.

相关方法