Register and show off your project at Ethereum QuickPitch and win $10,000. Apply now

Contents

eth_getFilterChanges RPC method

The API credit value for this method is 2 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. Quantity - The filter id that is returned from eth_newFilter, eth_newBlockFilter or eth_newPendingTransactionFilter, .

Returns:

  1. Array - Array of one of the following, depending on the filter type, or empty if no changes since last poll:
    • eth_newBlockFilter

      blockHash - The 32 byte hash of a block that meets your filter requirements.

    • eth_newPendingTransactionFilter

      transactionHash - The 32 byte hash of a transaction that meets your filter requirements.

    • eth_newFilter

      removed - Boolean true if log was removed, due to a chain reorganization. false if its a valid log.

      logIndex - Integer of log index position in the block encoded as a hexadecimal. null if pending.

      transactionIndex - Integer of transactions index position log was created from. null if pending.

      transactionHash - Hash of the transactions this log was created from. null if pending.

      blockHash - Hash of the block where this log was in. null when its pending. null if pending.

      blockNumber - The block number where this log was, encoded as a hexadecimal. null if pending.

      address - The address from which this log originated.

      data - Contains one or more 32 Bytes non-indexed arguments of the log.

      topics - Array of 0 to 4 32 Bytes of indexed log arguments.

Code Examples:

require 'ethereum.rb'
client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')
filterId = client.eth_new_filter(
{
fromBlock: '0x1',
toBlock: '0x2',
address: '0x8888f1f195afa192cfee860698584c030f4c9db1',
topics: ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"]
}
)
puts filterId["result"]
logs = client.eth_get_filter_changes(filterId["result"].to_s)
puts logs["result"]
Ready to get started? Create a free account