Module: Cryptoprocessing::Client::Trackers
- Included in:
- Cryptoprocessing::Client
- Defined in:
- lib/cryptoprocessing/client/trackers.rb
Instance Method Summary collapse
-
#create_tracker(account_id, address, options = {}) ⇒ Object
Add address for tracking.
-
#trackers(account_id, options = {}) ⇒ Object
Tracking address list.
Instance Method Details
#create_tracker(account_id, address, options = {}) ⇒ Object
Add address for tracking
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cryptoprocessing/client/trackers.rb', line 25 def create_tracker(account_id, address, = {}) out = nil currency = if [:currency] then [:currency] else blockchain_type end [:address] = address post("/v1/#{currency}/accounts/#{account_id}/tracing/address", ) do |resp| out = Cryptoprocessing::Tracker.new(self, resp.data.merge()) 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(account_id, = {}) out = nil currency = if [:currency] then [:currency] else blockchain_type end get("/v1/#{currency}/accounts/#{account_id}/tracing/address", ) do |resp| out = resp.data['addresses'].map { |item| Cryptoprocessing::Tracker.new(self, item) } yield(out, resp) if block_given? end out end |