Class: QuidaxWithdrawal

Inherits:
QuidaxBaseObject show all
Defined in:
lib/quidax/objects/withdrawal.rb

Overview

Object for withdrawal related actions

Instance Attribute Summary

Attributes inherited from QuidaxBaseObject

#quidax

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from QuidaxBaseObject

get_request, #initialize, post_request, put_request, url

Constructor Details

This class inherits a constructor from QuidaxBaseObject

Class Method Details

.cancel(q_object:, withdrawal_id:) ⇒ Object



29
30
31
32
# File 'lib/quidax/objects/withdrawal.rb', line 29

def self.cancel(q_object:, withdrawal_id:)
  path = "#{API::USER_PATH}/me#{API::WITHDRAWAL_PATH}/#{withdrawal_id}/cancel"
  post_request(q_object, path)
end

.get_all_withdrawals_detail(q_object:, user_id:, query:) ⇒ Object



17
18
19
20
21
22
# File 'lib/quidax/objects/withdrawal.rb', line 17

def self.get_all_withdrawals_detail(q_object:, user_id:, query:)
  Utils.check_missing_keys(required_keys: %w[currency state], keys: query.keys, field: "query")
  path = "#{API::USER_PATH}/#{user_id}#{API::WITHDRAWAL_PATH}"

  get_request(q_object, path, query)
end

.get_detail(q_object:, user_id:, withdrawal_id:) ⇒ Object



24
25
26
27
# File 'lib/quidax/objects/withdrawal.rb', line 24

def self.get_detail(q_object:, user_id:, withdrawal_id:)
  path = "#{API::USER_PATH}/#{user_id}#{API::WITHDRAWAL_PATH}/#{withdrawal_id}"
  get_request(q_object, path)
end

Instance Method Details

#cancel(withdrawal_id:) ⇒ Object



13
14
15
# File 'lib/quidax/objects/withdrawal.rb', line 13

def cancel(withdrawal_id:)
  QuidaxWithdrawal.cancel(q_object: @quidax, withdrawal_id: withdrawal_id)
end

#get_all_withdrawals_detail(user_id:, query:) ⇒ Object



5
6
7
# File 'lib/quidax/objects/withdrawal.rb', line 5

def get_all_withdrawals_detail(user_id:, query:)
  QuidaxWithdrawal.get_all_withdrawals_detail(q_object: @quidax, user_id: user_id, query: query)
end

#get_detail(user_id:, withdrawal_id:) ⇒ Object



9
10
11
# File 'lib/quidax/objects/withdrawal.rb', line 9

def get_detail(user_id:, withdrawal_id:)
  QuidaxWithdrawal.get_detail(q_object: @quidax, user_id: user_id, withdrawal_id: withdrawal_id)
end