module Cryptoprocessing::Client::Addresses
Methods for addresses
@return [Cryptoprocessing::Address] @see api.cryptoprocessing.io/#be1b38bb-7702-51c6-192f-91cf3a506ae8
Public Instance Methods
address(account_id, address, options = {})
click to toggle source
Get address info
@param [String] account_id @param [String] address @return [Cryptoprocessing::Address] @see api.cryptoprocessing.io/#55759d22-b04b-1a63-ca8d-6b881b0212b2
# File lib/cryptoprocessing/client/addresses.rb, line 18 def address(account_id, address, options = {}) out = nil currency = if options[:currency] then options[:currency] else blockchain_type end get("/v1/#{currency}/accounts/#{account_id}/addresses/#{address}", options) do |resp| out = Cryptoprocessing::Address.new(self, resp.data) end out end
addresses(account_id, options = {})
click to toggle source
Get addresses list
@param [String] account_id @return [Array<Cryptoprocessing::Address>] A list of addresses @see api.cryptoprocessing.io/#b826594e-db0d-4efe-04e9-c1286e6f8948
# File lib/cryptoprocessing/client/addresses.rb, line 32 def addresses(account_id, options = {}) out = nil currency = if options[:currency] then options[:currency] else blockchain_type end get("/v1/#{currency}/accounts/#{account_id}/addresses", options) do |resp| out = resp.data['addresses'].map { |item| Cryptoprocessing::Address.new(self, item) } end out end
create_address(account_id, options = {})
click to toggle source
Create address for account
@param [String] account_id @return [Cryptoprocessing::Address] @see api.cryptoprocessing.io/#d6486a95-a5cb-4d4b-0369-0c7af040bc4d
# File lib/cryptoprocessing/client/addresses.rb, line 46 def create_address(account_id, options = {}) out = nil currency = if options[:currency] then options[:currency] else blockchain_type end post("/v1/#{currency}/accounts/#{account_id}/addresses", options) do |resp| out = Cryptoprocessing::Address.new(self, resp.data) end out end