Class: CoinbaseCustody::Wallets

Inherits:
Client
  • Object
show all
Defined in:
lib/coinbase_custody/wallets.rb

Overview

Wallets API's

Constant Summary collapse

WALLETS_PATH =
'/wallets'

Constants included from Util

Util::BASE_API_URL

Instance Method Summary collapse

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(wallet_details) ⇒ Hash

Creates a new wallet

Request a new wallet be created for your organization The response value can be filtered by query parameters. apporval_url, currency, name, activity_id

Returns:

  • (Hash)

    a hash with status code and wallet creation detail such as



26
27
28
# File 'lib/coinbase_custody/wallets.rb', line 26

def create(wallet_details)
  format_response(post(WALLETS_PATH, body: wallet_details))
end

#fetch(wallet_id) ⇒ Hash

fetch a specific wallet by id

Retrieve information about an individual wallet for your organization.

Returns:

  • (Hash)

    a hash with status code and wallet details



35
36
37
# File 'lib/coinbase_custody/wallets.rb', line 35

def fetch(wallet_id)
  format_response(get("#{WALLETS_PATH}/#{wallet_id}"))
end

#list(params = {}) ⇒ Hash

Gets a list of wallets

Retrieve a list of your organization's wallets. The response value can be filtered by query parameters.

Returns:

  • (Hash)

    a hash with status code and organization's wallets



14
15
16
# File 'lib/coinbase_custody/wallets.rb', line 14

def list(params = {})
  format_response(get(WALLETS_PATH, query: params))
end