Class: Bitex::SpecieWithdrawal
- Inherits:
-
Object
- Object
- Bitex::SpecieWithdrawal
- Defined in:
- lib/bitex/specie_withdrawal.rb
Overview
A withdrawal of some specie from your bitex.la balance
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Time when this withdrawal was requested by you.
-
#id ⇒ Integer
This SpecieWithdrawal’s unique ID.
-
#kyc_profile_id ⇒ Integer
Kyc profile id for which this request was made.
-
#label ⇒ String
A custom label you gave to this address.
-
#quantity ⇒ BigDecimal
Quantity deposited.
-
#reason ⇒ Object
Returns the reason for cancellation of this withdrawal, if any.
-
#specie ⇒ Symbol
:btc or :ltc.
-
#status ⇒ Object
Returns the status of this withdrawal.
-
#to_address ⇒ String
Address to wich you made this withdrawal.
-
#transaction_id ⇒ String
Network transaction id, if available.
Class Method Summary collapse
- .all(specie) ⇒ Object
- .create!(specie, address, amount, label, kyc_profile_id = nil) ⇒ Object
- .find(specie, id) ⇒ Object
Instance Attribute Details
#created_at ⇒ Time
Returns Time when this withdrawal was requested by you.
10 11 12 |
# File 'lib/bitex/specie_withdrawal.rb', line 10 def created_at @created_at end |
#id ⇒ Integer
Returns This SpecieWithdrawal’s unique ID.
6 7 8 |
# File 'lib/bitex/specie_withdrawal.rb', line 6 def id @id end |
#kyc_profile_id ⇒ Integer
Returns Kyc profile id for which this request was made.
46 47 48 |
# File 'lib/bitex/specie_withdrawal.rb', line 46 def kyc_profile_id @kyc_profile_id end |
#label ⇒ String
Returns A custom label you gave to this address.
42 43 44 |
# File 'lib/bitex/specie_withdrawal.rb', line 42 def label @label end |
#quantity ⇒ BigDecimal
Returns Quantity deposited.
18 19 20 |
# File 'lib/bitex/specie_withdrawal.rb', line 18 def quantity @quantity end |
#reason ⇒ Object
Returns the reason for cancellation of this withdrawal, if any.
-
:not_cancelled
-
:insufficient_funds The instruction was received, but you didn’t have enough funds available
-
:destination_invalid The destination address was invalid.
34 35 36 |
# File 'lib/bitex/specie_withdrawal.rb', line 34 def reason @reason end |
#specie ⇒ Symbol
Returns :btc or :ltc.
14 15 16 |
# File 'lib/bitex/specie_withdrawal.rb', line 14 def specie @specie end |
#status ⇒ Object
Returns the status of this withdrawal.
-
:received Our engine is checking if you have enough funds.
-
:pending your withdrawal was accepted and is being processed.
-
:done your withdrawal was processed and published to the network.
-
:cancelled your withdrawal could not be processed.
26 27 28 |
# File 'lib/bitex/specie_withdrawal.rb', line 26 def status @status end |
#to_address ⇒ String
Returns Address to wich you made this withdrawal.
38 39 40 |
# File 'lib/bitex/specie_withdrawal.rb', line 38 def to_address @to_address end |
#transaction_id ⇒ String
Returns Network transaction id, if available.
50 51 52 |
# File 'lib/bitex/specie_withdrawal.rb', line 50 def transaction_id @transaction_id end |
Class Method Details
.all(specie) ⇒ Object
89 90 91 92 |
# File 'lib/bitex/specie_withdrawal.rb', line 89 def self.all(specie) Api.private(:get, "/private/#{specie}/withdrawals") .collect{|x| from_json(x) } end |
.create!(specie, address, amount, label, kyc_profile_id = nil) ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/bitex/specie_withdrawal.rb', line 76 def self.create!(specie, address, amount, label, kyc_profile_id=nil) from_json(Api.private(:post, "/private/#{specie}/withdrawals", { address: address, amount: amount, label: label, kyc_profile_id: kyc_profile_id })) end |