eth_newFilter - Ethereum

eth_newFilter. Creates a filter object, based on filter options, to notify when the state changes (logs)

eth_newFilter - ethereum [Value: 20CU]
Creates a filter object, based on filter options, to notify when the state changes (logs).
Use cases

Use cases

  • Monitor contract events within specific block range
  • Filter logs from a particular smart contract
  • Track specific events for auditing or analytics
Constraints

Constraints

  • Requires valid block range and contract address
  • Node must support filter creation functionality
  • Accurate block and address input essential for results
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://eth.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock": "0xe20360", "toBlock": "0xe20411", "address": "0x6b175474e89094c44da98b954eedeac495271d0f","topics": []}],"id":1}'
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xb1770efb14906e509893b6190359658208ae64d0c56e22f748a1b0869885559e"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray of objects
array of objects
blockHashstring
The block hash to filter logs from. If this parameter is present, then the fromBlock and toBlock parameters are ignored.
addressarray_of_strings
Contract address or a list of addresses from which logs should originate.
fromBlockstring
String - Either the hex value of a block number OR block tags:
  • latest [default] - the blockchain's most recent block
  • safe - a block validated by the beacon chain
  • finalized - a block confirmed by over two-thirds of validators
  • earliest - the first or genesis block
  • pending - transactions broadcasted but not yet included in a block
toBlockstring
Either the hex value of a block number OR block tags:
  • latest [default] - the blockchain's most recent block
  • safe - a block validated by the beacon chain
  • finalized - a block confirmed by over two-thirds of validators
  • earliest - the first or genesis block
  • pending - transactions broadcasted but not yet included in a block
topicsarray_of_strings
Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with 'or' options.

Response

200
Returns a filter id.

Response params

object
idinteger
jsonrpcstring
resultarray_of_objects