eth_getLogs
与えられたフィルタオブジェクトに基づき、マッチするすべてのログの配列を返します。
パラメータ
1. Object - フィルタオプション
fromBlock : QUANTITY|TAG
オプショナル
デフォルト値は "latest"
ブロック番号
または、以下のいずれか
マイニング済みのブロック : "latest"
まだマイニングされていないブロック : "pending", "earliest"
toBlock : QUANTITY|TAG
オプショナル
デフォルト値は "latest"
ブロック番号
または、以下のいずれか
マイニング済みのブロック : "latest"
まだマイニングされていないブロック : "pending", "earliest"
address : DATA|Array
オプショナル
20バイト
ログの起源となるコントラクトアドレスまたはアドレスのリスト
topics : Array of DATA
オプショナル
32バイトの DATA トピック
トピックは順序が固定
それぞれのトピックは配列として渡すことも可能(or条件になる。)
#todo 正しい解釈か確認
blockhash : DATA
オプショナル
EIP-234 で追加
指定したブロックハッシュのログを取得することが可能
このオプションを使うことは、fromBlock と toBlock に同じブロック番号を指定したことに相当
blockhash を指定した場合、fromBlock と toBlockは許可されません。
code:params.js
params: [{
"topics": "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
}]
戻り値
eth_getFilterChanges と同じです。
サンプル
code:example.sh
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"}],"id":74}'
結果については、eth_getFilterChanges を参考にしてください。
参考
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs
https://infura.io/docs/api/get/eth_getLogs
#JSON_RPC_API
Ethereum JSON RPC API 日本語リファレンス