eth_newFilter

The eth_newFilter method creates a filter object based on filter options to notify when the state changes (logs). This method is essential for applications that need to monitor specific events on the blockchain, such as token transfers or contract events. The filter can be configured with specific addresses, topics, and block ranges to capture relevant log entries.


Parameters

parameter
type
description
filterObject
object (required)
Filter options including fromBlock, toBlock, address, and topics

Filter Object Properties:

property
type
description
fromBlock
string (optional)
Block number in hex or tag (latest, earliest, pending). Defaults to latest
toBlock
string (optional)
Block number in hex or tag (latest, earliest, pending). Defaults to latest
address
string or array (optional)
Contract address or array of addresses to filter logs from
topics
array (optional)
Array of topics to filter. Each position can be null or an array of values
Return Object

The method returns a filter ID as a hexadecimal string that can be used with eth_getFilterChanges or eth_getFilterLogs to retrieve matching log entries.

Request Example
Request
Response Example
Response

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