Module: Cryptoprocessing::Client::Trackers

Included in:
Cryptoprocessing::Client
Defined in:
lib/cryptoprocessing/client/trackers.rb

Instance Method Summary collapse

Instance Method Details

#create_tracker(account_id, address, options = {}) ⇒ Object

Add address for tracking

Parameters:

  • account_id (String)
  • address (String)

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/cryptoprocessing/client/trackers.rb', line 25

def create_tracker(, address, options = {})
  out = nil
  currency = if options[:currency] then options[:currency] else blockchain_type end
  options[:address] = address
  post("/v1/#{currency}/accounts/#{}/tracing/address", options) do |resp|
    out = Cryptoprocessing::Tracker.new(self, resp.data.merge(options))
    yield(out, resp) if block_given?
  end
  out
end

#trackers(account_id, options = {}) ⇒ Object

Tracking address list



10
11
12
13
14
15
16
17
18
# File 'lib/cryptoprocessing/client/trackers.rb', line 10

def trackers(, options = {})
  out = nil
  currency = if options[:currency] then options[:currency] else blockchain_type end
  get("/v1/#{currency}/accounts/#{}/tracing/address", options) do |resp|
    out = resp.data['addresses'].map { |item| Cryptoprocessing::Tracker.new(self, item) }
    yield(out, resp) if block_given?
  end
  out
end