eth_getLogs
Returns an array of all logs matching a given filter object. For more information about eth_getLogs check out our Deep Dive into eth_getLogs page.
If you need to pull logs frequently, we recommend using WebSockets to push new logs to you when they are available
Parameters
Object
- The filter options:
fromBlock
:QUANTITY|TAG
- (optional, default: "latest") Value:Integer block number
"latest" for the last mined block
"pending", "earliest" for not yet mined transactions.
toBlock
:QUANTITY|TAG
- (optional, default: "latest") Value:Integer block number
"latest" for the last mined block
"pending", "earliest" for not yet mined transactions.
address
:DATA|Array
, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.topics
:Array
ofDATA
, - (optional) Array of 32 Bytes DATA topics.Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
blockHash
:DATA
, 32 Bytes - (optional) With the addition of EIP-234, blockHash is a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hashblockHash
.
Returns
Array
- Array of log objects, or an empty array if nothing has changed since last poll.
Request
Result
Last updated