Class: Privy::Resources::Wallets::Balance

Inherits:
Object
  • Object
show all
Defined in:
lib/privy/resources/wallets/balance.rb

Overview

Operations related to wallets

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Balance

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Balance.

Parameters:



45
46
47
# File 'lib/privy/resources/wallets/balance.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#get(wallet_id, token: nil, asset: nil, chain: nil, include_currency: nil, request_options: {}) ⇒ Privy::Models::Wallets::BalanceGetResponse

Some parameter documentations has been truncated, see Models::Wallets::BalanceGetParams for more details.

Get the balance of a wallet by wallet ID.

Parameters:

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/privy/resources/wallets/balance.rb', line 30

def get(wallet_id, params = {})
  parsed, options = Privy::Wallets::BalanceGetParams.dump_request(params)
  query = Privy::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/wallets/%1$s/balance", wallet_id],
    query: query,
    model: Privy::Models::Wallets::BalanceGetResponse,
    options: options
  )
end