Module: Cryptoprocessing::Client::Accounts

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

Overview

Methods for the Commits API

Instance Method Summary collapse

Instance Method Details

#account(id, options = {}) ⇒ Array<Cryptoprocessing::Account>

Get account info

Parameters:

  • id (String)

Returns:

See Also:



16
17
18
19
20
21
22
23
24
# File 'lib/cryptoprocessing/client/accounts.rb', line 16

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

#create_account(options = {}) ⇒ Cryptoprocessing::Account

Create account for given currency and with given name

Создаем аккаунт



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

def (options = {})
  options[:currency] = blockchain_type unless options[:currency]
  out = nil
  post("/v1/accounts", options) do |resp|
    out = Cryptoprocessing::Account.new(self, resp.data.merge(options))
    yield(out, resp) if block_given?
  end
  out
end