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
-
#account(id, options = {}) ⇒ Array<Cryptoprocessing::Account>
Get account info.
-
#create_account(options = {}) ⇒ Cryptoprocessing::Account
Create account for given currency and with given name.
Instance Method Details
#account(id, options = {}) ⇒ Array<Cryptoprocessing::Account>
Get account info
16 17 18 19 20 21 22 23 24 |
# File 'lib/cryptoprocessing/client/accounts.rb', line 16 def account(id, = {}) currency = if [:currency] then [:currency] else blockchain_type end out = nil get("/v1/#{currency}/accounts/#{id}", ) 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 create_account( = {}) [:currency] = blockchain_type unless [:currency] out = nil post("/v1/accounts", ) do |resp| out = Cryptoprocessing::Account.new(self, resp.data.merge()) yield(out, resp) if block_given? end out end |