Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges.
Parameters:
fromBlock - (Optional) Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.
toBlock - (Optional) Integer block number encoded as a hexadecimal, "latest","pending", or "earliest" tags.
address - (Optional) Contract address or a list of addresses from which logs should originate.
topics - (Optional) Array of DATA topics. Topics are order-dependent. Go here to learn more about topics.
Returns:
Code Examples:
require 'ethereum.rb' client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/') filter = { fromBlock: "0xe20360", toBlock: "0xe20411", address: "0x6B175474E89094C44Da98b954EedeAC495271d0F" } response = client.eth_new_filter(filter) puts response["result"]
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')) newFilterId = w3.eth.filter({ 'fromBlock': "0xe20360", 'toBlock': "0xe20411", 'address': '0x6B175474E89094C44Da98b954EedeAC495271d0F' }) print(newFilterId)
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock": "0xe20360", "toBlock": "0xe20411", "address": "0x6b175474e89094c44da98b954eedeac495271d0f","topics": []}],"id":1}'
const ethers = require("ethers"); const filter = { fromBlock: "0xe20360", toBlock: "0xe20411", address: "0x6B175474E89094C44Da98b954EedeAC495271d0F", }; (async () => { const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); const filterId = await provider.send("eth_newFilter", [filter]); console.log(filterId); })();