Sha256: 267debf74c09fd3bcc50f052b956d74a00087a798bc92c7ec9cddcd1a67243d9

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module Harmony
  module Api
    module V1
      module Filters
        module Filter
          # 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.
          def get_filter_logs(filter_id)
            params = [Harmony::Api::Utilities.int_to_hex(filter_id)]
            response(post('getFilterLogs', params: params))
          end

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

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
harmony-api-0.1.4 lib/harmony/api/v1/filters/filter.rb
harmony-api-0.1.3 lib/harmony/api/v1/filters/filter.rb