Class: WhopSDK::Resources::Deposits

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/deposits.rb,
sig/whop_sdk/resources/deposits.rbs

Overview

Deposits describe ways to add funds to an account balance, including hosted deposit pages, bank deposit instructions, and supported crypto wallet addresses.

Use the Deposits API to create deposit instructions for an account and retrieve existing bank deposit activity.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Deposits

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

Parameters:



72
73
74
# File 'lib/whop_sdk/resources/deposits.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#create(destination:, amount: nil, metadata: nil, network: nil, request_options: {}) ⇒ WhopSDK::Models::DepositCreateResponse

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

Resolves a deposit destination and returns the on-chain addresses that can fund it. No authentication is required; any business can be resolved by its account ID. A caller authenticated as a user can additionally resolve their own user account.

Parameters:

  • destination (String, WhopSDK::Models::DepositCreateParams::Destination::UnionMember1)

    Destination account ID or wallet address. Object form is supported for compatibi

  • amount (Float)

    Amount to prefill on hosted deposit page.

  • metadata (Hash{Symbol=>Object})

    Metadata to include with the deposit response.

  • network (String, nil)

    Destination network override.

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

Returns:

See Also:



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

def create(params)
  parsed, options = WhopSDK::DepositCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "deposits",
    body: parsed,
    model: WhopSDK::Models::DepositCreateResponse,
    options: options
  )
end

#list(account_id:, request_options: {}) ⇒ WhopSDK::Models::DepositListResponse

Returns deposit transactions for a business account. Bank deposit transactions are nested under the bank field.

Parameters:

  • account_id (String)

    Business account ID (biz_*).

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

Returns:

See Also:



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

def list(params)
  parsed, options = WhopSDK::DepositListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "deposits",
    query: query,
    model: WhopSDK::Models::DepositListResponse,
    options: options
  )
end