module Cryptoprocessing::Client::Accounts

Methods for the Commits API

@see api.cryptoprocessing.io/#db40c5d3-078d-af2a-63e0-fd616f56e433

Public Instance Methods

account(id, options = {}) { |out, resp| ... } click to toggle source

Get account info

@param [String] id @return [Array<Cryptoprocessing::Account>] A list of accounts @see api.cryptoprocessing.io/#4df50869-9044-21b6-bb27-a718f30e0040

# File lib/cryptoprocessing/client/accounts.rb, line 16
def account(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 = {}) { |out, resp| ... } click to toggle source

Create account for given currency and with given name

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

@return [Cryptoprocessing::Account] @see api.cryptoprocessing.io/#7b3bacaf-aa8e-77ad-4d0d-f834b10ebc95

# File lib/cryptoprocessing/client/accounts.rb, line 32
def create_account(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