Class: WhopSDK::Resources::Wallets

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Wallets

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 Wallets.

Parameters:



73
74
75
# File 'lib/whop_sdk/resources/wallets.rb', line 73

def initialize(client:)
  @client = client
end

Instance Method Details

#balance(account_id, request_options: {}) ⇒ WhopSDK::Models::WalletBalanceResponse

Returns per-token balances held in an account’s wallet.

Parameters:

  • account_id (String)

    The business or user account ID whose wallet balance should be returned.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



35
36
37
38
39
40
41
42
# File 'lib/whop_sdk/resources/wallets.rb', line 35

def balance(, params = {})
  @client.request(
    method: :get,
    path: ["wallets/%1$s/balance", ],
    model: WhopSDK::Models::WalletBalanceResponse,
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ WhopSDK::Models::WalletListResponse

Lists every crypto wallet linked to the authenticated resource.

Parameters:

Returns:

See Also:



15
16
17
18
19
20
21
22
# File 'lib/whop_sdk/resources/wallets.rb', line 15

def list(params = {})
  @client.request(
    method: :get,
    path: "wallets",
    model: WhopSDK::Models::WalletListResponse,
    options: params[:request_options]
  )
end

#send_(account_id, amount:, to:, request_options: {}) ⇒ WhopSDK::Models::WalletSendResponse

Sends USDT from an account’s wallet to another Whop user or business.

Parameters:

  • account_id (String)

    The sending account ID.

  • amount (String)

    USDT amount to send.

  • to (String)

    Recipient user ID, business account ID, ledger account ID, or email.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
# File 'lib/whop_sdk/resources/wallets.rb', line 59

def send_(, params)
  parsed, options = WhopSDK::WalletSendParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["wallets/%1$s/sends", ],
    body: parsed,
    model: WhopSDK::Models::WalletSendResponse,
    options: options
  )
end