Class: Cryptopay::CoinWithdrawals
- Inherits:
-
Object
- Object
- Cryptopay::CoinWithdrawals
- Defined in:
- lib/cryptopay/api/coin_withdrawals.rb
Instance Method Summary collapse
-
#commit(coin_withdrawal_id, _opts = {}) ⇒ CoinWithdrawalResult
Commit a withdrawal.
-
#create(coin_withdrawal_params, _opts = {}) ⇒ CoinWithdrawalResult
Create a withdrawal.
-
#initialize(connection) ⇒ CoinWithdrawals
constructor
A new instance of CoinWithdrawals.
-
#list(opts = {}) ⇒ CoinWithdrawalListResult
List withdrawals.
-
#list_network_fees(opts = {}) ⇒ NetworkFeeListResult
List network fees.
-
#retrieve(coin_withdrawal_id, _opts = {}) ⇒ CoinWithdrawalResult
Retrieve a withdrawal.
-
#retrieve_by_custom_id(custom_id, _opts = {}) ⇒ CoinWithdrawalResult
Retrieve a withdrawal by custom id.
Constructor Details
#initialize(connection) ⇒ CoinWithdrawals
Returns a new instance of CoinWithdrawals.
8 9 10 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 8 def initialize(connection) @connection = connection end |
Instance Method Details
#commit(coin_withdrawal_id, _opts = {}) ⇒ CoinWithdrawalResult
Commit a withdrawal
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 16 def commit(coin_withdrawal_id, _opts = {}) path = '/api/coin_withdrawals/{coin_withdrawal_id}/commit' path = path.sub('{coin_withdrawal_id}', CGI.escape(coin_withdrawal_id.to_s)) req = Request.new( method: :post, path: path ) connection.call(req, return_type: CoinWithdrawalResult) end |
#create(coin_withdrawal_params, _opts = {}) ⇒ CoinWithdrawalResult
Create a withdrawal
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 32 def create(coin_withdrawal_params, _opts = {}) path = '/api/coin_withdrawals' req = Request.new( method: :post, path: path, body_params: coin_withdrawal_params ) connection.call(req, return_type: CoinWithdrawalResult) end |
#list(opts = {}) ⇒ CoinWithdrawalListResult
List withdrawals
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 49 def list(opts = {}) path = '/api/coin_withdrawals' query_params = {} query_params[:customer_id] = opts[:customer_id] unless opts[:customer_id].nil? query_params[:starting_after] = opts[:starting_after] unless opts[:starting_after].nil? req = Request.new( method: :get, path: path, query_params: query_params ) connection.call(req, return_type: CoinWithdrawalListResult) end |
#list_network_fees(opts = {}) ⇒ NetworkFeeListResult
List network fees
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 69 def list_network_fees(opts = {}) path = '/api/coin_withdrawals/network_fees' query_params = {} query_params[:all_networks] = opts[:all_networks] unless opts[:all_networks].nil? req = Request.new( method: :get, path: path, query_params: query_params ) connection.call(req, return_type: NetworkFeeListResult) end |
#retrieve(coin_withdrawal_id, _opts = {}) ⇒ CoinWithdrawalResult
Retrieve a withdrawal
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 88 def retrieve(coin_withdrawal_id, _opts = {}) path = '/api/coin_withdrawals/{coin_withdrawal_id}' path = path.sub('{coin_withdrawal_id}', CGI.escape(coin_withdrawal_id.to_s)) req = Request.new( method: :get, path: path ) connection.call(req, return_type: CoinWithdrawalResult) end |
#retrieve_by_custom_id(custom_id, _opts = {}) ⇒ CoinWithdrawalResult
Retrieve a withdrawal by custom id
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/cryptopay/api/coin_withdrawals.rb', line 104 def retrieve_by_custom_id(custom_id, _opts = {}) path = '/api/coin_withdrawals/custom_id/{custom_id}' path = path.sub('{custom_id}', CGI.escape(custom_id.to_s)) req = Request.new( method: :get, path: path ) connection.call(req, return_type: CoinWithdrawalResult) end |