Module: Cryptoprocessing::Client::Callbacks
- Included in:
- Cryptoprocessing::Client
- Defined in:
- lib/cryptoprocessing/client/callbacks.rb
Instance Method Summary collapse
-
#callbacks(account_id, options = {}) ⇒ Array<Cryptoprocessing::Callback>
Callback list.
-
#create_callback(account_id, address, options = {}) ⇒ Cryptoprocessing::Callback
Create callback.
Instance Method Details
#callbacks(account_id, options = {}) ⇒ Array<Cryptoprocessing::Callback>
Callback list
11 12 13 14 15 16 17 18 19 |
# File 'lib/cryptoprocessing/client/callbacks.rb', line 11 def callbacks(account_id, = {}) out = nil currency = if [:currency] then [:currency] else blockchain_type end get("/v1/#{currency}/accounts/#{account_id}/callback", ) do |resp| out = resp.data['addresses'].map { |item| Cryptoprocessing::Callback.new(self, item) } yield(out, resp) if block_given? end out end |
#create_callback(account_id, address, options = {}) ⇒ Cryptoprocessing::Callback
Create callback
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cryptoprocessing/client/callbacks.rb', line 27 def create_callback(account_id, address, = {}) out = nil currency = if [:currency] then [:currency] else blockchain_type end [:address] = address post("/v1/#{currency}/accounts/#{account_id}/callback", ) do |resp| out = Cryptoprocessing::Callback.new(self, resp.body.merge()) yield(out, resp) if block_given? end out end |