Class: CoinbaseCustody::Transactions
- Defined in:
- lib/coinbase_custody/transactions.rb
Overview
Coinbase Transaction APIs
Constant Summary collapse
- TRANSACTIONS_PATH =
'/transactions'
Constants included from Util
Instance Method Summary collapse
-
#create(params = {}) ⇒ Hash
Creates a new withdrawal transaction.
-
#fetch(transaction_id) ⇒ Hash
Gets a single transaction by id.
-
#list(params = {}) ⇒ Hash
Retrieve a list of the transactions from organization.
Methods inherited from Client
#get, #headers, #http_request, #initialize, #post
Methods included from Util
#format_response, #pagination_params, #send_request
Constructor Details
This class inherits a constructor from CoinbaseCustody::Client
Instance Method Details
#create(params = {}) ⇒ Hash
Creates a new withdrawal transaction
body [Object] The create transaction payload source [String] The source wallet id for the transaction currency [String] A fiat currency symbol such as USD. If provided Custody will automatically convert the amount value into crypto units. whole_amount [String] The amount of the transaction in whole units (e.g. “1.01”) destination [String] The destination address of the transaction account_identifier [String] The account identifier of the transaction (for example destination tag or memo value)
52 53 54 |
# File 'lib/coinbase_custody/transactions.rb', line 52 def create(params = {}) format_response(post(TRANSACTIONS_PATH, body: params)) end |
#fetch(transaction_id) ⇒ Hash
Gets a single transaction by id
from organization.
34 35 36 |
# File 'lib/coinbase_custody/transactions.rb', line 34 def fetch(transaction_id) format_response(get("#{TRANSACTIONS_PATH}/#{transaction_id}")) end |
#list(params = {}) ⇒ Hash
Retrieve a list of the transactions from organization. The response is filterable by query parameters.
currency [String] The type of currency to filter. state [String] The state of transactions to filter. type [String] The type of transactions to filter. wallet_id [String] The wallet id to filter. start_time [String] The start time to filter. end_time [String] The end time to filter. human_id [String] The human id to filter. 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.
25 26 27 |
# File 'lib/coinbase_custody/transactions.rb', line 25 def list(params = {}) format_response(get(TRANSACTIONS_PATH, query: params)) end |