Class: Coinbase::Transfers

Inherits:
Client
  • Object
show all
Defined in:
lib/coinbase/transfers.rb

Overview

Coinbase transfer APIs

Direct Known Subclasses

Deposits, Withdrawals

Instance Method Summary collapse

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

#fetch(transfer_id) ⇒ Hash

Fetch information on a single deposit.

Parameters:

  • transfer_id (String)

    The transfer ID of the deposit.

Returns:

  • (Hash)

    a hash with status code and deposit information.



19
20
21
22
23
# File 'lib/coinbase/transfers.rb', line 19

def fetch(transfer_id)
  operation_url = "/transfers/#{transfer_id}"
  response = get(operation_url)
  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).

Parameters:

  • profile_id (String)

    Limit list of deposits to this profile_id. By default, it retrieves deposits using default profile (optional).

  • type (String)

    Set to deposit or internal_deposit (optional).

  • paginate_options (Hash)

    an hash with the following parameters

Returns:

  • (Hash)

    a hash with status code and deposit list.



39
40
41
42
43
44
45
46
# File 'lib/coinbase/transfers.rb', line 39

def list(options = {})
  operation_url = '/transfers'
  query_params = build_query_params(options)

  operation_url += '/?' + query_params if query_params.present?
  response = get(operation_url)
  format_response(response)
end

#payment_methodsHash

List available payment methods.

Returns:

  • (Hash)

    a hash of payment methods.



8
9
10
11
12
# File 'lib/coinbase/transfers.rb', line 8

def payment_methods
  operation_url = '/payment-methods'
  response = get(operation_url)
  format_response(response)
end