Class: Coinbase::Transactions
- Defined in:
- lib/coinbase/transactions.rb
Overview
Coinbase Transactio APIs
Constant Summary collapse
- TRANSACTION_BASE_URL =
'/accounts'
Instance Method Summary collapse
-
#holds(paginate_options = {}) ⇒ Hash
List holds of an account.
-
#initialize(account_id) ⇒ Object
constructor
Initializes the API client for transaction.
-
#ledger(paginate_options = {}) ⇒ Hash
Lists account activity.
Methods inherited from Client
configuration, configure, #delete, #get, #headers, #http_request, #post, #put, #signature
Methods included from Util
#base_uri, #build_query_params, #format_response, #pagination_params, #send_request
Constructor Details
#initialize(account_id) ⇒ Object
Initializes the API client for transaction.
12 13 14 15 |
# File 'lib/coinbase/transactions.rb', line 12 def initialize(account_id) @account_id = account_id super() end |
Instance Method Details
#holds(paginate_options = {}) ⇒ Hash
List holds of an account.
before [String] Request page before (newer) this pagination id (optional). after [String] Request page after (older) this pagination id (optional). limit [Integer] Number of results per request.
39 40 41 42 43 44 45 |
# File 'lib/coinbase/transactions.rb', line 39 def holds( = {}) operation_url = "#{TRANSACTION_BASE_URL}/#{@account_id}/holds" query_params = build_query_params() operation_url += '/?' + query_params if query_params.present? response = get(operation_url) format_response(response) end |
#ledger(paginate_options = {}) ⇒ Hash
Lists account activity. By default it will return recent 25 transactions.
before [String] Request page before (newer) this pagination id (optional). after [String] Request page after (older) this pagination id (optional). limit [Integer] Number of results per request.
24 25 26 27 28 29 30 |
# File 'lib/coinbase/transactions.rb', line 24 def ledger( = {}) operation_url = "#{TRANSACTION_BASE_URL}/#{@account_id}/ledger" query_params = build_query_params() operation_url += '/?' + query_params if query_params.present? response = get(operation_url) format_response(response) end |