Class: Coinbase::Deposits
- Defined in:
- lib/coinbase/deposits.rb
Overview
Deposite coinbase APIs
Constant Summary collapse
- DEFAULT_TYPE =
'deposit'
Instance Method Summary collapse
-
#by_account(deposit_details) ⇒ Hash
Deposit funds from a coinbase account.
-
#by_method(deposit_details) ⇒ Hash
Deposit funds from a payment method.
-
#generate_address(coinbase_account_id) ⇒ Hash
Generate a crypto deposit address.
-
#list(options = {}) ⇒ Hash
Fetch the list of deposits from the profile of the API key, in descending order by created time.
Methods inherited from Transfers
Methods inherited from Client
configuration, configure, #delete, #get, #headers, #http_request, #initialize, #post, #put, #signature
Methods included from Util
#base_uri, #build_query_params, #format_response, #pagination_params, #send_request
Constructor Details
This class inherits a constructor from Coinbase::Client
Instance Method Details
#by_account(deposit_details) ⇒ Hash
Deposit funds from a coinbase account.
amount [Float] The amount to deposit. currency [String] The type of currency. coinbase_account_id [String] ID of coinbase account.
25 26 27 28 29 30 |
# File 'lib/coinbase/deposits.rb', line 25 def by_account(deposit_details) response = post( '/deposits/coinbase-account', body: deposit_details ) format_response(response) end |
#by_method(deposit_details) ⇒ Hash
Deposit funds from a payment method.
amount [Float] The amount to deposit. currency [String] The type of currency. payment_method_id [String] ID of the payment method.
39 40 41 42 43 44 45 |
# File 'lib/coinbase/deposits.rb', line 39 def by_method(deposit_details) response = post( '/deposits/payment-method', body: deposit_details ) format_response(response) end |
#generate_address(coinbase_account_id) ⇒ Hash
Generate a crypto deposit address.
11 12 13 14 15 16 |
# File 'lib/coinbase/deposits.rb', line 11 def generate_address(coinbase_account_id) response = post( "/coinbase-accounts/#{coinbase_account_id}/addresses" ) format_response(response) end |
#list(options = {}) ⇒ Hash
Fetch the list of deposits from the profile of the API key, in descending order by created time.
before [String] If before is set, then it returns deposits created after
the before timestamp, sorted by oldest creation date (optional).
after [String] If after is set, then it returns deposits created before
the after timestamp, sorted by newest (optional).
limit [Integer] Truncate list to this many deposits, capped at 100.
Default is 100. (optional).
62 63 64 65 |
# File 'lib/coinbase/deposits.rb', line 62 def list( = {}) [:type] = [:type].blank? ? DEFAULT_TYPE : [:type] super() end |