eth_newFilter - Polygon
eth_newFilter. Create a new filter to monitor specific logs or events
eth_newFilter - polygon [Value: 20CU]
Creates a filter object to notify when logs that match specific criteria are added to the blockchain
- Monitor contract events within specific block range
- Filter logs from a particular smart contract
- Track specific events for auditing or analytics
- Available only on paid tier
- Node must support filter creation functionality
- Accurate block and address input essential for results
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Request
Examples
curl https://polygon.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}'
'Response
200
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xb1770efb14906e509893b6190359658208ae64d0c56e22f748a1b0869885559e"
}idinteger
jsonrpcstring
methodstring
array of objects
blockHashstring
Specifies the block hash to filter logs from. If this parameter is set, the fromBlock and toBlock parameters will be ignored.
addressarray_of_strings
(optional) Contract address or a list of addresses from which logs should originate.
fromBlockstring
(optional) The starting block for the filter.
- latest [default] - The most recent block in the blockchain (default).
- earliest - The first block, also known as the genesis block.
- pending - Transactions that have been broadcast but not yet included in a block.
toBlockstring
(optional) The ending block for the filter
- latest [default] - The most recent block in the blockchain (default).
- earliest - The first block, also known as the genesis block.
- pending - Transactions that have been broadcast but not yet included in a block.
topicsarray_of_strings
(optional) An array of log topics.
200
The ID of the newly created filter, represented as a hexadecimal string. object
idinteger
jsonrpcstring
resultarray_of_objects