# Ethereum eth_newFilter RPC method

Ethereum API method that creates a filter object based on the filter options to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges.

Parameters:

  • object — should contain the filter information. All keys are optional:
    • fromBlock — (optional) the integer block number, or the string 'latest', 'earliest' or 'pending', encoded as hexadecimal starting with 0x.
    • toBlock — (optional) the integer block number, or the string 'latest', 'earliest' or 'pending', encoded as hexadecimal starting with 0x.
    • address — (optional) the contract address, or a list of addresses from which the logs should originate.
    • topics — (optional) the array of DATA topics. Topics are order-dependent.

Returns:

Example:

Information

cURL needs a HEX String starting with 0x to identify the block if you want to use a hex integer block number as a parameter. For example, block number 14000000 will be 0xD59F80.

  • web3.js
  • web3.py
  • eth.rb
  • cURL
// Web3.js does not support this feature. See the Web3.js subscriptions page.