eth_getlogs
Parameters:
Object - The filter options:
fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block
toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block
address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
topics: Array of DATA - (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, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash.
The block range of eth_getLogs is limited to 1024 for public endpoints and 5000 for private endpoints. Requests with blocks over this range will get an error.
Returns:
Array - Array of log objects.
removed: TAG - true when the log was removed, due to a chain reorganization.
logIndex: QUANTITY - integer of the log index position in the block.
transactionIndex: QUANTITY - integer of the transactions index position log was created from.
transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from.
blockHash: DATA, 32 Bytes - hash of the block where this log was in.
blockNumber: QUANTITY - the block number where this log was in.
blockTimestamp: QUANTITY - the block timestamp.
address: DATA, 20 Bytes - address from which this log originated.
data: DATA - contains one or more 32 Bytes non-indexed arguments of the log.
topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments.
Example:
Was this helpful?