Contents

eth_newFilter RPC method

Parameters:

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

    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:

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

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"]
Ready to try QuickNode? Start your 7-day free trial