Module: Cryptoprocessing::Client::Addresses

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

Overview

Methods for addresses

Instance Method Summary collapse

Instance Method Details

#address(account_id, address, options = {}) ⇒ Cryptoprocessing::Address

Get address info

Parameters:

  • account_id (String)
  • address (String)

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/cryptoprocessing/client/addresses.rb', line 18

def address(, address, options = {})
  out = nil
  currency = if options[:currency] then options[:currency] else blockchain_type end
  get("/v1/#{currency}/accounts/#{}/addresses/#{address}", options) do |resp|
    out = Cryptoprocessing::Address.new(self, resp.data)
  end
  out
end

#addresses(account_id, options = {}) ⇒ Array<Cryptoprocessing::Address>

Get addresses list

Parameters:

  • account_id (String)

Returns:

See Also:



32
33
34
35
36
37
38
39
# File 'lib/cryptoprocessing/client/addresses.rb', line 32

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

#create_address(account_id, options = {}) ⇒ Cryptoprocessing::Address

Create address for account



46
47
48
49
50
51
52
53
# File 'lib/cryptoprocessing/client/addresses.rb', line 46

def create_address(, options = {})
  out = nil
  currency = if options[:currency] then options[:currency] else blockchain_type end
  post("/v1/#{currency}/accounts/#{}/addresses", options) do |resp|
    out = Cryptoprocessing::Address.new(self, resp.data)
  end
  out
end