Class: WhopSDK::Resources::Wallets
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Wallets
- Defined in:
- lib/whop_sdk/resources/wallets.rb
Instance Method Summary collapse
-
#balance(account_id, request_options: {}) ⇒ WhopSDK::Models::WalletBalanceResponse
Returns per-token balances held in an account’s wallet.
-
#initialize(client:) ⇒ Wallets
constructor
private
A new instance of Wallets.
-
#list(request_options: {}) ⇒ WhopSDK::Models::WalletListResponse
Lists every crypto wallet linked to the authenticated resource.
-
#send_(account_id, amount:, to:, request_options: {}) ⇒ WhopSDK::Models::WalletSendResponse
Sends USDT from an account’s wallet to another Whop user or business.
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.
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.
35 36 37 38 39 40 41 42 |
# File 'lib/whop_sdk/resources/wallets.rb', line 35 def balance(account_id, params = {}) @client.request( method: :get, path: ["wallets/%1$s/balance", account_id], model: WhopSDK::Models::WalletBalanceResponse, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ WhopSDK::Models::WalletListResponse
Lists every crypto wallet linked to the authenticated resource.
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.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/whop_sdk/resources/wallets.rb', line 59 def send_(account_id, params) parsed, = WhopSDK::WalletSendParams.dump_request(params) @client.request( method: :post, path: ["wallets/%1$s/sends", account_id], body: parsed, model: WhopSDK::Models::WalletSendResponse, options: ) end |