class Vertpig::Withdrawal

Attributes

address[R]
authorized[R]
canceled[R]
currency[R]
executed_at[R]
id[R]
invalid_address[R]
pending[R]
quantity[R]
raw[R]
transaction_cost[R]
transaction_id[R]

Public Class Methods

all() click to toggle source
# File lib/vertpig/withdrawal.rb, line 24
def self.all
  client.get('account/getwithdrawalhistory').map{|data| new(data) }
end
new(attrs = {}) click to toggle source
# File lib/vertpig/withdrawal.rb, line 9
def initialize(attrs = {})
  @id = attrs['PaymentUuid']
  @currency = attrs['Currency']
  @quantity = attrs['Amount']
  @address = attrs['Address']
  @authorized = attrs['Authorized']
  @pending = attrs['PendingPayment']
  @canceled = attrs['Canceled']
  @invalid_address = attrs['Canceled']
  @transaction_cost = attrs['TxCost']
  @transaction_id = attrs['TxId']
  @executed_at = extract_timestamp(attrs['Opened'])
  @raw = attrs
end
single(currency, quantity, address) click to toggle source
# File lib/vertpig/withdrawal.rb, line 28
def self.single(currency, quantity, address)
  client.get('account/withdraw', {
    currency: currency,
    quantity: quantity,
    address: address
  })
end

Private Class Methods

client() click to toggle source
# File lib/vertpig/withdrawal.rb, line 38
def self.client
  @client ||= Vertpig.client
end