@whop/elements 1.0.0-beta.1 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/wallet.d.ts CHANGED
@@ -15,6 +15,15 @@ export interface WalletOptions {
15
15
  * @default "usd"
16
16
  */
17
17
  currency?: string;
18
+ /**
19
+ * Optional scoped token projected to data-backed wallet children. Without it, reads use the viewer session.
20
+ */
21
+ accessToken?: string;
22
+ /**
23
+ * Show a holding's balance page in place of the balances chart and list when a row is clicked. Off by default so a host that routes on `balanceSelected` is not covered by a second screen.
24
+ * @default false
25
+ */
26
+ openHoldingOnSelect?: boolean;
18
27
  /**
19
28
  * Account or user ID whose money these surfaces read. Account IDs are prefixed `biz_`; user IDs are prefixed `user_` and can read only the viewer's own balance.
20
29
  */
@@ -38,38 +47,30 @@ export interface WalletOptions {
38
47
  }
39
48
 
40
49
  /**
41
- * Consumer props for the "activity" element. Set at create (or as `<ActivityElement />` JSX props), and updatable live via `update()`.
42
- * @see https://docs.whop.com/elements/latest/wallet/activity
50
+ * Consumer props for the "required-actions" element. Set at create (or as `<RequiredActionsElement />` JSX props), and updatable live via `update()`.
51
+ * @see https://docs.whop.com/elements/latest/wallet/required-actions
43
52
  */
44
- export interface ActivityElementProps {
45
- /**
46
- * Only show activity for this currency. Without it, activity from every currency is shown.
47
- */
48
- currency?: string;
53
+ export interface RequiredActionsElementProps {
49
54
  /**
50
- * A scoped token for the read. An account needs `company:balance:read`, and a user needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
55
+ * A scoped token for the read and for starting verification — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
51
56
  */
52
57
  accessToken?: string;
53
58
  /**
54
- * When off, card transaction rows render inert (no click, no hover) instead of firing `activitySelected`. Use it when you know the viewer isn't allowed to see those details.
55
- * @default true
59
+ * Which verification the Verify button starts. `individual` (KYC) is what unlocks payouts and a Whop card. `business` (KYB) covers that and additionally unlocks financing and business cards — use it for a company that will need those.
60
+ * @default "individual"
56
61
  */
57
- canOpenCardTransactionDetails?: boolean;
62
+ kind?: "individual" | "business";
58
63
  }
59
64
 
60
65
  /**
61
- * The live handle for a mounted "activity" element. Returned by `create("activity")`; in React, the component's `ref`.
62
- * @see https://docs.whop.com/elements/latest/wallet/activity
66
+ * The live handle for a mounted "required-actions" element. Returned by `create("required-actions")`; in React, the component's `ref`.
67
+ * @see https://docs.whop.com/elements/latest/wallet/required-actions
63
68
  */
64
- export interface ActivityElementHandle {
69
+ export interface RequiredActionsElementHandle {
65
70
  /**
66
- * Re-fetch the account's activity from the first page. Call it after a mutation made elsewhere (a deposit, a send) so the list reflects it without waiting for the cache to expire.
71
+ * Re-read the account. Call it when the viewer returns from verifying or depositing so the banners reflect the new state without waiting for the cache to expire.
67
72
  */
68
73
  refresh: () => Promise<void>;
69
- /**
70
- * Set the date filter from outside the element, for example wiring a chart brush selection into the list. Pass `null` to clear it.
71
- */
72
- setDateRange: (input: ActivityDateRangeOverride | null) => Promise<void>;
73
74
  /**
74
75
  * Mounts the element in `target` and starts loading. React components mount themselves.
75
76
  */
@@ -81,44 +82,40 @@ export interface ActivityElementHandle {
81
82
  /**
82
83
  * Merges new props into the mounted element. In React, change the component props instead.
83
84
  */
84
- update: (options: Partial<ActivityElementProps>) => void;
85
+ update: (options: Partial<RequiredActionsElementProps>) => void;
85
86
  }
86
87
 
87
88
  /**
88
- * Options for `create("activity")`: the consumer props plus event callbacks and lifecycle hooks.
89
+ * Options for `create("required-actions")`: the consumer props plus event callbacks and lifecycle hooks.
89
90
  * @example
90
91
  * ```ts
91
- * const activity = wallet.create("activity", {}); // this interface: props + on<Event> callbacks
92
- * activity.mount("#wallet-activity");
92
+ * const required_actions = wallet.create("required-actions", {}); // this interface: props + on<Event> callbacks
93
+ * required_actions.mount("#wallet-required-actions");
93
94
  * ```
94
- * @see https://docs.whop.com/elements/latest/wallet/activity
95
+ * @see https://docs.whop.com/elements/latest/wallet/required-actions
95
96
  */
96
- export interface ActivityElementCreateOptions {
97
- /**
98
- * Only show activity for this currency. Without it, activity from every currency is shown.
99
- */
100
- currency?: string;
97
+ export interface RequiredActionsElementCreateOptions {
101
98
  /**
102
- * A scoped token for the read. An account needs `company:balance:read`, and a user needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
99
+ * A scoped token for the read and for starting verification — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
103
100
  */
104
101
  accessToken?: string;
105
102
  /**
106
- * When off, card transaction rows render inert (no click, no hover) instead of firing `activitySelected`. Use it when you know the viewer isn't allowed to see those details.
107
- * @default true
103
+ * Which verification the Verify button starts. `individual` (KYC) is what unlocks payouts and a Whop card. `business` (KYB) covers that and additionally unlocks financing and business cards — use it for a company that will need those.
104
+ * @default "individual"
108
105
  */
109
- canOpenCardTransactionDetails?: boolean;
106
+ kind?: "individual" | "business";
110
107
  /**
111
- * A row was clicked. Open your own detail view or route for it; the element never navigates.
108
+ * The viewer pressed a banner button. Fires for every action, including ones the element also handles itself.
112
109
  */
113
- onActivitySelected?: ((payload: { activity: LedgerActivity; }) => void);
110
+ onActionRequested?: ((payload: { action: "deposit_funds" | "submit_information_request" | "update_automatic_withdrawal_method" | "reauthorize_payout_methods" | "update_payout_profile" | "card_usage_review" | "verify_identity" | "sign_formation_documents" | "connect_fulfillment_tracker" | "setup_apple_pay_domains" | "configure_tax_remitter" | "add_vat_registration"; accountId: string; }) => void);
114
111
  /**
115
- * The pointer entered a row, or left one (`null`). Point something of your own at the same moment, like marking the row on a balance chart.
112
+ * The viewer pressed Verify on a `verify_identity` action the element can start. The element opens identity verification itself — this fires alongside, so a host can record the trip.
116
113
  */
117
- onActivityHovered?: ((payload: { activity: LedgerActivity; } | null) => void);
114
+ onIdentityVerificationRequested?: ((payload: { accountId: string; }) => void);
118
115
  /**
119
- * The viewer changed the date filter through the filter row rather than through `setDateRange`. Clear any range selection of your own, like a chart brush, that no longer matches.
116
+ * The viewer pressed Add money. The Wallet controller opens its deposit overlay.
120
117
  */
121
- onDateRangeChanged?: ((payload: { dateRange: { start: string; end: string; } | null; }) => void);
118
+ onDepositRequested?: ((payload: Record<string, never>) => void);
122
119
  /**
123
120
  * Runs after the loading skeleton first paints and before `onReady`.
124
121
  */
@@ -134,80 +131,67 @@ export interface ActivityElementCreateOptions {
134
131
  }
135
132
 
136
133
  /**
137
- * Consumer props for the "deposit" element. Set at create (or as `<DepositElement />` JSX props), and updatable live via `update()`.
138
- * @see https://docs.whop.com/elements/latest/wallet/deposit
134
+ * Consumer props for the "actions" element. Set at create (or as `<ActionsElement />` JSX props), and updatable live via `update()`.
135
+ * @see https://docs.whop.com/elements/latest/wallet/actions
139
136
  */
140
- export interface DepositElementProps {
141
- /**
142
- * Prefill the amount and make it read-only — for flows that already know what is owed. An amount at or below zero, or above 9,999,999, is ignored.
143
- * @default ""
144
- */
145
- amount?: string;
137
+ export interface ActionsElementProps {
146
138
  /**
147
- * Offer the crypto rail when the account has a deposit address.
139
+ * Show the Deposit button.
148
140
  * @default true
149
141
  */
150
- showCrypto?: boolean;
142
+ showDeposit?: boolean;
151
143
  /**
152
- * Offer the bank-transfer rail when the account has wire instructions.
144
+ * Show the Accept button.
153
145
  * @default true
154
146
  */
155
- showBank?: boolean;
147
+ showAccept?: boolean;
156
148
  /**
157
- * Cards you already hold for this payer, rendered as funding rows. Choosing one emits `cardDepositRequested` with the amount — the element never collects a card payment.
158
- * @default []
149
+ * Show the Send button.
150
+ * @default true
159
151
  */
160
- savedCards?: DepositSavedCard[];
152
+ showSend?: boolean;
161
153
  /**
162
- * Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
154
+ * Show the Withdraw button. Off by default so an existing row keeps the buttons it already had.
163
155
  * @default false
164
156
  */
165
- allowNewCard?: boolean;
157
+ showWithdraw?: boolean;
166
158
  /**
167
- * Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
168
- * @default false
159
+ * Show the Convert button.
160
+ * @default true
169
161
  */
170
- showPlatformBalance?: boolean;
162
+ showConvert?: boolean;
171
163
  /**
172
- * Processing fees to preview under the amount when a card row is selected. `percentageFee` is in percentage POINTS (`2.9` is 2.9%); `fixedFee` and `radarFee` are major units (`0.3` is $0.30).
173
- * @default null
164
+ * Disable the Deposit button while keeping it visible.
165
+ * @default false
174
166
  */
175
- cardFee?: DepositCardFee | null;
167
+ depositDisabled?: boolean;
176
168
  /**
177
- * Preselect a rail by id (`bank`, `crypto`, `platform_balance`, or a saved card id). Continue stays disabled while that rail is not yet offered, rather than funding through another one.
178
- * @default ""
169
+ * Disable the Accept button while keeping it visible.
170
+ * @default false
179
171
  */
180
- preferredMethodId?: string;
172
+ acceptDisabled?: boolean;
181
173
  /**
182
- * Emit `bankSelected` and stay on the amount screen instead of showing the wire fields — for hosts that run their own step (a verification, an onboarding) first. Because that host owns the rail, the row is then offered even before the account has instructions to show.
174
+ * Disable the Send button while keeping it visible.
183
175
  * @default false
184
176
  */
185
- deferBankToHost?: boolean;
177
+ sendDisabled?: boolean;
186
178
  /**
187
- * Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
179
+ * Disable the Withdraw button while keeping it visible.
188
180
  * @default false
189
181
  */
190
- confirmCryptoDeposit?: boolean;
182
+ withdrawDisabled?: boolean;
191
183
  /**
192
- * Open straight onto a rail instead of the picker. `crypto` and `bank` need no amount; their back button emits `dismissed` because there is no picker behind them.
193
- * @default "amount"
184
+ * Disable the Convert button while keeping it visible.
185
+ * @default false
194
186
  */
195
- initialStep?: "amount" | "bank" | "crypto";
187
+ convertDisabled?: boolean;
196
188
  }
197
189
 
198
190
  /**
199
- * The live handle for a mounted "deposit" element. Returned by `create("deposit")`; in React, the component's `ref`.
200
- * @see https://docs.whop.com/elements/latest/wallet/deposit
191
+ * The live handle for a mounted "actions" element. Returned by `create("actions")`; in React, the component's `ref`.
192
+ * @see https://docs.whop.com/elements/latest/wallet/actions
201
193
  */
202
- export interface DepositElementHandle {
203
- /**
204
- * Move the element to a screen. `{ step: "amount" }` is how you hand control back after settling a card or platform-balance deposit on your side.
205
- */
206
- showStep: (input: { step: "amount" | "bank" | "crypto"; }) => Promise<void>;
207
- /**
208
- * Re-resolve the account's funding rails. Call it after anything on your side changes what the account can offer — finishing bank onboarding, for instance — so the new rail appears without waiting for the cache to expire.
209
- */
210
- refresh: () => Promise<void>;
194
+ export interface ActionsElementHandle {
211
195
  /**
212
196
  * Mounts the element in `target` and starts loading. React components mount themselves.
213
197
  */
@@ -219,106 +203,89 @@ export interface DepositElementHandle {
219
203
  /**
220
204
  * Merges new props into the mounted element. In React, change the component props instead.
221
205
  */
222
- update: (options: Partial<DepositElementProps>) => void;
206
+ update: (options: Partial<ActionsElementProps>) => void;
223
207
  }
224
208
 
225
209
  /**
226
- * Options for `create("deposit")`: the consumer props plus event callbacks and lifecycle hooks.
210
+ * Options for `create("actions")`: the consumer props plus event callbacks and lifecycle hooks.
227
211
  * @example
228
212
  * ```ts
229
- * const deposit = wallet.create("deposit", {}); // this interface: props + on<Event> callbacks
230
- * deposit.mount("#wallet-deposit");
213
+ * const actions = wallet.create("actions", {}); // this interface: props + on<Event> callbacks
214
+ * actions.mount("#wallet-actions");
231
215
  * ```
232
- * @see https://docs.whop.com/elements/latest/wallet/deposit
216
+ * @see https://docs.whop.com/elements/latest/wallet/actions
233
217
  */
234
- export interface DepositElementCreateOptions {
218
+ export interface ActionsElementCreateOptions {
235
219
  /**
236
- * Prefill the amount and make it read-only — for flows that already know what is owed. An amount at or below zero, or above 9,999,999, is ignored.
237
- * @default ""
238
- */
239
- amount?: string;
240
- /**
241
- * Offer the crypto rail when the account has a deposit address.
220
+ * Show the Deposit button.
242
221
  * @default true
243
222
  */
244
- showCrypto?: boolean;
223
+ showDeposit?: boolean;
245
224
  /**
246
- * Offer the bank-transfer rail when the account has wire instructions.
225
+ * Show the Accept button.
247
226
  * @default true
248
227
  */
249
- showBank?: boolean;
250
- /**
251
- * Cards you already hold for this payer, rendered as funding rows. Choosing one emits `cardDepositRequested` with the amount — the element never collects a card payment.
252
- * @default []
253
- */
254
- savedCards?: DepositSavedCard[];
228
+ showAccept?: boolean;
255
229
  /**
256
- * Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
257
- * @default false
230
+ * Show the Send button.
231
+ * @default true
258
232
  */
259
- allowNewCard?: boolean;
233
+ showSend?: boolean;
260
234
  /**
261
- * Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
235
+ * Show the Withdraw button. Off by default so an existing row keeps the buttons it already had.
262
236
  * @default false
263
237
  */
264
- showPlatformBalance?: boolean;
265
- /**
266
- * Processing fees to preview under the amount when a card row is selected. `percentageFee` is in percentage POINTS (`2.9` is 2.9%); `fixedFee` and `radarFee` are major units (`0.3` is $0.30).
267
- * @default null
268
- */
269
- cardFee?: DepositCardFee | null;
238
+ showWithdraw?: boolean;
270
239
  /**
271
- * Preselect a rail by id (`bank`, `crypto`, `platform_balance`, or a saved card id). Continue stays disabled while that rail is not yet offered, rather than funding through another one.
272
- * @default ""
240
+ * Show the Convert button.
241
+ * @default true
273
242
  */
274
- preferredMethodId?: string;
243
+ showConvert?: boolean;
275
244
  /**
276
- * Emit `bankSelected` and stay on the amount screen instead of showing the wire fields — for hosts that run their own step (a verification, an onboarding) first. Because that host owns the rail, the row is then offered even before the account has instructions to show.
245
+ * Disable the Deposit button while keeping it visible.
277
246
  * @default false
278
247
  */
279
- deferBankToHost?: boolean;
248
+ depositDisabled?: boolean;
280
249
  /**
281
- * Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
250
+ * Disable the Accept button while keeping it visible.
282
251
  * @default false
283
252
  */
284
- confirmCryptoDeposit?: boolean;
285
- /**
286
- * Open straight onto a rail instead of the picker. `crypto` and `bank` need no amount; their back button emits `dismissed` because there is no picker behind them.
287
- * @default "amount"
288
- */
289
- initialStep?: "amount" | "bank" | "crypto";
253
+ acceptDisabled?: boolean;
290
254
  /**
291
- * The payer confirmed an amount and a rail. Fires for every rail, before any instructions render — the analytics/funnel hook.
255
+ * Disable the Send button while keeping it visible.
256
+ * @default false
292
257
  */
293
- onDepositInitiated?: ((payload: { method: "card" | "bank" | "crypto" | "platform_balance"; amount: number; currency: string; paymentMethodId?: string | undefined; }) => void);
258
+ sendDisabled?: boolean;
294
259
  /**
295
- * A saved card was chosen. Collect the payment on your side, then call `showStep({ step: "amount" })` to return the element to the picker.
260
+ * Disable the Withdraw button while keeping it visible.
261
+ * @default false
296
262
  */
297
- onCardDepositRequested?: ((payload: { amount: number; currency: string; paymentMethodId: string; }) => void);
263
+ withdrawDisabled?: boolean;
298
264
  /**
299
- * The "Add card" row was picked — open your card-collection flow.
265
+ * Disable the Convert button while keeping it visible.
266
+ * @default false
300
267
  */
301
- onAddCardRequested?: ((payload: Record<string, never>) => void);
268
+ convertDisabled?: boolean;
302
269
  /**
303
- * The bank rail was chosen while `deferBankToHost` is set — run your step, then show the fields yourself or call `showStep({ step: "bank" })`.
270
+ * The Deposit button was pressed and the Wallet controller opened its deposit overlay.
304
271
  */
305
- onBankSelected?: ((payload: Record<string, never>) => void);
272
+ onDepositRequested?: ((payload: Record<string, never>) => void);
306
273
  /**
307
- * The platform-balance row was picked. It carries no amount — your own screen collects that.
274
+ * The Accept button was pressed and the Wallet controller opened the corresponding Whop setup page.
308
275
  */
309
- onPlatformBalanceSelected?: ((payload: Record<string, never>) => void);
276
+ onAcceptRequested?: ((payload: Record<string, never>) => void);
310
277
  /**
311
- * The payer said they sent the crypto. `since` is a unix-seconds floor to start matching incoming transfers from (it looks slightly back in time, so a transfer sent moments before the click still matches).
278
+ * The Send button was pressed and the Wallet controller opened its send overlay.
312
279
  */
313
- onDepositConfirmed?: ((payload: { network: string; token: string; networkLabel: string; since: number; }) => void);
280
+ onSendRequested?: ((payload: Record<string, never>) => void);
314
281
  /**
315
- * The visible screen changed.
282
+ * The Withdraw button was pressed and the Wallet controller opened its withdraw overlay.
316
283
  */
317
- onStepChanged?: ((payload: { step: "amount" | "bank" | "crypto"; }) => void);
284
+ onWithdrawRequested?: ((payload: Record<string, never>) => void);
318
285
  /**
319
- * The payer backed out of a rail the element was opened directly onto — close the surface holding it.
286
+ * The Convert button was pressed and the Wallet controller opened its convert overlay.
320
287
  */
321
- onDismissed?: ((payload: Record<string, never>) => void);
288
+ onConvertRequested?: ((payload: Record<string, never>) => void);
322
289
  /**
323
290
  * Runs after the loading skeleton first paints and before `onReady`.
324
291
  */
@@ -334,125 +301,170 @@ export interface DepositElementCreateOptions {
334
301
  }
335
302
 
336
303
  /**
337
- * The overlay handle for "deposit". Returned by `createOverlay("deposit")`; drives the modal presentation imperatively.
338
- * @see https://docs.whop.com/elements/latest/wallet/deposit
304
+ * Consumer props for the "activity" element. Set at create (or as `<ActivityElement />` JSX props), and updatable live via `update()`.
305
+ * @see https://docs.whop.com/elements/latest/wallet/activity
339
306
  */
340
- export interface DepositElementOverlayHandle {
307
+ export interface ActivityElementProps {
341
308
  /**
342
- * Open the overlay. The first call mounts the element. Later calls reuse it.
309
+ * Only show activity for this currency. Without it, activity from every currency is shown.
343
310
  */
344
- open(): void;
311
+ currency?: string;
345
312
  /**
346
- * Close the overlay without destroying it. Keep the handle and `open()` again.
313
+ * A scoped token for the read. An account needs `company:balance:read`, and a user needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
347
314
  */
348
- close(): void;
315
+ accessToken?: string;
349
316
  /**
350
- * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
317
+ * Show at most this many rows and stop paging, for a preview of recent activity. The list gains a See all activity control that reports `seeAllRequested` instead of navigating.
351
318
  */
352
- destroy(): void;
319
+ maxItems?: number;
353
320
  /**
354
- * Merges new props into the mounted element. In React, change the component props instead.
321
+ * When off, card transaction rows render inert (no click, no hover) instead of firing `activitySelected`. Use it when you know the viewer isn't allowed to see those details.
322
+ * @default true
355
323
  */
356
- update(options: Partial<DepositElementProps>): void;
324
+ canOpenCardTransactionDetails?: boolean;
325
+ /**
326
+ * Activity types selected when the element mounts or its account changes. The viewer can change them with the built-in filters.
327
+ * @default []
328
+ */
329
+ defaultLineTypes?: ("platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "payment_gross_reversal" | "payment_refund" | "payment_refund_reversal" | "payment_dispute_reversal" | "payment_dispute_adjustment" | "dispute_hold_adjustment" | "topup_reversal" | "platform_balance_payment" | "platform_balance_payment_refund" | "platform_balance_transfer_incoming" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "withdrawal_reversal" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "payment_revshare_refund" | "payment_revshare_reversal" | "payment_referral" | "payment_referral_reversal" | "application_fee_payout" | "airdrop_reversal" | "airdrop_link_created" | "airdrop_link_returned" | "card_spend_authorization_void" | "card_spend_refund" | "onchain_deposit" | "bank_transfer" | "currency_conversion_outgoing" | "currency_conversion_incoming" | "airdrop_link_redeemed" | "resolution_center_refund" | "withdrawal_reclassification" | "payment_revshare_payout" | "platform_affiliate_payment" | "platform_affiliate_payment_reversal" | "onboarding_reward" | "platform_covered_dispute" | "treasury_payin" | "passthrough_gmv" | "promo_reversal" | "misc_reversal" | "ad_spend_charge" | "ad_campaign_budget" | "ad_budget_release" | "ad_publisher_payout" | "ad_publisher_payout_received" | "affiliate_fee" | "application_fee" | "billing_percentage_fee" | "buyer_fee" | "cross_border_percentage_fee" | "dispute_alert_fee" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "orchestration_percentage_fee" | "payment_dispute_fee" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payout_fee" | "revshare_percentage_fee" | "sales_tax_fee" | "sales_tax_remittance" | "sales_tax_remittance_reversal" | "stripe_domestic_processing_fee" | "stripe_international_processing_fee" | "three_ds_fixed_fee" | "whop_processing_fee")[];
330
+ /**
331
+ * Hide the filter chips, for a compact list that the viewer does not filter.
332
+ * @default false
333
+ */
334
+ hideFilters?: boolean;
357
335
  }
358
336
 
359
337
  /**
360
- * Consumer props for the "withdraw" element. Set at create (or as `<WithdrawElement />` JSX props), and updatable live via `update()`.
361
- * @see https://docs.whop.com/elements/latest/wallet/withdraw
338
+ * The live handle for a mounted "activity" element. Returned by `create("activity")`; in React, the component's `ref`.
339
+ * @see https://docs.whop.com/elements/latest/wallet/activity
362
340
  */
363
- export interface WithdrawElementProps {
341
+ export interface ActivityElementHandle {
364
342
  /**
365
- * Whether the confirmed payout was created successfully.
366
- * @default false
343
+ * Re-fetch the account's activity from the first page. Call it after a mutation made elsewhere (a deposit, a send) so the list reflects it without waiting for the cache to expire.
367
344
  */
368
- succeeded?: boolean;
345
+ refresh: () => Promise<void>;
369
346
  /**
370
- * Saved payout methods with quotes for the current amount.
371
- * @default []
347
+ * Set the date filter from outside the element, for example wiring a chart brush selection into the list. Pass `null` to clear it.
372
348
  */
373
- methods?: WithdrawalMethod[];
349
+ setDateRange: (input: ActivityDateRangeOverride | null) => Promise<void>;
374
350
  /**
375
- * Settled balance available to standard payout methods.
376
- * @default 0
351
+ * Mounts the element in `target` and starts loading. React components mount themselves.
377
352
  */
378
- availableBalance?: number;
353
+ mount: (target: string | HTMLElement) => void;
379
354
  /**
380
- * Pending balance that may be available to instant payout methods.
381
- * @default 0
355
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
382
356
  */
383
- pendingBalance?: number;
357
+ destroy: () => void;
384
358
  /**
385
- * The payout account's ISO 3166-1 alpha-2 country.
386
- * @default "US"
359
+ * Merges new props into the mounted element. In React, change the component props instead.
387
360
  */
388
- payoutCountry?: string;
361
+ update: (options: Partial<ActivityElementProps>) => void;
362
+ }
363
+
364
+ /**
365
+ * Options for `create("activity")`: the consumer props plus event callbacks and lifecycle hooks.
366
+ * @example
367
+ * ```ts
368
+ * const activity = wallet.create("activity", {}); // this interface: props + on<Event> callbacks
369
+ * activity.mount("#wallet-activity");
370
+ * ```
371
+ * @see https://docs.whop.com/elements/latest/wallet/activity
372
+ */
373
+ export interface ActivityElementCreateOptions {
389
374
  /**
390
- * Payout methods available to add in the selected country, including required fields.
391
- * @default []
375
+ * Only show activity for this currency. Without it, activity from every currency is shown.
392
376
  */
393
- supportedMethods?: WithdrawalSupportedMethod[];
377
+ currency?: string;
394
378
  /**
395
- * Whether supported payout methods are loading for the selected country.
396
- * @default false
379
+ * A scoped token for the read. An account needs `company:balance:read`, and a user needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
397
380
  */
398
- supportedMethodsLoading?: boolean;
381
+ accessToken?: string;
399
382
  /**
400
- * Live standard and instant payout limits.
401
- * @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
383
+ * Show at most this many rows and stop paging, for a preview of recent activity. The list gains a See all activity control that reports `seeAllRequested` instead of navigating.
402
384
  */
403
- limits?: WithdrawalLimits;
385
+ maxItems?: number;
404
386
  /**
405
- * Whether payout methods and limits are loading.
406
- * @default false
387
+ * When off, card transaction rows render inert (no click, no hover) instead of firing `activitySelected`. Use it when you know the viewer isn't allowed to see those details.
388
+ * @default true
407
389
  */
408
- loading?: boolean;
390
+ canOpenCardTransactionDetails?: boolean;
409
391
  /**
410
- * Whether the current amount is being repriced.
411
- * @default false
392
+ * Activity types selected when the element mounts or its account changes. The viewer can change them with the built-in filters.
393
+ * @default []
412
394
  */
413
- quoteLoading?: boolean;
395
+ defaultLineTypes?: ("platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "payment_gross_reversal" | "payment_refund" | "payment_refund_reversal" | "payment_dispute_reversal" | "payment_dispute_adjustment" | "dispute_hold_adjustment" | "topup_reversal" | "platform_balance_payment" | "platform_balance_payment_refund" | "platform_balance_transfer_incoming" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "withdrawal_reversal" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "payment_revshare_refund" | "payment_revshare_reversal" | "payment_referral" | "payment_referral_reversal" | "application_fee_payout" | "airdrop_reversal" | "airdrop_link_created" | "airdrop_link_returned" | "card_spend_authorization_void" | "card_spend_refund" | "onchain_deposit" | "bank_transfer" | "currency_conversion_outgoing" | "currency_conversion_incoming" | "airdrop_link_redeemed" | "resolution_center_refund" | "withdrawal_reclassification" | "payment_revshare_payout" | "platform_affiliate_payment" | "platform_affiliate_payment_reversal" | "onboarding_reward" | "platform_covered_dispute" | "treasury_payin" | "passthrough_gmv" | "promo_reversal" | "misc_reversal" | "ad_spend_charge" | "ad_campaign_budget" | "ad_budget_release" | "ad_publisher_payout" | "ad_publisher_payout_received" | "affiliate_fee" | "application_fee" | "billing_percentage_fee" | "buyer_fee" | "cross_border_percentage_fee" | "dispute_alert_fee" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "orchestration_percentage_fee" | "payment_dispute_fee" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payout_fee" | "revshare_percentage_fee" | "sales_tax_fee" | "sales_tax_remittance" | "sales_tax_remittance_reversal" | "stripe_domestic_processing_fee" | "stripe_international_processing_fee" | "three_ds_fixed_fee" | "whop_processing_fee")[];
414
396
  /**
415
- * Whether a new payout method is being saved.
397
+ * Hide the filter chips, for a compact list that the viewer does not filter.
416
398
  * @default false
417
399
  */
418
- savingMethod?: boolean;
400
+ hideFilters?: boolean;
419
401
  /**
420
- * Whether the confirmed payout is being created.
421
- * @default false
402
+ * A row was clicked. Open your own detail view or route for it; the element never navigates.
422
403
  */
423
- submitting?: boolean;
404
+ onActivitySelected?: ((payload: { activity: LedgerActivity; }) => void);
424
405
  /**
425
- * A host-side error to show inside the current screen.
426
- * @default ""
406
+ * The pointer entered a row, or left one (`null`). Point something of your own at the same moment, like marking the row on a balance chart.
427
407
  */
428
- error?: string;
408
+ onActivityHovered?: ((payload: { activity: LedgerActivity; } | null) => void);
429
409
  /**
430
- * True when the last payout was refused because the bank could not confirm the account holder name. Shows a fix-or-confirm choice; confirming re-emits withdrawalRequested with acknowledgeBankWarning set. Set this back to false when handling each withdrawalRequested — the choice appears on the change to true, so a flag left true hides every later refusal.
431
- * @default false
410
+ * The viewer pressed See all activity on a `maxItems` list. Open your own full activity screen; the element never navigates.
432
411
  */
433
- bankWarning?: boolean;
412
+ onSeeAllRequested?: ((payload: Record<string, never>) => void);
434
413
  /**
435
- * The most recently created method, selected when it appears in methods.
436
- * @default ""
414
+ * The viewer changed the date filter through the filter chips rather than through `setDateRange`. Clear any range selection of your own, like a chart brush, that no longer matches.
437
415
  */
438
- createdMethodId?: string;
416
+ onDateRangeChanged?: ((payload: { dateRange: { start: string; end: string; } | null; }) => void);
439
417
  /**
440
- * Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
441
- * @default false
418
+ * Runs after the loading skeleton first paints and before `onReady`.
442
419
  */
443
- plaidUnavailable?: boolean;
420
+ onLoaderStart?: (() => void);
444
421
  /**
445
- * Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
422
+ * Runs after the element's first complete paint.
423
+ */
424
+ onReady?: (() => void);
425
+ /**
426
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
427
+ */
428
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
429
+ }
430
+
431
+ /**
432
+ * Consumer props for the "activityDetail" element. Set at create (or as `<ActivityDetailElement />` JSX props), and updatable live via `update()`.
433
+ * @see https://docs.whop.com/elements/latest/wallet/activityDetail
434
+ */
435
+ export interface ActivityDetailElementProps {
436
+ /**
437
+ * Optional prefetched ledger activity row. When provided, the element renders it without another request.
438
+ * @default null
439
+ */
440
+ activity?: LedgerActivity | null;
441
+ /**
442
+ * Optional ledger activity ID to retrieve when no prefetched activity row is provided.
443
+ * @default null
444
+ */
445
+ activityId?: string | null;
446
+ /**
447
+ * Optional card transaction ID (`citx_`) to retrieve and show as a card receipt — what a card table hands back when a row is pressed. Takes precedence over `activityId`, and is ignored when a prefetched row is passed.
448
+ * @default null
449
+ */
450
+ cardTransactionId?: string | null;
451
+ /**
452
+ * Show the cardholder row on a card receipt. Company accounts only — a personal wallet has one cardholder, so the row never appears there. Reading the name needs `company:authorized_user:read`; without it the row reads Unavailable.
453
+ * @default true
454
+ */
455
+ showCardholder?: boolean;
456
+ /**
457
+ * Show the report-an-issue action for eligible card transactions. The action emits an event for the host.
446
458
  * @default false
447
459
  */
448
- linkingBank?: boolean;
460
+ showCardTransactionReportIssueAction?: boolean;
449
461
  }
450
462
 
451
463
  /**
452
- * The live handle for a mounted "withdraw" element. Returned by `create("withdraw")`; in React, the component's `ref`.
453
- * @see https://docs.whop.com/elements/latest/wallet/withdraw
464
+ * The live handle for a mounted "activityDetail" element. Returned by `create("activityDetail")`; in React, the component's `ref`.
465
+ * @see https://docs.whop.com/elements/latest/wallet/activityDetail
454
466
  */
455
- export interface WithdrawElementHandle {
467
+ export interface ActivityDetailElementHandle {
456
468
  /**
457
469
  * Mounts the element in `target` and starts loading. React components mount themselves.
458
470
  */
@@ -464,144 +476,1608 @@ export interface WithdrawElementHandle {
464
476
  /**
465
477
  * Merges new props into the mounted element. In React, change the component props instead.
466
478
  */
467
- update: (options: Partial<WithdrawElementProps>) => void;
479
+ update: (options: Partial<ActivityDetailElementProps>) => void;
468
480
  }
469
481
 
470
482
  /**
471
- * Options for `create("withdraw")`: the consumer props plus event callbacks and lifecycle hooks.
483
+ * Options for `create("activityDetail")`: the consumer props plus event callbacks and lifecycle hooks.
472
484
  * @example
473
485
  * ```ts
474
- * const withdraw = wallet.create("withdraw", {}); // this interface: props + on<Event> callbacks
475
- * withdraw.mount("#wallet-withdraw");
486
+ * const activityDetail = wallet.createOverlay("activityDetail", {}); // this interface: props + on<Event> callbacks
487
+ * activityDetail.open();
476
488
  * ```
477
- * @see https://docs.whop.com/elements/latest/wallet/withdraw
489
+ * @see https://docs.whop.com/elements/latest/wallet/activityDetail
478
490
  */
479
- export interface WithdrawElementCreateOptions {
491
+ export interface ActivityDetailElementCreateOptions {
480
492
  /**
481
- * Whether the confirmed payout was created successfully.
493
+ * Optional prefetched ledger activity row. When provided, the element renders it without another request.
494
+ * @default null
495
+ */
496
+ activity?: LedgerActivity | null;
497
+ /**
498
+ * Optional ledger activity ID to retrieve when no prefetched activity row is provided.
499
+ * @default null
500
+ */
501
+ activityId?: string | null;
502
+ /**
503
+ * Optional card transaction ID (`citx_`) to retrieve and show as a card receipt — what a card table hands back when a row is pressed. Takes precedence over `activityId`, and is ignored when a prefetched row is passed.
504
+ * @default null
505
+ */
506
+ cardTransactionId?: string | null;
507
+ /**
508
+ * Show the cardholder row on a card receipt. Company accounts only — a personal wallet has one cardholder, so the row never appears there. Reading the name needs `company:authorized_user:read`; without it the row reads Unavailable.
509
+ * @default true
510
+ */
511
+ showCardholder?: boolean;
512
+ /**
513
+ * Show the report-an-issue action for eligible card transactions. The action emits an event for the host.
482
514
  * @default false
483
515
  */
484
- succeeded?: boolean;
516
+ showCardTransactionReportIssueAction?: boolean;
485
517
  /**
486
- * Saved payout methods with quotes for the current amount.
487
- * @default []
518
+ * The card row was clicked.
488
519
  */
489
- methods?: WithdrawalMethod[];
520
+ onCardSelected?: ((payload: { cardId: string; }) => void);
490
521
  /**
491
- * Settled balance available to standard payout methods.
492
- * @default 0
522
+ * The cardholder row was clicked. Open your own profile surface for that user.
493
523
  */
494
- availableBalance?: number;
524
+ onCardholderSelected?: ((payload: { userId: string; }) => void);
495
525
  /**
496
- * Pending balance that may be available to instant payout methods.
497
- * @default 0
526
+ * Report an issue was clicked. Open the host-owned card dispute flow.
498
527
  */
499
- pendingBalance?: number;
528
+ onCardTransactionIssueRequested?: ((payload: { transactionId: string; }) => void);
500
529
  /**
501
- * The payout account's ISO 3166-1 alpha-2 country.
502
- * @default "US"
530
+ * Runs after the loading skeleton first paints and before `onReady`.
503
531
  */
504
- payoutCountry?: string;
532
+ onLoaderStart?: (() => void);
505
533
  /**
506
- * Payout methods available to add in the selected country, including required fields.
507
- * @default []
534
+ * Runs after the element's first complete paint.
508
535
  */
509
- supportedMethods?: WithdrawalSupportedMethod[];
536
+ onReady?: (() => void);
510
537
  /**
511
- * Whether supported payout methods are loading for the selected country.
512
- * @default false
538
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
513
539
  */
514
- supportedMethodsLoading?: boolean;
540
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
541
+ }
542
+
543
+ /**
544
+ * The overlay handle for "activityDetail". Returned by `createOverlay("activityDetail")`; drives the modal presentation imperatively.
545
+ * @see https://docs.whop.com/elements/latest/wallet/activityDetail
546
+ */
547
+ export interface ActivityDetailElementOverlayHandle {
515
548
  /**
516
- * Live standard and instant payout limits.
517
- * @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
549
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
518
550
  */
519
- limits?: WithdrawalLimits;
551
+ open(): void;
520
552
  /**
521
- * Whether payout methods and limits are loading.
553
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
554
+ */
555
+ close(): void;
556
+ /**
557
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
558
+ */
559
+ destroy(): void;
560
+ /**
561
+ * Merges new props into the mounted element. In React, change the component props instead.
562
+ */
563
+ update(options: Partial<ActivityDetailElementProps>): void;
564
+ }
565
+
566
+ /**
567
+ * Consumer props for the "deposit" element. Set at create (or as `<DepositElement />` JSX props), and updatable live via `update()`.
568
+ * @see https://docs.whop.com/elements/latest/wallet/deposit
569
+ */
570
+ export interface DepositElementProps {
571
+ /**
572
+ * A scoped token that lets the rails resolution read a personal (`user_`) account — needs `payout:account:read`, plus `payout:account:update` for the bank rail to provision. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the call carries the viewer's own session, which only answers same-origin; business accounts resolve without any credential.
573
+ */
574
+ accessToken?: string;
575
+ /**
576
+ * Prefill the amount and make it read-only — for flows that already know what is owed. An amount at or below zero is ignored, as is one longer than 12 whole digits; the rest is rounded to the currency’s decimal places.
577
+ * @default ""
578
+ */
579
+ amount?: string;
580
+ /**
581
+ * Offer the crypto rail when the account has a deposit address.
582
+ * @default true
583
+ */
584
+ showCrypto?: boolean;
585
+ /**
586
+ * Offer the bank-transfer rail. Shown even before the account has bank details — choosing it then asks the viewer to verify their identity when that is what the account still owes, and reports the rail as not available yet when it is not.
587
+ * @default true
588
+ */
589
+ showBank?: boolean;
590
+ /**
591
+ * Cards you already hold for this payer, rendered as funding rows. Choosing one emits `cardDepositRequested` with the amount — the element never collects a card payment.
592
+ * @default []
593
+ */
594
+ savedCards?: DepositSavedCard[];
595
+ /**
596
+ * Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
522
597
  * @default false
523
598
  */
524
- loading?: boolean;
599
+ allowNewCard?: boolean;
525
600
  /**
526
- * Whether the current amount is being repriced.
601
+ * Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
527
602
  * @default false
528
603
  */
529
- quoteLoading?: boolean;
604
+ showPlatformBalance?: boolean;
530
605
  /**
531
- * Whether a new payout method is being saved.
606
+ * Processing fees to preview under the amount when a card row is selected. `percentageFee` is in percentage POINTS (`2.9` is 2.9%); `fixedFee` and `radarFee` are major units (`0.3` is $0.30).
607
+ * @default null
608
+ */
609
+ cardFee?: DepositCardFee | null;
610
+ /**
611
+ * Preselect a rail by id (`bank`, `crypto`, `platform_balance`, or a saved card id). Continue stays disabled while that rail is not yet offered, rather than funding through another one.
612
+ * @default ""
613
+ */
614
+ preferredMethodId?: string;
615
+ /**
616
+ * Emit `bankSelected` and stay on the amount screen instead of showing the wire fields — for hosts that run their own step after the account already has a virtual bank account.
532
617
  * @default false
533
618
  */
534
- savingMethod?: boolean;
619
+ deferBankToHost?: boolean;
535
620
  /**
536
- * Whether the confirmed payout is being created.
621
+ * Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
537
622
  * @default false
538
623
  */
539
- submitting?: boolean;
624
+ confirmCryptoDeposit?: boolean;
540
625
  /**
541
- * A host-side error to show inside the current screen.
626
+ * Open straight onto a rail instead of the picker. `crypto` and `bank` need no amount; their back button emits `dismissed` because there is no picker behind them.
627
+ * @default "amount"
628
+ */
629
+ initialStep?: "amount" | "bank" | "crypto";
630
+ }
631
+
632
+ /**
633
+ * The live handle for a mounted "deposit" element. Returned by `create("deposit")`; in React, the component's `ref`.
634
+ * @see https://docs.whop.com/elements/latest/wallet/deposit
635
+ */
636
+ export interface DepositElementHandle {
637
+ /**
638
+ * Move the element to a screen. `{ step: "amount" }` is how you hand control back after settling a card or platform-balance deposit on your side.
639
+ */
640
+ showStep: (input: { step: "amount" | "bank" | "crypto"; }) => Promise<void>;
641
+ /**
642
+ * Re-resolve the account's funding rails. Call it after anything on your side changes what the account can offer — finishing bank onboarding, for instance — so the new rail appears without waiting for the cache to expire.
643
+ */
644
+ refresh: () => Promise<void>;
645
+ /**
646
+ * Mounts the element in `target` and starts loading. React components mount themselves.
647
+ */
648
+ mount: (target: string | HTMLElement) => void;
649
+ /**
650
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
651
+ */
652
+ destroy: () => void;
653
+ /**
654
+ * Merges new props into the mounted element. In React, change the component props instead.
655
+ */
656
+ update: (options: Partial<DepositElementProps>) => void;
657
+ }
658
+
659
+ /**
660
+ * Options for `create("deposit")`: the consumer props plus event callbacks and lifecycle hooks.
661
+ * @example
662
+ * ```ts
663
+ * const deposit = wallet.create("deposit", {}); // this interface: props + on<Event> callbacks
664
+ * deposit.mount("#wallet-deposit");
665
+ * ```
666
+ * @see https://docs.whop.com/elements/latest/wallet/deposit
667
+ */
668
+ export interface DepositElementCreateOptions {
669
+ /**
670
+ * A scoped token that lets the rails resolution read a personal (`user_`) account — needs `payout:account:read`, plus `payout:account:update` for the bank rail to provision. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the call carries the viewer's own session, which only answers same-origin; business accounts resolve without any credential.
671
+ */
672
+ accessToken?: string;
673
+ /**
674
+ * Prefill the amount and make it read-only — for flows that already know what is owed. An amount at or below zero is ignored, as is one longer than 12 whole digits; the rest is rounded to the currency’s decimal places.
542
675
  * @default ""
543
676
  */
544
- error?: string;
677
+ amount?: string;
545
678
  /**
546
- * True when the last payout was refused because the bank could not confirm the account holder name. Shows a fix-or-confirm choice; confirming re-emits withdrawalRequested with acknowledgeBankWarning set. Set this back to false when handling each withdrawalRequested — the choice appears on the change to true, so a flag left true hides every later refusal.
679
+ * Offer the crypto rail when the account has a deposit address.
680
+ * @default true
681
+ */
682
+ showCrypto?: boolean;
683
+ /**
684
+ * Offer the bank-transfer rail. Shown even before the account has bank details — choosing it then asks the viewer to verify their identity when that is what the account still owes, and reports the rail as not available yet when it is not.
685
+ * @default true
686
+ */
687
+ showBank?: boolean;
688
+ /**
689
+ * Cards you already hold for this payer, rendered as funding rows. Choosing one emits `cardDepositRequested` with the amount — the element never collects a card payment.
690
+ * @default []
691
+ */
692
+ savedCards?: DepositSavedCard[];
693
+ /**
694
+ * Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
547
695
  * @default false
548
696
  */
549
- bankWarning?: boolean;
697
+ allowNewCard?: boolean;
550
698
  /**
551
- * The most recently created method, selected when it appears in methods.
699
+ * Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
700
+ * @default false
701
+ */
702
+ showPlatformBalance?: boolean;
703
+ /**
704
+ * Processing fees to preview under the amount when a card row is selected. `percentageFee` is in percentage POINTS (`2.9` is 2.9%); `fixedFee` and `radarFee` are major units (`0.3` is $0.30).
705
+ * @default null
706
+ */
707
+ cardFee?: DepositCardFee | null;
708
+ /**
709
+ * Preselect a rail by id (`bank`, `crypto`, `platform_balance`, or a saved card id). Continue stays disabled while that rail is not yet offered, rather than funding through another one.
552
710
  * @default ""
553
711
  */
554
- createdMethodId?: string;
712
+ preferredMethodId?: string;
555
713
  /**
556
- * Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
714
+ * Emit `bankSelected` and stay on the amount screen instead of showing the wire fields — for hosts that run their own step after the account already has a virtual bank account.
557
715
  * @default false
558
716
  */
559
- plaidUnavailable?: boolean;
717
+ deferBankToHost?: boolean;
560
718
  /**
561
- * Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
719
+ * Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
562
720
  * @default false
563
721
  */
564
- linkingBank?: boolean;
722
+ confirmCryptoDeposit?: boolean;
565
723
  /**
566
- * The amount changed and should be repriced.
724
+ * Open straight onto a rail instead of the picker. `crypto` and `bank` need no amount; their back button emits `dismissed` because there is no picker behind them.
725
+ * @default "amount"
567
726
  */
568
- onAmountChanged?: ((payload: { amount: number; }) => void);
727
+ initialStep?: "amount" | "bank" | "crypto";
569
728
  /**
570
- * The add-method country changed and supported methods should be refreshed.
729
+ * The payer confirmed an amount and a rail. Fires for every rail, before any instructions render — the analytics/funnel hook.
571
730
  */
572
- onCountryChanged?: ((payload: { country: string; }) => void);
731
+ onDepositInitiated?: ((payload: { method: "bank" | "crypto" | "card" | "platform_balance"; amount: number; currency: string; paymentMethodId?: string | undefined; }) => void);
732
+ /**
733
+ * A saved card was chosen. Collect the payment on your side, then call `showStep({ step: "amount" })` to return the element to the picker.
734
+ */
735
+ onCardDepositRequested?: ((payload: { amount: number; currency: string; paymentMethodId: string; }) => void);
736
+ /**
737
+ * The "Add card" row was picked — open your card-collection flow.
738
+ */
739
+ onAddCardRequested?: ((payload: Record<string, never>) => void);
740
+ /**
741
+ * The bank rail was chosen while `deferBankToHost` is set — run your step, then show the fields yourself or call `showStep({ step: "bank" })`.
742
+ */
743
+ onBankSelected?: ((payload: Record<string, never>) => void);
744
+ /**
745
+ * The viewer chose bank transfer before this account has a virtual bank account. The element stays on the amount screen and never navigates — mount your own verification, such as the `verifications` controller, in answer to this.
746
+ */
747
+ onIdentityVerificationRequested?: ((payload: { accountId: string; }) => void);
748
+ /**
749
+ * The platform-balance row was picked. It carries no amount — your own screen collects that.
750
+ */
751
+ onPlatformBalanceSelected?: ((payload: Record<string, never>) => void);
752
+ /**
753
+ * The payer said they sent the crypto. `since` is a unix-seconds floor to start matching incoming transfers from (it looks slightly back in time, so a transfer sent moments before the click still matches).
754
+ */
755
+ onDepositConfirmed?: ((payload: { network: string; token: string; networkLabel: string; since: number; }) => void);
756
+ /**
757
+ * The visible screen changed.
758
+ */
759
+ onStepChanged?: ((payload: { step: "amount" | "bank" | "crypto"; }) => void);
760
+ /**
761
+ * The payer backed out of a rail the element was opened directly onto — close the surface holding it.
762
+ */
763
+ onDismissed?: ((payload: Record<string, never>) => void);
764
+ /**
765
+ * Runs after the loading skeleton first paints and before `onReady`.
766
+ */
767
+ onLoaderStart?: (() => void);
768
+ /**
769
+ * Runs after the element's first complete paint.
770
+ */
771
+ onReady?: (() => void);
772
+ /**
773
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
774
+ */
775
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
776
+ }
777
+
778
+ /**
779
+ * The overlay handle for "deposit". Returned by `createOverlay("deposit")`; drives the modal presentation imperatively.
780
+ * @see https://docs.whop.com/elements/latest/wallet/deposit
781
+ */
782
+ export interface DepositElementOverlayHandle {
783
+ /**
784
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
785
+ */
786
+ open(): void;
787
+ /**
788
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
789
+ */
790
+ close(): void;
791
+ /**
792
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
793
+ */
794
+ destroy(): void;
795
+ /**
796
+ * Merges new props into the mounted element. In React, change the component props instead.
797
+ */
798
+ update(options: Partial<DepositElementProps>): void;
799
+ }
800
+
801
+ /**
802
+ * Consumer props for the "convert" element. Set at create (or as `<ConvertElement />` JSX props), and updatable live via `update()`.
803
+ * @see https://docs.whop.com/elements/latest/wallet/convert
804
+ */
805
+ export interface ConvertElementProps {}
806
+
807
+ /**
808
+ * The live handle for a mounted "convert" element. Returned by `create("convert")`; in React, the component's `ref`.
809
+ * @see https://docs.whop.com/elements/latest/wallet/convert
810
+ */
811
+ export interface ConvertElementHandle {
812
+ /**
813
+ * Re-fetch the account balance after another surface changes it.
814
+ */
815
+ refresh: () => Promise<void>;
816
+ /**
817
+ * Mounts the element in `target` and starts loading. React components mount themselves.
818
+ */
819
+ mount: (target: string | HTMLElement) => void;
820
+ /**
821
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
822
+ */
823
+ destroy: () => void;
824
+ /**
825
+ * Merges new props into the mounted element. In React, change the component props instead.
826
+ */
827
+ update: (options: Partial<ConvertElementProps>) => void;
828
+ }
829
+
830
+ /**
831
+ * Options for `create("convert")`: the consumer props plus event callbacks and lifecycle hooks.
832
+ * @example
833
+ * ```ts
834
+ * const convert = wallet.create("convert", {}); // this interface: props + on<Event> callbacks
835
+ * convert.mount("#wallet-convert");
836
+ * ```
837
+ * @see https://docs.whop.com/elements/latest/wallet/convert
838
+ */
839
+ export interface ConvertElementCreateOptions {
840
+ /**
841
+ * The visible conversion step changed.
842
+ */
843
+ onViewChanged?: ((payload: { view: "pending" | "input" | "review" | "success"; }) => void);
844
+ /**
845
+ * A conversion completed or remains pending after the polling window. Refresh account balance and activity.
846
+ */
847
+ onBalanceChanged?: ((payload: Record<string, never>) => void);
848
+ /**
849
+ * The viewer finished or dismissed the conversion flow.
850
+ */
851
+ onDone?: ((payload: Record<string, never>) => void);
852
+ /**
853
+ * Runs after the loading skeleton first paints and before `onReady`.
854
+ */
855
+ onLoaderStart?: (() => void);
856
+ /**
857
+ * Runs after the element's first complete paint.
858
+ */
859
+ onReady?: (() => void);
860
+ /**
861
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
862
+ */
863
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
864
+ }
865
+
866
+ /**
867
+ * The overlay handle for "convert". Returned by `createOverlay("convert")`; drives the modal presentation imperatively.
868
+ * @see https://docs.whop.com/elements/latest/wallet/convert
869
+ */
870
+ export interface ConvertElementOverlayHandle {
871
+ /**
872
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
873
+ */
874
+ open(): void;
875
+ /**
876
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
877
+ */
878
+ close(): void;
879
+ /**
880
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
881
+ */
882
+ destroy(): void;
883
+ /**
884
+ * Merges new props into the mounted element. In React, change the component props instead.
885
+ */
886
+ update(options: Partial<ConvertElementProps>): void;
887
+ }
888
+
889
+ /**
890
+ * Consumer props for the "withdraw" element. Set at create (or as `<WithdrawElement />` JSX props), and updatable live via `update()`.
891
+ * @see https://docs.whop.com/elements/latest/wallet/withdraw
892
+ */
893
+ export interface WithdrawElementProps {
894
+ /**
895
+ * A scoped token for listing payout methods and creating the payout — needs `payout:withdraw_funds`, `payout:destination:read`, and `payout:create_destination` to add a bank. Omitted, the calls carry the viewer's own session, which only answers same-origin.
896
+ */
897
+ accessToken?: string;
898
+ /**
899
+ * Whether the confirmed payout was created successfully.
900
+ * @default false
901
+ */
902
+ succeeded?: boolean;
903
+ /**
904
+ * Saved payout methods with quotes for the current amount.
905
+ * @default []
906
+ */
907
+ methods?: WithdrawalMethod[];
908
+ /**
909
+ * Settled balance available to standard payout methods.
910
+ * @default 0
911
+ */
912
+ availableBalance?: number;
913
+ /**
914
+ * Pending balance that may be available to instant payout methods.
915
+ * @default 0
916
+ */
917
+ pendingBalance?: number;
918
+ /**
919
+ * The payout account's ISO 3166-1 alpha-2 country.
920
+ * @default "US"
921
+ */
922
+ payoutCountry?: string;
923
+ /**
924
+ * Payout methods available to add in the selected country, including required fields.
925
+ * @default []
926
+ */
927
+ supportedMethods?: WithdrawalSupportedMethod[];
928
+ /**
929
+ * Whether supported payout methods are loading for the selected country.
930
+ * @default false
931
+ */
932
+ supportedMethodsLoading?: boolean;
933
+ /**
934
+ * Live standard and instant payout limits.
935
+ * @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
936
+ */
937
+ limits?: WithdrawalLimits;
938
+ /**
939
+ * Whether payout methods and limits are loading.
940
+ * @default false
941
+ */
942
+ loading?: boolean;
943
+ /**
944
+ * Whether the current amount is being repriced.
945
+ * @default false
946
+ */
947
+ quoteLoading?: boolean;
948
+ /**
949
+ * Whether this payout must use an exact provider-backed quote before confirmation.
950
+ * @default false
951
+ */
952
+ payoutQuoteRequired?: boolean;
953
+ /**
954
+ * The exact short-lived payout quote returned for the current confirmation request.
955
+ * @default null
956
+ */
957
+ payoutQuote?: WithdrawalPayoutQuote | null;
958
+ /**
959
+ * Whether an exact payout quote is being created.
960
+ * @default false
961
+ */
962
+ payoutQuoteLoading?: boolean;
963
+ /**
964
+ * The error from the current exact payout quote request, if any.
965
+ * @default ""
966
+ */
967
+ payoutQuoteError?: string;
968
+ /**
969
+ * Whether the last quote request was inconclusive and must be retried with the same request ID.
970
+ * @default false
971
+ */
972
+ payoutQuoteRetryRequired?: boolean;
973
+ /**
974
+ * Whether the last payout result was inconclusive and must be retried exactly.
975
+ * @default false
976
+ */
977
+ withdrawalRetryRequired?: boolean;
978
+ /**
979
+ * The exact unresolved payout request to retry after the element remounts.
980
+ * @default null
981
+ */
982
+ unresolvedWithdrawalRequest?: WithdrawalRequest | null;
983
+ /**
984
+ * Whether a new payout method is being saved.
985
+ * @default false
986
+ */
987
+ savingMethod?: boolean;
988
+ /**
989
+ * Whether the confirmed payout is being created.
990
+ * @default false
991
+ */
992
+ submitting?: boolean;
993
+ /**
994
+ * A host-side error to show inside the current screen.
995
+ * @default ""
996
+ */
997
+ error?: string;
998
+ /**
999
+ * True when the last payout was refused because the bank could not confirm the account holder name. Shows a fix-or-confirm choice; confirming re-emits withdrawalRequested with acknowledgeBankWarning set. Set this back to false when handling each withdrawalRequested — the choice appears on the change to true, so a flag left true hides every later refusal.
1000
+ * @default false
1001
+ */
1002
+ bankWarning?: boolean;
1003
+ /**
1004
+ * The most recently created method, selected when it appears in methods.
1005
+ * @default ""
1006
+ */
1007
+ createdMethodId?: string;
1008
+ /**
1009
+ * Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
1010
+ * @default false
1011
+ */
1012
+ plaidUnavailable?: boolean;
1013
+ /**
1014
+ * Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
1015
+ * @default false
1016
+ */
1017
+ linkingBank?: boolean;
1018
+ }
1019
+
1020
+ /**
1021
+ * The live handle for a mounted "withdraw" element. Returned by `create("withdraw")`; in React, the component's `ref`.
1022
+ * @see https://docs.whop.com/elements/latest/wallet/withdraw
1023
+ */
1024
+ export interface WithdrawElementHandle {
1025
+ /**
1026
+ * Re-fetch saved payout methods and limits. Call it after anything on your side changes what the account can pay out to.
1027
+ */
1028
+ refresh: () => Promise<void>;
1029
+ /**
1030
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1031
+ */
1032
+ mount: (target: string | HTMLElement) => void;
1033
+ /**
1034
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1035
+ */
1036
+ destroy: () => void;
1037
+ /**
1038
+ * Merges new props into the mounted element. In React, change the component props instead.
1039
+ */
1040
+ update: (options: Partial<WithdrawElementProps>) => void;
1041
+ }
1042
+
1043
+ /**
1044
+ * Options for `create("withdraw")`: the consumer props plus event callbacks and lifecycle hooks.
1045
+ * @example
1046
+ * ```ts
1047
+ * const withdraw = wallet.create("withdraw", {}); // this interface: props + on<Event> callbacks
1048
+ * withdraw.mount("#wallet-withdraw");
1049
+ * ```
1050
+ * @see https://docs.whop.com/elements/latest/wallet/withdraw
1051
+ */
1052
+ export interface WithdrawElementCreateOptions {
1053
+ /**
1054
+ * A scoped token for listing payout methods and creating the payout — needs `payout:withdraw_funds`, `payout:destination:read`, and `payout:create_destination` to add a bank. Omitted, the calls carry the viewer's own session, which only answers same-origin.
1055
+ */
1056
+ accessToken?: string;
1057
+ /**
1058
+ * Whether the confirmed payout was created successfully.
1059
+ * @default false
1060
+ */
1061
+ succeeded?: boolean;
1062
+ /**
1063
+ * Saved payout methods with quotes for the current amount.
1064
+ * @default []
1065
+ */
1066
+ methods?: WithdrawalMethod[];
1067
+ /**
1068
+ * Settled balance available to standard payout methods.
1069
+ * @default 0
1070
+ */
1071
+ availableBalance?: number;
1072
+ /**
1073
+ * Pending balance that may be available to instant payout methods.
1074
+ * @default 0
1075
+ */
1076
+ pendingBalance?: number;
1077
+ /**
1078
+ * The payout account's ISO 3166-1 alpha-2 country.
1079
+ * @default "US"
1080
+ */
1081
+ payoutCountry?: string;
1082
+ /**
1083
+ * Payout methods available to add in the selected country, including required fields.
1084
+ * @default []
1085
+ */
1086
+ supportedMethods?: WithdrawalSupportedMethod[];
1087
+ /**
1088
+ * Whether supported payout methods are loading for the selected country.
1089
+ * @default false
1090
+ */
1091
+ supportedMethodsLoading?: boolean;
1092
+ /**
1093
+ * Live standard and instant payout limits.
1094
+ * @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
1095
+ */
1096
+ limits?: WithdrawalLimits;
1097
+ /**
1098
+ * Whether payout methods and limits are loading.
1099
+ * @default false
1100
+ */
1101
+ loading?: boolean;
1102
+ /**
1103
+ * Whether the current amount is being repriced.
1104
+ * @default false
1105
+ */
1106
+ quoteLoading?: boolean;
1107
+ /**
1108
+ * Whether this payout must use an exact provider-backed quote before confirmation.
1109
+ * @default false
1110
+ */
1111
+ payoutQuoteRequired?: boolean;
1112
+ /**
1113
+ * The exact short-lived payout quote returned for the current confirmation request.
1114
+ * @default null
1115
+ */
1116
+ payoutQuote?: WithdrawalPayoutQuote | null;
1117
+ /**
1118
+ * Whether an exact payout quote is being created.
1119
+ * @default false
1120
+ */
1121
+ payoutQuoteLoading?: boolean;
1122
+ /**
1123
+ * The error from the current exact payout quote request, if any.
1124
+ * @default ""
1125
+ */
1126
+ payoutQuoteError?: string;
1127
+ /**
1128
+ * Whether the last quote request was inconclusive and must be retried with the same request ID.
1129
+ * @default false
1130
+ */
1131
+ payoutQuoteRetryRequired?: boolean;
1132
+ /**
1133
+ * Whether the last payout result was inconclusive and must be retried exactly.
1134
+ * @default false
1135
+ */
1136
+ withdrawalRetryRequired?: boolean;
1137
+ /**
1138
+ * The exact unresolved payout request to retry after the element remounts.
1139
+ * @default null
1140
+ */
1141
+ unresolvedWithdrawalRequest?: WithdrawalRequest | null;
1142
+ /**
1143
+ * Whether a new payout method is being saved.
1144
+ * @default false
1145
+ */
1146
+ savingMethod?: boolean;
1147
+ /**
1148
+ * Whether the confirmed payout is being created.
1149
+ * @default false
1150
+ */
1151
+ submitting?: boolean;
1152
+ /**
1153
+ * A host-side error to show inside the current screen.
1154
+ * @default ""
1155
+ */
1156
+ error?: string;
1157
+ /**
1158
+ * True when the last payout was refused because the bank could not confirm the account holder name. Shows a fix-or-confirm choice; confirming re-emits withdrawalRequested with acknowledgeBankWarning set. Set this back to false when handling each withdrawalRequested — the choice appears on the change to true, so a flag left true hides every later refusal.
1159
+ * @default false
1160
+ */
1161
+ bankWarning?: boolean;
1162
+ /**
1163
+ * The most recently created method, selected when it appears in methods.
1164
+ * @default ""
1165
+ */
1166
+ createdMethodId?: string;
1167
+ /**
1168
+ * Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
1169
+ * @default false
1170
+ */
1171
+ plaidUnavailable?: boolean;
1172
+ /**
1173
+ * Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
1174
+ * @default false
1175
+ */
1176
+ linkingBank?: boolean;
1177
+ /**
1178
+ * The amount changed and should be repriced.
1179
+ */
1180
+ onAmountChanged?: ((payload: { amount: number; }) => void);
1181
+ /**
1182
+ * The add-method country changed and supported methods should be refreshed.
1183
+ */
1184
+ onCountryChanged?: ((payload: { country: string; }) => void);
1185
+ /**
1186
+ * A supported payout method was selected and its exact required fields should be loaded.
1187
+ */
1188
+ onSupportedMethodChanged?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
1189
+ /**
1190
+ * The payer submitted the dynamic add-payout-method form.
1191
+ */
1192
+ onAddMethodRequested?: ((payload: WithdrawalCreateMethodInput) => void);
1193
+ /**
1194
+ * The payer chose to link their bank through Plaid instead of typing details. Open Plaid Link on receipt.
1195
+ */
1196
+ onPlaidLinkRequested?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
1197
+ /**
1198
+ * The newly added payout method finished its verification step.
1199
+ */
1200
+ onMethodVerificationCompleted?: ((payload: Record<string, never>) => void);
1201
+ /**
1202
+ * The payer requested to rename a saved payout method.
1203
+ */
1204
+ onRenameMethodRequested?: ((payload: { methodId: string; }) => void);
1205
+ /**
1206
+ * The payer requested to remove a saved payout method.
1207
+ */
1208
+ onRemoveMethodRequested?: ((payload: { methodId: string; }) => void);
1209
+ /**
1210
+ * The payer requested an exact short-lived quote before confirming a payout.
1211
+ */
1212
+ onPayoutQuoteRequested?: ((payload: WithdrawalPayoutQuoteRequest) => void);
1213
+ /**
1214
+ * The payer confirmed the payout. When the host is driving the flow, create the payout on receipt. When the element created it, this fires after success so the host can refresh balances — do not create a second payout.
1215
+ */
1216
+ onWithdrawalRequested?: ((payload: WithdrawalRequest) => void);
1217
+ /**
1218
+ * The payer finished reviewing a successful payout.
1219
+ */
1220
+ onDone?: ((payload: Record<string, never>) => void);
1221
+ /**
1222
+ * Runs after the loading skeleton first paints and before `onReady`.
1223
+ */
1224
+ onLoaderStart?: (() => void);
1225
+ /**
1226
+ * Runs after the element's first complete paint.
1227
+ */
1228
+ onReady?: (() => void);
1229
+ /**
1230
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1231
+ */
1232
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1233
+ }
1234
+
1235
+ /**
1236
+ * The overlay handle for "withdraw". Returned by `createOverlay("withdraw")`; drives the modal presentation imperatively.
1237
+ * @see https://docs.whop.com/elements/latest/wallet/withdraw
1238
+ */
1239
+ export interface WithdrawElementOverlayHandle {
1240
+ /**
1241
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
1242
+ */
1243
+ open(): void;
1244
+ /**
1245
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
1246
+ */
1247
+ close(): void;
1248
+ /**
1249
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1250
+ */
1251
+ destroy(): void;
1252
+ /**
1253
+ * Merges new props into the mounted element. In React, change the component props instead.
1254
+ */
1255
+ update(options: Partial<WithdrawElementProps>): void;
1256
+ }
1257
+
1258
+ /**
1259
+ * Consumer props for the "send" element. Set at create (or as `<SendElement />` JSX props), and updatable live via `update()`.
1260
+ * @see https://docs.whop.com/elements/latest/wallet/send
1261
+ */
1262
+ export interface SendElementProps {
1263
+ /**
1264
+ * A scoped token for the privileged read/write — needs `payout:transfer_funds` for direct transfers and `payout:withdraw_funds` for recipient lists (plus `company:authorized_user:read` and `member:basic:read` for recipient search, `airdrop_link:manage` for claim links). Omitted, the read carries the viewer's own session, which only answers same-origin.
1265
+ */
1266
+ accessToken?: string;
1267
+ /**
1268
+ * Overrides the recipient-picker header. Omitted, the header is "Choose recipient".
1269
+ */
1270
+ title?: string;
1271
+ /**
1272
+ * Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
1273
+ * @default true
1274
+ */
1275
+ canSearchRecipients?: boolean;
1276
+ /**
1277
+ * Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
1278
+ * @default true
1279
+ */
1280
+ canCreateLink?: boolean;
1281
+ /**
1282
+ * Skip the picker and open straight onto this recipient's amount screen — for a "pay this person" action row. No back button is shown in that case, matching there being no picker behind it.
1283
+ * @default null
1284
+ */
1285
+ initialRecipient?: SendRecipient | null;
1286
+ /**
1287
+ * Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
1288
+ * @default ""
1289
+ */
1290
+ initialCurrency?: string;
1291
+ }
1292
+
1293
+ /**
1294
+ * The live handle for a mounted "send" element. Returned by `create("send")`; in React, the component's `ref`.
1295
+ * @see https://docs.whop.com/elements/latest/wallet/send
1296
+ */
1297
+ export interface SendElementHandle {
1298
+ /**
1299
+ * Re-fetch the account's balances and recipient list. Call it after anything on your side changes what it can offer.
1300
+ */
1301
+ refresh: () => Promise<void>;
1302
+ /**
1303
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1304
+ */
1305
+ mount: (target: string | HTMLElement) => void;
1306
+ /**
1307
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1308
+ */
1309
+ destroy: () => void;
1310
+ /**
1311
+ * Merges new props into the mounted element. In React, change the component props instead.
1312
+ */
1313
+ update: (options: Partial<SendElementProps>) => void;
1314
+ }
1315
+
1316
+ /**
1317
+ * Options for `create("send")`: the consumer props plus event callbacks and lifecycle hooks.
1318
+ * @example
1319
+ * ```ts
1320
+ * const send = wallet.create("send", {}); // this interface: props + on<Event> callbacks
1321
+ * send.mount("#wallet-send");
1322
+ * ```
1323
+ * @see https://docs.whop.com/elements/latest/wallet/send
1324
+ */
1325
+ export interface SendElementCreateOptions {
1326
+ /**
1327
+ * A scoped token for the privileged read/write — needs `payout:transfer_funds` for direct transfers and `payout:withdraw_funds` for recipient lists (plus `company:authorized_user:read` and `member:basic:read` for recipient search, `airdrop_link:manage` for claim links). Omitted, the read carries the viewer's own session, which only answers same-origin.
1328
+ */
1329
+ accessToken?: string;
1330
+ /**
1331
+ * Overrides the recipient-picker header. Omitted, the header is "Choose recipient".
1332
+ */
1333
+ title?: string;
1334
+ /**
1335
+ * Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
1336
+ * @default true
1337
+ */
1338
+ canSearchRecipients?: boolean;
1339
+ /**
1340
+ * Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
1341
+ * @default true
1342
+ */
1343
+ canCreateLink?: boolean;
1344
+ /**
1345
+ * Skip the picker and open straight onto this recipient's amount screen — for a "pay this person" action row. No back button is shown in that case, matching there being no picker behind it.
1346
+ * @default null
1347
+ */
1348
+ initialRecipient?: SendRecipient | null;
1349
+ /**
1350
+ * Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
1351
+ * @default ""
1352
+ */
1353
+ initialCurrency?: string;
1354
+ /**
1355
+ * The visible screen changed.
1356
+ */
1357
+ onStepChanged?: ((payload: { step: "success" | "enter_amount" | "select_recipient" | "create_link" | "link_success"; }) => void);
1358
+ /**
1359
+ * A transfer succeeded. Refresh anything on your side reading the account's balance or activity.
1360
+ */
1361
+ onSendCompleted?: ((payload: { recipient: SendRecipient; amount: number; currency: string; }) => void);
1362
+ /**
1363
+ * A claim link was created. Refresh anything on your side reading the account's balance.
1364
+ */
1365
+ onLinkCreated?: ((payload: { claimUrl: string; amount: number; redeemableCount: number; }) => void);
1366
+ /**
1367
+ * The viewer clicked "Done" on a success screen — close the surface holding it.
1368
+ */
1369
+ onDone?: ((payload: Record<string, never>) => void);
1370
+ /**
1371
+ * Runs after the loading skeleton first paints and before `onReady`.
1372
+ */
1373
+ onLoaderStart?: (() => void);
1374
+ /**
1375
+ * Runs after the element's first complete paint.
1376
+ */
1377
+ onReady?: (() => void);
1378
+ /**
1379
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1380
+ */
1381
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1382
+ }
1383
+
1384
+ /**
1385
+ * The overlay handle for "send". Returned by `createOverlay("send")`; drives the modal presentation imperatively.
1386
+ * @see https://docs.whop.com/elements/latest/wallet/send
1387
+ */
1388
+ export interface SendElementOverlayHandle {
1389
+ /**
1390
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
1391
+ */
1392
+ open(): void;
1393
+ /**
1394
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
1395
+ */
1396
+ close(): void;
1397
+ /**
1398
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1399
+ */
1400
+ destroy(): void;
1401
+ /**
1402
+ * Merges new props into the mounted element. In React, change the component props instead.
1403
+ */
1404
+ update(options: Partial<SendElementProps>): void;
1405
+ }
1406
+
1407
+ /**
1408
+ * Consumer props for the "cardDetails" element. Set at create (or as `<CardDetailsElement />` JSX props), and updatable live via `update()`.
1409
+ * @see https://docs.whop.com/elements/latest/wallet/cardDetails
1410
+ */
1411
+ export interface CardDetailsElementProps {
1412
+ /**
1413
+ * A scoped token for the card and its transactions — needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
1414
+ */
1415
+ accessToken?: string;
1416
+ /**
1417
+ * Non-sensitive card metadata a host has already loaded. Supplying it saves the card face a list request; its authorized secrets are still fetched so the reveal stays instant.
1418
+ */
1419
+ card?: { status: "active" | "frozen" | "canceled" | "invited" | "denied" | null; name: string | null; id: string; last4: string | null; billing: Billing | null; expiration_month: string | null; expiration_year: string | null; };
1420
+ /**
1421
+ * The card this drawer describes, prefixed `icrd_`.
1422
+ * @default ""
1423
+ */
1424
+ cardId?: string;
1425
+ /**
1426
+ * How many recent transactions to list under the card.
1427
+ * @default 5
1428
+ */
1429
+ latestCount?: number;
1430
+ /**
1431
+ * Hide the latest-transactions list, for a host that shows its own beneath the drawer.
1432
+ * @default false
1433
+ */
1434
+ hideTransactions?: boolean;
1435
+ /**
1436
+ * Hide the overflow button, for a host with no card actions of its own to offer.
1437
+ * @default false
1438
+ */
1439
+ hideMenuButton?: boolean;
1440
+ }
1441
+
1442
+ /**
1443
+ * The live handle for a mounted "cardDetails" element. Returned by `create("cardDetails")`; in React, the component's `ref`.
1444
+ * @see https://docs.whop.com/elements/latest/wallet/cardDetails
1445
+ */
1446
+ export interface CardDetailsElementHandle {
1447
+ /**
1448
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1449
+ */
1450
+ mount: (target: string | HTMLElement) => void;
1451
+ /**
1452
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1453
+ */
1454
+ destroy: () => void;
1455
+ /**
1456
+ * Merges new props into the mounted element. In React, change the component props instead.
1457
+ */
1458
+ update: (options: Partial<CardDetailsElementProps>) => void;
1459
+ }
1460
+
1461
+ /**
1462
+ * Options for `create("cardDetails")`: the consumer props plus event callbacks and lifecycle hooks.
1463
+ * @example
1464
+ * ```ts
1465
+ * const cardDetails = wallet.createOverlay("cardDetails", {}); // this interface: props + on<Event> callbacks
1466
+ * cardDetails.open();
1467
+ * ```
1468
+ * @see https://docs.whop.com/elements/latest/wallet/cardDetails
1469
+ */
1470
+ export interface CardDetailsElementCreateOptions {
1471
+ /**
1472
+ * A scoped token for the card and its transactions — needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
1473
+ */
1474
+ accessToken?: string;
1475
+ /**
1476
+ * Non-sensitive card metadata a host has already loaded. Supplying it saves the card face a list request; its authorized secrets are still fetched so the reveal stays instant.
1477
+ */
1478
+ card?: { status: "active" | "frozen" | "canceled" | "invited" | "denied" | null; name: string | null; id: string; last4: string | null; billing: Billing | null; expiration_month: string | null; expiration_year: string | null; };
1479
+ /**
1480
+ * The card this drawer describes, prefixed `icrd_`.
1481
+ * @default ""
1482
+ */
1483
+ cardId?: string;
1484
+ /**
1485
+ * How many recent transactions to list under the card.
1486
+ * @default 5
1487
+ */
1488
+ latestCount?: number;
1489
+ /**
1490
+ * Hide the latest-transactions list, for a host that shows its own beneath the drawer.
1491
+ * @default false
1492
+ */
1493
+ hideTransactions?: boolean;
1494
+ /**
1495
+ * Hide the overflow button, for a host with no card actions of its own to offer.
1496
+ * @default false
1497
+ */
1498
+ hideMenuButton?: boolean;
1499
+ /**
1500
+ * A transaction in the drawer was pressed.
1501
+ */
1502
+ onTransactionSelected?: ((payload: { transactionId: string; }) => void);
1503
+ /**
1504
+ * View all was pressed. Open your own full transaction surface — the drawer never navigates.
1505
+ */
1506
+ onAllTransactionsRequested?: ((payload: { cardId: string; }) => void);
1507
+ /**
1508
+ * Top up was pressed. Present your own funding surface, such as the wallet's deposit element.
1509
+ */
1510
+ onTopUpRequested?: ((payload: { cardId: string; }) => void);
1511
+ /**
1512
+ * Close was pressed. Dismiss the surface you opened the drawer in — the drawer never closes itself.
1513
+ */
1514
+ onCloseRequested?: ((payload: { cardId: string; }) => void);
1515
+ /**
1516
+ * The overflow button was pressed. Present your own card actions menu.
1517
+ */
1518
+ onMenuRequested?: ((payload: { cardId: string; }) => void);
1519
+ /**
1520
+ * Runs after the loading skeleton first paints and before `onReady`.
1521
+ */
1522
+ onLoaderStart?: (() => void);
1523
+ /**
1524
+ * Runs after the element's first complete paint.
1525
+ */
1526
+ onReady?: (() => void);
1527
+ /**
1528
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1529
+ */
1530
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1531
+ }
1532
+
1533
+ /**
1534
+ * The overlay handle for "cardDetails". Returned by `createOverlay("cardDetails")`; drives the modal presentation imperatively.
1535
+ * @see https://docs.whop.com/elements/latest/wallet/cardDetails
1536
+ */
1537
+ export interface CardDetailsElementOverlayHandle {
1538
+ /**
1539
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
1540
+ */
1541
+ open(): void;
1542
+ /**
1543
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
1544
+ */
1545
+ close(): void;
1546
+ /**
1547
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1548
+ */
1549
+ destroy(): void;
1550
+ /**
1551
+ * Merges new props into the mounted element. In React, change the component props instead.
1552
+ */
1553
+ update(options: Partial<CardDetailsElementProps>): void;
1554
+ }
1555
+
1556
+ /**
1557
+ * Consumer props for the "verification" element. Set at create (or as `<VerificationElement />` JSX props), and updatable live via `update()`.
1558
+ * @see https://docs.whop.com/elements/latest/wallet/verification
1559
+ */
1560
+ export interface VerificationElementProps {
1561
+ /**
1562
+ * A scoped token for the read and for starting verification — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
1563
+ */
1564
+ accessToken?: string;
1565
+ /**
1566
+ * Which verification the button starts. `individual` (KYC) is what unlocks payouts and a Whop card. `business` (KYB) covers that and additionally unlocks financing and business cards — use it for a company that will need those.
1567
+ * @default "individual"
1568
+ */
1569
+ kind?: "individual" | "business";
1570
+ }
1571
+
1572
+ /**
1573
+ * The live handle for a mounted "verification" element. Returned by `create("verification")`; in React, the component's `ref`.
1574
+ * @see https://docs.whop.com/elements/latest/wallet/verification
1575
+ */
1576
+ export interface VerificationElementHandle {
1577
+ /**
1578
+ * Re-read the account. Call it when the viewer returns from verifying so the banner reflects the new state without waiting for the cache to expire.
1579
+ */
1580
+ refresh: () => Promise<void>;
1581
+ /**
1582
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1583
+ */
1584
+ mount: (target: string | HTMLElement) => void;
1585
+ /**
1586
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1587
+ */
1588
+ destroy: () => void;
1589
+ /**
1590
+ * Merges new props into the mounted element. In React, change the component props instead.
1591
+ */
1592
+ update: (options: Partial<VerificationElementProps>) => void;
1593
+ }
1594
+
1595
+ /**
1596
+ * Options for `create("verification")`: the consumer props plus event callbacks and lifecycle hooks.
1597
+ * @example
1598
+ * ```ts
1599
+ * const verification = wallet.create("verification", {}); // this interface: props + on<Event> callbacks
1600
+ * verification.mount("#wallet-verification");
1601
+ * ```
1602
+ * @see https://docs.whop.com/elements/latest/wallet/verification
1603
+ */
1604
+ export interface VerificationElementCreateOptions {
1605
+ /**
1606
+ * A scoped token for the read and for starting verification — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
1607
+ */
1608
+ accessToken?: string;
1609
+ /**
1610
+ * Which verification the button starts. `individual` (KYC) is what unlocks payouts and a Whop card. `business` (KYB) covers that and additionally unlocks financing and business cards — use it for a company that will need those.
1611
+ * @default "individual"
1612
+ */
1613
+ kind?: "individual" | "business";
1614
+ /**
1615
+ * The viewer pressed the verify button. The element never navigates — mount your own verification, such as the `verifications` controller, in answer to this.
1616
+ */
1617
+ onVerificationRequested?: ((payload: { accountId: string; }) => void);
1618
+ /**
1619
+ * Runs after the loading skeleton first paints and before `onReady`.
1620
+ */
1621
+ onLoaderStart?: (() => void);
1622
+ /**
1623
+ * Runs after the element's first complete paint.
1624
+ */
1625
+ onReady?: (() => void);
1626
+ /**
1627
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1628
+ */
1629
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1630
+ }
1631
+
1632
+ /**
1633
+ * Consumer props for the "balances" sub-controller: the `create("balances")` options and the minted sub handle's `update()` payload (React: `<Balances>` props). Parent-injected props never appear here.
1634
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1635
+ */
1636
+ export interface BalancesSubOptions {
1637
+ /**
1638
+ * A scoped token for balance breakdown and settlement reads. An account needs `company:balance:read`. Omitted, the viewer's same-origin session is used.
1639
+ */
1640
+ accessToken?: string;
1641
+ /**
1642
+ * Show this unit's holding balance page in place of the chart and list when a row is clicked. Off by default so a host that routes on `balanceSelected` is not covered by a second screen.
1643
+ * @default false
1644
+ */
1645
+ openHoldingOnSelect?: boolean;
1646
+ }
1647
+
1648
+ /**
1649
+ * Consumer props for the "balances" sub-controller's "balance" element.
1650
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1651
+ */
1652
+ export interface BalanceElementProps {
1653
+ /**
1654
+ * A scoped token for the reads. An account needs `company:balance:read` for the total and `stats:read` for the chart; a user's own balance needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`, and set a fresh one before it expires. Without it the reads use the viewer's own session, which only works same-origin.
1655
+ * @default ""
1656
+ */
1657
+ accessToken?: string;
1658
+ /**
1659
+ * The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
1660
+ * @default "1M"
1661
+ */
1662
+ range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
1663
+ /**
1664
+ * When the account was opened, as an ISO 8601 timestamp. `ALL` starts here instead of at its five-year default, so an account older than that keeps its full history.
1665
+ * @default ""
1666
+ */
1667
+ openedAt?: string;
1668
+ /**
1669
+ * Adds the account name to the label: `Total balance · Acme` normally, and `Acme balance on Jul 9` while the viewer reads a point. Without it the label is just `Total balance`.
1670
+ * @default ""
1671
+ */
1672
+ accountName?: string;
1673
+ /**
1674
+ * The selected range on the chart, as ISO 8601 timestamps. Set it to control the selection yourself, or `null` to clear the one the viewer made. Echo back what `rangeBrushed` reports, and clearing a filter elsewhere on your page clears the selection here too.
1675
+ * @default null
1676
+ */
1677
+ brush?: { from: string; to: string; } | null;
1678
+ /**
1679
+ * A moment to mark on the chart, as an ISO 8601 timestamp — the point something else on your page is pointing at, like the row under the pointer in an activity list. It reads like the viewer hovering that point themselves, and is ignored when it falls outside the window on screen or when they are reading the chart.
1680
+ * @default ""
1681
+ */
1682
+ markedAt?: string;
1683
+ /**
1684
+ * For a user, total their own money plus every account they own instead of their own money alone. Ignored for an account, which is a single account already.
1685
+ * @default false
1686
+ */
1687
+ includeOwnedAccounts?: boolean;
1688
+ /**
1689
+ * Hide the total and its change, leaving the chart and the range buttons.
1690
+ * @default false
1691
+ */
1692
+ hideTotal?: boolean;
1693
+ /**
1694
+ * Hide the chart, leaving the total and the range buttons.
1695
+ * @default false
1696
+ */
1697
+ hideChart?: boolean;
1698
+ /**
1699
+ * How tall the chart is drawn, in pixels.
1700
+ * @default 210
1701
+ */
1702
+ height?: number;
1703
+ }
1704
+
1705
+ /**
1706
+ * The live handle for a mounted "balance" element. Returned by the "balances" sub handle's `create("balance")`.
1707
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1708
+ */
1709
+ export interface BalanceElementHandle {
1710
+ /**
1711
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1712
+ */
1713
+ mount: (target: string | HTMLElement) => void;
1714
+ /**
1715
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1716
+ */
1717
+ destroy: () => void;
1718
+ /**
1719
+ * Merges new props into the mounted element. In React, change the component props instead.
1720
+ */
1721
+ update: (options: Partial<BalanceElementProps>) => void;
1722
+ }
1723
+
1724
+ /**
1725
+ * Options for the "balances" sub handle's `create("balance")`: the consumer props plus event callbacks and lifecycle hooks.
1726
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1727
+ */
1728
+ export interface BalanceElementCreateOptions {
1729
+ /**
1730
+ * A scoped token for the reads. An account needs `company:balance:read` for the total and `stats:read` for the chart; a user's own balance needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`, and set a fresh one before it expires. Without it the reads use the viewer's own session, which only works same-origin.
1731
+ * @default ""
1732
+ */
1733
+ accessToken?: string;
1734
+ /**
1735
+ * The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
1736
+ * @default "1M"
1737
+ */
1738
+ range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
1739
+ /**
1740
+ * When the account was opened, as an ISO 8601 timestamp. `ALL` starts here instead of at its five-year default, so an account older than that keeps its full history.
1741
+ * @default ""
1742
+ */
1743
+ openedAt?: string;
1744
+ /**
1745
+ * Adds the account name to the label: `Total balance · Acme` normally, and `Acme balance on Jul 9` while the viewer reads a point. Without it the label is just `Total balance`.
1746
+ * @default ""
1747
+ */
1748
+ accountName?: string;
1749
+ /**
1750
+ * The selected range on the chart, as ISO 8601 timestamps. Set it to control the selection yourself, or `null` to clear the one the viewer made. Echo back what `rangeBrushed` reports, and clearing a filter elsewhere on your page clears the selection here too.
1751
+ * @default null
1752
+ */
1753
+ brush?: { from: string; to: string; } | null;
1754
+ /**
1755
+ * A moment to mark on the chart, as an ISO 8601 timestamp — the point something else on your page is pointing at, like the row under the pointer in an activity list. It reads like the viewer hovering that point themselves, and is ignored when it falls outside the window on screen or when they are reading the chart.
1756
+ * @default ""
1757
+ */
1758
+ markedAt?: string;
1759
+ /**
1760
+ * For a user, total their own money plus every account they own instead of their own money alone. Ignored for an account, which is a single account already.
1761
+ * @default false
1762
+ */
1763
+ includeOwnedAccounts?: boolean;
1764
+ /**
1765
+ * Hide the total and its change, leaving the chart and the range buttons.
1766
+ * @default false
1767
+ */
1768
+ hideTotal?: boolean;
1769
+ /**
1770
+ * Hide the chart, leaving the total and the range buttons.
1771
+ * @default false
1772
+ */
1773
+ hideChart?: boolean;
1774
+ /**
1775
+ * How tall the chart is drawn, in pixels.
1776
+ * @default 210
1777
+ */
1778
+ height?: number;
1779
+ /**
1780
+ * The visible time range changed. Mirror it if something else on your page reads the same period.
1781
+ */
1782
+ onRangeChanged?: ((payload: { range: "1D" | "1W" | "1M" | "1Y" | "ALL"; }) => void);
1783
+ /**
1784
+ * The viewer dragged across the chart to select a range, or cleared the selection (`null`). Gives ISO 8601 timestamps plus the range they were read in, so you can filter your own views, like an activity list or a table, to the same period.
1785
+ */
1786
+ onRangeBrushed?: ((payload: { from: string; to: string; range: "1D" | "1W" | "1M" | "1Y" | "ALL"; } | null) => void);
1787
+ /**
1788
+ * Runs after the loading skeleton first paints and before `onReady`.
1789
+ */
1790
+ onLoaderStart?: (() => void);
1791
+ /**
1792
+ * Runs after the element's first complete paint.
1793
+ */
1794
+ onReady?: (() => void);
1795
+ /**
1796
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1797
+ */
1798
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1799
+ }
1800
+
1801
+ /**
1802
+ * Consumer props for the "balances" sub-controller's "breakdown" element.
1803
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1804
+ */
1805
+ export interface BreakdownElementProps {
1806
+ /**
1807
+ * Off, the element performs no reads and renders a zero balance.
1808
+ * @default true
1809
+ */
1810
+ enabled?: boolean;
1811
+ /**
1812
+ * Show amounts in the selected holding. Turn this off to value the same balance breakdown in USD.
1813
+ * @default true
1814
+ */
1815
+ showSourceCurrency?: boolean;
1816
+ /**
1817
+ * Show the currency title and total above the rows. Turn this off when the surface around it already shows them.
1818
+ * @default true
1819
+ */
1820
+ showTotal?: boolean;
1821
+ /**
1822
+ * Draw the surrounding page padding. Turn this off when the surface around it already provides it.
1823
+ * @default true
1824
+ */
1825
+ padded?: boolean;
1826
+ }
1827
+
1828
+ /**
1829
+ * The live handle for a mounted "breakdown" element. Returned by the "balances" sub handle's `create("breakdown")`.
1830
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1831
+ */
1832
+ export interface BreakdownElementHandle {
1833
+ /**
1834
+ * Re-fetch the balance after the host moves money.
1835
+ */
1836
+ refresh: () => Promise<void>;
1837
+ /**
1838
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1839
+ */
1840
+ mount: (target: string | HTMLElement) => void;
1841
+ /**
1842
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1843
+ */
1844
+ destroy: () => void;
1845
+ /**
1846
+ * Merges new props into the mounted element. In React, change the component props instead.
1847
+ */
1848
+ update: (options: Partial<BreakdownElementProps>) => void;
1849
+ }
1850
+
1851
+ /**
1852
+ * Options for the "balances" sub handle's `create("breakdown")`: the consumer props plus event callbacks and lifecycle hooks.
1853
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1854
+ */
1855
+ export interface BreakdownElementCreateOptions {
1856
+ /**
1857
+ * Off, the element performs no reads and renders a zero balance.
1858
+ * @default true
1859
+ */
1860
+ enabled?: boolean;
1861
+ /**
1862
+ * Show amounts in the selected holding. Turn this off to value the same balance breakdown in USD.
1863
+ * @default true
1864
+ */
1865
+ showSourceCurrency?: boolean;
1866
+ /**
1867
+ * Show the currency title and total above the rows. Turn this off when the surface around it already shows them.
1868
+ * @default true
1869
+ */
1870
+ showTotal?: boolean;
1871
+ /**
1872
+ * Draw the surrounding page padding. Turn this off when the surface around it already provides it.
1873
+ * @default true
1874
+ */
1875
+ padded?: boolean;
1876
+ /**
1877
+ * A balance row or its matching bar segment was clicked. The host can open details for `available`, `pending`, `reserve`, or `debt`.
1878
+ */
1879
+ onBreakdownSelected?: ((payload: { category: "pending" | "available" | "debt" | "reserve"; }) => void);
1880
+ /**
1881
+ * Runs after the loading skeleton first paints and before `onReady`.
1882
+ */
1883
+ onLoaderStart?: (() => void);
1884
+ /**
1885
+ * Runs after the element's first complete paint.
1886
+ */
1887
+ onReady?: (() => void);
1888
+ /**
1889
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1890
+ */
1891
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1892
+ }
1893
+
1894
+ /**
1895
+ * Consumer props for the "balances" sub-controller's "settlement" element.
1896
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1897
+ */
1898
+ export interface SettlementElementProps {
1899
+ /**
1900
+ * Off, the Element performs no read and renders an empty details state.
1901
+ * @default true
1902
+ */
1903
+ enabled?: boolean;
1904
+ /**
1905
+ * Show amounts in the selected holding. Turn this off to value the details in USD.
1906
+ * @default true
1907
+ */
1908
+ showSourceCurrency?: boolean;
1909
+ }
1910
+
1911
+ /**
1912
+ * The live handle for a mounted "settlement" element. Returned by the "balances" sub handle's `create("settlement")`.
1913
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1914
+ */
1915
+ export interface SettlementElementHandle {
1916
+ /**
1917
+ * Re-fetch settlement and reserve details.
1918
+ */
1919
+ refresh: () => Promise<void>;
1920
+ /**
1921
+ * Mounts the element in `target` and starts loading. React components mount themselves.
1922
+ */
1923
+ mount: (target: string | HTMLElement) => void;
1924
+ /**
1925
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1926
+ */
1927
+ destroy: () => void;
1928
+ /**
1929
+ * Merges new props into the mounted element. In React, change the component props instead.
1930
+ */
1931
+ update: (options: Partial<SettlementElementProps>) => void;
1932
+ }
1933
+
1934
+ /**
1935
+ * Options for the "balances" sub handle's `create("settlement")`: the consumer props plus event callbacks and lifecycle hooks.
1936
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1937
+ */
1938
+ export interface SettlementElementCreateOptions {
1939
+ /**
1940
+ * Off, the Element performs no read and renders an empty details state.
1941
+ * @default true
1942
+ */
1943
+ enabled?: boolean;
1944
+ /**
1945
+ * Show amounts in the selected holding. Turn this off to value the details in USD.
1946
+ * @default true
1947
+ */
1948
+ showSourceCurrency?: boolean;
1949
+ /**
1950
+ * Runs after the loading skeleton first paints and before `onReady`.
1951
+ */
1952
+ onLoaderStart?: (() => void);
1953
+ /**
1954
+ * Runs after the element's first complete paint.
1955
+ */
1956
+ onReady?: (() => void);
1957
+ /**
1958
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
1959
+ */
1960
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
1961
+ }
1962
+
1963
+ /**
1964
+ * The overlay handle for the "balances" sub-controller's "settlement" element.
1965
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1966
+ */
1967
+ export interface SettlementElementOverlayHandle {
1968
+ /**
1969
+ * Open the overlay. The first call mounts the element. Later calls reuse it.
1970
+ */
1971
+ open(): void;
1972
+ /**
1973
+ * Close the overlay without destroying it. Keep the handle and `open()` again.
1974
+ */
1975
+ close(): void;
1976
+ /**
1977
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
1978
+ */
1979
+ destroy(): void;
1980
+ /**
1981
+ * Merges new props into the mounted element. In React, change the component props instead.
1982
+ */
1983
+ update(options: Partial<SettlementElementProps>): void;
1984
+ }
1985
+
1986
+ /**
1987
+ * Consumer props for the "balances" sub-controller's "list" element.
1988
+ * @see https://docs.whop.com/elements/latest/wallet/overview
1989
+ */
1990
+ export interface ListElementProps {
1991
+ /**
1992
+ * A scoped token for the read. An account needs `company:balance:read`; a user's holdings or owned-account list needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
1993
+ */
1994
+ accessToken?: string;
1995
+ /**
1996
+ * For a user's `user_…` account, list their personal balance followed by every owned account the backend returns instead of listing the holdings inside their personal account. Ignored for an account.
1997
+ * @default false
1998
+ */
1999
+ includeOwnedAccounts?: boolean;
2000
+ /**
2001
+ * Show each row in the currency it is held in (€4.20, 0.00000009 cbBTC) and put the dollar value underneath. Off by default, so every row is in dollars.
2002
+ * @default false
2003
+ */
2004
+ showSourceCurrency?: boolean;
2005
+ /**
2006
+ * Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
2007
+ * @default true
2008
+ */
2009
+ showUsdEquivalent?: boolean;
2010
+ /**
2011
+ * Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
2012
+ * @default true
2013
+ */
2014
+ showPersonalAccount?: boolean;
2015
+ /**
2016
+ * Show at most this many holding rows, largest first. When there are more, the list gains a Show all balances control that expands the rest in place. Without it every holding is listed.
2017
+ */
2018
+ maxItems?: number;
2019
+ }
2020
+
2021
+ /**
2022
+ * The live handle for a mounted "list" element. Returned by the "balances" sub handle's `create("list")`.
2023
+ * @see https://docs.whop.com/elements/latest/wallet/overview
2024
+ */
2025
+ export interface ListElementHandle {
2026
+ /**
2027
+ * Mounts the element in `target` and starts loading. React components mount themselves.
2028
+ */
2029
+ mount: (target: string | HTMLElement) => void;
2030
+ /**
2031
+ * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
2032
+ */
2033
+ destroy: () => void;
2034
+ /**
2035
+ * Merges new props into the mounted element. In React, change the component props instead.
2036
+ */
2037
+ update: (options: Partial<ListElementProps>) => void;
2038
+ }
2039
+
2040
+ /**
2041
+ * Options for the "balances" sub handle's `create("list")`: the consumer props plus event callbacks and lifecycle hooks.
2042
+ * @see https://docs.whop.com/elements/latest/wallet/overview
2043
+ */
2044
+ export interface ListElementCreateOptions {
573
2045
  /**
574
- * A supported payout method was selected and its exact required fields should be loaded.
2046
+ * A scoped token for the read. An account needs `company:balance:read`; a user's holdings or owned-account list needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
575
2047
  */
576
- onSupportedMethodChanged?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
2048
+ accessToken?: string;
577
2049
  /**
578
- * The payer submitted the dynamic add-payout-method form.
2050
+ * For a user's `user_…` account, list their personal balance followed by every owned account the backend returns instead of listing the holdings inside their personal account. Ignored for an account.
2051
+ * @default false
579
2052
  */
580
- onAddMethodRequested?: ((payload: WithdrawalCreateMethodInput) => void);
2053
+ includeOwnedAccounts?: boolean;
581
2054
  /**
582
- * The payer chose to link their bank through Plaid instead of typing details. Open Plaid Link on receipt.
2055
+ * Show each row in the currency it is held in (€4.20, 0.00000009 cbBTC) and put the dollar value underneath. Off by default, so every row is in dollars.
2056
+ * @default false
583
2057
  */
584
- onPlaidLinkRequested?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
2058
+ showSourceCurrency?: boolean;
585
2059
  /**
586
- * The newly added payout method finished its verification step.
2060
+ * Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
2061
+ * @default true
587
2062
  */
588
- onMethodVerificationCompleted?: ((payload: Record<string, never>) => void);
2063
+ showUsdEquivalent?: boolean;
589
2064
  /**
590
- * The payer requested to rename a saved payout method.
2065
+ * Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
2066
+ * @default true
591
2067
  */
592
- onRenameMethodRequested?: ((payload: { methodId: string; }) => void);
2068
+ showPersonalAccount?: boolean;
593
2069
  /**
594
- * The payer requested to remove a saved payout method.
2070
+ * Show at most this many holding rows, largest first. When there are more, the list gains a Show all balances control that expands the rest in place. Without it every holding is listed.
595
2071
  */
596
- onRemoveMethodRequested?: ((payload: { methodId: string; }) => void);
2072
+ maxItems?: number;
597
2073
  /**
598
- * The payer confirmed the final payout details. Create the payout on receipt.
2074
+ * A holding row was clicked, with `includeOwnedAccounts` off. `holding` is `usd` for the combined dollar row, otherwise the holding symbol (`cbBTC`, `EUR`), and `kind` tells you which of the three it is so you can route without classifying symbols yourself. The element never navigates.
599
2075
  */
600
- onWithdrawalRequested?: ((payload: WithdrawalRequest) => void);
2076
+ onBalanceSelected?: ((payload: { holding: string; kind: "usd" | "cash" | "asset"; }) => void);
601
2077
  /**
602
- * The payer finished reviewing a successful payout.
2078
+ * An account row was clicked, with `includeOwnedAccounts` on. `accountId` is the personal `user_…` tag or an owned `biz_…` tag, and `kind` lets you route without inspecting it. The element never navigates.
603
2079
  */
604
- onDone?: ((payload: Record<string, never>) => void);
2080
+ onAccountSelected?: ((payload: { accountId: string; kind: "business" | "personal"; }) => void);
605
2081
  /**
606
2082
  * Runs after the loading skeleton first paints and before `onReady`.
607
2083
  */
@@ -617,66 +2093,85 @@ export interface WithdrawElementCreateOptions {
617
2093
  }
618
2094
 
619
2095
  /**
620
- * The overlay handle for "withdraw". Returned by `createOverlay("withdraw")`; drives the modal presentation imperatively.
621
- * @see https://docs.whop.com/elements/latest/wallet/withdraw
2096
+ * The "balances" sub-handle, minted by `handle.create("balances", …)`. Mounts the sub-controller's elements and carries its actions.
2097
+ * @see https://docs.whop.com/elements/latest/wallet/overview
622
2098
  */
623
- export interface WithdrawElementOverlayHandle {
2099
+ export interface BalancesSubHandle {
624
2100
  /**
625
- * Open the overlay. The first call mounts the element. Later calls reuse it.
2101
+ * An account's balance and a chart of how it changed. The total and its change sit at the top, the chart below that, and the time range buttons at the bottom. The viewer can read individual points on the chart and switch the time range themselves.
626
2102
  */
627
- open(): void;
2103
+ create(name: "balance", options?: BalanceElementCreateOptions): BalanceElementHandle;
628
2104
  /**
629
- * Close the overlay without destroying it. Keep the handle and `open()` again.
2105
+ * One currency's total split into available, pending, reserve, and negative balances. Zero-value rows disappear, and the surface deliberately contains no money-movement buttons so the host owns those actions.
630
2106
  */
631
- close(): void;
2107
+ create(name: "breakdown", options?: BreakdownElementCreateOptions): BreakdownElementHandle;
632
2108
  /**
633
- * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
2109
+ * The account balance details shown by Whop's dashboard: available funds, pending settlement dates, reserve terms, and any negative balance. It opens as a 550px modal and uses the balances handle's account, currency, and credential.
634
2110
  */
635
- destroy(): void;
2111
+ createOverlay(name: "settlement", options?: SettlementElementCreateOptions): SettlementElementOverlayHandle;
636
2112
  /**
637
- * Merges new props into the mounted element. In React, change the component props instead.
2113
+ * The holdings behind an account's balance. Every currency and token gets its own row, showing its name and its value in dollars, largest first. Rows can report which one the viewer tapped, so you can open your own screen for it. When `openHoldingOnSelect` is on, a row click shows that holding's balance page in place of this unit's chart and list.
638
2114
  */
639
- update(options: Partial<WithdrawElementProps>): void;
2115
+ create(name: "list", options?: ListElementCreateOptions): ListElementHandle;
2116
+ /**
2117
+ * Merges new props and callbacks into the sub-controller.
2118
+ */
2119
+ update(options: Partial<BalancesSubOptions>): void;
2120
+ /**
2121
+ * Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("balances")` starts fresh.
2122
+ */
2123
+ destroy(): void;
640
2124
  }
641
2125
 
642
2126
  /**
643
- * Consumer props for the "send" element. Set at create (or as `<SendElement />` JSX props), and updatable live via `update()`.
644
- * @see https://docs.whop.com/elements/latest/wallet/send
2127
+ * Consumer props for the "cards" sub-controller: the `create("cards")` options and the minted sub handle's `update()` payload (React: `<Cards>` props). Parent-injected props never appear here.
2128
+ * @see https://docs.whop.com/elements/latest/wallet/overview
645
2129
  */
646
- export interface SendElementProps {
2130
+ export interface CardsSubOptions {
647
2131
  /**
648
- * A scoped token for the privileged read/write — needs `payout:withdraw_funds` (plus `company:authorized_user:read` and `member:basic:read` for recipient search, `airdrop_link:manage` for claim links). Omitted, the read carries the viewer's own session, which only answers same-origin.
2132
+ * A scoped token for the card reads. Card rows need `payout:account:read`; cardholder names also need `company:authorized_user:read`. Omitted, the viewer's same-origin session is used, which only answers same-origin.
649
2133
  */
650
2134
  accessToken?: string;
2135
+ }
2136
+
2137
+ /**
2138
+ * Consumer props for the "cards" sub-controller's "cards" element.
2139
+ * @see https://docs.whop.com/elements/latest/wallet/overview
2140
+ */
2141
+ export interface CardsElementProps {
651
2142
  /**
652
- * Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
653
- * @default true
2143
+ * A scoped token for the privileged read and verification start — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
654
2144
  */
655
- canSearchRecipients?: boolean;
2145
+ accessToken?: string;
656
2146
  /**
657
- * Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
2147
+ * Off, the element fetches nothing and keeps the title and "+" button visible with an empty body — for a host that only wants to fetch once some precondition (card issuing being active for this account, say) is true.
658
2148
  * @default true
659
2149
  */
660
- canCreateLink?: boolean;
2150
+ enabled?: boolean;
661
2151
  /**
662
- * Skip the picker and open straight onto this recipient's amount screen — for a "pay this person" action row. No back button is shown in that case, matching there being no picker behind it.
2152
+ * Cap the rows shown, most recently issued first. `null` shows every active card.
663
2153
  * @default null
664
2154
  */
665
- initialRecipient?: SendRecipient | null;
2155
+ limit?: number | null;
666
2156
  /**
667
- * Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
668
- * @default ""
2157
+ * Render the title as plain, unclickable text instead of a click target. Off by default, in which case clicking the title emits `viewAllSelected` for you to route to the full cards list — the element never navigates.
2158
+ * @default false
669
2159
  */
670
- initialCurrency?: string;
2160
+ disableRedirect?: boolean;
2161
+ /**
2162
+ * Hide the "+" button. Off by default, in which case clicking it emits `addCardRequested`.
2163
+ * @default false
2164
+ */
2165
+ hideAddButton?: boolean;
671
2166
  }
672
2167
 
673
2168
  /**
674
- * The live handle for a mounted "send" element. Returned by `create("send")`; in React, the component's `ref`.
675
- * @see https://docs.whop.com/elements/latest/wallet/send
2169
+ * The live handle for a mounted "cards" element. Returned by the "cards" sub handle's `create("cards")`.
2170
+ * @see https://docs.whop.com/elements/latest/wallet/overview
676
2171
  */
677
- export interface SendElementHandle {
2172
+ export interface CardsElementHandle {
678
2173
  /**
679
- * Re-fetch the account's balances and recipient list. Call it after anything on your side changes what it can offer.
2174
+ * Re-fetch the account's cards. Call it after a mutation made elsewhere (rename, freeze, cancel, a new card) so the list reflects it without waiting for the cache to expire.
680
2175
  */
681
2176
  refresh: () => Promise<void>;
682
2177
  /**
@@ -690,59 +2185,54 @@ export interface SendElementHandle {
690
2185
  /**
691
2186
  * Merges new props into the mounted element. In React, change the component props instead.
692
2187
  */
693
- update: (options: Partial<SendElementProps>) => void;
2188
+ update: (options: Partial<CardsElementProps>) => void;
694
2189
  }
695
2190
 
696
2191
  /**
697
- * Options for `create("send")`: the consumer props plus event callbacks and lifecycle hooks.
698
- * @example
699
- * ```ts
700
- * const send = wallet.create("send", {}); // this interface: props + on<Event> callbacks
701
- * send.mount("#wallet-send");
702
- * ```
703
- * @see https://docs.whop.com/elements/latest/wallet/send
2192
+ * Options for the "cards" sub handle's `create("cards")`: the consumer props plus event callbacks and lifecycle hooks.
2193
+ * @see https://docs.whop.com/elements/latest/wallet/overview
704
2194
  */
705
- export interface SendElementCreateOptions {
2195
+ export interface CardsElementCreateOptions {
706
2196
  /**
707
- * A scoped token for the privileged read/write — needs `payout:withdraw_funds` (plus `company:authorized_user:read` and `member:basic:read` for recipient search, `airdrop_link:manage` for claim links). Omitted, the read carries the viewer's own session, which only answers same-origin.
2197
+ * A scoped token for the privileged read and verification start — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
708
2198
  */
709
2199
  accessToken?: string;
710
2200
  /**
711
- * Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
2201
+ * Off, the element fetches nothing and keeps the title and "+" button visible with an empty body — for a host that only wants to fetch once some precondition (card issuing being active for this account, say) is true.
712
2202
  * @default true
713
2203
  */
714
- canSearchRecipients?: boolean;
2204
+ enabled?: boolean;
715
2205
  /**
716
- * Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
717
- * @default true
2206
+ * Cap the rows shown, most recently issued first. `null` shows every active card.
2207
+ * @default null
718
2208
  */
719
- canCreateLink?: boolean;
2209
+ limit?: number | null;
720
2210
  /**
721
- * Skip the picker and open straight onto this recipient's amount screen — for a "pay this person" action row. No back button is shown in that case, matching there being no picker behind it.
722
- * @default null
2211
+ * Render the title as plain, unclickable text instead of a click target. Off by default, in which case clicking the title emits `viewAllSelected` for you to route to the full cards list — the element never navigates.
2212
+ * @default false
723
2213
  */
724
- initialRecipient?: SendRecipient | null;
2214
+ disableRedirect?: boolean;
725
2215
  /**
726
- * Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
727
- * @default ""
2216
+ * Hide the "+" button. Off by default, in which case clicking it emits `addCardRequested`.
2217
+ * @default false
728
2218
  */
729
- initialCurrency?: string;
2219
+ hideAddButton?: boolean;
730
2220
  /**
731
- * The visible screen changed.
2221
+ * A card row was clicked. Open your own card details for it — the element never navigates.
732
2222
  */
733
- onStepChanged?: ((payload: { step: "success" | "enter_amount" | "select_recipient" | "create_link" | "link_success"; }) => void);
2223
+ onCardSelected?: ((payload: { cardId: string; }) => void);
734
2224
  /**
735
- * A transfer succeeded. Refresh anything on your side reading the account's balance or activity.
2225
+ * The title was clicked. Only fires when `disableRedirect` is false.
736
2226
  */
737
- onSendCompleted?: ((payload: { recipient: SendRecipient; amount: number; currency: string; }) => void);
2227
+ onViewAllSelected?: ((payload: Record<string, never>) => void);
738
2228
  /**
739
- * A claim link was created. Refresh anything on your side reading the account's balance.
2229
+ * The "+" button was clicked. Only fires when `hideAddButton` is false.
740
2230
  */
741
- onLinkCreated?: ((payload: { claimUrl: string; amount: number; redeemableCount: number; }) => void);
2231
+ onAddCardRequested?: ((payload: Record<string, never>) => void);
742
2232
  /**
743
- * The viewer clicked "Done" on a success screen — close the surface holding it.
2233
+ * The viewer pressed the verify button on an account with no card program. The element starts the hosted session and leaves for it itself — this fires alongside, so a host can record the trip or show its own state.
744
2234
  */
745
- onDone?: ((payload: Record<string, never>) => void);
2235
+ onVerificationRequested?: ((payload: { accountId: string; }) => void);
746
2236
  /**
747
2237
  * Runs after the loading skeleton first paints and before `onReady`.
748
2238
  */
@@ -758,66 +2248,128 @@ export interface SendElementCreateOptions {
758
2248
  }
759
2249
 
760
2250
  /**
761
- * The overlay handle for "send". Returned by `createOverlay("send")`; drives the modal presentation imperatively.
762
- * @see https://docs.whop.com/elements/latest/wallet/send
2251
+ * Consumer props for the "cards" sub-controller's "cardsTable" element.
2252
+ * @see https://docs.whop.com/elements/latest/wallet/overview
763
2253
  */
764
- export interface SendElementOverlayHandle {
2254
+ export interface CardsTableElementProps {
765
2255
  /**
766
- * Open the overlay. The first call mounts the element. Later calls reuse it.
2256
+ * A scoped token for the privileged reads. Card rows need `payout:account:read`; cardholder names also need `company:authorized_user:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
767
2257
  */
768
- open(): void;
2258
+ accessToken?: string;
769
2259
  /**
770
- * Close the overlay without destroying it. Keep the handle and `open()` again.
2260
+ * Off, the element does not fetch and renders its shell with no card rows.
2261
+ * @default true
771
2262
  */
772
- close(): void;
2263
+ enabled?: boolean;
2264
+ /**
2265
+ * Hide the create virtual card button. Off by default.
2266
+ * @default false
2267
+ */
2268
+ hideCreateButton?: boolean;
2269
+ /**
2270
+ * Show last month's spend. Turn this off when the viewer may see cards but not account financials.
2271
+ * @default true
2272
+ */
2273
+ showFinancials?: boolean;
2274
+ }
2275
+
2276
+ /**
2277
+ * The live handle for a mounted "cardsTable" element. Returned by the "cards" sub handle's `create("cardsTable")`.
2278
+ * @see https://docs.whop.com/elements/latest/wallet/overview
2279
+ */
2280
+ export interface CardsTableElementHandle {
2281
+ /**
2282
+ * Re-fetch the cards and cardholders after the host creates, freezes, cancels, or renames a card.
2283
+ */
2284
+ refresh: () => Promise<void>;
2285
+ /**
2286
+ * Mounts the element in `target` and starts loading. React components mount themselves.
2287
+ */
2288
+ mount: (target: string | HTMLElement) => void;
773
2289
  /**
774
2290
  * Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
775
2291
  */
776
- destroy(): void;
2292
+ destroy: () => void;
777
2293
  /**
778
2294
  * Merges new props into the mounted element. In React, change the component props instead.
779
2295
  */
780
- update(options: Partial<SendElementProps>): void;
2296
+ update: (options: Partial<CardsTableElementProps>) => void;
781
2297
  }
782
2298
 
783
2299
  /**
784
- * Consumer props for the "cards" element. Set at create (or as `<CardsElement />` JSX props), and updatable live via `update()`.
785
- * @see https://docs.whop.com/elements/latest/wallet/cards
2300
+ * Options for the "cards" sub handle's `create("cardsTable")`: the consumer props plus event callbacks and lifecycle hooks.
2301
+ * @see https://docs.whop.com/elements/latest/wallet/overview
786
2302
  */
787
- export interface CardsElementProps {
2303
+ export interface CardsTableElementCreateOptions {
788
2304
  /**
789
- * A scoped token for the privileged read and verification start — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
2305
+ * A scoped token for the privileged reads. Card rows need `payout:account:read`; cardholder names also need `company:authorized_user:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
790
2306
  */
791
2307
  accessToken?: string;
792
2308
  /**
793
- * Off, the element fetches nothing and keeps the title and "+" button visible with an empty body — for a host that only wants to fetch once some precondition (card issuing being active for this account, say) is true.
2309
+ * Off, the element does not fetch and renders its shell with no card rows.
794
2310
  * @default true
795
2311
  */
796
2312
  enabled?: boolean;
797
2313
  /**
798
- * Cap the rows shown, most recently issued first. `null` shows every active card.
799
- * @default null
2314
+ * Hide the create virtual card button. Off by default.
2315
+ * @default false
800
2316
  */
801
- limit?: number | null;
2317
+ hideCreateButton?: boolean;
802
2318
  /**
803
- * Render the title as plain, unclickable text instead of a click target. Off by default, in which case clicking the title emits `viewAllSelected` for you to route to the full cards list — the element never navigates.
804
- * @default false
2319
+ * Show last month's spend. Turn this off when the viewer may see cards but not account financials.
2320
+ * @default true
805
2321
  */
806
- disableRedirect?: boolean;
2322
+ showFinancials?: boolean;
807
2323
  /**
808
- * Hide the "+" button. Off by default, in which case clicking it emits `addCardRequested`.
809
- * @default false
2324
+ * A row was clicked. Open the host-owned card details experience for this card.
810
2325
  */
811
- hideAddButton?: boolean;
2326
+ onCardSelected?: ((payload: { cardId: string; }) => void);
2327
+ /**
2328
+ * The create virtual card button was clicked.
2329
+ */
2330
+ onCreateCardRequested?: ((payload: Record<string, never>) => void);
2331
+ /**
2332
+ * Runs after the loading skeleton first paints and before `onReady`.
2333
+ */
2334
+ onLoaderStart?: (() => void);
2335
+ /**
2336
+ * Runs after the element's first complete paint.
2337
+ */
2338
+ onReady?: (() => void);
2339
+ /**
2340
+ * Runs when the element fails to load or crashes. The fallback remains visible. Use `code` for programmatic handling. `sourceKey` identifies a failed host-state source.
2341
+ */
2342
+ onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
812
2343
  }
813
2344
 
814
2345
  /**
815
- * The live handle for a mounted "cards" element. Returned by `create("cards")`; in React, the component's `ref`.
816
- * @see https://docs.whop.com/elements/latest/wallet/cards
2346
+ * Consumer props for the "cards" sub-controller's "cardsChart" element.
2347
+ * @see https://docs.whop.com/elements/latest/wallet/overview
817
2348
  */
818
- export interface CardsElementHandle {
2349
+ export interface CardsChartElementProps {
819
2350
  /**
820
- * Re-fetch the account's cards. Call it after a mutation made elsewhere (rename, freeze, cancel, a new card) so the list reflects it without waiting for the cache to expire.
2351
+ * A scoped token for card transaction reads. Needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
2352
+ */
2353
+ accessToken?: string;
2354
+ /**
2355
+ * Off, the chart performs no reads and renders an empty plot.
2356
+ * @default true
2357
+ */
2358
+ enabled?: boolean;
2359
+ /**
2360
+ * The initial reporting window: `7d`, `1m`, `3m`, `ytd`, or `1y`.
2361
+ * @default "1m"
2362
+ */
2363
+ period?: "7d" | "1m" | "3m" | "ytd" | "1y";
2364
+ }
2365
+
2366
+ /**
2367
+ * The live handle for a mounted "cardsChart" element. Returned by the "cards" sub handle's `create("cardsChart")`.
2368
+ * @see https://docs.whop.com/elements/latest/wallet/overview
2369
+ */
2370
+ export interface CardsChartElementHandle {
2371
+ /**
2372
+ * Re-fetch the selected spend window.
821
2373
  */
822
2374
  refresh: () => Promise<void>;
823
2375
  /**
@@ -831,59 +2383,36 @@ export interface CardsElementHandle {
831
2383
  /**
832
2384
  * Merges new props into the mounted element. In React, change the component props instead.
833
2385
  */
834
- update: (options: Partial<CardsElementProps>) => void;
2386
+ update: (options: Partial<CardsChartElementProps>) => void;
835
2387
  }
836
2388
 
837
2389
  /**
838
- * Options for `create("cards")`: the consumer props plus event callbacks and lifecycle hooks.
839
- * @example
840
- * ```ts
841
- * const cards = wallet.create("cards", {}); // this interface: props + on<Event> callbacks
842
- * cards.mount("#wallet-cards");
843
- * ```
844
- * @see https://docs.whop.com/elements/latest/wallet/cards
2390
+ * Options for the "cards" sub handle's `create("cardsChart")`: the consumer props plus event callbacks and lifecycle hooks.
2391
+ * @see https://docs.whop.com/elements/latest/wallet/overview
845
2392
  */
846
- export interface CardsElementCreateOptions {
2393
+ export interface CardsChartElementCreateOptions {
847
2394
  /**
848
- * A scoped token for the privileged read and verification start — needs `payout:account:read` and `identity:write`. Mint it on your server with `POST /api/v1/access_tokens`. Omitted, the calls carry the viewer's own session, which only answers same-origin.
2395
+ * A scoped token for card transaction reads. Needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
849
2396
  */
850
2397
  accessToken?: string;
851
2398
  /**
852
- * Off, the element fetches nothing and keeps the title and "+" button visible with an empty body — for a host that only wants to fetch once some precondition (card issuing being active for this account, say) is true.
2399
+ * Off, the chart performs no reads and renders an empty plot.
853
2400
  * @default true
854
2401
  */
855
2402
  enabled?: boolean;
856
2403
  /**
857
- * Cap the rows shown, most recently issued first. `null` shows every active card.
858
- * @default null
859
- */
860
- limit?: number | null;
861
- /**
862
- * Render the title as plain, unclickable text instead of a click target. Off by default, in which case clicking the title emits `viewAllSelected` for you to route to the full cards list — the element never navigates.
863
- * @default false
864
- */
865
- disableRedirect?: boolean;
866
- /**
867
- * Hide the "+" button. Off by default, in which case clicking it emits `addCardRequested`.
868
- * @default false
869
- */
870
- hideAddButton?: boolean;
871
- /**
872
- * A card row was clicked. Open your own card details for it — the element never navigates.
873
- */
874
- onCardSelected?: ((payload: { cardId: string; }) => void);
875
- /**
876
- * The title was clicked. Only fires when `disableRedirect` is false.
2404
+ * The initial reporting window: `7d`, `1m`, `3m`, `ytd`, or `1y`.
2405
+ * @default "1m"
877
2406
  */
878
- onViewAllSelected?: ((payload: Record<string, never>) => void);
2407
+ period?: "7d" | "1m" | "3m" | "ytd" | "1y";
879
2408
  /**
880
- * The "+" button was clicked. Only fires when `hideAddButton` is false.
2409
+ * The viewer selected a new reporting window. The chart has already updated itself.
881
2410
  */
882
- onAddCardRequested?: ((payload: Record<string, never>) => void);
2411
+ onPeriodChanged?: ((payload: { period: "7d" | "1m" | "3m" | "ytd" | "1y"; }) => void);
883
2412
  /**
884
- * The viewer pressed the verify button on an account with no card program. The element starts the hosted session and leaves for it itself — this fires alongside, so a host can record the trip or show its own state.
2413
+ * The viewer selected or cleared a daily bar. Dates use `YYYY-MM-DD` in UTC.
885
2414
  */
886
- onVerificationRequested?: ((payload: { accountId: string; }) => void);
2415
+ onDateSelected?: ((payload: { date: string | null; }) => void);
887
2416
  /**
888
2417
  * Runs after the loading skeleton first paints and before `onReady`.
889
2418
  */
@@ -899,73 +2428,46 @@ export interface CardsElementCreateOptions {
899
2428
  }
900
2429
 
901
2430
  /**
902
- * Consumer props for the "balances" sub-controller: the `create("balances")` options and the minted sub handle's `update()` payload (React: `<Balances>` props). Parent-injected props never appear here.
903
- * @see https://docs.whop.com/elements/latest/wallet/overview
904
- */
905
- export interface BalancesSubOptions {}
906
-
907
- /**
908
- * Consumer props for the "balances" sub-controller's "balance" element.
2431
+ * Consumer props for the "cards" sub-controller's "whopCard" element.
909
2432
  * @see https://docs.whop.com/elements/latest/wallet/overview
910
2433
  */
911
- export interface BalanceElementProps {
2434
+ export interface WhopCardElementProps {
912
2435
  /**
913
- * A scoped token for the reads. An account needs `company:balance:read` for the total and `stats:read` for the chart; a user's own balance needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`, and set a fresh one before it expires. Without it the reads use the viewer's own session, which only works same-origin.
914
- * @default ""
2436
+ * A scoped token for card access. Omitted calls carry the viewer session when same-origin. Secrets are returned only when the API authorizes the viewer.
915
2437
  */
916
2438
  accessToken?: string;
917
2439
  /**
918
- * The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
919
- * @default "1M"
920
- */
921
- range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
922
- /**
923
- * When the account was opened, as an ISO 8601 timestamp. `ALL` starts here instead of at its five-year default, so an account older than that keeps its full history.
924
- * @default ""
925
- */
926
- openedAt?: string;
927
- /**
928
- * Adds the account name to the label: `Total balance · Acme` normally, and `Acme balance on Jul 9` while the viewer reads a point. Without it the label is just `Total balance`.
929
- * @default ""
930
- */
931
- accountName?: string;
932
- /**
933
- * The selected range on the chart, as ISO 8601 timestamps. Set it to control the selection yourself, or `null` to clear the one the viewer made. Echo back what `rangeBrushed` reports, and clearing a filter elsewhere on your page clears the selection here too.
934
- * @default null
935
- */
936
- brush?: { from: string; to: string; } | null;
937
- /**
938
- * A moment to mark on the chart, as an ISO 8601 timestamp — the point something else on your page is pointing at, like the row under the pointer in an activity list. It reads like the viewer hovering that point themselves, and is ignored when it falls outside the window on screen or when they are reading the chart.
2440
+ * Issued card ID, prefixed `icrd_`.
939
2441
  * @default ""
940
2442
  */
941
- markedAt?: string;
2443
+ cardId?: string;
942
2444
  /**
943
- * For a user, total their own money plus every account they own instead of their own money alone. Ignored for an account, which is a single account already.
2445
+ * Hide the View details and Lock card buttons. The card itself remains clickable to reveal details.
944
2446
  * @default false
945
2447
  */
946
- includeOwnedAccounts?: boolean;
2448
+ hideControls?: boolean;
947
2449
  /**
948
- * Hide the total and its change, leaving the chart and the range buttons.
2450
+ * Disable the lock control while keeping it visible. Useful when a host has temporarily frozen card actions.
949
2451
  * @default false
950
2452
  */
951
- hideTotal?: boolean;
2453
+ disableLock?: boolean;
952
2454
  /**
953
- * Hide the chart, leaving the total and the range buttons.
2455
+ * Hide the Add to Apple Wallet button. It is shown for active and locked cards by default.
954
2456
  * @default false
955
2457
  */
956
- hideChart?: boolean;
2458
+ hideAppleWalletButton?: boolean;
957
2459
  /**
958
- * How tall the chart is drawn, in pixels.
959
- * @default 210
2460
+ * Direct-mode integration option. Emits `lockRequested` without updating the card so a first-party host can retain its confirmation flow.
2461
+ * @default false
960
2462
  */
961
- height?: number;
2463
+ deferLockToHost?: boolean;
962
2464
  }
963
2465
 
964
2466
  /**
965
- * The live handle for a mounted "balance" element. Returned by the "balances" sub handle's `create("balance")`.
2467
+ * The live handle for a mounted "whopCard" element. Returned by the "cards" sub handle's `create("whopCard")`.
966
2468
  * @see https://docs.whop.com/elements/latest/wallet/overview
967
2469
  */
968
- export interface BalanceElementHandle {
2470
+ export interface WhopCardElementHandle {
969
2471
  /**
970
2472
  * Mounts the element in `target` and starts loading. React components mount themselves.
971
2473
  */
@@ -977,72 +2479,59 @@ export interface BalanceElementHandle {
977
2479
  /**
978
2480
  * Merges new props into the mounted element. In React, change the component props instead.
979
2481
  */
980
- update: (options: Partial<BalanceElementProps>) => void;
2482
+ update: (options: Partial<WhopCardElementProps>) => void;
981
2483
  }
982
2484
 
983
2485
  /**
984
- * Options for the "balances" sub handle's `create("balance")`: the consumer props plus event callbacks and lifecycle hooks.
2486
+ * Options for the "cards" sub handle's `create("whopCard")`: the consumer props plus event callbacks and lifecycle hooks.
985
2487
  * @see https://docs.whop.com/elements/latest/wallet/overview
986
2488
  */
987
- export interface BalanceElementCreateOptions {
2489
+ export interface WhopCardElementCreateOptions {
988
2490
  /**
989
- * A scoped token for the reads. An account needs `company:balance:read` for the total and `stats:read` for the chart; a user's own balance needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`, and set a fresh one before it expires. Without it the reads use the viewer's own session, which only works same-origin.
990
- * @default ""
2491
+ * A scoped token for card access. Omitted calls carry the viewer session when same-origin. Secrets are returned only when the API authorizes the viewer.
991
2492
  */
992
2493
  accessToken?: string;
993
2494
  /**
994
- * The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
995
- * @default "1M"
996
- */
997
- range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
998
- /**
999
- * When the account was opened, as an ISO 8601 timestamp. `ALL` starts here instead of at its five-year default, so an account older than that keeps its full history.
1000
- * @default ""
1001
- */
1002
- openedAt?: string;
1003
- /**
1004
- * Adds the account name to the label: `Total balance · Acme` normally, and `Acme balance on Jul 9` while the viewer reads a point. Without it the label is just `Total balance`.
2495
+ * Issued card ID, prefixed `icrd_`.
1005
2496
  * @default ""
1006
2497
  */
1007
- accountName?: string;
2498
+ cardId?: string;
1008
2499
  /**
1009
- * The selected range on the chart, as ISO 8601 timestamps. Set it to control the selection yourself, or `null` to clear the one the viewer made. Echo back what `rangeBrushed` reports, and clearing a filter elsewhere on your page clears the selection here too.
1010
- * @default null
2500
+ * Hide the View details and Lock card buttons. The card itself remains clickable to reveal details.
2501
+ * @default false
1011
2502
  */
1012
- brush?: { from: string; to: string; } | null;
2503
+ hideControls?: boolean;
1013
2504
  /**
1014
- * A moment to mark on the chart, as an ISO 8601 timestamp — the point something else on your page is pointing at, like the row under the pointer in an activity list. It reads like the viewer hovering that point themselves, and is ignored when it falls outside the window on screen or when they are reading the chart.
1015
- * @default ""
2505
+ * Disable the lock control while keeping it visible. Useful when a host has temporarily frozen card actions.
2506
+ * @default false
1016
2507
  */
1017
- markedAt?: string;
2508
+ disableLock?: boolean;
1018
2509
  /**
1019
- * For a user, total their own money plus every account they own instead of their own money alone. Ignored for an account, which is a single account already.
2510
+ * Hide the Add to Apple Wallet button. It is shown for active and locked cards by default.
1020
2511
  * @default false
1021
2512
  */
1022
- includeOwnedAccounts?: boolean;
2513
+ hideAppleWalletButton?: boolean;
1023
2514
  /**
1024
- * Hide the total and its change, leaving the chart and the range buttons.
2515
+ * Direct-mode integration option. Emits `lockRequested` without updating the card so a first-party host can retain its confirmation flow.
1025
2516
  * @default false
1026
2517
  */
1027
- hideTotal?: boolean;
2518
+ deferLockToHost?: boolean;
1028
2519
  /**
1029
- * Hide the chart, leaving the total and the range buttons.
1030
- * @default false
2520
+ * Fires after details are revealed or hidden.
1031
2521
  */
1032
- hideChart?: boolean;
2522
+ onDetailsChanged?: ((payload: { cardId: string; revealed: boolean; }) => void);
1033
2523
  /**
1034
- * How tall the chart is drawn, in pixels.
1035
- * @default 210
2524
+ * Fires instead of updating when `deferLockToHost` is true.
1036
2525
  */
1037
- height?: number;
2526
+ onLockRequested?: ((payload: { cardId: string; locked: boolean; }) => void);
1038
2527
  /**
1039
- * The visible time range changed. Mirror it if something else on your page reads the same period.
2528
+ * Fires after the Cards REST API successfully locks or unlocks the card.
1040
2529
  */
1041
- onRangeChanged?: ((payload: { range: "1D" | "1W" | "1M" | "1Y" | "ALL"; }) => void);
2530
+ onLockChanged?: ((payload: { cardId: string; locked: boolean; }) => void);
1042
2531
  /**
1043
- * The viewer dragged across the chart to select a range, or cleared the selection (`null`). Gives ISO 8601 timestamps plus the range they were read in, so you can filter your own views, like an activity list or a table, to the same period.
2532
+ * Fires when the viewer presses Add to Apple Wallet. The host owns the resulting Apple Wallet flow.
1044
2533
  */
1045
- onRangeBrushed?: ((payload: { from: string; to: string; range: "1D" | "1W" | "1M" | "1Y" | "ALL"; } | null) => void);
2534
+ onAppleWalletRequested?: ((payload: { cardId: string; }) => void);
1046
2535
  /**
1047
2536
  * Runs after the loading skeleton first paints and before `onReady`.
1048
2537
  */
@@ -1058,41 +2547,55 @@ export interface BalanceElementCreateOptions {
1058
2547
  }
1059
2548
 
1060
2549
  /**
1061
- * Consumer props for the "balances" sub-controller's "list" element.
2550
+ * Consumer props for the "cards" sub-controller's "cardTransactions" element.
1062
2551
  * @see https://docs.whop.com/elements/latest/wallet/overview
1063
2552
  */
1064
- export interface ListElementProps {
2553
+ export interface CardTransactionsElementProps {
1065
2554
  /**
1066
- * A scoped token for the read. An account needs `company:balance:read`; a user's holdings or owned-account list needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
2555
+ * A scoped token for the reads. Rows and card labels need `payout:account:read`; cardholder names also need `company:authorized_user:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
1067
2556
  */
1068
2557
  accessToken?: string;
1069
2558
  /**
1070
- * For a user's `user_…` account, list their personal balance followed by every owned account the backend returns instead of listing the holdings inside their personal account. Ignored for an account.
1071
- * @default false
2559
+ * Off, the table performs no reads and renders empty.
2560
+ * @default true
1072
2561
  */
1073
- includeOwnedAccounts?: boolean;
2562
+ enabled?: boolean;
1074
2563
  /**
1075
- * Show each row in the currency it is held in (€4.20, 0.00000009 cbBTC) and put the dollar value underneath. Off by default, so every row is in dollars.
1076
- * @default false
2564
+ * Restrict the table to these cards. Empty shows every card on the account.
2565
+ * @default []
1077
2566
  */
1078
- showSourceCurrency?: boolean;
2567
+ cardIds?: string[];
1079
2568
  /**
1080
- * Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
1081
- * @default true
2569
+ * Restrict the table to these cardholders. Empty shows every cardholder on the account.
2570
+ * @default []
1082
2571
  */
1083
- showUsdEquivalent?: boolean;
2572
+ cardholderIds?: string[];
1084
2573
  /**
1085
- * Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
2574
+ * Restrict the table to these statuses — `completed`, `pending`, `declined` or `reversed`. Anything else is ignored. Empty shows every status.
2575
+ * @default []
2576
+ */
2577
+ statuses?: string[];
2578
+ /**
2579
+ * Show the cardholder column and its filter. Off for an account whose cards all belong to one person.
1086
2580
  * @default true
1087
2581
  */
1088
- showPersonalAccount?: boolean;
2582
+ showCardholders?: boolean;
2583
+ /**
2584
+ * How many transactions to read per page.
2585
+ * @default 50
2586
+ */
2587
+ pageSize?: number;
1089
2588
  }
1090
2589
 
1091
2590
  /**
1092
- * The live handle for a mounted "list" element. Returned by the "balances" sub handle's `create("list")`.
2591
+ * The live handle for a mounted "cardTransactions" element. Returned by the "cards" sub handle's `create("cardTransactions")`.
1093
2592
  * @see https://docs.whop.com/elements/latest/wallet/overview
1094
2593
  */
1095
- export interface ListElementHandle {
2594
+ export interface CardTransactionsElementHandle {
2595
+ /**
2596
+ * Re-read the transactions, for a host that just changed something on the account.
2597
+ */
2598
+ refresh: () => Promise<void>;
1096
2599
  /**
1097
2600
  * Mounts the element in `target` and starts loading. React components mount themselves.
1098
2601
  */
@@ -1104,46 +2607,52 @@ export interface ListElementHandle {
1104
2607
  /**
1105
2608
  * Merges new props into the mounted element. In React, change the component props instead.
1106
2609
  */
1107
- update: (options: Partial<ListElementProps>) => void;
2610
+ update: (options: Partial<CardTransactionsElementProps>) => void;
1108
2611
  }
1109
2612
 
1110
2613
  /**
1111
- * Options for the "balances" sub handle's `create("list")`: the consumer props plus event callbacks and lifecycle hooks.
2614
+ * Options for the "cards" sub handle's `create("cardTransactions")`: the consumer props plus event callbacks and lifecycle hooks.
1112
2615
  * @see https://docs.whop.com/elements/latest/wallet/overview
1113
2616
  */
1114
- export interface ListElementCreateOptions {
2617
+ export interface CardTransactionsElementCreateOptions {
1115
2618
  /**
1116
- * A scoped token for the read. An account needs `company:balance:read`; a user's holdings or owned-account list needs `user:balance:read`. Mint it on your server with `POST /api/v1/access_tokens`. Without it the read uses the viewer's own session, which only works same-origin.
2619
+ * A scoped token for the reads. Rows and card labels need `payout:account:read`; cardholder names also need `company:authorized_user:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
1117
2620
  */
1118
2621
  accessToken?: string;
1119
2622
  /**
1120
- * For a user's `user_…` account, list their personal balance followed by every owned account the backend returns instead of listing the holdings inside their personal account. Ignored for an account.
1121
- * @default false
2623
+ * Off, the table performs no reads and renders empty.
2624
+ * @default true
1122
2625
  */
1123
- includeOwnedAccounts?: boolean;
2626
+ enabled?: boolean;
1124
2627
  /**
1125
- * Show each row in the currency it is held in (€4.20, 0.00000009 cbBTC) and put the dollar value underneath. Off by default, so every row is in dollars.
1126
- * @default false
2628
+ * Restrict the table to these cards. Empty shows every card on the account.
2629
+ * @default []
1127
2630
  */
1128
- showSourceCurrency?: boolean;
2631
+ cardIds?: string[];
1129
2632
  /**
1130
- * Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
1131
- * @default true
2633
+ * Restrict the table to these cardholders. Empty shows every cardholder on the account.
2634
+ * @default []
1132
2635
  */
1133
- showUsdEquivalent?: boolean;
2636
+ cardholderIds?: string[];
1134
2637
  /**
1135
- * Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
2638
+ * Restrict the table to these statuses — `completed`, `pending`, `declined` or `reversed`. Anything else is ignored. Empty shows every status.
2639
+ * @default []
2640
+ */
2641
+ statuses?: string[];
2642
+ /**
2643
+ * Show the cardholder column and its filter. Off for an account whose cards all belong to one person.
1136
2644
  * @default true
1137
2645
  */
1138
- showPersonalAccount?: boolean;
2646
+ showCardholders?: boolean;
1139
2647
  /**
1140
- * A holding row was clicked, with `includeOwnedAccounts` off. `holding` is `usd` for the combined dollar row, otherwise the holding symbol (`cbBTC`, `EUR`), and `kind` tells you which of the three it is so you can route without classifying symbols yourself. The element never navigates.
2648
+ * How many transactions to read per page.
2649
+ * @default 50
1141
2650
  */
1142
- onBalanceSelected?: ((payload: { holding: string; kind: "usd" | "cash" | "asset"; }) => void);
2651
+ pageSize?: number;
1143
2652
  /**
1144
- * An account row was clicked, with `includeOwnedAccounts` on. `accountId` is the personal `user_…` tag or an owned `biz_…` tag, and `kind` lets you route without inspecting it. The element never navigates.
2653
+ * A row was pressed. Open your own detail surface in answer to this — the element never navigates.
1145
2654
  */
1146
- onAccountSelected?: ((payload: { accountId: string; kind: "personal" | "business"; }) => void);
2655
+ onTransactionSelected?: ((payload: { transactionId: string; }) => void);
1147
2656
  /**
1148
2657
  * Runs after the loading skeleton first paints and before `onReady`.
1149
2658
  */
@@ -1159,24 +2668,36 @@ export interface ListElementCreateOptions {
1159
2668
  }
1160
2669
 
1161
2670
  /**
1162
- * The "balances" sub-handle, minted by `handle.create("balances", …)`. Mounts the sub-controller's elements and carries its actions.
2671
+ * The "cards" sub-handle, minted by `handle.create("cards", …)`. Mounts the sub-controller's elements and carries its actions.
1163
2672
  * @see https://docs.whop.com/elements/latest/wallet/overview
1164
2673
  */
1165
- export interface BalancesSubHandle {
2674
+ export interface CardsSubHandle {
1166
2675
  /**
1167
- * An account's balance and a chart of how it changed. The total and its change sit at the top, the chart below that, and the time range buttons at the bottom. The viewer can read individual points on the chart and switch the time range themselves.
2676
+ * Lists the account's active issued cards, most recently issued first. Needs an `accessToken`. The title and rows are click targets that emit events instead of navigating — a host wires up its own routing and card-detail UI.
1168
2677
  */
1169
- create(name: "balance", options?: BalanceElementCreateOptions): BalanceElementHandle;
2678
+ create(name: "cards", options?: CardsElementCreateOptions): CardsElementHandle;
1170
2679
  /**
1171
- * The holdings behind an account's balance. Every currency and token gets its own row, showing its name and its value in dollars, largest first. Rows can report which one the viewer tapped, so you can open your own screen for it.
2680
+ * A sortable table of every issued card on an account, including cardholder, last month's spend, limit, and creation date. Rows and the create button emit events so the host owns card details and issuance flows.
1172
2681
  */
1173
- create(name: "list", options?: ListElementCreateOptions): ListElementHandle;
2682
+ create(name: "cardsTable", options?: CardsTableElementCreateOptions): CardsTableElementHandle;
2683
+ /**
2684
+ * A business account's card spend over time, using the same interactive bar chart as Whop's cards dashboard. The period picker changes the mounted chart and emits an event so the host can persist the selection.
2685
+ */
2686
+ create(name: "cardsChart", options?: CardsChartElementCreateOptions): CardsChartElementHandle;
2687
+ /**
2688
+ * Renders one issued Whop Card. The element prefetches authorized secrets immediately after it mounts with a card ID, but keeps them masked until the viewer clicks it or selects `View details`. The API remains the permission authority. Includes lock and unlock controls by default.
2689
+ */
2690
+ create(name: "whopCard", options?: WhopCardElementCreateOptions): WhopCardElementHandle;
2691
+ /**
2692
+ * Every card transaction on an account, as the sortable table the dashboard shows: date, merchant, amount, cashback, status, card and cardholder, with filters for status, card and cardholder. A host can seed any of those three so the table opens on a narrowed view the reader can still widen. Card and cardholder narrow the read itself; search and status narrow the rows already loaded, so the count and total describe the current view rather than the account's lifetime. Selecting a row reports it — the element never opens a drawer of its own.
2693
+ */
2694
+ create(name: "cardTransactions", options?: CardTransactionsElementCreateOptions): CardTransactionsElementHandle;
1174
2695
  /**
1175
2696
  * Merges new props and callbacks into the sub-controller.
1176
2697
  */
1177
- update(options: Partial<BalancesSubOptions>): void;
2698
+ update(options: Partial<CardsSubOptions>): void;
1178
2699
  /**
1179
- * Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("balances")` starts fresh.
2700
+ * Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("cards")` starts fresh.
1180
2701
  */
1181
2702
  destroy(): void;
1182
2703
  }
@@ -1186,42 +2707,70 @@ export interface BalancesSubHandle {
1186
2707
  * @see https://docs.whop.com/elements/latest/wallet/overview
1187
2708
  */
1188
2709
  export interface WalletHandle {
2710
+ /**
2711
+ * The outstanding-action banners from Whop's balance dashboard — identity verification, deposits, tax, and the rest — in the same order the API returns them. An account with nothing outstanding renders nothing at all, so the element can sit permanently in a layout. Copy comes from the API. Pressing Verify starts a hosted identity session and leaves for it; Add money asks the Wallet controller to open deposit; every other button follows the action's own link. Needs an `accessToken`. A failed read renders nothing rather than an error — a banner should never become the loudest thing on someone else's page.
2712
+ */
2713
+ create(name: "required-actions", options?: RequiredActionsElementCreateOptions): RequiredActionsElementHandle;
2714
+ /**
2715
+ * The account action row from Whop's balance dashboard. Deposit, Send, Withdraw, and Convert open the Wallet controller's built-in overlays. Accept opens Whop's checkout-link creator for a business account or company creation for a personal account. Each button also emits its requested event so the embedding page can observe the action.
2716
+ */
2717
+ create(name: "actions", options?: ActionsElementCreateOptions): ActionsElementHandle;
1189
2718
  /**
1190
2719
  * An account's ledger activity: every movement of money in or out, newest first. The list pages as the viewer scrolls, and rows report which one was tapped instead of navigating, so you can open your own detail screen.
1191
2720
  */
1192
2721
  create(name: "activity", options?: ActivityElementCreateOptions): ActivityElementHandle;
1193
2722
  /**
1194
- * Funds a Whop account. Renders an amount field and the account's live funding rails — crypto (a per-network deposit address with its QR) and bank transfer (the wire fields for each settlement currency) — resolved from the account ID with no credentials, so it works on any page. Cards and platform balance are opt-in: pass `savedCards`, `allowNewCard`, or `showPlatformBalance` and the element collects the amount and the choice, then emits `cardDepositRequested` / `addCardRequested` / `platformBalanceSelected` and waits for you to call `showStep({ step: 'amount' })` when your own screen is done.
2723
+ * A standalone detail drawer for one movement. Point it at a prefetched financial-activity row, a ledger activity ID, or a card transaction ID — a prefetched row takes precedence, otherwise the element retrieves the record itself. A card transaction opens the card receipt: merchant, amount, status, the card it was charged to, its cardholder on a company account, the settlement date, category, currency conversion and cashback.
2724
+ */
2725
+ createOverlay(name: "activityDetail", options?: ActivityDetailElementCreateOptions): ActivityDetailElementOverlayHandle;
2726
+ /**
2727
+ * Funds a Whop account. Renders an amount field and the account's live funding rails — crypto (a per-network deposit address with its QR) and bank transfer (the wire fields for each settlement currency). A business account's rails resolve with no credentials, so they work on any page; a personal (`user_`) account only reveals its rails to itself, so pass `accessToken` for it — omitted, the viewer's own same-origin session covers it. Cards and platform balance are opt-in: pass `savedCards`, `allowNewCard`, or `showPlatformBalance` and the element collects the amount and the choice, then emits `cardDepositRequested` / `addCardRequested` / `platformBalanceSelected` and waits for you to call `showStep({ step: 'amount' })` when your own screen is done.
1195
2728
  */
1196
2729
  create(name: "deposit", options?: DepositElementCreateOptions): DepositElementHandle;
1197
2730
  /**
1198
- * Funds a Whop account. Renders an amount field and the account's live funding rails — crypto (a per-network deposit address with its QR) and bank transfer (the wire fields for each settlement currency) — resolved from the account ID with no credentials, so it works on any page. Cards and platform balance are opt-in: pass `savedCards`, `allowNewCard`, or `showPlatformBalance` and the element collects the amount and the choice, then emits `cardDepositRequested` / `addCardRequested` / `platformBalanceSelected` and waits for you to call `showStep({ step: 'amount' })` when your own screen is done.
2731
+ * Funds a Whop account. Renders an amount field and the account's live funding rails — crypto (a per-network deposit address with its QR) and bank transfer (the wire fields for each settlement currency). A business account's rails resolve with no credentials, so they work on any page; a personal (`user_`) account only reveals its rails to itself, so pass `accessToken` for it — omitted, the viewer's own same-origin session covers it. Cards and platform balance are opt-in: pass `savedCards`, `allowNewCard`, or `showPlatformBalance` and the element collects the amount and the choice, then emits `cardDepositRequested` / `addCardRequested` / `platformBalanceSelected` and waits for you to call `showStep({ step: 'amount' })` when your own screen is done.
1199
2732
  */
1200
2733
  createOverlay(name: "deposit", options?: DepositElementCreateOptions): DepositElementOverlayHandle;
1201
2734
  /**
1202
- * Collects a payout amount and saved payout method, groups standard and instant delivery choices with live fees and arrival estimates, collects a new payout method when needed, and presents a confirmation screen before emitting the final payout request.
2735
+ * Converts an account's USD balance to Gold or Coinbase Wrapped Bitcoin, and back, through Whop's public swaps API. A cross-origin mount needs an `accessToken` scoped to `company:balance:read` plus `crypto_wallet:swap` or `crypto_wallet:manage`.
2736
+ */
2737
+ create(name: "convert", options?: ConvertElementCreateOptions): ConvertElementHandle;
2738
+ /**
2739
+ * Converts an account's USD balance to Gold or Coinbase Wrapped Bitcoin, and back, through Whop's public swaps API. A cross-origin mount needs an `accessToken` scoped to `company:balance:read` plus `crypto_wallet:swap` or `crypto_wallet:manage`.
2740
+ */
2741
+ createOverlay(name: "convert", options?: ConvertElementCreateOptions): ConvertElementOverlayHandle;
2742
+ /**
2743
+ * Collects a payout amount and saved payout method, groups standard and instant delivery choices with live fees and arrival estimates, and collects a new payout method when needed. When the host does not drive the flow, the element lists methods and creates the payout itself — pass `accessToken` (or rely on the viewer's same-origin session). A host that already talks to the payouts API can still supply methods, limits, and loading flags; confirming then emits `withdrawalRequested` for that host to create.
1203
2744
  */
1204
2745
  create(name: "withdraw", options?: WithdrawElementCreateOptions): WithdrawElementHandle;
1205
2746
  /**
1206
- * Collects a payout amount and saved payout method, groups standard and instant delivery choices with live fees and arrival estimates, collects a new payout method when needed, and presents a confirmation screen before emitting the final payout request.
2747
+ * Collects a payout amount and saved payout method, groups standard and instant delivery choices with live fees and arrival estimates, and collects a new payout method when needed. When the host does not drive the flow, the element lists methods and creates the payout itself — pass `accessToken` (or rely on the viewer's same-origin session). A host that already talks to the payouts API can still supply methods, limits, and loading flags; confirming then emits `withdrawalRequested` for that host to create.
1207
2748
  */
1208
2749
  createOverlay(name: "withdraw", options?: WithdrawElementCreateOptions): WithdrawElementOverlayHandle;
1209
2750
  /**
1210
- * Sends money from an account to a recipient — a user, another account, or a public claim link anyone can redeem. Renders its own recipient search resolved from the account ID with no credentials beyond the account's own token. Needs an `accessToken` scoped to `payout:withdraw_funds`; account recipient search additionally needs `company:authorized_user:read` and `member:basic:read`, and account claim links need `airdrop_link:manage` — a host without one of those scopes should turn off the matching prop rather than leave a row that will 403.
2751
+ * Sends money from an account to a recipient — a user, another account, or a public claim link anyone can redeem. Direct transfers use the source account's configured fiat or crypto rail. Renders its own recipient search resolved from the account ID with no credentials beyond the account's own token. Needs an `accessToken` scoped to `payout:transfer_funds` for direct transfers and `payout:withdraw_funds` for recipient lists; account recipient search additionally needs `company:authorized_user:read` and `member:basic:read`, and account claim links need `airdrop_link:manage` — a host without one of those scopes should turn off the matching prop rather than leave a row that will 403.
1211
2752
  */
1212
2753
  create(name: "send", options?: SendElementCreateOptions): SendElementHandle;
1213
2754
  /**
1214
- * Sends money from an account to a recipient — a user, another account, or a public claim link anyone can redeem. Renders its own recipient search resolved from the account ID with no credentials beyond the account's own token. Needs an `accessToken` scoped to `payout:withdraw_funds`; account recipient search additionally needs `company:authorized_user:read` and `member:basic:read`, and account claim links need `airdrop_link:manage` — a host without one of those scopes should turn off the matching prop rather than leave a row that will 403.
2755
+ * Sends money from an account to a recipient — a user, another account, or a public claim link anyone can redeem. Direct transfers use the source account's configured fiat or crypto rail. Renders its own recipient search resolved from the account ID with no credentials beyond the account's own token. Needs an `accessToken` scoped to `payout:transfer_funds` for direct transfers and `payout:withdraw_funds` for recipient lists; account recipient search additionally needs `company:authorized_user:read` and `member:basic:read`, and account claim links need `airdrop_link:manage` — a host without one of those scopes should turn off the matching prop rather than leave a row that will 403.
1215
2756
  */
1216
2757
  createOverlay(name: "send", options?: SendElementCreateOptions): SendElementOverlayHandle;
1217
2758
  /**
1218
- * Lists the account's active issued cards, most recently issued first. Needs an `accessToken`. The title and rows are click targets that emit events instead of navigating — a host wires up its own routing and card-detail UI.
2759
+ * One card and what has been spent on it: the card itself, what it has spent against its limit, and its latest transactions. Opens as a drawer. The card face, its reveal and its lock come from the `whopCard` element composed inside, so a host gets one surface rather than assembling three. Pressing a transaction, or asking for the full list, reports the request — the drawer never navigates.
1219
2760
  */
1220
- create(name: "cards", options?: CardsElementCreateOptions): CardsElementHandle;
2761
+ createOverlay(name: "cardDetails", options?: CardDetailsElementCreateOptions): CardDetailsElementOverlayHandle;
2762
+ /**
2763
+ * A banner asking the account holder to verify their identity, shown only while verification is outstanding — an account that has already verified renders nothing at all, so the element can sit permanently in a layout. The headline and body come from the API, so they track the account's actual state: an unstarted account is invited to unlock cards and payouts, one under review reads as pending, and a failed or flagged one says so. Pressing the button reports `verificationRequested` and stays put, so the host mounts its own verification — the `verifications` controller's `kyc` element, say. Needs an `accessToken`. A failed read renders nothing rather than an error — a nudge should never become the loudest thing on the page.
2764
+ */
2765
+ create(name: "verification", options?: VerificationElementCreateOptions): VerificationElementHandle;
1221
2766
  /**
1222
- * Two views of an account's money. The balance view shows the total, a chart of how it changed, and a picker for the time range. The list view shows the holdings that make up that total, valued in dollars.
2767
+ * Three views of an account's money. The balance view shows the total, a chart of how it changed, and a picker for the time range. The list view shows the holdings that make up that total, valued in dollars. The breakdown view splits one currency into available, pending, reserve, and negative amounts without money-movement controls. When `openHoldingOnSelect` is on, a list row replaces this unit's canvas — the chart and the list — with that holding's balance page instead of only reporting the click.
1223
2768
  */
1224
2769
  create(name: "balances", options?: BalancesSubOptions): BalancesSubHandle;
2770
+ /**
2771
+ * An account's card surfaces, mounted from one place: the compact issued-card list, the full sortable roster, the spend chart, and a single revealable card. Mount the faces the page needs — they share the account and the credential this unit is minted with, so a page showing a chart above a roster wires them once.
2772
+ */
2773
+ create(name: "cards", options?: CardsSubOptions): CardsSubHandle;
1225
2774
  /**
1226
2775
  * Merges new handle options into every mounted element. In React, change the namespace props instead.
1227
2776
  */
@@ -1251,6 +2800,28 @@ export interface ActivityDateRangeOverride {
1251
2800
  displayPostedBefore?: string | undefined;
1252
2801
  }
1253
2802
 
2803
+ /**
2804
+ * Declared from the app's `Money`, referenced by a host-capability surface.
2805
+ */
2806
+ export interface Money {
2807
+ /**
2808
+ * Three-letter ISO 4217 currency code, lowercase.
2809
+ */
2810
+ currency: string;
2811
+ /**
2812
+ * The amount in major units, as an exact decimal string — `"10.00"` is ten dollars. A string so no float rounds it in transit.
2813
+ */
2814
+ amount: string;
2815
+ /**
2816
+ * How many decimal places the amount CARRIES — the precision the charge itself runs at.
2817
+ */
2818
+ decimals: number;
2819
+ /**
2820
+ * How many decimal places to SHOW. Usually equal to `decimals`, and deliberately not always: COP is charged in centavos but written in whole pesos, so it is `2` and `0`. Format the number in your own locale using this.
2821
+ */
2822
+ display_decimals: number;
2823
+ }
2824
+
1254
2825
  /**
1255
2826
  * Declared from the app's `LedgerActivity`, referenced by a host-capability surface.
1256
2827
  */
@@ -1263,11 +2834,15 @@ export interface LedgerActivity {
1263
2834
  /**
1264
2835
  * The ledger line category this activity was posted under.
1265
2836
  */
1266
- line_type: "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "airdrop" | "airdrop_link_created" | "airdrop_link_redeemed" | "airdrop_link_returned" | "airdrop_reversal" | "application_fee" | "application_fee_payout" | "bank_transfer" | "billing_percentage_fee" | "buyer_fee" | "card_spend_authorization" | "card_spend_authorization_void" | "card_spend_refund" | "company_referral" | "cross_border_percentage_fee" | "currency_conversion_incoming" | "currency_conversion_outgoing" | "dispute_alert_fee" | "dispute_hold_adjustment" | "dispute_representment_fee" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "installment_default" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "internal_withdrawal" | "internal_withdrawal_reversal" | "legacy_crypto_payment" | "legacy_payment" | "legacy_payment_refund" | "license_sale" | "license_sale_commission" | "license_sale_revenue" | "misc_purchase" | "misc_refund" | "misc_reversal" | "onchain_deposit" | "onchain_swap_target" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "orchestration_percentage_fee" | "passthrough_gmv" | "payment_dispute" | "payment_dispute_adjustment" | "payment_dispute_fee" | "payment_dispute_reversal" | "payment_gross" | "payment_gross_reversal" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payment_referral" | "payment_referral_reversal" | "payment_refund" | "payment_refund_reversal" | "payment_revshare" | "payment_revshare_payout" | "payment_revshare_refund" | "payment_revshare_reversal" | "payout_fee" | "platform_affiliate_payment" | "platform_affiliate_payment_reversal" | "platform_balance_payment" | "platform_balance_payment_refund" | "platform_balance_transfer_incoming" | "platform_balance_transfer_outgoing" | "platform_covered_dispute" | "promo_reversal" | "referral_bonus" | "resolution_center_refund" | "revshare_percentage_fee" | "sales_tax_fee" | "sales_tax_remittance" | "sales_tax_remittance_reversal" | "software_rental_revshare" | "software_rental_transaction" | "stripe_domestic_processing_fee" | "stripe_international_processing_fee" | "three_ds_fixed_fee" | "topup" | "topup_fee" | "topup_reversal" | "treasury_payin" | "whop_processing_fee" | "withdrawal" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "withdrawal_reclassification" | "withdrawal_reversal";
2837
+ line_type: "platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "payment_gross_reversal" | "payment_refund" | "payment_refund_reversal" | "payment_dispute_reversal" | "payment_dispute_adjustment" | "dispute_hold_adjustment" | "topup_reversal" | "platform_balance_payment" | "platform_balance_payment_refund" | "platform_balance_transfer_incoming" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "withdrawal_reversal" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "payment_revshare_refund" | "payment_revshare_reversal" | "payment_referral" | "payment_referral_reversal" | "application_fee_payout" | "airdrop_reversal" | "airdrop_link_created" | "airdrop_link_returned" | "card_spend_authorization_void" | "card_spend_refund" | "onchain_deposit" | "bank_transfer" | "currency_conversion_outgoing" | "currency_conversion_incoming" | "airdrop_link_redeemed" | "resolution_center_refund" | "withdrawal_reclassification" | "payment_revshare_payout" | "platform_affiliate_payment" | "platform_affiliate_payment_reversal" | "onboarding_reward" | "platform_covered_dispute" | "treasury_payin" | "passthrough_gmv" | "promo_reversal" | "misc_reversal" | "ad_spend_charge" | "ad_campaign_budget" | "ad_budget_release" | "ad_publisher_payout" | "ad_publisher_payout_received" | "affiliate_fee" | "application_fee" | "billing_percentage_fee" | "buyer_fee" | "cross_border_percentage_fee" | "dispute_alert_fee" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "orchestration_percentage_fee" | "payment_dispute_fee" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payout_fee" | "revshare_percentage_fee" | "sales_tax_fee" | "sales_tax_remittance" | "sales_tax_remittance_reversal" | "stripe_domestic_processing_fee" | "stripe_international_processing_fee" | "three_ds_fixed_fee" | "whop_processing_fee" | "balance_reservation" | "balance_reservation_reversal" | "card_interchange" | "card_load_deposit" | "card_load_transfer" | "card_unload_deposit" | "card_unload_transfer" | "company_referral" | "connected_account_negative_balance" | "dispute_representment_fee" | "external_card_load_deposit" | "installment_default" | "internal_withdrawal" | "internal_withdrawal_complete" | "internal_withdrawal_fee" | "internal_withdrawal_fee_reversal" | "internal_withdrawal_in_transit" | "internal_withdrawal_in_transit_reversal" | "internal_withdrawal_markup_fee" | "internal_withdrawal_markup_fee_payout" | "internal_withdrawal_markup_fee_payout_reversal" | "internal_withdrawal_markup_fee_reversal" | "internal_withdrawal_reversal" | "legacy_crypto_payment" | "legacy_payment" | "legacy_payment_refund" | "license_sale" | "license_sale_commission" | "license_sale_revenue" | "marketplace_affiliate_fee" | "misc_purchase" | "misc_refund" | "onchain_swap_source" | "onchain_withdrawal" | "payment_referral_refund" | "platform_balance_transfer_fee" | "platform_earning" | "referral_bonus" | "software_rental_revshare" | "software_rental_transaction" | "swap_fee" | "topup_fee" | "withdrawal_fee" | "withdrawal_fee_reversal" | "withdrawal_markup_fee" | "withdrawal_markup_fee_payout" | "withdrawal_markup_fee_payout_reversal" | "withdrawal_markup_fee_reversal" | "withdrawal_topup_adjustment" | "deposit" | "wallet_transfer_incoming" | "wallet_transfer_outgoing" | "swap_source" | "swap_target";
1267
2838
  /**
1268
2839
  * Signed amount in the currency's smallest precision units.
1269
2840
  */
1270
2841
  amount: string;
2842
+ /**
2843
+ * Dollar value of this movement as a decimal string, signed like `amount`. Converted from the posted amount at the rate that was live when the line posted — the same pricing the wallet balance chart and the financial reports use — so a crypto row carries its dollar value too. `null` for a currency Whop holds no exchange rate for.
2844
+ */
2845
+ usd_amount: string | null;
1271
2846
  /**
1272
2847
  * Currency for this ledger activity.
1273
2848
  */
@@ -1277,13 +2852,9 @@ export interface LedgerActivity {
1277
2852
  */
1278
2853
  posted_at: string;
1279
2854
  /**
1280
- * ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: the posted time for already-settled funds, or 00:00:00 UTC on the scheduled release date for pending funds. Present only on inflows entering the balance (payments, top-ups, incoming transfers/affiliate); null on withdrawals, refunds, disputes and on-chain rows. The available_after/before filters window on its UTC settlement date.
2855
+ * ISO 8601 timestamp these funds became (or are scheduled to become) withdrawable: the posted time for already-settled funds, or 00:00:00 UTC on the scheduled release date for pending funds. Present only on inflows entering the balance (payments, top-ups, incoming transfers/affiliate); null on payouts, refunds, disputes and on-chain rows. The available_after/before filters window on its UTC settlement date.
1281
2856
  */
1282
2857
  available_at: string | null;
1283
- /**
1284
- * When the activity record was created.
1285
- */
1286
- created_at: string | null;
1287
2858
  /**
1288
2859
  * Resource associated with this ledger activity.
1289
2860
  */
@@ -1291,7 +2862,43 @@ export interface LedgerActivity {
1291
2862
  /**
1292
2863
  * Source of this ledger activity.
1293
2864
  */
1294
- source: { object: string; id: string; status?: string | null | undefined; reason?: string | null | undefined; claim_url?: string | null | undefined; amount_float?: number | null | undefined; created_at?: string | null | undefined; estimated_arrival?: string | null | undefined; payer_name?: string | null | undefined; payout_token_nickname?: string | null | undefined; tx_hash?: string | null | undefined; sender_address?: string | null | undefined; chain?: string | null | undefined; from_amount?: string | null | undefined; from_currency?: string | null | undefined; to_amount?: string | null | undefined; to_currency?: string | null | undefined; payout_destination?: { payer_name?: string | null | undefined; icon_url?: string | null | undefined; } | null | undefined; [key: string]: unknown; } | null;
2865
+ source: { object: string; id: string; status?: string | null | undefined; payment_amount?: Money | null | undefined; payment_method_type?: string | null | undefined; payment_processor?: string | null | undefined; card_brand?: string | null | undefined; reason?: string | null | undefined; notes?: string | null | undefined; risk_review_hold?: boolean | null | undefined; claim_url?: string | null | undefined; amount_float?: number | null | undefined; created_at?: string | null | undefined; estimated_arrival?: string | null | undefined; payer_name?: string | null | undefined; payout_token_nickname?: string | null | undefined; tx_hash?: string | null | undefined; sender_address?: string | null | undefined; chain?: string | null | undefined; from_amount?: string | null | undefined; from_currency?: string | null | undefined; to_amount?: string | null | undefined; to_currency?: string | null | undefined; payout_destination?: { payer_name?: string | null | undefined; icon_url?: string | null | undefined; } | null | undefined; [key: string]: unknown; } | null;
2866
+ /**
2867
+ * Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.
2868
+ */
2869
+ payment?: { object: "payment"; id: string; amount: Money | null; payment_method_type: string | null; payment_processor: string | null; card_brand: string | null; card_last4: string | null; user: { id: string; name: string; email: string | null; } | null; product: { id: string; name: string; } | null; plan: { id: string; name: string | null; } | null; created_at: string; } | null | undefined;
2870
+ /**
2871
+ * Payment ID for any payment-related activity, including refunds and disputes.
2872
+ */
2873
+ payment_id?: string | null | undefined;
2874
+ /**
2875
+ * ID of the customer associated with the payment.
2876
+ */
2877
+ user_id?: string | null | undefined;
2878
+ /**
2879
+ * Display name of the customer associated with the payment.
2880
+ */
2881
+ user_name?: string | null | undefined;
2882
+ /**
2883
+ * Email of the customer associated with the payment. Requires member:email:read.
2884
+ */
2885
+ user_email?: string | null | undefined;
2886
+ /**
2887
+ * ID of the product associated with the payment, when applicable.
2888
+ */
2889
+ product_id?: string | null | undefined;
2890
+ /**
2891
+ * Name of the product associated with the payment, when applicable.
2892
+ */
2893
+ product_name?: string | null | undefined;
2894
+ /**
2895
+ * ID of the plan associated with the payment, when applicable.
2896
+ */
2897
+ plan_id?: string | null | undefined;
2898
+ /**
2899
+ * Name of the plan associated with the payment, when applicable.
2900
+ */
2901
+ plan_name?: string | null | undefined;
1295
2902
  /**
1296
2903
  * The viewer account that owns this row's ledger. Present only when the response aggregates owned accounts (include_owned_accounts=true); omitted otherwise.
1297
2904
  */
@@ -1363,6 +2970,7 @@ export interface WithdrawalQuote {
1363
2970
  exchangeRate: number;
1364
2971
  minLimit: number;
1365
2972
  maxLimit?: number | null | undefined;
2973
+ instantUnavailableReason?: "minimum_crypto_sales_not_met" | null | undefined;
1366
2974
  standard?: WithdrawalQuoteSpeed | null | undefined;
1367
2975
  instant?: WithdrawalQuoteSpeed | null | undefined;
1368
2976
  }
@@ -1372,12 +2980,14 @@ export interface WithdrawalQuote {
1372
2980
  */
1373
2981
  export interface WithdrawalMethod {
1374
2982
  id: string;
2983
+ createdAt?: string | null | undefined;
1375
2984
  nickname?: string | null | undefined;
1376
2985
  accountReference?: string | null | undefined;
1377
2986
  payerName?: string | null | undefined;
1378
2987
  destinationCurrency: string;
1379
2988
  isDefault: boolean;
1380
2989
  iconUrl?: string | null | undefined;
2990
+ name?: string | null | undefined;
1381
2991
  deliveryType: string;
1382
2992
  supportsStandard: boolean;
1383
2993
  supportsInstant: boolean;
@@ -1422,8 +3032,50 @@ export interface WithdrawalSupportedMethod {
1422
3032
  * Declared from the app's `WithdrawalLimits`, referenced by a host-capability surface.
1423
3033
  */
1424
3034
  export interface WithdrawalLimits {
1425
- standard: { maxAmount: number; errorMessage?: string | null | undefined; };
1426
- instant: { maxAmount: number; dailyAmountRemaining?: number | null | undefined; errorMessage?: string | null | undefined; };
3035
+ standard: { maxAmount: number; errorCode?: string | null | undefined; errorMessage?: string | null | undefined; };
3036
+ instant: { maxAmount: number; dailyAmountRemaining?: number | null | undefined; errorCode?: string | null | undefined; errorMessage?: string | null | undefined; };
3037
+ }
3038
+
3039
+ /**
3040
+ * Declared from the app's `WithdrawalMoney`, referenced by a host-capability surface.
3041
+ */
3042
+ export interface WithdrawalMoney {
3043
+ currency: string;
3044
+ amount: string;
3045
+ decimals: number;
3046
+ display_decimals: number;
3047
+ }
3048
+
3049
+ /**
3050
+ * Declared from the app's `WithdrawalPayoutQuote`, referenced by a host-capability surface.
3051
+ */
3052
+ export interface WithdrawalPayoutQuote {
3053
+ requestId: string;
3054
+ payoutMethodId: string;
3055
+ speed: "standard" | "instant";
3056
+ id: string;
3057
+ amount: WithdrawalMoney;
3058
+ fee: WithdrawalMoney;
3059
+ netAmount: WithdrawalMoney;
3060
+ destinationAmount: WithdrawalMoney;
3061
+ exchangeRate: number;
3062
+ expiresAt: string;
3063
+ quoteToken: string;
3064
+ }
3065
+
3066
+ /**
3067
+ * Declared from the app's `WithdrawalRequest`, referenced by a host-capability surface.
3068
+ */
3069
+ export interface WithdrawalRequest {
3070
+ amount: number;
3071
+ currency: string;
3072
+ payoutMethodId: string;
3073
+ presentedFee: number;
3074
+ quoteId?: string | undefined;
3075
+ quoteToken?: string | undefined;
3076
+ speed: "standard" | "instant";
3077
+ notes?: string | undefined;
3078
+ acknowledgeBankWarning?: boolean | undefined;
1427
3079
  }
1428
3080
 
1429
3081
  /**
@@ -1438,16 +3090,14 @@ export interface WithdrawalCreateMethodInput {
1438
3090
  }
1439
3091
 
1440
3092
  /**
1441
- * Declared from the app's `WithdrawalRequest`, referenced by a host-capability surface.
3093
+ * Declared from the app's `WithdrawalPayoutQuoteRequest`, referenced by a host-capability surface.
1442
3094
  */
1443
- export interface WithdrawalRequest {
3095
+ export interface WithdrawalPayoutQuoteRequest {
3096
+ requestId: string;
1444
3097
  amount: number;
1445
3098
  currency: string;
1446
3099
  payoutMethodId: string;
1447
- presentedFee: number;
1448
3100
  speed: "standard" | "instant";
1449
- notes?: string | undefined;
1450
- acknowledgeBankWarning?: boolean | undefined;
1451
3101
  }
1452
3102
 
1453
3103
  /**
@@ -1460,3 +3110,34 @@ export interface SendRecipient {
1460
3110
  profilePicUrl: string | null;
1461
3111
  kind: "business" | "user" | "email";
1462
3112
  }
3113
+
3114
+ /**
3115
+ * The billing address.
3116
+ * Declared from the app's `Billing`, referenced by a host-capability surface.
3117
+ */
3118
+ export interface Billing {
3119
+ /**
3120
+ * Billing city.
3121
+ */
3122
+ city: string | null;
3123
+ /**
3124
+ * Billing country code.
3125
+ */
3126
+ country_code: string | null;
3127
+ /**
3128
+ * Street address line 1.
3129
+ */
3130
+ line1: string | null;
3131
+ /**
3132
+ * Street address line 2.
3133
+ */
3134
+ line2: string | null;
3135
+ /**
3136
+ * Billing postal code.
3137
+ */
3138
+ postal_code: string | null;
3139
+ /**
3140
+ * Billing region or state.
3141
+ */
3142
+ region: string | null;
3143
+ }