eth_getLogs

The eth_getLogs method returns an array of all logs matching a given filter object on the Optimism network. This method is essential for querying historical event logs emitted by smart contracts, enabling applications to track contract events, monitor specific transactions, and build event-driven features. You can filter by block range, addresses, and specific event topics to efficiently retrieve relevant logs.


Parameters

parameter
type
description
filterObject
object (required)
Filter options: fromBlock, toBlock, address (contract address or array), topics (array of topics to filter)
Return Object

The method returns an array of log objects matching the filter criteria.

Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?