Module: Harmony::Api::V1::Filters::Filter

Defined in:
lib/harmony/api/v1/filters/filter.rb

Instance Method Summary collapse

Instance Method Details

#get_filter_changes(filter_id) ⇒ Object



15
16
17
18
# File 'lib/harmony/api/v1/filters/filter.rb', line 15

def get_filter_changes(filter_id)
  params = [Harmony::Api::Utilities.int_to_hex(filter_id)]
  response(post('getFilterChanges', params: params))
end

#get_filter_logs(filter_id) ⇒ Object

get_filter_logs returns the logs for the filter with the given id. If the filter could not be found an empty array of logs is returned.



10
11
12
13
# File 'lib/harmony/api/v1/filters/filter.rb', line 10

def get_filter_logs(filter_id)
  params = [Harmony::Api::Utilities.int_to_hex(filter_id)]
  response(post('getFilterLogs', params: params))
end

#new_block_filter(_block_hash) ⇒ Object



29
30
31
# File 'lib/harmony/api/v1/filters/filter.rb', line 29

def new_block_filter(_block_hash)
  response(post('newBlockFilter'))
end

#new_filter(block_hash) ⇒ Object



20
21
22
# File 'lib/harmony/api/v1/filters/filter.rb', line 20

def new_filter(block_hash)
  response(post('newFilter', params: [block_hash]))
end

#new_pending_transaction_filter(topics: []) ⇒ Object



24
25
26
27
# File 'lib/harmony/api/v1/filters/filter.rb', line 24

def new_pending_transaction_filter(topics: [])
  params = [{ topics: topics }]
  response(post('newPendingTransactionFilter', params: params))
end