🚀 We’re excited to announce our $35m Series A led by Tiger Global: Press Release, Coindesk, Bloomberg, Business Insider & RefreshMiami!

Contents

eth_newFilter RPC method

Parameters:

  1. Object - Should contain filter information, all keys are optional:

    fromBlock - Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.

    toBlock - Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.

    address - Contract address or a list of addresses from which logs should originate.

    topics - Array of DATA topics. Topics are order-dependent. Go here to learn more about topics.

Returns:

  1. Result - A filter id - to be used when calling eth_getFilterChanges.

Code Examples:

from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/'))
newFilterId = w3.eth.filter({
  'fromBlock': 1000000,
  'toBlock': 1000100,
  'address': '0x6B175474E89094C44Da98b954EedeAC495271d0F'
})
print(newFilterId)
Ready to try QuickNode? Start your 7-day free trial