@whop/elements 1.0.0-beta.2 → 1.0.0-beta.4
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/_framework.d.cts +6 -1
- package/_framework.d.ts +6 -1
- package/ads.d.cts +32 -2
- package/ads.d.ts +32 -2
- package/checkout.d.cts +4 -4
- package/checkout.d.ts +4 -4
- package/index.cjs +1 -1
- package/index.d.cts +10 -5
- package/index.d.ts +10 -5
- package/index.js +1 -1
- package/package.json +10 -2
- package/payments.d.cts +240 -35
- package/payments.d.ts +240 -35
- package/tracking.d.cts +94 -3
- package/tracking.d.ts +94 -3
- package/verifications.d.cts +308 -0
- package/verifications.d.ts +308 -0
- package/wallet.d.cts +2294 -546
- package/wallet.d.ts +2294 -546
- package/websites.d.cts +36 -10
- package/websites.d.ts +36 -10
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 "
|
|
42
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
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
|
|
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
|
-
*
|
|
55
|
-
* @default
|
|
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
|
-
|
|
62
|
+
kind?: "individual" | "business";
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
/**
|
|
61
|
-
* The live handle for a mounted "
|
|
62
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
69
|
+
export interface RequiredActionsElementHandle {
|
|
65
70
|
/**
|
|
66
|
-
* Re-
|
|
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<
|
|
85
|
+
update: (options: Partial<RequiredActionsElementProps>) => void;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
|
-
* Options for `create("
|
|
89
|
+
* Options for `create("required-actions")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
89
90
|
* @example
|
|
90
91
|
* ```ts
|
|
91
|
-
* const
|
|
92
|
-
*
|
|
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/
|
|
95
|
+
* @see https://docs.whop.com/elements/latest/wallet/required-actions
|
|
95
96
|
*/
|
|
96
|
-
export interface
|
|
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
|
|
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
|
-
*
|
|
107
|
-
* @default
|
|
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
|
-
|
|
106
|
+
kind?: "individual" | "business";
|
|
110
107
|
/**
|
|
111
|
-
*
|
|
108
|
+
* The viewer pressed a banner button. Fires for every action, including ones the element also handles itself.
|
|
112
109
|
*/
|
|
113
|
-
|
|
110
|
+
onActionRequested?: ((payload: { action: "deposit_funds" | "accept_airwallex_terms" | "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
|
|
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
|
-
|
|
114
|
+
onIdentityVerificationRequested?: ((payload: { accountId: string; }) => void);
|
|
118
115
|
/**
|
|
119
|
-
* The viewer
|
|
116
|
+
* The viewer pressed Add money. The Wallet controller opens its deposit overlay.
|
|
120
117
|
*/
|
|
121
|
-
|
|
118
|
+
onDepositRequested?: ((payload: Record<string, never>) => void);
|
|
122
119
|
/**
|
|
123
120
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
124
121
|
*/
|
|
@@ -153,6 +150,16 @@ export interface ActionsElementProps {
|
|
|
153
150
|
* @default true
|
|
154
151
|
*/
|
|
155
152
|
showSend?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Show the Withdraw button. Off by default so an existing row keeps the buttons it already had.
|
|
155
|
+
* @default false
|
|
156
|
+
*/
|
|
157
|
+
showWithdraw?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Show the Convert button.
|
|
160
|
+
* @default true
|
|
161
|
+
*/
|
|
162
|
+
showConvert?: boolean;
|
|
156
163
|
/**
|
|
157
164
|
* Disable the Deposit button while keeping it visible.
|
|
158
165
|
* @default false
|
|
@@ -168,6 +175,16 @@ export interface ActionsElementProps {
|
|
|
168
175
|
* @default false
|
|
169
176
|
*/
|
|
170
177
|
sendDisabled?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Disable the Withdraw button while keeping it visible.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
withdrawDisabled?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Disable the Convert button while keeping it visible.
|
|
185
|
+
* @default false
|
|
186
|
+
*/
|
|
187
|
+
convertDisabled?: boolean;
|
|
171
188
|
}
|
|
172
189
|
|
|
173
190
|
/**
|
|
@@ -214,6 +231,16 @@ export interface ActionsElementCreateOptions {
|
|
|
214
231
|
* @default true
|
|
215
232
|
*/
|
|
216
233
|
showSend?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Show the Withdraw button. Off by default so an existing row keeps the buttons it already had.
|
|
236
|
+
* @default false
|
|
237
|
+
*/
|
|
238
|
+
showWithdraw?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Show the Convert button.
|
|
241
|
+
* @default true
|
|
242
|
+
*/
|
|
243
|
+
showConvert?: boolean;
|
|
217
244
|
/**
|
|
218
245
|
* Disable the Deposit button while keeping it visible.
|
|
219
246
|
* @default false
|
|
@@ -229,6 +256,16 @@ export interface ActionsElementCreateOptions {
|
|
|
229
256
|
* @default false
|
|
230
257
|
*/
|
|
231
258
|
sendDisabled?: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Disable the Withdraw button while keeping it visible.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
withdrawDisabled?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Disable the Convert button while keeping it visible.
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
convertDisabled?: boolean;
|
|
232
269
|
/**
|
|
233
270
|
* The Deposit button was pressed and the Wallet controller opened its deposit overlay.
|
|
234
271
|
*/
|
|
@@ -241,6 +278,14 @@ export interface ActionsElementCreateOptions {
|
|
|
241
278
|
* The Send button was pressed and the Wallet controller opened its send overlay.
|
|
242
279
|
*/
|
|
243
280
|
onSendRequested?: ((payload: Record<string, never>) => void);
|
|
281
|
+
/**
|
|
282
|
+
* The Withdraw button was pressed and the Wallet controller opened its withdraw overlay.
|
|
283
|
+
*/
|
|
284
|
+
onWithdrawRequested?: ((payload: Record<string, never>) => void);
|
|
285
|
+
/**
|
|
286
|
+
* The Convert button was pressed and the Wallet controller opened its convert overlay.
|
|
287
|
+
*/
|
|
288
|
+
onConvertRequested?: ((payload: Record<string, never>) => void);
|
|
244
289
|
/**
|
|
245
290
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
246
291
|
*/
|
|
@@ -256,80 +301,52 @@ export interface ActionsElementCreateOptions {
|
|
|
256
301
|
}
|
|
257
302
|
|
|
258
303
|
/**
|
|
259
|
-
* Consumer props for the "
|
|
260
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
261
306
|
*/
|
|
262
|
-
export interface
|
|
263
|
-
/**
|
|
264
|
-
* 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.
|
|
265
|
-
* @default ""
|
|
266
|
-
*/
|
|
267
|
-
amount?: string;
|
|
268
|
-
/**
|
|
269
|
-
* Offer the crypto rail when the account has a deposit address.
|
|
270
|
-
* @default true
|
|
271
|
-
*/
|
|
272
|
-
showCrypto?: boolean;
|
|
273
|
-
/**
|
|
274
|
-
* Offer the bank-transfer rail when the account has wire instructions.
|
|
275
|
-
* @default true
|
|
276
|
-
*/
|
|
277
|
-
showBank?: boolean;
|
|
278
|
-
/**
|
|
279
|
-
* 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.
|
|
280
|
-
* @default []
|
|
281
|
-
*/
|
|
282
|
-
savedCards?: DepositSavedCard[];
|
|
307
|
+
export interface ActivityElementProps {
|
|
283
308
|
/**
|
|
284
|
-
*
|
|
285
|
-
* @default false
|
|
309
|
+
* Only show activity for this currency. Without it, activity from every currency is shown.
|
|
286
310
|
*/
|
|
287
|
-
|
|
311
|
+
currency?: string;
|
|
288
312
|
/**
|
|
289
|
-
*
|
|
290
|
-
* @default false
|
|
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.
|
|
291
314
|
*/
|
|
292
|
-
|
|
315
|
+
accessToken?: string;
|
|
293
316
|
/**
|
|
294
|
-
*
|
|
295
|
-
* @default null
|
|
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.
|
|
296
318
|
*/
|
|
297
|
-
|
|
319
|
+
maxItems?: number;
|
|
298
320
|
/**
|
|
299
|
-
*
|
|
300
|
-
* @default
|
|
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
|
|
301
323
|
*/
|
|
302
|
-
|
|
324
|
+
canOpenCardTransactionDetails?: boolean;
|
|
303
325
|
/**
|
|
304
|
-
*
|
|
305
|
-
* @default
|
|
326
|
+
* Activity types selected when the element mounts or its account changes. The viewer can change them with the built-in filters.
|
|
327
|
+
* @default []
|
|
306
328
|
*/
|
|
307
|
-
|
|
329
|
+
defaultLineTypes?: ("platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "cashback" | "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "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_void" | "card_spend_refund" | "cross_border_percentage_fee" | "currency_conversion_incoming" | "currency_conversion_outgoing" | "dispute_alert_fee" | "dispute_hold_adjustment" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "misc_reversal" | "onboarding_reward" | "onchain_deposit" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "orchestration_percentage_fee" | "passthrough_gmv" | "payment_dispute_adjustment" | "payment_dispute_fee" | "payment_dispute_reversal" | "payment_gross_reversal" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payment_referral" | "payment_referral_reversal" | "payment_refund" | "payment_refund_reversal" | "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_covered_dispute" | "platform_markup_fee" | "platform_markup_fee_payout" | "promo_reversal" | "resolution_center_refund" | "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" | "topup_reversal" | "treasury_payin" | "whop_processing_fee" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "withdrawal_reclassification" | "withdrawal_reversal")[];
|
|
308
330
|
/**
|
|
309
|
-
*
|
|
331
|
+
* Hide the filter chips, for a compact list that the viewer does not filter.
|
|
310
332
|
* @default false
|
|
311
333
|
*/
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* 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.
|
|
315
|
-
* @default "amount"
|
|
316
|
-
*/
|
|
317
|
-
initialStep?: "amount" | "bank" | "crypto";
|
|
334
|
+
hideFilters?: boolean;
|
|
318
335
|
}
|
|
319
336
|
|
|
320
337
|
/**
|
|
321
|
-
* The live handle for a mounted "
|
|
322
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
323
340
|
*/
|
|
324
|
-
export interface
|
|
341
|
+
export interface ActivityElementHandle {
|
|
325
342
|
/**
|
|
326
|
-
*
|
|
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.
|
|
327
344
|
*/
|
|
328
|
-
|
|
345
|
+
refresh: () => Promise<void>;
|
|
329
346
|
/**
|
|
330
|
-
*
|
|
347
|
+
* Set the date filter from outside the element, for example wiring a chart brush selection into the list. Pass `null` to clear it.
|
|
331
348
|
*/
|
|
332
|
-
|
|
349
|
+
setDateRange: (input: ActivityDateRangeOverride | null) => Promise<void>;
|
|
333
350
|
/**
|
|
334
351
|
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
335
352
|
*/
|
|
@@ -341,106 +358,62 @@ export interface DepositElementHandle {
|
|
|
341
358
|
/**
|
|
342
359
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
343
360
|
*/
|
|
344
|
-
update: (options: Partial<
|
|
361
|
+
update: (options: Partial<ActivityElementProps>) => void;
|
|
345
362
|
}
|
|
346
363
|
|
|
347
364
|
/**
|
|
348
|
-
* Options for `create("
|
|
365
|
+
* Options for `create("activity")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
349
366
|
* @example
|
|
350
367
|
* ```ts
|
|
351
|
-
* const
|
|
352
|
-
*
|
|
368
|
+
* const activity = wallet.create("activity", {}); // this interface: props + on<Event> callbacks
|
|
369
|
+
* activity.mount("#wallet-activity");
|
|
353
370
|
* ```
|
|
354
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
371
|
+
* @see https://docs.whop.com/elements/latest/wallet/activity
|
|
355
372
|
*/
|
|
356
|
-
export interface
|
|
357
|
-
/**
|
|
358
|
-
* 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.
|
|
359
|
-
* @default ""
|
|
360
|
-
*/
|
|
361
|
-
amount?: string;
|
|
362
|
-
/**
|
|
363
|
-
* Offer the crypto rail when the account has a deposit address.
|
|
364
|
-
* @default true
|
|
365
|
-
*/
|
|
366
|
-
showCrypto?: boolean;
|
|
367
|
-
/**
|
|
368
|
-
* Offer the bank-transfer rail when the account has wire instructions.
|
|
369
|
-
* @default true
|
|
370
|
-
*/
|
|
371
|
-
showBank?: boolean;
|
|
372
|
-
/**
|
|
373
|
-
* 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.
|
|
374
|
-
* @default []
|
|
375
|
-
*/
|
|
376
|
-
savedCards?: DepositSavedCard[];
|
|
373
|
+
export interface ActivityElementCreateOptions {
|
|
377
374
|
/**
|
|
378
|
-
*
|
|
379
|
-
* @default false
|
|
375
|
+
* Only show activity for this currency. Without it, activity from every currency is shown.
|
|
380
376
|
*/
|
|
381
|
-
|
|
377
|
+
currency?: string;
|
|
382
378
|
/**
|
|
383
|
-
*
|
|
384
|
-
* @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.
|
|
385
380
|
*/
|
|
386
|
-
|
|
381
|
+
accessToken?: string;
|
|
387
382
|
/**
|
|
388
|
-
*
|
|
389
|
-
* @default null
|
|
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.
|
|
390
384
|
*/
|
|
391
|
-
|
|
385
|
+
maxItems?: number;
|
|
392
386
|
/**
|
|
393
|
-
*
|
|
394
|
-
* @default
|
|
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
|
|
395
389
|
*/
|
|
396
|
-
|
|
390
|
+
canOpenCardTransactionDetails?: boolean;
|
|
397
391
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @default
|
|
392
|
+
* Activity types selected when the element mounts or its account changes. The viewer can change them with the built-in filters.
|
|
393
|
+
* @default []
|
|
400
394
|
*/
|
|
401
|
-
|
|
395
|
+
defaultLineTypes?: ("platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "cashback" | "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "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_void" | "card_spend_refund" | "cross_border_percentage_fee" | "currency_conversion_incoming" | "currency_conversion_outgoing" | "dispute_alert_fee" | "dispute_hold_adjustment" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "misc_reversal" | "onboarding_reward" | "onchain_deposit" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "orchestration_percentage_fee" | "passthrough_gmv" | "payment_dispute_adjustment" | "payment_dispute_fee" | "payment_dispute_reversal" | "payment_gross_reversal" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payment_referral" | "payment_referral_reversal" | "payment_refund" | "payment_refund_reversal" | "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_covered_dispute" | "platform_markup_fee" | "platform_markup_fee_payout" | "promo_reversal" | "resolution_center_refund" | "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" | "topup_reversal" | "treasury_payin" | "whop_processing_fee" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "withdrawal_reclassification" | "withdrawal_reversal")[];
|
|
402
396
|
/**
|
|
403
|
-
*
|
|
397
|
+
* Hide the filter chips, for a compact list that the viewer does not filter.
|
|
404
398
|
* @default false
|
|
405
399
|
*/
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* 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.
|
|
409
|
-
* @default "amount"
|
|
410
|
-
*/
|
|
411
|
-
initialStep?: "amount" | "bank" | "crypto";
|
|
412
|
-
/**
|
|
413
|
-
* The payer confirmed an amount and a rail. Fires for every rail, before any instructions render — the analytics/funnel hook.
|
|
414
|
-
*/
|
|
415
|
-
onDepositInitiated?: ((payload: { method: "card" | "bank" | "crypto" | "platform_balance"; amount: number; currency: string; paymentMethodId?: string | undefined; }) => void);
|
|
416
|
-
/**
|
|
417
|
-
* A saved card was chosen. Collect the payment on your side, then call `showStep({ step: "amount" })` to return the element to the picker.
|
|
418
|
-
*/
|
|
419
|
-
onCardDepositRequested?: ((payload: { amount: number; currency: string; paymentMethodId: string; }) => void);
|
|
420
|
-
/**
|
|
421
|
-
* The "Add card" row was picked — open your card-collection flow.
|
|
422
|
-
*/
|
|
423
|
-
onAddCardRequested?: ((payload: Record<string, never>) => void);
|
|
424
|
-
/**
|
|
425
|
-
* The bank rail was chosen while `deferBankToHost` is set — run your step, then show the fields yourself or call `showStep({ step: "bank" })`.
|
|
426
|
-
*/
|
|
427
|
-
onBankSelected?: ((payload: Record<string, never>) => void);
|
|
400
|
+
hideFilters?: boolean;
|
|
428
401
|
/**
|
|
429
|
-
*
|
|
402
|
+
* A row was clicked. Open your own detail view or route for it; the element never navigates.
|
|
430
403
|
*/
|
|
431
|
-
|
|
404
|
+
onActivitySelected?: ((payload: { activity: LedgerActivity; }) => void);
|
|
432
405
|
/**
|
|
433
|
-
* The
|
|
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.
|
|
434
407
|
*/
|
|
435
|
-
|
|
408
|
+
onActivityHovered?: ((payload: { activity: LedgerActivity; } | null) => void);
|
|
436
409
|
/**
|
|
437
|
-
* The
|
|
410
|
+
* The viewer pressed See all activity on a `maxItems` list. Open your own full activity screen; the element never navigates.
|
|
438
411
|
*/
|
|
439
|
-
|
|
412
|
+
onSeeAllRequested?: ((payload: Record<string, never>) => void);
|
|
440
413
|
/**
|
|
441
|
-
* The
|
|
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.
|
|
442
415
|
*/
|
|
443
|
-
|
|
416
|
+
onDateRangeChanged?: ((payload: { dateRange: { start: string; end: string; } | null; }) => void);
|
|
444
417
|
/**
|
|
445
418
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
446
419
|
*/
|
|
@@ -456,125 +429,1514 @@ export interface DepositElementCreateOptions {
|
|
|
456
429
|
}
|
|
457
430
|
|
|
458
431
|
/**
|
|
459
|
-
*
|
|
460
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
461
434
|
*/
|
|
462
|
-
export interface
|
|
435
|
+
export interface ActivityDetailElementProps {
|
|
463
436
|
/**
|
|
464
|
-
*
|
|
437
|
+
* Optional prefetched ledger activity row. When provided, the element renders it without another request.
|
|
438
|
+
* @default null
|
|
465
439
|
*/
|
|
466
|
-
|
|
440
|
+
activity?: LedgerActivity | null;
|
|
467
441
|
/**
|
|
468
|
-
*
|
|
442
|
+
* Optional ledger activity ID to retrieve when no prefetched activity row is provided.
|
|
443
|
+
* @default null
|
|
469
444
|
*/
|
|
470
|
-
|
|
445
|
+
activityId?: string | null;
|
|
471
446
|
/**
|
|
472
|
-
*
|
|
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
|
|
473
449
|
*/
|
|
474
|
-
|
|
450
|
+
cardTransactionId?: string | null;
|
|
475
451
|
/**
|
|
476
|
-
*
|
|
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
|
|
477
454
|
*/
|
|
478
|
-
|
|
455
|
+
showCardholder?: boolean;
|
|
456
|
+
/**
|
|
457
|
+
* Show the report-an-issue action for eligible card transactions. The action emits an event for the host.
|
|
458
|
+
* @default false
|
|
459
|
+
*/
|
|
460
|
+
showCardTransactionReportIssueAction?: boolean;
|
|
479
461
|
}
|
|
480
462
|
|
|
481
463
|
/**
|
|
482
|
-
*
|
|
483
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
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
|
|
484
466
|
*/
|
|
485
|
-
export interface
|
|
467
|
+
export interface ActivityDetailElementHandle {
|
|
486
468
|
/**
|
|
487
|
-
*
|
|
488
|
-
* @default false
|
|
469
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
489
470
|
*/
|
|
490
|
-
|
|
471
|
+
mount: (target: string | HTMLElement) => void;
|
|
491
472
|
/**
|
|
492
|
-
*
|
|
473
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
474
|
+
*/
|
|
475
|
+
destroy: () => void;
|
|
476
|
+
/**
|
|
477
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
478
|
+
*/
|
|
479
|
+
update: (options: Partial<ActivityDetailElementProps>) => void;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Options for `create("activityDetail")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
484
|
+
* @example
|
|
485
|
+
* ```ts
|
|
486
|
+
* const activityDetail = wallet.createOverlay("activityDetail", {}); // this interface: props + on<Event> callbacks
|
|
487
|
+
* activityDetail.open();
|
|
488
|
+
* ```
|
|
489
|
+
* @see https://docs.whop.com/elements/latest/wallet/activityDetail
|
|
490
|
+
*/
|
|
491
|
+
export interface ActivityDetailElementCreateOptions {
|
|
492
|
+
/**
|
|
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.
|
|
514
|
+
* @default false
|
|
515
|
+
*/
|
|
516
|
+
showCardTransactionReportIssueAction?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* The card row was clicked.
|
|
519
|
+
*/
|
|
520
|
+
onCardSelected?: ((payload: { cardId: string; }) => void);
|
|
521
|
+
/**
|
|
522
|
+
* The cardholder row was clicked. Open your own profile surface for that user.
|
|
523
|
+
*/
|
|
524
|
+
onCardholderSelected?: ((payload: { userId: string; }) => void);
|
|
525
|
+
/**
|
|
526
|
+
* Report an issue was clicked. Open the host-owned card dispute flow.
|
|
527
|
+
*/
|
|
528
|
+
onCardTransactionIssueRequested?: ((payload: { transactionId: string; }) => void);
|
|
529
|
+
/**
|
|
530
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
531
|
+
*/
|
|
532
|
+
onLoaderStart?: (() => void);
|
|
533
|
+
/**
|
|
534
|
+
* Runs after the element's first complete paint.
|
|
535
|
+
*/
|
|
536
|
+
onReady?: (() => void);
|
|
537
|
+
/**
|
|
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.
|
|
539
|
+
*/
|
|
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 {
|
|
548
|
+
/**
|
|
549
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
550
|
+
*/
|
|
551
|
+
open(): void;
|
|
552
|
+
/**
|
|
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.
|
|
493
592
|
* @default []
|
|
494
593
|
*/
|
|
495
|
-
|
|
594
|
+
savedCards?: DepositSavedCard[];
|
|
496
595
|
/**
|
|
497
|
-
*
|
|
498
|
-
* @default
|
|
596
|
+
* Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
|
|
597
|
+
* @default false
|
|
499
598
|
*/
|
|
500
|
-
|
|
599
|
+
allowNewCard?: boolean;
|
|
501
600
|
/**
|
|
502
|
-
*
|
|
503
|
-
* @default
|
|
601
|
+
* Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
|
|
602
|
+
* @default false
|
|
504
603
|
*/
|
|
505
|
-
|
|
604
|
+
showPlatformBalance?: boolean;
|
|
506
605
|
/**
|
|
507
|
-
*
|
|
508
|
-
* @default
|
|
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
|
+
* Deposit fees to preview under the rail picker, keyed by rail (`bank`, `crypto`). `percentageFee` is in percentage POINTS (`1.5` is 1.5%); `fixedFeeUsd` is USD major units (`2` is $2.00) whatever the deposit currency. Shows the rate before an amount is typed and the charged amount after.
|
|
612
|
+
* @default {}
|
|
613
|
+
*/
|
|
614
|
+
depositRailFees?: Partial<Record<"bank" | "crypto", DepositRailFee>>;
|
|
615
|
+
/**
|
|
616
|
+
* 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.
|
|
617
|
+
* @default ""
|
|
618
|
+
*/
|
|
619
|
+
preferredMethodId?: string;
|
|
620
|
+
/**
|
|
621
|
+
* 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.
|
|
622
|
+
* @default false
|
|
623
|
+
*/
|
|
624
|
+
deferBankToHost?: boolean;
|
|
625
|
+
/**
|
|
626
|
+
* Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
|
|
627
|
+
* @default false
|
|
628
|
+
*/
|
|
629
|
+
confirmCryptoDeposit?: boolean;
|
|
630
|
+
/**
|
|
631
|
+
* 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.
|
|
632
|
+
* @default "amount"
|
|
633
|
+
*/
|
|
634
|
+
initialStep?: "amount" | "bank" | "crypto";
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* The live handle for a mounted "deposit" element. Returned by `create("deposit")`; in React, the component's `ref`.
|
|
639
|
+
* @see https://docs.whop.com/elements/latest/wallet/deposit
|
|
640
|
+
*/
|
|
641
|
+
export interface DepositElementHandle {
|
|
642
|
+
/**
|
|
643
|
+
* 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.
|
|
644
|
+
*/
|
|
645
|
+
showStep: (input: { step: "amount" | "bank" | "crypto"; }) => Promise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* 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.
|
|
648
|
+
*/
|
|
649
|
+
refresh: () => Promise<void>;
|
|
650
|
+
/**
|
|
651
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
652
|
+
*/
|
|
653
|
+
mount: (target: string | HTMLElement) => void;
|
|
654
|
+
/**
|
|
655
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
656
|
+
*/
|
|
657
|
+
destroy: () => void;
|
|
658
|
+
/**
|
|
659
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
660
|
+
*/
|
|
661
|
+
update: (options: Partial<DepositElementProps>) => void;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Options for `create("deposit")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
666
|
+
* @example
|
|
667
|
+
* ```ts
|
|
668
|
+
* const deposit = wallet.create("deposit", {}); // this interface: props + on<Event> callbacks
|
|
669
|
+
* deposit.mount("#wallet-deposit");
|
|
670
|
+
* ```
|
|
671
|
+
* @see https://docs.whop.com/elements/latest/wallet/deposit
|
|
672
|
+
*/
|
|
673
|
+
export interface DepositElementCreateOptions {
|
|
674
|
+
/**
|
|
675
|
+
* 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.
|
|
676
|
+
*/
|
|
677
|
+
accessToken?: string;
|
|
678
|
+
/**
|
|
679
|
+
* 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.
|
|
680
|
+
* @default ""
|
|
681
|
+
*/
|
|
682
|
+
amount?: string;
|
|
683
|
+
/**
|
|
684
|
+
* Offer the crypto rail when the account has a deposit address.
|
|
685
|
+
* @default true
|
|
686
|
+
*/
|
|
687
|
+
showCrypto?: boolean;
|
|
688
|
+
/**
|
|
689
|
+
* 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.
|
|
690
|
+
* @default true
|
|
691
|
+
*/
|
|
692
|
+
showBank?: boolean;
|
|
693
|
+
/**
|
|
694
|
+
* 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.
|
|
695
|
+
* @default []
|
|
696
|
+
*/
|
|
697
|
+
savedCards?: DepositSavedCard[];
|
|
698
|
+
/**
|
|
699
|
+
* Add an "Add card" row that emits `addCardRequested` so you can open your own card-collection flow.
|
|
700
|
+
* @default false
|
|
701
|
+
*/
|
|
702
|
+
allowNewCard?: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* Offer a "Platform balance" row that emits `platformBalanceSelected` immediately, with no amount step.
|
|
705
|
+
* @default false
|
|
706
|
+
*/
|
|
707
|
+
showPlatformBalance?: boolean;
|
|
708
|
+
/**
|
|
709
|
+
* 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).
|
|
710
|
+
* @default null
|
|
711
|
+
*/
|
|
712
|
+
cardFee?: DepositCardFee | null;
|
|
713
|
+
/**
|
|
714
|
+
* Deposit fees to preview under the rail picker, keyed by rail (`bank`, `crypto`). `percentageFee` is in percentage POINTS (`1.5` is 1.5%); `fixedFeeUsd` is USD major units (`2` is $2.00) whatever the deposit currency. Shows the rate before an amount is typed and the charged amount after.
|
|
715
|
+
* @default {}
|
|
716
|
+
*/
|
|
717
|
+
depositRailFees?: Partial<Record<"bank" | "crypto", DepositRailFee>>;
|
|
718
|
+
/**
|
|
719
|
+
* 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.
|
|
720
|
+
* @default ""
|
|
721
|
+
*/
|
|
722
|
+
preferredMethodId?: string;
|
|
723
|
+
/**
|
|
724
|
+
* 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.
|
|
725
|
+
* @default false
|
|
726
|
+
*/
|
|
727
|
+
deferBankToHost?: boolean;
|
|
728
|
+
/**
|
|
729
|
+
* Show an "I have deposited my funds" button on the crypto screen that emits `depositConfirmed`, so you can start watching for the transfer.
|
|
730
|
+
* @default false
|
|
731
|
+
*/
|
|
732
|
+
confirmCryptoDeposit?: boolean;
|
|
733
|
+
/**
|
|
734
|
+
* 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.
|
|
735
|
+
* @default "amount"
|
|
736
|
+
*/
|
|
737
|
+
initialStep?: "amount" | "bank" | "crypto";
|
|
738
|
+
/**
|
|
739
|
+
* The payer confirmed an amount and a rail. Fires for every rail, before any instructions render — the analytics/funnel hook.
|
|
740
|
+
*/
|
|
741
|
+
onDepositInitiated?: ((payload: { method: "bank" | "crypto" | "card" | "platform_balance"; amount: number; currency: string; paymentMethodId?: string | undefined; }) => void);
|
|
742
|
+
/**
|
|
743
|
+
* A saved card was chosen. Collect the payment on your side, then call `showStep({ step: "amount" })` to return the element to the picker.
|
|
744
|
+
*/
|
|
745
|
+
onCardDepositRequested?: ((payload: { amount: number; currency: string; paymentMethodId: string; }) => void);
|
|
746
|
+
/**
|
|
747
|
+
* The "Add card" row was picked — open your card-collection flow.
|
|
748
|
+
*/
|
|
749
|
+
onAddCardRequested?: ((payload: Record<string, never>) => void);
|
|
750
|
+
/**
|
|
751
|
+
* The bank rail was chosen while `deferBankToHost` is set — run your step, then show the fields yourself or call `showStep({ step: "bank" })`.
|
|
752
|
+
*/
|
|
753
|
+
onBankSelected?: ((payload: Record<string, never>) => void);
|
|
754
|
+
/**
|
|
755
|
+
* 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.
|
|
756
|
+
*/
|
|
757
|
+
onIdentityVerificationRequested?: ((payload: { accountId: string; }) => void);
|
|
758
|
+
/**
|
|
759
|
+
* The platform-balance row was picked. It carries no amount — your own screen collects that.
|
|
760
|
+
*/
|
|
761
|
+
onPlatformBalanceSelected?: ((payload: Record<string, never>) => void);
|
|
762
|
+
/**
|
|
763
|
+
* 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).
|
|
764
|
+
*/
|
|
765
|
+
onDepositConfirmed?: ((payload: { network: string; token: string; networkLabel: string; since: number; }) => void);
|
|
766
|
+
/**
|
|
767
|
+
* The visible screen changed.
|
|
768
|
+
*/
|
|
769
|
+
onStepChanged?: ((payload: { step: "amount" | "bank" | "crypto"; }) => void);
|
|
770
|
+
/**
|
|
771
|
+
* The payer backed out of a rail the element was opened directly onto — close the surface holding it.
|
|
772
|
+
*/
|
|
773
|
+
onDismissed?: ((payload: Record<string, never>) => void);
|
|
774
|
+
/**
|
|
775
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
776
|
+
*/
|
|
777
|
+
onLoaderStart?: (() => void);
|
|
778
|
+
/**
|
|
779
|
+
* Runs after the element's first complete paint.
|
|
780
|
+
*/
|
|
781
|
+
onReady?: (() => void);
|
|
782
|
+
/**
|
|
783
|
+
* 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.
|
|
784
|
+
*/
|
|
785
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* The overlay handle for "deposit". Returned by `createOverlay("deposit")`; drives the modal presentation imperatively.
|
|
790
|
+
* @see https://docs.whop.com/elements/latest/wallet/deposit
|
|
791
|
+
*/
|
|
792
|
+
export interface DepositElementOverlayHandle {
|
|
793
|
+
/**
|
|
794
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
795
|
+
*/
|
|
796
|
+
open(): void;
|
|
797
|
+
/**
|
|
798
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
799
|
+
*/
|
|
800
|
+
close(): void;
|
|
801
|
+
/**
|
|
802
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
803
|
+
*/
|
|
804
|
+
destroy(): void;
|
|
805
|
+
/**
|
|
806
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
807
|
+
*/
|
|
808
|
+
update(options: Partial<DepositElementProps>): void;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Consumer props for the "convert" element. Set at create (or as `<ConvertElement />` JSX props), and updatable live via `update()`.
|
|
813
|
+
* @see https://docs.whop.com/elements/latest/wallet/convert
|
|
814
|
+
*/
|
|
815
|
+
export interface ConvertElementProps {}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* The live handle for a mounted "convert" element. Returned by `create("convert")`; in React, the component's `ref`.
|
|
819
|
+
* @see https://docs.whop.com/elements/latest/wallet/convert
|
|
820
|
+
*/
|
|
821
|
+
export interface ConvertElementHandle {
|
|
822
|
+
/**
|
|
823
|
+
* Re-fetch the account balance after another surface changes it.
|
|
824
|
+
*/
|
|
825
|
+
refresh: () => Promise<void>;
|
|
826
|
+
/**
|
|
827
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
828
|
+
*/
|
|
829
|
+
mount: (target: string | HTMLElement) => void;
|
|
830
|
+
/**
|
|
831
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
832
|
+
*/
|
|
833
|
+
destroy: () => void;
|
|
834
|
+
/**
|
|
835
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
836
|
+
*/
|
|
837
|
+
update: (options: Partial<ConvertElementProps>) => void;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Options for `create("convert")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
842
|
+
* @example
|
|
843
|
+
* ```ts
|
|
844
|
+
* const convert = wallet.create("convert", {}); // this interface: props + on<Event> callbacks
|
|
845
|
+
* convert.mount("#wallet-convert");
|
|
846
|
+
* ```
|
|
847
|
+
* @see https://docs.whop.com/elements/latest/wallet/convert
|
|
848
|
+
*/
|
|
849
|
+
export interface ConvertElementCreateOptions {
|
|
850
|
+
/**
|
|
851
|
+
* The visible conversion step changed.
|
|
852
|
+
*/
|
|
853
|
+
onViewChanged?: ((payload: { view: "pending" | "input" | "review" | "success"; }) => void);
|
|
854
|
+
/**
|
|
855
|
+
* A conversion completed or remains pending after the polling window. Refresh account balance and activity.
|
|
856
|
+
*/
|
|
857
|
+
onBalanceChanged?: ((payload: Record<string, never>) => void);
|
|
858
|
+
/**
|
|
859
|
+
* The viewer finished or dismissed the conversion flow.
|
|
860
|
+
*/
|
|
861
|
+
onDone?: ((payload: Record<string, never>) => void);
|
|
862
|
+
/**
|
|
863
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
864
|
+
*/
|
|
865
|
+
onLoaderStart?: (() => void);
|
|
866
|
+
/**
|
|
867
|
+
* Runs after the element's first complete paint.
|
|
868
|
+
*/
|
|
869
|
+
onReady?: (() => void);
|
|
870
|
+
/**
|
|
871
|
+
* 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.
|
|
872
|
+
*/
|
|
873
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* The overlay handle for "convert". Returned by `createOverlay("convert")`; drives the modal presentation imperatively.
|
|
878
|
+
* @see https://docs.whop.com/elements/latest/wallet/convert
|
|
879
|
+
*/
|
|
880
|
+
export interface ConvertElementOverlayHandle {
|
|
881
|
+
/**
|
|
882
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
883
|
+
*/
|
|
884
|
+
open(): void;
|
|
885
|
+
/**
|
|
886
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
887
|
+
*/
|
|
888
|
+
close(): void;
|
|
889
|
+
/**
|
|
890
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
891
|
+
*/
|
|
892
|
+
destroy(): void;
|
|
893
|
+
/**
|
|
894
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
895
|
+
*/
|
|
896
|
+
update(options: Partial<ConvertElementProps>): void;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Consumer props for the "withdraw" element. Set at create (or as `<WithdrawElement />` JSX props), and updatable live via `update()`.
|
|
901
|
+
* @see https://docs.whop.com/elements/latest/wallet/withdraw
|
|
902
|
+
*/
|
|
903
|
+
export interface WithdrawElementProps {
|
|
904
|
+
/**
|
|
905
|
+
* 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.
|
|
906
|
+
*/
|
|
907
|
+
accessToken?: string;
|
|
908
|
+
/**
|
|
909
|
+
* Whether the confirmed payout was created successfully.
|
|
910
|
+
* @default false
|
|
911
|
+
*/
|
|
912
|
+
succeeded?: boolean;
|
|
913
|
+
/**
|
|
914
|
+
* Saved payout methods with quotes for the current amount.
|
|
915
|
+
* @default []
|
|
916
|
+
*/
|
|
917
|
+
methods?: WithdrawalMethod[];
|
|
918
|
+
/**
|
|
919
|
+
* Settled balance available to standard payout methods.
|
|
920
|
+
* @default 0
|
|
921
|
+
*/
|
|
922
|
+
availableBalance?: number;
|
|
923
|
+
/**
|
|
924
|
+
* Pending balance that may be available to instant payout methods.
|
|
925
|
+
* @default 0
|
|
926
|
+
*/
|
|
927
|
+
pendingBalance?: number;
|
|
928
|
+
/**
|
|
929
|
+
* The payout account's ISO 3166-1 alpha-2 country.
|
|
930
|
+
* @default "US"
|
|
931
|
+
*/
|
|
932
|
+
payoutCountry?: string;
|
|
933
|
+
/**
|
|
934
|
+
* Payout methods available to add in the selected country, including required fields.
|
|
935
|
+
* @default []
|
|
936
|
+
*/
|
|
937
|
+
supportedMethods?: WithdrawalSupportedMethod[];
|
|
938
|
+
/**
|
|
939
|
+
* Whether supported payout methods are loading for the selected country.
|
|
940
|
+
* @default false
|
|
941
|
+
*/
|
|
942
|
+
supportedMethodsLoading?: boolean;
|
|
943
|
+
/**
|
|
944
|
+
* Live standard and instant payout limits.
|
|
945
|
+
* @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
|
|
946
|
+
*/
|
|
947
|
+
limits?: WithdrawalLimits;
|
|
948
|
+
/**
|
|
949
|
+
* Whether payout methods and limits are loading.
|
|
950
|
+
* @default false
|
|
951
|
+
*/
|
|
952
|
+
loading?: boolean;
|
|
953
|
+
/**
|
|
954
|
+
* Whether the current amount is being repriced.
|
|
955
|
+
* @default false
|
|
956
|
+
*/
|
|
957
|
+
quoteLoading?: boolean;
|
|
958
|
+
/**
|
|
959
|
+
* Whether this payout must use an exact provider-backed quote before confirmation.
|
|
960
|
+
* @default false
|
|
961
|
+
*/
|
|
962
|
+
payoutQuoteRequired?: boolean;
|
|
963
|
+
/**
|
|
964
|
+
* The exact short-lived payout quote returned for the current confirmation request.
|
|
965
|
+
* @default null
|
|
966
|
+
*/
|
|
967
|
+
payoutQuote?: WithdrawalPayoutQuote | null;
|
|
968
|
+
/**
|
|
969
|
+
* Whether an exact payout quote is being created.
|
|
970
|
+
* @default false
|
|
971
|
+
*/
|
|
972
|
+
payoutQuoteLoading?: boolean;
|
|
973
|
+
/**
|
|
974
|
+
* The error from the current exact payout quote request, if any.
|
|
975
|
+
* @default ""
|
|
976
|
+
*/
|
|
977
|
+
payoutQuoteError?: string;
|
|
978
|
+
/**
|
|
979
|
+
* Whether the last quote request was inconclusive and must be retried with the same request ID.
|
|
980
|
+
* @default false
|
|
981
|
+
*/
|
|
982
|
+
payoutQuoteRetryRequired?: boolean;
|
|
983
|
+
/**
|
|
984
|
+
* Whether the last payout result was inconclusive and must be retried exactly.
|
|
985
|
+
* @default false
|
|
986
|
+
*/
|
|
987
|
+
withdrawalRetryRequired?: boolean;
|
|
988
|
+
/**
|
|
989
|
+
* The exact unresolved payout request to retry after the element remounts.
|
|
990
|
+
* @default null
|
|
991
|
+
*/
|
|
992
|
+
unresolvedWithdrawalRequest?: WithdrawalRequest | null;
|
|
993
|
+
/**
|
|
994
|
+
* Whether a new payout method is being saved.
|
|
995
|
+
* @default false
|
|
996
|
+
*/
|
|
997
|
+
savingMethod?: boolean;
|
|
998
|
+
/**
|
|
999
|
+
* Whether the confirmed payout is being created.
|
|
1000
|
+
* @default false
|
|
1001
|
+
*/
|
|
1002
|
+
submitting?: boolean;
|
|
1003
|
+
/**
|
|
1004
|
+
* A host-side error to show inside the current screen.
|
|
1005
|
+
* @default ""
|
|
1006
|
+
*/
|
|
1007
|
+
error?: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* 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.
|
|
1010
|
+
* @default false
|
|
1011
|
+
*/
|
|
1012
|
+
bankWarning?: boolean;
|
|
1013
|
+
/**
|
|
1014
|
+
* The most recently created method, selected when it appears in methods.
|
|
1015
|
+
* @default ""
|
|
1016
|
+
*/
|
|
1017
|
+
createdMethodId?: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
|
|
1020
|
+
* @default false
|
|
1021
|
+
*/
|
|
1022
|
+
plaidUnavailable?: boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
|
|
1025
|
+
* @default false
|
|
1026
|
+
*/
|
|
1027
|
+
linkingBank?: boolean;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* The live handle for a mounted "withdraw" element. Returned by `create("withdraw")`; in React, the component's `ref`.
|
|
1032
|
+
* @see https://docs.whop.com/elements/latest/wallet/withdraw
|
|
1033
|
+
*/
|
|
1034
|
+
export interface WithdrawElementHandle {
|
|
1035
|
+
/**
|
|
1036
|
+
* Re-fetch saved payout methods and limits. Call it after anything on your side changes what the account can pay out to.
|
|
1037
|
+
*/
|
|
1038
|
+
refresh: () => Promise<void>;
|
|
1039
|
+
/**
|
|
1040
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1041
|
+
*/
|
|
1042
|
+
mount: (target: string | HTMLElement) => void;
|
|
1043
|
+
/**
|
|
1044
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1045
|
+
*/
|
|
1046
|
+
destroy: () => void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1049
|
+
*/
|
|
1050
|
+
update: (options: Partial<WithdrawElementProps>) => void;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Options for `create("withdraw")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1055
|
+
* @example
|
|
1056
|
+
* ```ts
|
|
1057
|
+
* const withdraw = wallet.create("withdraw", {}); // this interface: props + on<Event> callbacks
|
|
1058
|
+
* withdraw.mount("#wallet-withdraw");
|
|
1059
|
+
* ```
|
|
1060
|
+
* @see https://docs.whop.com/elements/latest/wallet/withdraw
|
|
1061
|
+
*/
|
|
1062
|
+
export interface WithdrawElementCreateOptions {
|
|
1063
|
+
/**
|
|
1064
|
+
* 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.
|
|
1065
|
+
*/
|
|
1066
|
+
accessToken?: string;
|
|
1067
|
+
/**
|
|
1068
|
+
* Whether the confirmed payout was created successfully.
|
|
1069
|
+
* @default false
|
|
1070
|
+
*/
|
|
1071
|
+
succeeded?: boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Saved payout methods with quotes for the current amount.
|
|
1074
|
+
* @default []
|
|
1075
|
+
*/
|
|
1076
|
+
methods?: WithdrawalMethod[];
|
|
1077
|
+
/**
|
|
1078
|
+
* Settled balance available to standard payout methods.
|
|
1079
|
+
* @default 0
|
|
1080
|
+
*/
|
|
1081
|
+
availableBalance?: number;
|
|
1082
|
+
/**
|
|
1083
|
+
* Pending balance that may be available to instant payout methods.
|
|
1084
|
+
* @default 0
|
|
1085
|
+
*/
|
|
1086
|
+
pendingBalance?: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* The payout account's ISO 3166-1 alpha-2 country.
|
|
1089
|
+
* @default "US"
|
|
1090
|
+
*/
|
|
1091
|
+
payoutCountry?: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* Payout methods available to add in the selected country, including required fields.
|
|
1094
|
+
* @default []
|
|
1095
|
+
*/
|
|
1096
|
+
supportedMethods?: WithdrawalSupportedMethod[];
|
|
1097
|
+
/**
|
|
1098
|
+
* Whether supported payout methods are loading for the selected country.
|
|
1099
|
+
* @default false
|
|
1100
|
+
*/
|
|
1101
|
+
supportedMethodsLoading?: boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* Live standard and instant payout limits.
|
|
1104
|
+
* @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
|
|
1105
|
+
*/
|
|
1106
|
+
limits?: WithdrawalLimits;
|
|
1107
|
+
/**
|
|
1108
|
+
* Whether payout methods and limits are loading.
|
|
1109
|
+
* @default false
|
|
1110
|
+
*/
|
|
1111
|
+
loading?: boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* Whether the current amount is being repriced.
|
|
1114
|
+
* @default false
|
|
1115
|
+
*/
|
|
1116
|
+
quoteLoading?: boolean;
|
|
1117
|
+
/**
|
|
1118
|
+
* Whether this payout must use an exact provider-backed quote before confirmation.
|
|
1119
|
+
* @default false
|
|
1120
|
+
*/
|
|
1121
|
+
payoutQuoteRequired?: boolean;
|
|
1122
|
+
/**
|
|
1123
|
+
* The exact short-lived payout quote returned for the current confirmation request.
|
|
1124
|
+
* @default null
|
|
1125
|
+
*/
|
|
1126
|
+
payoutQuote?: WithdrawalPayoutQuote | null;
|
|
1127
|
+
/**
|
|
1128
|
+
* Whether an exact payout quote is being created.
|
|
1129
|
+
* @default false
|
|
1130
|
+
*/
|
|
1131
|
+
payoutQuoteLoading?: boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* The error from the current exact payout quote request, if any.
|
|
1134
|
+
* @default ""
|
|
1135
|
+
*/
|
|
1136
|
+
payoutQuoteError?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* Whether the last quote request was inconclusive and must be retried with the same request ID.
|
|
1139
|
+
* @default false
|
|
1140
|
+
*/
|
|
1141
|
+
payoutQuoteRetryRequired?: boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Whether the last payout result was inconclusive and must be retried exactly.
|
|
1144
|
+
* @default false
|
|
1145
|
+
*/
|
|
1146
|
+
withdrawalRetryRequired?: boolean;
|
|
1147
|
+
/**
|
|
1148
|
+
* The exact unresolved payout request to retry after the element remounts.
|
|
1149
|
+
* @default null
|
|
1150
|
+
*/
|
|
1151
|
+
unresolvedWithdrawalRequest?: WithdrawalRequest | null;
|
|
1152
|
+
/**
|
|
1153
|
+
* Whether a new payout method is being saved.
|
|
1154
|
+
* @default false
|
|
1155
|
+
*/
|
|
1156
|
+
savingMethod?: boolean;
|
|
1157
|
+
/**
|
|
1158
|
+
* Whether the confirmed payout is being created.
|
|
1159
|
+
* @default false
|
|
1160
|
+
*/
|
|
1161
|
+
submitting?: boolean;
|
|
1162
|
+
/**
|
|
1163
|
+
* A host-side error to show inside the current screen.
|
|
1164
|
+
* @default ""
|
|
1165
|
+
*/
|
|
1166
|
+
error?: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* 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.
|
|
1169
|
+
* @default false
|
|
1170
|
+
*/
|
|
1171
|
+
bankWarning?: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* The most recently created method, selected when it appears in methods.
|
|
1174
|
+
* @default ""
|
|
1175
|
+
*/
|
|
1176
|
+
createdMethodId?: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Set when the payer backed out of Plaid Link or it failed to open. Unlocks manual entry on a rail that otherwise requires linking.
|
|
1179
|
+
* @default false
|
|
1180
|
+
*/
|
|
1181
|
+
plaidUnavailable?: boolean;
|
|
1182
|
+
/**
|
|
1183
|
+
* Whether a bank link is in progress — the Plaid session is open, or the linked method is being saved.
|
|
1184
|
+
* @default false
|
|
1185
|
+
*/
|
|
1186
|
+
linkingBank?: boolean;
|
|
1187
|
+
/**
|
|
1188
|
+
* The amount changed and should be repriced.
|
|
1189
|
+
*/
|
|
1190
|
+
onAmountChanged?: ((payload: { amount: number; }) => void);
|
|
1191
|
+
/**
|
|
1192
|
+
* The add-method country changed and supported methods should be refreshed.
|
|
1193
|
+
*/
|
|
1194
|
+
onCountryChanged?: ((payload: { country: string; }) => void);
|
|
1195
|
+
/**
|
|
1196
|
+
* A supported payout method was selected and its exact required fields should be loaded.
|
|
1197
|
+
*/
|
|
1198
|
+
onSupportedMethodChanged?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
|
|
1199
|
+
/**
|
|
1200
|
+
* The payer submitted the dynamic add-payout-method form.
|
|
1201
|
+
*/
|
|
1202
|
+
onAddMethodRequested?: ((payload: WithdrawalCreateMethodInput) => void);
|
|
1203
|
+
/**
|
|
1204
|
+
* The payer chose to link their bank through Plaid instead of typing details. Open Plaid Link on receipt.
|
|
1205
|
+
*/
|
|
1206
|
+
onPlaidLinkRequested?: ((payload: { country: string; supportedPayoutMethodId: string; destinationCurrency: string; }) => void);
|
|
1207
|
+
/**
|
|
1208
|
+
* The newly added payout method finished its verification step.
|
|
1209
|
+
*/
|
|
1210
|
+
onMethodVerificationCompleted?: ((payload: Record<string, never>) => void);
|
|
1211
|
+
/**
|
|
1212
|
+
* The payer requested to rename a saved payout method.
|
|
1213
|
+
*/
|
|
1214
|
+
onRenameMethodRequested?: ((payload: { methodId: string; }) => void);
|
|
1215
|
+
/**
|
|
1216
|
+
* The payer requested to remove a saved payout method.
|
|
1217
|
+
*/
|
|
1218
|
+
onRemoveMethodRequested?: ((payload: { methodId: string; }) => void);
|
|
1219
|
+
/**
|
|
1220
|
+
* The payer requested an exact short-lived quote before confirming a payout.
|
|
1221
|
+
*/
|
|
1222
|
+
onPayoutQuoteRequested?: ((payload: WithdrawalPayoutQuoteRequest) => void);
|
|
1223
|
+
/**
|
|
1224
|
+
* 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.
|
|
1225
|
+
*/
|
|
1226
|
+
onWithdrawalRequested?: ((payload: WithdrawalRequest) => void);
|
|
1227
|
+
/**
|
|
1228
|
+
* The payer finished reviewing a successful payout.
|
|
1229
|
+
*/
|
|
1230
|
+
onDone?: ((payload: Record<string, never>) => void);
|
|
1231
|
+
/**
|
|
1232
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1233
|
+
*/
|
|
1234
|
+
onLoaderStart?: (() => void);
|
|
1235
|
+
/**
|
|
1236
|
+
* Runs after the element's first complete paint.
|
|
1237
|
+
*/
|
|
1238
|
+
onReady?: (() => void);
|
|
1239
|
+
/**
|
|
1240
|
+
* 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.
|
|
1241
|
+
*/
|
|
1242
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* The overlay handle for "withdraw". Returned by `createOverlay("withdraw")`; drives the modal presentation imperatively.
|
|
1247
|
+
* @see https://docs.whop.com/elements/latest/wallet/withdraw
|
|
1248
|
+
*/
|
|
1249
|
+
export interface WithdrawElementOverlayHandle {
|
|
1250
|
+
/**
|
|
1251
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
1252
|
+
*/
|
|
1253
|
+
open(): void;
|
|
1254
|
+
/**
|
|
1255
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
1256
|
+
*/
|
|
1257
|
+
close(): void;
|
|
1258
|
+
/**
|
|
1259
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1260
|
+
*/
|
|
1261
|
+
destroy(): void;
|
|
1262
|
+
/**
|
|
1263
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1264
|
+
*/
|
|
1265
|
+
update(options: Partial<WithdrawElementProps>): void;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Consumer props for the "send" element. Set at create (or as `<SendElement />` JSX props), and updatable live via `update()`.
|
|
1270
|
+
* @see https://docs.whop.com/elements/latest/wallet/send
|
|
1271
|
+
*/
|
|
1272
|
+
export interface SendElementProps {
|
|
1273
|
+
/**
|
|
1274
|
+
* 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.
|
|
1275
|
+
*/
|
|
1276
|
+
accessToken?: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* Overrides the recipient-picker header. Omitted, the header is "Choose recipient".
|
|
1279
|
+
*/
|
|
1280
|
+
title?: string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
|
|
1283
|
+
* @default true
|
|
1284
|
+
*/
|
|
1285
|
+
canSearchRecipients?: boolean;
|
|
1286
|
+
/**
|
|
1287
|
+
* Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
|
|
1288
|
+
* @default true
|
|
1289
|
+
*/
|
|
1290
|
+
canCreateLink?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* 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.
|
|
1293
|
+
* @default null
|
|
1294
|
+
*/
|
|
1295
|
+
initialRecipient?: SendRecipient | null;
|
|
1296
|
+
/**
|
|
1297
|
+
* Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
|
|
1298
|
+
* @default ""
|
|
1299
|
+
*/
|
|
1300
|
+
initialCurrency?: string;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* The live handle for a mounted "send" element. Returned by `create("send")`; in React, the component's `ref`.
|
|
1305
|
+
* @see https://docs.whop.com/elements/latest/wallet/send
|
|
1306
|
+
*/
|
|
1307
|
+
export interface SendElementHandle {
|
|
1308
|
+
/**
|
|
1309
|
+
* Re-fetch the account's balances and recipient list. Call it after anything on your side changes what it can offer.
|
|
1310
|
+
*/
|
|
1311
|
+
refresh: () => Promise<void>;
|
|
1312
|
+
/**
|
|
1313
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1314
|
+
*/
|
|
1315
|
+
mount: (target: string | HTMLElement) => void;
|
|
1316
|
+
/**
|
|
1317
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1318
|
+
*/
|
|
1319
|
+
destroy: () => void;
|
|
1320
|
+
/**
|
|
1321
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1322
|
+
*/
|
|
1323
|
+
update: (options: Partial<SendElementProps>) => void;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Options for `create("send")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1328
|
+
* @example
|
|
1329
|
+
* ```ts
|
|
1330
|
+
* const send = wallet.create("send", {}); // this interface: props + on<Event> callbacks
|
|
1331
|
+
* send.mount("#wallet-send");
|
|
1332
|
+
* ```
|
|
1333
|
+
* @see https://docs.whop.com/elements/latest/wallet/send
|
|
1334
|
+
*/
|
|
1335
|
+
export interface SendElementCreateOptions {
|
|
1336
|
+
/**
|
|
1337
|
+
* 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.
|
|
1338
|
+
*/
|
|
1339
|
+
accessToken?: string;
|
|
1340
|
+
/**
|
|
1341
|
+
* Overrides the recipient-picker header. Omitted, the header is "Choose recipient".
|
|
1342
|
+
*/
|
|
1343
|
+
title?: string;
|
|
1344
|
+
/**
|
|
1345
|
+
* Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
|
|
1346
|
+
* @default true
|
|
1347
|
+
*/
|
|
1348
|
+
canSearchRecipients?: boolean;
|
|
1349
|
+
/**
|
|
1350
|
+
* Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
|
|
1351
|
+
* @default true
|
|
1352
|
+
*/
|
|
1353
|
+
canCreateLink?: boolean;
|
|
1354
|
+
/**
|
|
1355
|
+
* 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.
|
|
1356
|
+
* @default null
|
|
1357
|
+
*/
|
|
1358
|
+
initialRecipient?: SendRecipient | null;
|
|
1359
|
+
/**
|
|
1360
|
+
* Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
|
|
1361
|
+
* @default ""
|
|
1362
|
+
*/
|
|
1363
|
+
initialCurrency?: string;
|
|
1364
|
+
/**
|
|
1365
|
+
* The visible screen changed.
|
|
1366
|
+
*/
|
|
1367
|
+
onStepChanged?: ((payload: { step: "success" | "enter_amount" | "select_recipient" | "create_link" | "link_success"; }) => void);
|
|
1368
|
+
/**
|
|
1369
|
+
* A transfer succeeded. Refresh anything on your side reading the account's balance or activity.
|
|
1370
|
+
*/
|
|
1371
|
+
onSendCompleted?: ((payload: { recipient: SendRecipient; amount: number; currency: string; }) => void);
|
|
1372
|
+
/**
|
|
1373
|
+
* A claim link was created. Refresh anything on your side reading the account's balance.
|
|
1374
|
+
*/
|
|
1375
|
+
onLinkCreated?: ((payload: { claimUrl: string; amount: number; redeemableCount: number; }) => void);
|
|
1376
|
+
/**
|
|
1377
|
+
* The viewer clicked "Done" on a success screen — close the surface holding it.
|
|
1378
|
+
*/
|
|
1379
|
+
onDone?: ((payload: Record<string, never>) => void);
|
|
1380
|
+
/**
|
|
1381
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1382
|
+
*/
|
|
1383
|
+
onLoaderStart?: (() => void);
|
|
1384
|
+
/**
|
|
1385
|
+
* Runs after the element's first complete paint.
|
|
1386
|
+
*/
|
|
1387
|
+
onReady?: (() => void);
|
|
1388
|
+
/**
|
|
1389
|
+
* 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.
|
|
1390
|
+
*/
|
|
1391
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* The overlay handle for "send". Returned by `createOverlay("send")`; drives the modal presentation imperatively.
|
|
1396
|
+
* @see https://docs.whop.com/elements/latest/wallet/send
|
|
1397
|
+
*/
|
|
1398
|
+
export interface SendElementOverlayHandle {
|
|
1399
|
+
/**
|
|
1400
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
1401
|
+
*/
|
|
1402
|
+
open(): void;
|
|
1403
|
+
/**
|
|
1404
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
1405
|
+
*/
|
|
1406
|
+
close(): void;
|
|
1407
|
+
/**
|
|
1408
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1409
|
+
*/
|
|
1410
|
+
destroy(): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1413
|
+
*/
|
|
1414
|
+
update(options: Partial<SendElementProps>): void;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Consumer props for the "cardDetails" element. Set at create (or as `<CardDetailsElement />` JSX props), and updatable live via `update()`.
|
|
1419
|
+
* @see https://docs.whop.com/elements/latest/wallet/cardDetails
|
|
1420
|
+
*/
|
|
1421
|
+
export interface CardDetailsElementProps {
|
|
1422
|
+
/**
|
|
1423
|
+
* 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.
|
|
1424
|
+
*/
|
|
1425
|
+
accessToken?: string;
|
|
1426
|
+
/**
|
|
1427
|
+
* 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.
|
|
1428
|
+
*/
|
|
1429
|
+
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; };
|
|
1430
|
+
/**
|
|
1431
|
+
* The card this drawer describes, prefixed `icrd_`.
|
|
1432
|
+
* @default ""
|
|
1433
|
+
*/
|
|
1434
|
+
cardId?: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* How many recent transactions to list under the card.
|
|
1437
|
+
* @default 5
|
|
1438
|
+
*/
|
|
1439
|
+
latestCount?: number;
|
|
1440
|
+
/**
|
|
1441
|
+
* Hide the latest-transactions list, for a host that shows its own beneath the drawer.
|
|
1442
|
+
* @default false
|
|
1443
|
+
*/
|
|
1444
|
+
hideTransactions?: boolean;
|
|
1445
|
+
/**
|
|
1446
|
+
* Hide the overflow button, for a host with no card actions of its own to offer.
|
|
1447
|
+
* @default false
|
|
1448
|
+
*/
|
|
1449
|
+
hideMenuButton?: boolean;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* The live handle for a mounted "cardDetails" element. Returned by `create("cardDetails")`; in React, the component's `ref`.
|
|
1454
|
+
* @see https://docs.whop.com/elements/latest/wallet/cardDetails
|
|
1455
|
+
*/
|
|
1456
|
+
export interface CardDetailsElementHandle {
|
|
1457
|
+
/**
|
|
1458
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1459
|
+
*/
|
|
1460
|
+
mount: (target: string | HTMLElement) => void;
|
|
1461
|
+
/**
|
|
1462
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1463
|
+
*/
|
|
1464
|
+
destroy: () => void;
|
|
1465
|
+
/**
|
|
1466
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1467
|
+
*/
|
|
1468
|
+
update: (options: Partial<CardDetailsElementProps>) => void;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Options for `create("cardDetails")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1473
|
+
* @example
|
|
1474
|
+
* ```ts
|
|
1475
|
+
* const cardDetails = wallet.createOverlay("cardDetails", {}); // this interface: props + on<Event> callbacks
|
|
1476
|
+
* cardDetails.open();
|
|
1477
|
+
* ```
|
|
1478
|
+
* @see https://docs.whop.com/elements/latest/wallet/cardDetails
|
|
1479
|
+
*/
|
|
1480
|
+
export interface CardDetailsElementCreateOptions {
|
|
1481
|
+
/**
|
|
1482
|
+
* 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.
|
|
1483
|
+
*/
|
|
1484
|
+
accessToken?: string;
|
|
1485
|
+
/**
|
|
1486
|
+
* 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.
|
|
1487
|
+
*/
|
|
1488
|
+
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; };
|
|
1489
|
+
/**
|
|
1490
|
+
* The card this drawer describes, prefixed `icrd_`.
|
|
1491
|
+
* @default ""
|
|
1492
|
+
*/
|
|
1493
|
+
cardId?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* How many recent transactions to list under the card.
|
|
1496
|
+
* @default 5
|
|
1497
|
+
*/
|
|
1498
|
+
latestCount?: number;
|
|
1499
|
+
/**
|
|
1500
|
+
* Hide the latest-transactions list, for a host that shows its own beneath the drawer.
|
|
1501
|
+
* @default false
|
|
1502
|
+
*/
|
|
1503
|
+
hideTransactions?: boolean;
|
|
1504
|
+
/**
|
|
1505
|
+
* Hide the overflow button, for a host with no card actions of its own to offer.
|
|
1506
|
+
* @default false
|
|
1507
|
+
*/
|
|
1508
|
+
hideMenuButton?: boolean;
|
|
1509
|
+
/**
|
|
1510
|
+
* A transaction in the drawer was pressed.
|
|
1511
|
+
*/
|
|
1512
|
+
onTransactionSelected?: ((payload: { transactionId: string; }) => void);
|
|
1513
|
+
/**
|
|
1514
|
+
* View all was pressed. Open your own full transaction surface — the drawer never navigates.
|
|
1515
|
+
*/
|
|
1516
|
+
onAllTransactionsRequested?: ((payload: { cardId: string; }) => void);
|
|
1517
|
+
/**
|
|
1518
|
+
* Top up was pressed. Present your own funding surface, such as the wallet's deposit element.
|
|
1519
|
+
*/
|
|
1520
|
+
onTopUpRequested?: ((payload: { cardId: string; }) => void);
|
|
1521
|
+
/**
|
|
1522
|
+
* Close was pressed. Dismiss the surface you opened the drawer in — the drawer never closes itself.
|
|
1523
|
+
*/
|
|
1524
|
+
onCloseRequested?: ((payload: { cardId: string; }) => void);
|
|
1525
|
+
/**
|
|
1526
|
+
* The overflow button was pressed. Present your own card actions menu.
|
|
1527
|
+
*/
|
|
1528
|
+
onMenuRequested?: ((payload: { cardId: string; }) => void);
|
|
1529
|
+
/**
|
|
1530
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1531
|
+
*/
|
|
1532
|
+
onLoaderStart?: (() => void);
|
|
1533
|
+
/**
|
|
1534
|
+
* Runs after the element's first complete paint.
|
|
1535
|
+
*/
|
|
1536
|
+
onReady?: (() => void);
|
|
1537
|
+
/**
|
|
1538
|
+
* 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.
|
|
1539
|
+
*/
|
|
1540
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
/**
|
|
1544
|
+
* The overlay handle for "cardDetails". Returned by `createOverlay("cardDetails")`; drives the modal presentation imperatively.
|
|
1545
|
+
* @see https://docs.whop.com/elements/latest/wallet/cardDetails
|
|
1546
|
+
*/
|
|
1547
|
+
export interface CardDetailsElementOverlayHandle {
|
|
1548
|
+
/**
|
|
1549
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
1550
|
+
*/
|
|
1551
|
+
open(): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
1554
|
+
*/
|
|
1555
|
+
close(): void;
|
|
1556
|
+
/**
|
|
1557
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1558
|
+
*/
|
|
1559
|
+
destroy(): void;
|
|
1560
|
+
/**
|
|
1561
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1562
|
+
*/
|
|
1563
|
+
update(options: Partial<CardDetailsElementProps>): void;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* Consumer props for the "verification" element. Set at create (or as `<VerificationElement />` JSX props), and updatable live via `update()`.
|
|
1568
|
+
* @see https://docs.whop.com/elements/latest/wallet/verification
|
|
1569
|
+
*/
|
|
1570
|
+
export interface VerificationElementProps {
|
|
1571
|
+
/**
|
|
1572
|
+
* 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.
|
|
1573
|
+
*/
|
|
1574
|
+
accessToken?: string;
|
|
1575
|
+
/**
|
|
1576
|
+
* 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.
|
|
1577
|
+
* @default "individual"
|
|
1578
|
+
*/
|
|
1579
|
+
kind?: "individual" | "business";
|
|
1580
|
+
/**
|
|
1581
|
+
* Show a compact inline prompt without the supporting description.
|
|
1582
|
+
* @default false
|
|
1583
|
+
*/
|
|
1584
|
+
compact?: boolean;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* The live handle for a mounted "verification" element. Returned by `create("verification")`; in React, the component's `ref`.
|
|
1589
|
+
* @see https://docs.whop.com/elements/latest/wallet/verification
|
|
1590
|
+
*/
|
|
1591
|
+
export interface VerificationElementHandle {
|
|
1592
|
+
/**
|
|
1593
|
+
* 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.
|
|
1594
|
+
*/
|
|
1595
|
+
refresh: () => Promise<void>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1598
|
+
*/
|
|
1599
|
+
mount: (target: string | HTMLElement) => void;
|
|
1600
|
+
/**
|
|
1601
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1602
|
+
*/
|
|
1603
|
+
destroy: () => void;
|
|
1604
|
+
/**
|
|
1605
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1606
|
+
*/
|
|
1607
|
+
update: (options: Partial<VerificationElementProps>) => void;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* Options for `create("verification")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1612
|
+
* @example
|
|
1613
|
+
* ```ts
|
|
1614
|
+
* const verification = wallet.create("verification", {}); // this interface: props + on<Event> callbacks
|
|
1615
|
+
* verification.mount("#wallet-verification");
|
|
1616
|
+
* ```
|
|
1617
|
+
* @see https://docs.whop.com/elements/latest/wallet/verification
|
|
1618
|
+
*/
|
|
1619
|
+
export interface VerificationElementCreateOptions {
|
|
1620
|
+
/**
|
|
1621
|
+
* 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.
|
|
1622
|
+
*/
|
|
1623
|
+
accessToken?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* 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.
|
|
1626
|
+
* @default "individual"
|
|
1627
|
+
*/
|
|
1628
|
+
kind?: "individual" | "business";
|
|
1629
|
+
/**
|
|
1630
|
+
* Show a compact inline prompt without the supporting description.
|
|
1631
|
+
* @default false
|
|
1632
|
+
*/
|
|
1633
|
+
compact?: boolean;
|
|
1634
|
+
/**
|
|
1635
|
+
* The viewer pressed the verify button. The element never navigates — mount your own verification, such as the `verifications` controller, in answer to this.
|
|
1636
|
+
*/
|
|
1637
|
+
onVerificationRequested?: ((payload: { accountId: string; }) => void);
|
|
1638
|
+
/**
|
|
1639
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1640
|
+
*/
|
|
1641
|
+
onLoaderStart?: (() => void);
|
|
1642
|
+
/**
|
|
1643
|
+
* Runs after the element's first complete paint.
|
|
1644
|
+
*/
|
|
1645
|
+
onReady?: (() => void);
|
|
1646
|
+
/**
|
|
1647
|
+
* 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.
|
|
1648
|
+
*/
|
|
1649
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
/**
|
|
1653
|
+
* 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.
|
|
1654
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1655
|
+
*/
|
|
1656
|
+
export interface BalancesSubOptions {
|
|
1657
|
+
/**
|
|
1658
|
+
* A scoped token for balance breakdown and settlement reads. An account needs `company:balance:read`. Omitted, the viewer's same-origin session is used.
|
|
1659
|
+
*/
|
|
1660
|
+
accessToken?: string;
|
|
1661
|
+
/**
|
|
1662
|
+
* 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.
|
|
1663
|
+
* @default false
|
|
1664
|
+
*/
|
|
1665
|
+
openHoldingOnSelect?: boolean;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Consumer props for the "balances" sub-controller's "balance" element.
|
|
1670
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1671
|
+
*/
|
|
1672
|
+
export interface BalanceElementProps {
|
|
1673
|
+
/**
|
|
1674
|
+
* 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.
|
|
1675
|
+
* @default ""
|
|
1676
|
+
*/
|
|
1677
|
+
accessToken?: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
|
|
1680
|
+
* @default "1M"
|
|
1681
|
+
*/
|
|
1682
|
+
range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
|
|
1683
|
+
/**
|
|
1684
|
+
* 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.
|
|
1685
|
+
* @default ""
|
|
1686
|
+
*/
|
|
1687
|
+
openedAt?: string;
|
|
1688
|
+
/**
|
|
1689
|
+
* 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`.
|
|
1690
|
+
* @default ""
|
|
1691
|
+
*/
|
|
1692
|
+
accountName?: string;
|
|
1693
|
+
/**
|
|
1694
|
+
* 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.
|
|
1695
|
+
* @default null
|
|
1696
|
+
*/
|
|
1697
|
+
brush?: { from: string; to: string; } | null;
|
|
1698
|
+
/**
|
|
1699
|
+
* 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.
|
|
1700
|
+
* @default ""
|
|
1701
|
+
*/
|
|
1702
|
+
markedAt?: string;
|
|
1703
|
+
/**
|
|
1704
|
+
* 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.
|
|
1705
|
+
* @default false
|
|
1706
|
+
*/
|
|
1707
|
+
includeOwnedAccounts?: boolean;
|
|
1708
|
+
/**
|
|
1709
|
+
* Hide the total and its change, leaving the chart and the range buttons.
|
|
1710
|
+
* @default false
|
|
1711
|
+
*/
|
|
1712
|
+
hideTotal?: boolean;
|
|
1713
|
+
/**
|
|
1714
|
+
* Hide the chart, leaving the total and the range buttons.
|
|
1715
|
+
* @default false
|
|
1716
|
+
*/
|
|
1717
|
+
hideChart?: boolean;
|
|
1718
|
+
/**
|
|
1719
|
+
* How tall the chart is drawn, in pixels.
|
|
1720
|
+
* @default 210
|
|
1721
|
+
*/
|
|
1722
|
+
height?: number;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* The live handle for a mounted "balance" element. Returned by the "balances" sub handle's `create("balance")`.
|
|
1727
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1728
|
+
*/
|
|
1729
|
+
export interface BalanceElementHandle {
|
|
1730
|
+
/**
|
|
1731
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1732
|
+
*/
|
|
1733
|
+
mount: (target: string | HTMLElement) => void;
|
|
1734
|
+
/**
|
|
1735
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
1736
|
+
*/
|
|
1737
|
+
destroy: () => void;
|
|
1738
|
+
/**
|
|
1739
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1740
|
+
*/
|
|
1741
|
+
update: (options: Partial<BalanceElementProps>) => void;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* Options for the "balances" sub handle's `create("balance")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1746
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1747
|
+
*/
|
|
1748
|
+
export interface BalanceElementCreateOptions {
|
|
1749
|
+
/**
|
|
1750
|
+
* 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.
|
|
1751
|
+
* @default ""
|
|
1752
|
+
*/
|
|
1753
|
+
accessToken?: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* The time range to open on. The buttons change it from there, or set this prop again to control it yourself.
|
|
1756
|
+
* @default "1M"
|
|
1757
|
+
*/
|
|
1758
|
+
range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
|
|
1759
|
+
/**
|
|
1760
|
+
* 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.
|
|
1761
|
+
* @default ""
|
|
1762
|
+
*/
|
|
1763
|
+
openedAt?: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* 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`.
|
|
1766
|
+
* @default ""
|
|
1767
|
+
*/
|
|
1768
|
+
accountName?: string;
|
|
1769
|
+
/**
|
|
1770
|
+
* 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.
|
|
1771
|
+
* @default null
|
|
1772
|
+
*/
|
|
1773
|
+
brush?: { from: string; to: string; } | null;
|
|
1774
|
+
/**
|
|
1775
|
+
* 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.
|
|
1776
|
+
* @default ""
|
|
1777
|
+
*/
|
|
1778
|
+
markedAt?: string;
|
|
1779
|
+
/**
|
|
1780
|
+
* 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.
|
|
1781
|
+
* @default false
|
|
1782
|
+
*/
|
|
1783
|
+
includeOwnedAccounts?: boolean;
|
|
1784
|
+
/**
|
|
1785
|
+
* Hide the total and its change, leaving the chart and the range buttons.
|
|
1786
|
+
* @default false
|
|
1787
|
+
*/
|
|
1788
|
+
hideTotal?: boolean;
|
|
1789
|
+
/**
|
|
1790
|
+
* Hide the chart, leaving the total and the range buttons.
|
|
1791
|
+
* @default false
|
|
1792
|
+
*/
|
|
1793
|
+
hideChart?: boolean;
|
|
1794
|
+
/**
|
|
1795
|
+
* How tall the chart is drawn, in pixels.
|
|
1796
|
+
* @default 210
|
|
1797
|
+
*/
|
|
1798
|
+
height?: number;
|
|
1799
|
+
/**
|
|
1800
|
+
* The visible time range changed. Mirror it if something else on your page reads the same period.
|
|
1801
|
+
*/
|
|
1802
|
+
onRangeChanged?: ((payload: { range: "1D" | "1W" | "1M" | "1Y" | "ALL"; }) => void);
|
|
1803
|
+
/**
|
|
1804
|
+
* 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.
|
|
1805
|
+
*/
|
|
1806
|
+
onRangeBrushed?: ((payload: { from: string; to: string; range: "1D" | "1W" | "1M" | "1Y" | "ALL"; } | null) => void);
|
|
1807
|
+
/**
|
|
1808
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1809
|
+
*/
|
|
1810
|
+
onLoaderStart?: (() => void);
|
|
1811
|
+
/**
|
|
1812
|
+
* Runs after the element's first complete paint.
|
|
1813
|
+
*/
|
|
1814
|
+
onReady?: (() => void);
|
|
1815
|
+
/**
|
|
1816
|
+
* 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.
|
|
1817
|
+
*/
|
|
1818
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Consumer props for the "balances" sub-controller's "breakdown" element.
|
|
1823
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1824
|
+
*/
|
|
1825
|
+
export interface BreakdownElementProps {
|
|
1826
|
+
/**
|
|
1827
|
+
* Off, the element performs no reads and renders a zero balance.
|
|
1828
|
+
* @default true
|
|
1829
|
+
*/
|
|
1830
|
+
enabled?: boolean;
|
|
1831
|
+
/**
|
|
1832
|
+
* Show amounts in the selected holding. Turn this off to value the same balance breakdown in USD.
|
|
1833
|
+
* @default true
|
|
1834
|
+
*/
|
|
1835
|
+
showSourceCurrency?: boolean;
|
|
1836
|
+
/**
|
|
1837
|
+
* Show the currency title and total above the rows. Turn this off when the surface around it already shows them.
|
|
1838
|
+
* @default true
|
|
1839
|
+
*/
|
|
1840
|
+
showTotal?: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* Draw the surrounding page padding. Turn this off when the surface around it already provides it.
|
|
1843
|
+
* @default true
|
|
1844
|
+
*/
|
|
1845
|
+
padded?: boolean;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
/**
|
|
1849
|
+
* The live handle for a mounted "breakdown" element. Returned by the "balances" sub handle's `create("breakdown")`.
|
|
1850
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1851
|
+
*/
|
|
1852
|
+
export interface BreakdownElementHandle {
|
|
1853
|
+
/**
|
|
1854
|
+
* Re-fetch the balance after the host moves money.
|
|
1855
|
+
*/
|
|
1856
|
+
refresh: () => Promise<void>;
|
|
1857
|
+
/**
|
|
1858
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
509
1859
|
*/
|
|
510
|
-
|
|
1860
|
+
mount: (target: string | HTMLElement) => void;
|
|
511
1861
|
/**
|
|
512
|
-
*
|
|
513
|
-
* @default []
|
|
1862
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
514
1863
|
*/
|
|
515
|
-
|
|
1864
|
+
destroy: () => void;
|
|
516
1865
|
/**
|
|
517
|
-
*
|
|
518
|
-
* @default false
|
|
1866
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
519
1867
|
*/
|
|
520
|
-
|
|
1868
|
+
update: (options: Partial<BreakdownElementProps>) => void;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* Options for the "balances" sub handle's `create("breakdown")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1873
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1874
|
+
*/
|
|
1875
|
+
export interface BreakdownElementCreateOptions {
|
|
521
1876
|
/**
|
|
522
|
-
*
|
|
523
|
-
* @default
|
|
1877
|
+
* Off, the element performs no reads and renders a zero balance.
|
|
1878
|
+
* @default true
|
|
524
1879
|
*/
|
|
525
|
-
|
|
1880
|
+
enabled?: boolean;
|
|
526
1881
|
/**
|
|
527
|
-
*
|
|
528
|
-
* @default
|
|
1882
|
+
* Show amounts in the selected holding. Turn this off to value the same balance breakdown in USD.
|
|
1883
|
+
* @default true
|
|
529
1884
|
*/
|
|
530
|
-
|
|
1885
|
+
showSourceCurrency?: boolean;
|
|
531
1886
|
/**
|
|
532
|
-
*
|
|
533
|
-
* @default
|
|
1887
|
+
* Show the currency title and total above the rows. Turn this off when the surface around it already shows them.
|
|
1888
|
+
* @default true
|
|
534
1889
|
*/
|
|
535
|
-
|
|
1890
|
+
showTotal?: boolean;
|
|
536
1891
|
/**
|
|
537
|
-
*
|
|
538
|
-
* @default
|
|
1892
|
+
* Draw the surrounding page padding. Turn this off when the surface around it already provides it.
|
|
1893
|
+
* @default true
|
|
539
1894
|
*/
|
|
540
|
-
|
|
1895
|
+
padded?: boolean;
|
|
541
1896
|
/**
|
|
542
|
-
*
|
|
543
|
-
* @default false
|
|
1897
|
+
* A balance row or its matching bar segment was clicked. The host can open details for `available`, `pending`, `reserve`, or `debt`.
|
|
544
1898
|
*/
|
|
545
|
-
|
|
1899
|
+
onBreakdownSelected?: ((payload: { category: "pending" | "available" | "debt" | "reserve"; }) => void);
|
|
546
1900
|
/**
|
|
547
|
-
*
|
|
548
|
-
* @default ""
|
|
1901
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
549
1902
|
*/
|
|
550
|
-
|
|
1903
|
+
onLoaderStart?: (() => void);
|
|
551
1904
|
/**
|
|
552
|
-
*
|
|
553
|
-
* @default false
|
|
1905
|
+
* Runs after the element's first complete paint.
|
|
554
1906
|
*/
|
|
555
|
-
|
|
1907
|
+
onReady?: (() => void);
|
|
556
1908
|
/**
|
|
557
|
-
* The
|
|
558
|
-
* @default ""
|
|
1909
|
+
* 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.
|
|
559
1910
|
*/
|
|
560
|
-
|
|
1911
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* Consumer props for the "balances" sub-controller's "settlement" element.
|
|
1916
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1917
|
+
*/
|
|
1918
|
+
export interface SettlementElementProps {
|
|
561
1919
|
/**
|
|
562
|
-
*
|
|
563
|
-
* @default
|
|
1920
|
+
* Off, the Element performs no read and renders an empty details state.
|
|
1921
|
+
* @default true
|
|
564
1922
|
*/
|
|
565
|
-
|
|
1923
|
+
enabled?: boolean;
|
|
566
1924
|
/**
|
|
567
|
-
*
|
|
568
|
-
* @default
|
|
1925
|
+
* Show amounts in the selected holding. Turn this off to value the details in USD.
|
|
1926
|
+
* @default true
|
|
569
1927
|
*/
|
|
570
|
-
|
|
1928
|
+
showSourceCurrency?: boolean;
|
|
571
1929
|
}
|
|
572
1930
|
|
|
573
1931
|
/**
|
|
574
|
-
* The live handle for a mounted "
|
|
575
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
1932
|
+
* The live handle for a mounted "settlement" element. Returned by the "balances" sub handle's `create("settlement")`.
|
|
1933
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
576
1934
|
*/
|
|
577
|
-
export interface
|
|
1935
|
+
export interface SettlementElementHandle {
|
|
1936
|
+
/**
|
|
1937
|
+
* Re-fetch settlement and reserve details.
|
|
1938
|
+
*/
|
|
1939
|
+
refresh: () => Promise<void>;
|
|
578
1940
|
/**
|
|
579
1941
|
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
580
1942
|
*/
|
|
@@ -586,219 +1948,286 @@ export interface WithdrawElementHandle {
|
|
|
586
1948
|
/**
|
|
587
1949
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
588
1950
|
*/
|
|
589
|
-
update: (options: Partial<
|
|
1951
|
+
update: (options: Partial<SettlementElementProps>) => void;
|
|
590
1952
|
}
|
|
591
1953
|
|
|
592
1954
|
/**
|
|
593
|
-
* Options for `create("
|
|
594
|
-
* @
|
|
595
|
-
* ```ts
|
|
596
|
-
* const withdraw = wallet.create("withdraw", {}); // this interface: props + on<Event> callbacks
|
|
597
|
-
* withdraw.mount("#wallet-withdraw");
|
|
598
|
-
* ```
|
|
599
|
-
* @see https://docs.whop.com/elements/latest/wallet/withdraw
|
|
1955
|
+
* Options for the "balances" sub handle's `create("settlement")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1956
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
600
1957
|
*/
|
|
601
|
-
export interface
|
|
1958
|
+
export interface SettlementElementCreateOptions {
|
|
602
1959
|
/**
|
|
603
|
-
*
|
|
604
|
-
* @default
|
|
1960
|
+
* Off, the Element performs no read and renders an empty details state.
|
|
1961
|
+
* @default true
|
|
605
1962
|
*/
|
|
606
|
-
|
|
1963
|
+
enabled?: boolean;
|
|
607
1964
|
/**
|
|
608
|
-
*
|
|
609
|
-
* @default
|
|
1965
|
+
* Show amounts in the selected holding. Turn this off to value the details in USD.
|
|
1966
|
+
* @default true
|
|
610
1967
|
*/
|
|
611
|
-
|
|
1968
|
+
showSourceCurrency?: boolean;
|
|
612
1969
|
/**
|
|
613
|
-
*
|
|
614
|
-
* @default 0
|
|
1970
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
615
1971
|
*/
|
|
616
|
-
|
|
1972
|
+
onLoaderStart?: (() => void);
|
|
617
1973
|
/**
|
|
618
|
-
*
|
|
619
|
-
* @default 0
|
|
1974
|
+
* Runs after the element's first complete paint.
|
|
620
1975
|
*/
|
|
621
|
-
|
|
1976
|
+
onReady?: (() => void);
|
|
622
1977
|
/**
|
|
623
|
-
* The
|
|
624
|
-
* @default "US"
|
|
1978
|
+
* 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.
|
|
625
1979
|
*/
|
|
626
|
-
|
|
1980
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* The overlay handle for the "balances" sub-controller's "settlement" element.
|
|
1985
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1986
|
+
*/
|
|
1987
|
+
export interface SettlementElementOverlayHandle {
|
|
627
1988
|
/**
|
|
628
|
-
*
|
|
629
|
-
* @default []
|
|
1989
|
+
* Open the overlay. The first call mounts the element. Later calls reuse it.
|
|
630
1990
|
*/
|
|
631
|
-
|
|
1991
|
+
open(): void;
|
|
632
1992
|
/**
|
|
633
|
-
*
|
|
634
|
-
* @default false
|
|
1993
|
+
* Close the overlay without destroying it. Keep the handle and `open()` again.
|
|
635
1994
|
*/
|
|
636
|
-
|
|
1995
|
+
close(): void;
|
|
637
1996
|
/**
|
|
638
|
-
*
|
|
639
|
-
* @default {"standard":{"maxAmount":0},"instant":{"maxAmount":0}}
|
|
1997
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
640
1998
|
*/
|
|
641
|
-
|
|
1999
|
+
destroy(): void;
|
|
642
2000
|
/**
|
|
643
|
-
*
|
|
644
|
-
* @default false
|
|
2001
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
645
2002
|
*/
|
|
646
|
-
|
|
2003
|
+
update(options: Partial<SettlementElementProps>): void;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Consumer props for the "balances" sub-controller's "list" element.
|
|
2008
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2009
|
+
*/
|
|
2010
|
+
export interface ListElementProps {
|
|
647
2011
|
/**
|
|
648
|
-
*
|
|
649
|
-
* @default false
|
|
2012
|
+
* 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.
|
|
650
2013
|
*/
|
|
651
|
-
|
|
2014
|
+
accessToken?: string;
|
|
652
2015
|
/**
|
|
653
|
-
*
|
|
2016
|
+
* 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.
|
|
654
2017
|
* @default false
|
|
655
2018
|
*/
|
|
656
|
-
|
|
2019
|
+
includeOwnedAccounts?: boolean;
|
|
657
2020
|
/**
|
|
658
|
-
*
|
|
2021
|
+
* 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.
|
|
659
2022
|
* @default false
|
|
660
2023
|
*/
|
|
661
|
-
|
|
2024
|
+
showSourceCurrency?: boolean;
|
|
662
2025
|
/**
|
|
663
|
-
*
|
|
664
|
-
* @default
|
|
2026
|
+
* Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
|
|
2027
|
+
* @default true
|
|
665
2028
|
*/
|
|
666
|
-
|
|
2029
|
+
showUsdEquivalent?: boolean;
|
|
667
2030
|
/**
|
|
668
|
-
*
|
|
669
|
-
* @default
|
|
2031
|
+
* Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
|
|
2032
|
+
* @default true
|
|
670
2033
|
*/
|
|
671
|
-
|
|
2034
|
+
showPersonalAccount?: boolean;
|
|
672
2035
|
/**
|
|
673
|
-
*
|
|
674
|
-
* @default ""
|
|
2036
|
+
* 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.
|
|
675
2037
|
*/
|
|
676
|
-
|
|
2038
|
+
maxItems?: number;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* The live handle for a mounted "list" element. Returned by the "balances" sub handle's `create("list")`.
|
|
2043
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2044
|
+
*/
|
|
2045
|
+
export interface ListElementHandle {
|
|
677
2046
|
/**
|
|
678
|
-
*
|
|
2047
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
2048
|
+
*/
|
|
2049
|
+
mount: (target: string | HTMLElement) => void;
|
|
2050
|
+
/**
|
|
2051
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
2052
|
+
*/
|
|
2053
|
+
destroy: () => void;
|
|
2054
|
+
/**
|
|
2055
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
2056
|
+
*/
|
|
2057
|
+
update: (options: Partial<ListElementProps>) => void;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* Options for the "balances" sub handle's `create("list")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2062
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2063
|
+
*/
|
|
2064
|
+
export interface ListElementCreateOptions {
|
|
2065
|
+
/**
|
|
2066
|
+
* 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.
|
|
2067
|
+
*/
|
|
2068
|
+
accessToken?: string;
|
|
2069
|
+
/**
|
|
2070
|
+
* 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.
|
|
679
2071
|
* @default false
|
|
680
2072
|
*/
|
|
681
|
-
|
|
2073
|
+
includeOwnedAccounts?: boolean;
|
|
682
2074
|
/**
|
|
683
|
-
*
|
|
2075
|
+
* 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.
|
|
684
2076
|
* @default false
|
|
685
2077
|
*/
|
|
686
|
-
|
|
2078
|
+
showSourceCurrency?: boolean;
|
|
687
2079
|
/**
|
|
688
|
-
*
|
|
2080
|
+
* Keep the dollar value under a holding shown in its own currency. Only applies when `showSourceCurrency` is on.
|
|
2081
|
+
* @default true
|
|
689
2082
|
*/
|
|
690
|
-
|
|
2083
|
+
showUsdEquivalent?: boolean;
|
|
691
2084
|
/**
|
|
692
|
-
*
|
|
2085
|
+
* Keep the personal row when `includeOwnedAccounts` is on. Turn it off if your app has no personal account to open.
|
|
2086
|
+
* @default true
|
|
693
2087
|
*/
|
|
694
|
-
|
|
2088
|
+
showPersonalAccount?: boolean;
|
|
695
2089
|
/**
|
|
696
|
-
*
|
|
2090
|
+
* 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.
|
|
697
2091
|
*/
|
|
698
|
-
|
|
2092
|
+
maxItems?: number;
|
|
699
2093
|
/**
|
|
700
|
-
*
|
|
2094
|
+
* 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.
|
|
701
2095
|
*/
|
|
702
|
-
|
|
2096
|
+
onBalanceSelected?: ((payload: { holding: string; kind: "usd" | "cash" | "asset"; }) => void);
|
|
703
2097
|
/**
|
|
704
|
-
*
|
|
2098
|
+
* 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.
|
|
705
2099
|
*/
|
|
706
|
-
|
|
2100
|
+
onAccountSelected?: ((payload: { accountId: string; kind: "business" | "personal"; }) => void);
|
|
707
2101
|
/**
|
|
708
|
-
*
|
|
2102
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
709
2103
|
*/
|
|
710
|
-
|
|
2104
|
+
onLoaderStart?: (() => void);
|
|
711
2105
|
/**
|
|
712
|
-
*
|
|
2106
|
+
* Runs after the element's first complete paint.
|
|
713
2107
|
*/
|
|
714
|
-
|
|
2108
|
+
onReady?: (() => void);
|
|
715
2109
|
/**
|
|
716
|
-
*
|
|
2110
|
+
* 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.
|
|
717
2111
|
*/
|
|
718
|
-
|
|
2112
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* The "balances" sub-handle, minted by `handle.create("balances", …)`. Mounts the sub-controller's elements and carries its actions.
|
|
2117
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2118
|
+
*/
|
|
2119
|
+
export interface BalancesSubHandle {
|
|
719
2120
|
/**
|
|
720
|
-
* The
|
|
2121
|
+
* 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.
|
|
721
2122
|
*/
|
|
722
|
-
|
|
2123
|
+
create(name: "balance", options?: BalanceElementCreateOptions): BalanceElementHandle;
|
|
723
2124
|
/**
|
|
724
|
-
*
|
|
2125
|
+
* 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.
|
|
725
2126
|
*/
|
|
726
|
-
|
|
2127
|
+
create(name: "breakdown", options?: BreakdownElementCreateOptions): BreakdownElementHandle;
|
|
727
2128
|
/**
|
|
728
|
-
*
|
|
2129
|
+
* 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.
|
|
729
2130
|
*/
|
|
730
|
-
|
|
2131
|
+
createOverlay(name: "settlement", options?: SettlementElementCreateOptions): SettlementElementOverlayHandle;
|
|
2132
|
+
/**
|
|
2133
|
+
* 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.
|
|
2134
|
+
*/
|
|
2135
|
+
create(name: "list", options?: ListElementCreateOptions): ListElementHandle;
|
|
731
2136
|
/**
|
|
732
|
-
*
|
|
2137
|
+
* Merges new props and callbacks into the sub-controller.
|
|
733
2138
|
*/
|
|
734
|
-
|
|
2139
|
+
update(options: Partial<BalancesSubOptions>): void;
|
|
735
2140
|
/**
|
|
736
|
-
*
|
|
2141
|
+
* Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("balances")` starts fresh.
|
|
737
2142
|
*/
|
|
738
|
-
|
|
2143
|
+
destroy(): void;
|
|
739
2144
|
}
|
|
740
2145
|
|
|
741
2146
|
/**
|
|
742
|
-
*
|
|
743
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2147
|
+
* Consumer props for the "reports" sub-controller: the `create("reports")` options and the minted sub handle's `update()` payload (React: `<Reports>` props). Parent-injected props never appear here.
|
|
2148
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
744
2149
|
*/
|
|
745
|
-
export interface
|
|
2150
|
+
export interface ReportsSubOptions {}
|
|
2151
|
+
|
|
2152
|
+
/**
|
|
2153
|
+
* Consumer props for the "reports" sub-controller's "balanceReport" element.
|
|
2154
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2155
|
+
*/
|
|
2156
|
+
export interface BalanceReportElementProps {}
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* The live handle for a mounted "balanceReport" element. Returned by the "reports" sub handle's `create("balanceReport")`.
|
|
2160
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2161
|
+
*/
|
|
2162
|
+
export interface BalanceReportElementHandle {
|
|
746
2163
|
/**
|
|
747
|
-
*
|
|
2164
|
+
* Refresh the report data after activity changes.
|
|
748
2165
|
*/
|
|
749
|
-
|
|
2166
|
+
refresh: () => Promise<void>;
|
|
750
2167
|
/**
|
|
751
|
-
*
|
|
2168
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
752
2169
|
*/
|
|
753
|
-
|
|
2170
|
+
mount: (target: string | HTMLElement) => void;
|
|
754
2171
|
/**
|
|
755
2172
|
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
756
2173
|
*/
|
|
757
|
-
destroy()
|
|
2174
|
+
destroy: () => void;
|
|
758
2175
|
/**
|
|
759
2176
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
760
2177
|
*/
|
|
761
|
-
update(options: Partial<
|
|
2178
|
+
update: (options: Partial<BalanceReportElementProps>) => void;
|
|
762
2179
|
}
|
|
763
2180
|
|
|
764
2181
|
/**
|
|
765
|
-
*
|
|
766
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2182
|
+
* Options for the "reports" sub handle's `create("balanceReport")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2183
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
767
2184
|
*/
|
|
768
|
-
export interface
|
|
2185
|
+
export interface BalanceReportElementCreateOptions {
|
|
769
2186
|
/**
|
|
770
|
-
*
|
|
2187
|
+
* Emitted when activity opens inline, with its exact filters. Your host can also use this callback to navigate to its own activity page.
|
|
771
2188
|
*/
|
|
772
|
-
|
|
2189
|
+
onActivityRequested?: ((payload: ReportActivityFilters) => void);
|
|
773
2190
|
/**
|
|
774
|
-
*
|
|
775
|
-
* @default true
|
|
2191
|
+
* Providing this callback enables payment-method links. Open your payments page for the supplied method and time window.
|
|
776
2192
|
*/
|
|
777
|
-
|
|
2193
|
+
onPaymentsRequested?: ((payload: ReportPaymentsRequest) => void);
|
|
778
2194
|
/**
|
|
779
|
-
*
|
|
780
|
-
* @default true
|
|
2195
|
+
* A CSV is ready. The element also shows an explicit download link.
|
|
781
2196
|
*/
|
|
782
|
-
|
|
2197
|
+
onExportReady?: ((payload: ReportExportReady) => void);
|
|
783
2198
|
/**
|
|
784
|
-
*
|
|
785
|
-
* @default null
|
|
2199
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
786
2200
|
*/
|
|
787
|
-
|
|
2201
|
+
onLoaderStart?: (() => void);
|
|
788
2202
|
/**
|
|
789
|
-
*
|
|
790
|
-
* @default ""
|
|
2203
|
+
* Runs after the element's first complete paint.
|
|
791
2204
|
*/
|
|
792
|
-
|
|
2205
|
+
onReady?: (() => void);
|
|
2206
|
+
/**
|
|
2207
|
+
* 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.
|
|
2208
|
+
*/
|
|
2209
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
793
2210
|
}
|
|
794
2211
|
|
|
795
2212
|
/**
|
|
796
|
-
*
|
|
797
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2213
|
+
* Consumer props for the "reports" sub-controller's "reportActivity" element.
|
|
2214
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
798
2215
|
*/
|
|
799
|
-
export interface
|
|
2216
|
+
export interface ReportActivityElementProps {
|
|
800
2217
|
/**
|
|
801
|
-
*
|
|
2218
|
+
* Initial filters. Changing these resets the table to the requested activity.
|
|
2219
|
+
* @default {}
|
|
2220
|
+
*/
|
|
2221
|
+
filters?: ReportActivityFilters;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* The live handle for a mounted "reportActivity" element. Returned by the "reports" sub handle's `create("reportActivity")`.
|
|
2226
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2227
|
+
*/
|
|
2228
|
+
export interface ReportActivityElementHandle {
|
|
2229
|
+
/**
|
|
2230
|
+
* Refresh the report data after activity changes.
|
|
802
2231
|
*/
|
|
803
2232
|
refresh: () => Promise<void>;
|
|
804
2233
|
/**
|
|
@@ -812,59 +2241,23 @@ export interface SendElementHandle {
|
|
|
812
2241
|
/**
|
|
813
2242
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
814
2243
|
*/
|
|
815
|
-
update: (options: Partial<
|
|
2244
|
+
update: (options: Partial<ReportActivityElementProps>) => void;
|
|
816
2245
|
}
|
|
817
2246
|
|
|
818
2247
|
/**
|
|
819
|
-
* Options for `create("
|
|
820
|
-
* @
|
|
821
|
-
* ```ts
|
|
822
|
-
* const send = wallet.create("send", {}); // this interface: props + on<Event> callbacks
|
|
823
|
-
* send.mount("#wallet-send");
|
|
824
|
-
* ```
|
|
825
|
-
* @see https://docs.whop.com/elements/latest/wallet/send
|
|
2248
|
+
* Options for the "reports" sub handle's `create("reportActivity")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2249
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
826
2250
|
*/
|
|
827
|
-
export interface
|
|
828
|
-
/**
|
|
829
|
-
* 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.
|
|
830
|
-
*/
|
|
831
|
-
accessToken?: string;
|
|
832
|
-
/**
|
|
833
|
-
* Off, only the team/other-account list shows — no search box. For a host that knows the viewer lacks `member:basic:read`.
|
|
834
|
-
* @default true
|
|
835
|
-
*/
|
|
836
|
-
canSearchRecipients?: boolean;
|
|
837
|
-
/**
|
|
838
|
-
* Off, the "Send via link" row is hidden. For a host that knows the viewer lacks `airdrop_link:manage`.
|
|
839
|
-
* @default true
|
|
840
|
-
*/
|
|
841
|
-
canCreateLink?: boolean;
|
|
842
|
-
/**
|
|
843
|
-
* 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.
|
|
844
|
-
* @default null
|
|
845
|
-
*/
|
|
846
|
-
initialRecipient?: SendRecipient | null;
|
|
847
|
-
/**
|
|
848
|
-
* Preselect a currency in the amount screen's picker. Falls back to `currency`, then USD.
|
|
849
|
-
* @default ""
|
|
850
|
-
*/
|
|
851
|
-
initialCurrency?: string;
|
|
852
|
-
/**
|
|
853
|
-
* The visible screen changed.
|
|
854
|
-
*/
|
|
855
|
-
onStepChanged?: ((payload: { step: "success" | "enter_amount" | "select_recipient" | "create_link" | "link_success"; }) => void);
|
|
2251
|
+
export interface ReportActivityElementCreateOptions {
|
|
856
2252
|
/**
|
|
857
|
-
*
|
|
858
|
-
|
|
859
|
-
onSendCompleted?: ((payload: { recipient: SendRecipient; amount: number; currency: string; }) => void);
|
|
860
|
-
/**
|
|
861
|
-
* A claim link was created. Refresh anything on your side reading the account's balance.
|
|
2253
|
+
* Initial filters. Changing these resets the table to the requested activity.
|
|
2254
|
+
* @default {}
|
|
862
2255
|
*/
|
|
863
|
-
|
|
2256
|
+
filters?: ReportActivityFilters;
|
|
864
2257
|
/**
|
|
865
|
-
* The
|
|
2258
|
+
* The CSV is ready; downloadUrl also appears as a clickable link.
|
|
866
2259
|
*/
|
|
867
|
-
|
|
2260
|
+
onExportReady?: ((payload: ReportExportReady) => void);
|
|
868
2261
|
/**
|
|
869
2262
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
870
2263
|
*/
|
|
@@ -880,31 +2273,42 @@ export interface SendElementCreateOptions {
|
|
|
880
2273
|
}
|
|
881
2274
|
|
|
882
2275
|
/**
|
|
883
|
-
* The
|
|
884
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2276
|
+
* The "reports" sub-handle, minted by `handle.create("reports", …)`. Mounts the sub-controller's elements and carries its actions.
|
|
2277
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
885
2278
|
*/
|
|
886
|
-
export interface
|
|
2279
|
+
export interface ReportsSubHandle {
|
|
887
2280
|
/**
|
|
888
|
-
*
|
|
2281
|
+
* Balance history with date, timezone, and currency controls, starting and ending balances, and money-in and money-out breakdowns. Drill into activity and export it without leaving the element.
|
|
889
2282
|
*/
|
|
890
|
-
|
|
2283
|
+
create(name: "balanceReport", options?: BalanceReportElementCreateOptions): BalanceReportElementHandle;
|
|
891
2284
|
/**
|
|
892
|
-
*
|
|
2285
|
+
* Financial activity with date, currency, direction, and movement filters, pagination, and CSV export. Mount independently or open it from the balance report.
|
|
893
2286
|
*/
|
|
894
|
-
|
|
2287
|
+
create(name: "reportActivity", options?: ReportActivityElementCreateOptions): ReportActivityElementHandle;
|
|
895
2288
|
/**
|
|
896
|
-
*
|
|
2289
|
+
* Merges new props and callbacks into the sub-controller.
|
|
2290
|
+
*/
|
|
2291
|
+
update(options: Partial<ReportsSubOptions>): void;
|
|
2292
|
+
/**
|
|
2293
|
+
* Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("reports")` starts fresh.
|
|
897
2294
|
*/
|
|
898
2295
|
destroy(): void;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* 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.
|
|
2300
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2301
|
+
*/
|
|
2302
|
+
export interface CardsSubOptions {
|
|
899
2303
|
/**
|
|
900
|
-
*
|
|
2304
|
+
* 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.
|
|
901
2305
|
*/
|
|
902
|
-
|
|
2306
|
+
accessToken?: string;
|
|
903
2307
|
}
|
|
904
2308
|
|
|
905
2309
|
/**
|
|
906
|
-
* Consumer props for the "cards" element.
|
|
907
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2310
|
+
* Consumer props for the "cards" sub-controller's "cards" element.
|
|
2311
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
908
2312
|
*/
|
|
909
2313
|
export interface CardsElementProps {
|
|
910
2314
|
/**
|
|
@@ -934,8 +2338,8 @@ export interface CardsElementProps {
|
|
|
934
2338
|
}
|
|
935
2339
|
|
|
936
2340
|
/**
|
|
937
|
-
* The live handle for a mounted "cards" element. Returned by
|
|
938
|
-
* @see https://docs.whop.com/elements/latest/wallet/
|
|
2341
|
+
* The live handle for a mounted "cards" element. Returned by the "cards" sub handle's `create("cards")`.
|
|
2342
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
939
2343
|
*/
|
|
940
2344
|
export interface CardsElementHandle {
|
|
941
2345
|
/**
|
|
@@ -957,13 +2361,8 @@ export interface CardsElementHandle {
|
|
|
957
2361
|
}
|
|
958
2362
|
|
|
959
2363
|
/**
|
|
960
|
-
* Options for `create("cards")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
961
|
-
* @
|
|
962
|
-
* ```ts
|
|
963
|
-
* const cards = wallet.create("cards", {}); // this interface: props + on<Event> callbacks
|
|
964
|
-
* cards.mount("#wallet-cards");
|
|
965
|
-
* ```
|
|
966
|
-
* @see https://docs.whop.com/elements/latest/wallet/cards
|
|
2364
|
+
* Options for the "cards" sub handle's `create("cards")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2365
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
967
2366
|
*/
|
|
968
2367
|
export interface CardsElementCreateOptions {
|
|
969
2368
|
/**
|
|
@@ -1021,73 +2420,226 @@ export interface CardsElementCreateOptions {
|
|
|
1021
2420
|
}
|
|
1022
2421
|
|
|
1023
2422
|
/**
|
|
1024
|
-
* Consumer props for the "
|
|
2423
|
+
* Consumer props for the "cards" sub-controller's "cardsTable" element.
|
|
1025
2424
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1026
2425
|
*/
|
|
1027
|
-
export interface
|
|
2426
|
+
export interface CardsTableElementProps {
|
|
2427
|
+
/**
|
|
2428
|
+
* 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.
|
|
2429
|
+
*/
|
|
2430
|
+
accessToken?: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* Off, the element does not fetch and renders its shell with no card rows.
|
|
2433
|
+
* @default true
|
|
2434
|
+
*/
|
|
2435
|
+
enabled?: boolean;
|
|
2436
|
+
/**
|
|
2437
|
+
* Hide the create virtual card button. Off by default.
|
|
2438
|
+
* @default false
|
|
2439
|
+
*/
|
|
2440
|
+
hideCreateButton?: boolean;
|
|
2441
|
+
/**
|
|
2442
|
+
* Show last month's spend. Turn this off when the viewer may see cards but not account financials.
|
|
2443
|
+
* @default true
|
|
2444
|
+
*/
|
|
2445
|
+
showFinancials?: boolean;
|
|
2446
|
+
}
|
|
1028
2447
|
|
|
1029
2448
|
/**
|
|
1030
|
-
*
|
|
2449
|
+
* The live handle for a mounted "cardsTable" element. Returned by the "cards" sub handle's `create("cardsTable")`.
|
|
1031
2450
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1032
2451
|
*/
|
|
1033
|
-
export interface
|
|
2452
|
+
export interface CardsTableElementHandle {
|
|
1034
2453
|
/**
|
|
1035
|
-
*
|
|
1036
|
-
|
|
2454
|
+
* Re-fetch the cards and cardholders after the host creates, freezes, cancels, or renames a card.
|
|
2455
|
+
*/
|
|
2456
|
+
refresh: () => Promise<void>;
|
|
2457
|
+
/**
|
|
2458
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
2459
|
+
*/
|
|
2460
|
+
mount: (target: string | HTMLElement) => void;
|
|
2461
|
+
/**
|
|
2462
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
2463
|
+
*/
|
|
2464
|
+
destroy: () => void;
|
|
2465
|
+
/**
|
|
2466
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
2467
|
+
*/
|
|
2468
|
+
update: (options: Partial<CardsTableElementProps>) => void;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2472
|
+
* Options for the "cards" sub handle's `create("cardsTable")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2473
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2474
|
+
*/
|
|
2475
|
+
export interface CardsTableElementCreateOptions {
|
|
2476
|
+
/**
|
|
2477
|
+
* 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.
|
|
1037
2478
|
*/
|
|
1038
2479
|
accessToken?: string;
|
|
1039
2480
|
/**
|
|
1040
|
-
*
|
|
1041
|
-
* @default
|
|
2481
|
+
* Off, the element does not fetch and renders its shell with no card rows.
|
|
2482
|
+
* @default true
|
|
2483
|
+
*/
|
|
2484
|
+
enabled?: boolean;
|
|
2485
|
+
/**
|
|
2486
|
+
* Hide the create virtual card button. Off by default.
|
|
2487
|
+
* @default false
|
|
2488
|
+
*/
|
|
2489
|
+
hideCreateButton?: boolean;
|
|
2490
|
+
/**
|
|
2491
|
+
* Show last month's spend. Turn this off when the viewer may see cards but not account financials.
|
|
2492
|
+
* @default true
|
|
2493
|
+
*/
|
|
2494
|
+
showFinancials?: boolean;
|
|
2495
|
+
/**
|
|
2496
|
+
* A row was clicked. Open the host-owned card details experience for this card.
|
|
2497
|
+
*/
|
|
2498
|
+
onCardSelected?: ((payload: { cardId: string; }) => void);
|
|
2499
|
+
/**
|
|
2500
|
+
* The create virtual card button was clicked.
|
|
2501
|
+
*/
|
|
2502
|
+
onCreateCardRequested?: ((payload: Record<string, never>) => void);
|
|
2503
|
+
/**
|
|
2504
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
2505
|
+
*/
|
|
2506
|
+
onLoaderStart?: (() => void);
|
|
2507
|
+
/**
|
|
2508
|
+
* Runs after the element's first complete paint.
|
|
2509
|
+
*/
|
|
2510
|
+
onReady?: (() => void);
|
|
2511
|
+
/**
|
|
2512
|
+
* 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.
|
|
2513
|
+
*/
|
|
2514
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* Consumer props for the "cards" sub-controller's "cardsChart" element.
|
|
2519
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2520
|
+
*/
|
|
2521
|
+
export interface CardsChartElementProps {
|
|
2522
|
+
/**
|
|
2523
|
+
* A scoped token for card transaction reads. Needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
|
|
2524
|
+
*/
|
|
2525
|
+
accessToken?: string;
|
|
2526
|
+
/**
|
|
2527
|
+
* Off, the chart performs no reads and renders an empty plot.
|
|
2528
|
+
* @default true
|
|
2529
|
+
*/
|
|
2530
|
+
enabled?: boolean;
|
|
2531
|
+
/**
|
|
2532
|
+
* The initial reporting window: `7d`, `1m`, `3m`, `ytd`, or `1y`.
|
|
2533
|
+
* @default "1m"
|
|
2534
|
+
*/
|
|
2535
|
+
period?: "7d" | "1m" | "3m" | "ytd" | "1y";
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
/**
|
|
2539
|
+
* The live handle for a mounted "cardsChart" element. Returned by the "cards" sub handle's `create("cardsChart")`.
|
|
2540
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2541
|
+
*/
|
|
2542
|
+
export interface CardsChartElementHandle {
|
|
2543
|
+
/**
|
|
2544
|
+
* Re-fetch the selected spend window.
|
|
2545
|
+
*/
|
|
2546
|
+
refresh: () => Promise<void>;
|
|
2547
|
+
/**
|
|
2548
|
+
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
2549
|
+
*/
|
|
2550
|
+
mount: (target: string | HTMLElement) => void;
|
|
2551
|
+
/**
|
|
2552
|
+
* Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
|
|
2553
|
+
*/
|
|
2554
|
+
destroy: () => void;
|
|
2555
|
+
/**
|
|
2556
|
+
* Merges new props into the mounted element. In React, change the component props instead.
|
|
2557
|
+
*/
|
|
2558
|
+
update: (options: Partial<CardsChartElementProps>) => void;
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
/**
|
|
2562
|
+
* Options for the "cards" sub handle's `create("cardsChart")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
2563
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2564
|
+
*/
|
|
2565
|
+
export interface CardsChartElementCreateOptions {
|
|
2566
|
+
/**
|
|
2567
|
+
* A scoped token for card transaction reads. Needs `payout:account:read`. Omitted, calls carry the viewer's own session, which only answers same-origin.
|
|
2568
|
+
*/
|
|
2569
|
+
accessToken?: string;
|
|
2570
|
+
/**
|
|
2571
|
+
* Off, the chart performs no reads and renders an empty plot.
|
|
2572
|
+
* @default true
|
|
2573
|
+
*/
|
|
2574
|
+
enabled?: boolean;
|
|
2575
|
+
/**
|
|
2576
|
+
* The initial reporting window: `7d`, `1m`, `3m`, `ytd`, or `1y`.
|
|
2577
|
+
* @default "1m"
|
|
2578
|
+
*/
|
|
2579
|
+
period?: "7d" | "1m" | "3m" | "ytd" | "1y";
|
|
2580
|
+
/**
|
|
2581
|
+
* The viewer selected a new reporting window. The chart has already updated itself.
|
|
2582
|
+
*/
|
|
2583
|
+
onPeriodChanged?: ((payload: { period: "7d" | "1m" | "3m" | "ytd" | "1y"; }) => void);
|
|
2584
|
+
/**
|
|
2585
|
+
* The viewer selected or cleared a daily bar. Dates use `YYYY-MM-DD` in UTC.
|
|
2586
|
+
*/
|
|
2587
|
+
onDateSelected?: ((payload: { date: string | null; }) => void);
|
|
2588
|
+
/**
|
|
2589
|
+
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1042
2590
|
*/
|
|
1043
|
-
|
|
2591
|
+
onLoaderStart?: (() => void);
|
|
1044
2592
|
/**
|
|
1045
|
-
*
|
|
1046
|
-
* @default ""
|
|
2593
|
+
* Runs after the element's first complete paint.
|
|
1047
2594
|
*/
|
|
1048
|
-
|
|
2595
|
+
onReady?: (() => void);
|
|
1049
2596
|
/**
|
|
1050
|
-
*
|
|
1051
|
-
* @default ""
|
|
2597
|
+
* 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.
|
|
1052
2598
|
*/
|
|
1053
|
-
|
|
2599
|
+
onError?: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void);
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
/**
|
|
2603
|
+
* Consumer props for the "cards" sub-controller's "whopCard" element.
|
|
2604
|
+
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
2605
|
+
*/
|
|
2606
|
+
export interface WhopCardElementProps {
|
|
1054
2607
|
/**
|
|
1055
|
-
*
|
|
1056
|
-
* @default null
|
|
2608
|
+
* 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.
|
|
1057
2609
|
*/
|
|
1058
|
-
|
|
2610
|
+
accessToken?: string;
|
|
1059
2611
|
/**
|
|
1060
|
-
*
|
|
2612
|
+
* Issued card ID, prefixed `icrd_`.
|
|
1061
2613
|
* @default ""
|
|
1062
2614
|
*/
|
|
1063
|
-
|
|
2615
|
+
cardId?: string;
|
|
1064
2616
|
/**
|
|
1065
|
-
*
|
|
2617
|
+
* Hide the View details and Lock card buttons. The card itself remains clickable to reveal details.
|
|
1066
2618
|
* @default false
|
|
1067
2619
|
*/
|
|
1068
|
-
|
|
2620
|
+
hideControls?: boolean;
|
|
1069
2621
|
/**
|
|
1070
|
-
*
|
|
2622
|
+
* Disable the lock control while keeping it visible. Useful when a host has temporarily frozen card actions.
|
|
1071
2623
|
* @default false
|
|
1072
2624
|
*/
|
|
1073
|
-
|
|
2625
|
+
disableLock?: boolean;
|
|
1074
2626
|
/**
|
|
1075
|
-
* Hide the
|
|
2627
|
+
* Hide the Add to Apple Wallet button. It is shown for active and locked cards by default.
|
|
1076
2628
|
* @default false
|
|
1077
2629
|
*/
|
|
1078
|
-
|
|
2630
|
+
hideAppleWalletButton?: boolean;
|
|
1079
2631
|
/**
|
|
1080
|
-
*
|
|
1081
|
-
* @default
|
|
2632
|
+
* Direct-mode integration option. Emits `lockRequested` without updating the card so a first-party host can retain its confirmation flow.
|
|
2633
|
+
* @default false
|
|
1082
2634
|
*/
|
|
1083
|
-
|
|
2635
|
+
deferLockToHost?: boolean;
|
|
1084
2636
|
}
|
|
1085
2637
|
|
|
1086
2638
|
/**
|
|
1087
|
-
* The live handle for a mounted "
|
|
2639
|
+
* The live handle for a mounted "whopCard" element. Returned by the "cards" sub handle's `create("whopCard")`.
|
|
1088
2640
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1089
2641
|
*/
|
|
1090
|
-
export interface
|
|
2642
|
+
export interface WhopCardElementHandle {
|
|
1091
2643
|
/**
|
|
1092
2644
|
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1093
2645
|
*/
|
|
@@ -1099,72 +2651,59 @@ export interface BalanceElementHandle {
|
|
|
1099
2651
|
/**
|
|
1100
2652
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1101
2653
|
*/
|
|
1102
|
-
update: (options: Partial<
|
|
2654
|
+
update: (options: Partial<WhopCardElementProps>) => void;
|
|
1103
2655
|
}
|
|
1104
2656
|
|
|
1105
2657
|
/**
|
|
1106
|
-
* Options for the "
|
|
2658
|
+
* Options for the "cards" sub handle's `create("whopCard")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1107
2659
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1108
2660
|
*/
|
|
1109
|
-
export interface
|
|
2661
|
+
export interface WhopCardElementCreateOptions {
|
|
1110
2662
|
/**
|
|
1111
|
-
* A scoped token for
|
|
1112
|
-
* @default ""
|
|
2663
|
+
* 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.
|
|
1113
2664
|
*/
|
|
1114
2665
|
accessToken?: string;
|
|
1115
2666
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
* @default "1M"
|
|
1118
|
-
*/
|
|
1119
|
-
range?: "1D" | "1W" | "1M" | "1Y" | "ALL";
|
|
1120
|
-
/**
|
|
1121
|
-
* 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.
|
|
1122
|
-
* @default ""
|
|
1123
|
-
*/
|
|
1124
|
-
openedAt?: string;
|
|
1125
|
-
/**
|
|
1126
|
-
* 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`.
|
|
2667
|
+
* Issued card ID, prefixed `icrd_`.
|
|
1127
2668
|
* @default ""
|
|
1128
2669
|
*/
|
|
1129
|
-
|
|
2670
|
+
cardId?: string;
|
|
1130
2671
|
/**
|
|
1131
|
-
*
|
|
1132
|
-
* @default
|
|
2672
|
+
* Hide the View details and Lock card buttons. The card itself remains clickable to reveal details.
|
|
2673
|
+
* @default false
|
|
1133
2674
|
*/
|
|
1134
|
-
|
|
2675
|
+
hideControls?: boolean;
|
|
1135
2676
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
* @default
|
|
2677
|
+
* Disable the lock control while keeping it visible. Useful when a host has temporarily frozen card actions.
|
|
2678
|
+
* @default false
|
|
1138
2679
|
*/
|
|
1139
|
-
|
|
2680
|
+
disableLock?: boolean;
|
|
1140
2681
|
/**
|
|
1141
|
-
*
|
|
2682
|
+
* Hide the Add to Apple Wallet button. It is shown for active and locked cards by default.
|
|
1142
2683
|
* @default false
|
|
1143
2684
|
*/
|
|
1144
|
-
|
|
2685
|
+
hideAppleWalletButton?: boolean;
|
|
1145
2686
|
/**
|
|
1146
|
-
*
|
|
2687
|
+
* Direct-mode integration option. Emits `lockRequested` without updating the card so a first-party host can retain its confirmation flow.
|
|
1147
2688
|
* @default false
|
|
1148
2689
|
*/
|
|
1149
|
-
|
|
2690
|
+
deferLockToHost?: boolean;
|
|
1150
2691
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
* @default false
|
|
2692
|
+
* Fires after details are revealed or hidden.
|
|
1153
2693
|
*/
|
|
1154
|
-
|
|
2694
|
+
onDetailsChanged?: ((payload: { cardId: string; revealed: boolean; }) => void);
|
|
1155
2695
|
/**
|
|
1156
|
-
*
|
|
1157
|
-
* @default 210
|
|
2696
|
+
* Fires instead of updating when `deferLockToHost` is true.
|
|
1158
2697
|
*/
|
|
1159
|
-
|
|
2698
|
+
onLockRequested?: ((payload: { cardId: string; locked: boolean; }) => void);
|
|
1160
2699
|
/**
|
|
1161
|
-
*
|
|
2700
|
+
* Fires after the Cards REST API successfully locks or unlocks the card.
|
|
1162
2701
|
*/
|
|
1163
|
-
|
|
2702
|
+
onLockChanged?: ((payload: { cardId: string; locked: boolean; }) => void);
|
|
1164
2703
|
/**
|
|
1165
|
-
*
|
|
2704
|
+
* Fires when the viewer presses Add to Apple Wallet. The host owns the resulting Apple Wallet flow.
|
|
1166
2705
|
*/
|
|
1167
|
-
|
|
2706
|
+
onAppleWalletRequested?: ((payload: { cardId: string; }) => void);
|
|
1168
2707
|
/**
|
|
1169
2708
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1170
2709
|
*/
|
|
@@ -1180,41 +2719,55 @@ export interface BalanceElementCreateOptions {
|
|
|
1180
2719
|
}
|
|
1181
2720
|
|
|
1182
2721
|
/**
|
|
1183
|
-
* Consumer props for the "
|
|
2722
|
+
* Consumer props for the "cards" sub-controller's "cardTransactions" element.
|
|
1184
2723
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1185
2724
|
*/
|
|
1186
|
-
export interface
|
|
2725
|
+
export interface CardTransactionsElementProps {
|
|
1187
2726
|
/**
|
|
1188
|
-
* A scoped token for the
|
|
2727
|
+
* 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.
|
|
1189
2728
|
*/
|
|
1190
2729
|
accessToken?: string;
|
|
1191
2730
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
* @default
|
|
2731
|
+
* Off, the table performs no reads and renders empty.
|
|
2732
|
+
* @default true
|
|
1194
2733
|
*/
|
|
1195
|
-
|
|
2734
|
+
enabled?: boolean;
|
|
1196
2735
|
/**
|
|
1197
|
-
*
|
|
1198
|
-
* @default
|
|
2736
|
+
* Restrict the table to these cards. Empty shows every card on the account.
|
|
2737
|
+
* @default []
|
|
1199
2738
|
*/
|
|
1200
|
-
|
|
2739
|
+
cardIds?: string[];
|
|
1201
2740
|
/**
|
|
1202
|
-
*
|
|
1203
|
-
* @default
|
|
2741
|
+
* Restrict the table to these cardholders. Empty shows every cardholder on the account.
|
|
2742
|
+
* @default []
|
|
1204
2743
|
*/
|
|
1205
|
-
|
|
2744
|
+
cardholderIds?: string[];
|
|
1206
2745
|
/**
|
|
1207
|
-
*
|
|
2746
|
+
* Restrict the table to these statuses — `completed`, `pending`, `declined` or `reversed`. Anything else is ignored. Empty shows every status.
|
|
2747
|
+
* @default []
|
|
2748
|
+
*/
|
|
2749
|
+
statuses?: string[];
|
|
2750
|
+
/**
|
|
2751
|
+
* Show the cardholder column and its filter. Off for an account whose cards all belong to one person.
|
|
1208
2752
|
* @default true
|
|
1209
2753
|
*/
|
|
1210
|
-
|
|
2754
|
+
showCardholders?: boolean;
|
|
2755
|
+
/**
|
|
2756
|
+
* How many transactions to read per page.
|
|
2757
|
+
* @default 50
|
|
2758
|
+
*/
|
|
2759
|
+
pageSize?: number;
|
|
1211
2760
|
}
|
|
1212
2761
|
|
|
1213
2762
|
/**
|
|
1214
|
-
* The live handle for a mounted "
|
|
2763
|
+
* The live handle for a mounted "cardTransactions" element. Returned by the "cards" sub handle's `create("cardTransactions")`.
|
|
1215
2764
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1216
2765
|
*/
|
|
1217
|
-
export interface
|
|
2766
|
+
export interface CardTransactionsElementHandle {
|
|
2767
|
+
/**
|
|
2768
|
+
* Re-read the transactions, for a host that just changed something on the account.
|
|
2769
|
+
*/
|
|
2770
|
+
refresh: () => Promise<void>;
|
|
1218
2771
|
/**
|
|
1219
2772
|
* Mounts the element in `target` and starts loading. React components mount themselves.
|
|
1220
2773
|
*/
|
|
@@ -1226,46 +2779,52 @@ export interface ListElementHandle {
|
|
|
1226
2779
|
/**
|
|
1227
2780
|
* Merges new props into the mounted element. In React, change the component props instead.
|
|
1228
2781
|
*/
|
|
1229
|
-
update: (options: Partial<
|
|
2782
|
+
update: (options: Partial<CardTransactionsElementProps>) => void;
|
|
1230
2783
|
}
|
|
1231
2784
|
|
|
1232
2785
|
/**
|
|
1233
|
-
* Options for the "
|
|
2786
|
+
* Options for the "cards" sub handle's `create("cardTransactions")`: the consumer props plus event callbacks and lifecycle hooks.
|
|
1234
2787
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1235
2788
|
*/
|
|
1236
|
-
export interface
|
|
2789
|
+
export interface CardTransactionsElementCreateOptions {
|
|
1237
2790
|
/**
|
|
1238
|
-
* A scoped token for the
|
|
2791
|
+
* 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.
|
|
1239
2792
|
*/
|
|
1240
2793
|
accessToken?: string;
|
|
1241
2794
|
/**
|
|
1242
|
-
*
|
|
1243
|
-
* @default
|
|
2795
|
+
* Off, the table performs no reads and renders empty.
|
|
2796
|
+
* @default true
|
|
1244
2797
|
*/
|
|
1245
|
-
|
|
2798
|
+
enabled?: boolean;
|
|
1246
2799
|
/**
|
|
1247
|
-
*
|
|
1248
|
-
* @default
|
|
2800
|
+
* Restrict the table to these cards. Empty shows every card on the account.
|
|
2801
|
+
* @default []
|
|
1249
2802
|
*/
|
|
1250
|
-
|
|
2803
|
+
cardIds?: string[];
|
|
1251
2804
|
/**
|
|
1252
|
-
*
|
|
1253
|
-
* @default
|
|
2805
|
+
* Restrict the table to these cardholders. Empty shows every cardholder on the account.
|
|
2806
|
+
* @default []
|
|
1254
2807
|
*/
|
|
1255
|
-
|
|
2808
|
+
cardholderIds?: string[];
|
|
1256
2809
|
/**
|
|
1257
|
-
*
|
|
2810
|
+
* Restrict the table to these statuses — `completed`, `pending`, `declined` or `reversed`. Anything else is ignored. Empty shows every status.
|
|
2811
|
+
* @default []
|
|
2812
|
+
*/
|
|
2813
|
+
statuses?: string[];
|
|
2814
|
+
/**
|
|
2815
|
+
* Show the cardholder column and its filter. Off for an account whose cards all belong to one person.
|
|
1258
2816
|
* @default true
|
|
1259
2817
|
*/
|
|
1260
|
-
|
|
2818
|
+
showCardholders?: boolean;
|
|
1261
2819
|
/**
|
|
1262
|
-
*
|
|
2820
|
+
* How many transactions to read per page.
|
|
2821
|
+
* @default 50
|
|
1263
2822
|
*/
|
|
1264
|
-
|
|
2823
|
+
pageSize?: number;
|
|
1265
2824
|
/**
|
|
1266
|
-
*
|
|
2825
|
+
* A row was pressed. Open your own detail surface in answer to this — the element never navigates.
|
|
1267
2826
|
*/
|
|
1268
|
-
|
|
2827
|
+
onTransactionSelected?: ((payload: { transactionId: string; }) => void);
|
|
1269
2828
|
/**
|
|
1270
2829
|
* Runs after the loading skeleton first paints and before `onReady`.
|
|
1271
2830
|
*/
|
|
@@ -1281,24 +2840,36 @@ export interface ListElementCreateOptions {
|
|
|
1281
2840
|
}
|
|
1282
2841
|
|
|
1283
2842
|
/**
|
|
1284
|
-
* The "
|
|
2843
|
+
* The "cards" sub-handle, minted by `handle.create("cards", …)`. Mounts the sub-controller's elements and carries its actions.
|
|
1285
2844
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1286
2845
|
*/
|
|
1287
|
-
export interface
|
|
2846
|
+
export interface CardsSubHandle {
|
|
1288
2847
|
/**
|
|
1289
|
-
*
|
|
2848
|
+
* 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.
|
|
1290
2849
|
*/
|
|
1291
|
-
create(name: "
|
|
2850
|
+
create(name: "cards", options?: CardsElementCreateOptions): CardsElementHandle;
|
|
1292
2851
|
/**
|
|
1293
|
-
*
|
|
2852
|
+
* 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.
|
|
1294
2853
|
*/
|
|
1295
|
-
create(name: "
|
|
2854
|
+
create(name: "cardsTable", options?: CardsTableElementCreateOptions): CardsTableElementHandle;
|
|
2855
|
+
/**
|
|
2856
|
+
* 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.
|
|
2857
|
+
*/
|
|
2858
|
+
create(name: "cardsChart", options?: CardsChartElementCreateOptions): CardsChartElementHandle;
|
|
2859
|
+
/**
|
|
2860
|
+
* 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.
|
|
2861
|
+
*/
|
|
2862
|
+
create(name: "whopCard", options?: WhopCardElementCreateOptions): WhopCardElementHandle;
|
|
2863
|
+
/**
|
|
2864
|
+
* 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.
|
|
2865
|
+
*/
|
|
2866
|
+
create(name: "cardTransactions", options?: CardTransactionsElementCreateOptions): CardTransactionsElementHandle;
|
|
1296
2867
|
/**
|
|
1297
2868
|
* Merges new props and callbacks into the sub-controller.
|
|
1298
2869
|
*/
|
|
1299
|
-
update(options: Partial<
|
|
2870
|
+
update(options: Partial<CardsSubOptions>): void;
|
|
1300
2871
|
/**
|
|
1301
|
-
* Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("
|
|
2872
|
+
* Destroys the sub-controller and its elements, then frees its exclusive slot. A later `create("cards")` starts fresh.
|
|
1302
2873
|
*/
|
|
1303
2874
|
destroy(): void;
|
|
1304
2875
|
}
|
|
@@ -1308,46 +2879,74 @@ export interface BalancesSubHandle {
|
|
|
1308
2879
|
* @see https://docs.whop.com/elements/latest/wallet/overview
|
|
1309
2880
|
*/
|
|
1310
2881
|
export interface WalletHandle {
|
|
2882
|
+
/**
|
|
2883
|
+
* 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.
|
|
2884
|
+
*/
|
|
2885
|
+
create(name: "required-actions", options?: RequiredActionsElementCreateOptions): RequiredActionsElementHandle;
|
|
2886
|
+
/**
|
|
2887
|
+
* 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.
|
|
2888
|
+
*/
|
|
2889
|
+
create(name: "actions", options?: ActionsElementCreateOptions): ActionsElementHandle;
|
|
1311
2890
|
/**
|
|
1312
2891
|
* 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.
|
|
1313
2892
|
*/
|
|
1314
2893
|
create(name: "activity", options?: ActivityElementCreateOptions): ActivityElementHandle;
|
|
1315
2894
|
/**
|
|
1316
|
-
*
|
|
2895
|
+
* 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.
|
|
1317
2896
|
*/
|
|
1318
|
-
|
|
2897
|
+
createOverlay(name: "activityDetail", options?: ActivityDetailElementCreateOptions): ActivityDetailElementOverlayHandle;
|
|
1319
2898
|
/**
|
|
1320
|
-
* 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)
|
|
2899
|
+
* 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.
|
|
1321
2900
|
*/
|
|
1322
2901
|
create(name: "deposit", options?: DepositElementCreateOptions): DepositElementHandle;
|
|
1323
2902
|
/**
|
|
1324
|
-
* 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)
|
|
2903
|
+
* 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.
|
|
1325
2904
|
*/
|
|
1326
2905
|
createOverlay(name: "deposit", options?: DepositElementCreateOptions): DepositElementOverlayHandle;
|
|
1327
2906
|
/**
|
|
1328
|
-
*
|
|
2907
|
+
* 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`.
|
|
2908
|
+
*/
|
|
2909
|
+
create(name: "convert", options?: ConvertElementCreateOptions): ConvertElementHandle;
|
|
2910
|
+
/**
|
|
2911
|
+
* 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`.
|
|
2912
|
+
*/
|
|
2913
|
+
createOverlay(name: "convert", options?: ConvertElementCreateOptions): ConvertElementOverlayHandle;
|
|
2914
|
+
/**
|
|
2915
|
+
* 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.
|
|
1329
2916
|
*/
|
|
1330
2917
|
create(name: "withdraw", options?: WithdrawElementCreateOptions): WithdrawElementHandle;
|
|
1331
2918
|
/**
|
|
1332
|
-
* 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
|
|
2919
|
+
* 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.
|
|
1333
2920
|
*/
|
|
1334
2921
|
createOverlay(name: "withdraw", options?: WithdrawElementCreateOptions): WithdrawElementOverlayHandle;
|
|
1335
2922
|
/**
|
|
1336
|
-
* 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
|
|
2923
|
+
* 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.
|
|
1337
2924
|
*/
|
|
1338
2925
|
create(name: "send", options?: SendElementCreateOptions): SendElementHandle;
|
|
1339
2926
|
/**
|
|
1340
|
-
* 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
|
|
2927
|
+
* 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.
|
|
1341
2928
|
*/
|
|
1342
2929
|
createOverlay(name: "send", options?: SendElementCreateOptions): SendElementOverlayHandle;
|
|
1343
2930
|
/**
|
|
1344
|
-
*
|
|
2931
|
+
* 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.
|
|
1345
2932
|
*/
|
|
1346
|
-
|
|
2933
|
+
createOverlay(name: "cardDetails", options?: CardDetailsElementCreateOptions): CardDetailsElementOverlayHandle;
|
|
2934
|
+
/**
|
|
2935
|
+
* 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 status messages come from the API, with a shorter description when inviting the account holder to start verification, 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.
|
|
2936
|
+
*/
|
|
2937
|
+
create(name: "verification", options?: VerificationElementCreateOptions): VerificationElementHandle;
|
|
1347
2938
|
/**
|
|
1348
|
-
*
|
|
2939
|
+
* 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.
|
|
1349
2940
|
*/
|
|
1350
2941
|
create(name: "balances", options?: BalancesSubOptions): BalancesSubHandle;
|
|
2942
|
+
/**
|
|
2943
|
+
* Balance history and the financial activity behind it, including CSV exports. Account statements are available in the Whop dashboard.
|
|
2944
|
+
*/
|
|
2945
|
+
create(name: "reports", options?: ReportsSubOptions): ReportsSubHandle;
|
|
2946
|
+
/**
|
|
2947
|
+
* 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.
|
|
2948
|
+
*/
|
|
2949
|
+
create(name: "cards", options?: CardsSubOptions): CardsSubHandle;
|
|
1351
2950
|
/**
|
|
1352
2951
|
* Merges new handle options into every mounted element. In React, change the namespace props instead.
|
|
1353
2952
|
*/
|
|
@@ -1411,11 +3010,15 @@ export interface LedgerActivity {
|
|
|
1411
3010
|
/**
|
|
1412
3011
|
* The ledger line category this activity was posted under.
|
|
1413
3012
|
*/
|
|
1414
|
-
line_type: "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "
|
|
3013
|
+
line_type: "platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "cashback" | "account_settlement" | "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "airdrop_link_created" | "airdrop_link_redeemed" | "airdrop_link_returned" | "airdrop_reversal" | "application_fee" | "application_fee_payout" | "balance_reservation" | "balance_reservation_reversal" | "bank_transfer" | "billing_percentage_fee" | "buyer_fee" | "card_interchange" | "card_load_deposit" | "card_load_transfer" | "card_spend_authorization_void" | "card_spend_refund" | "card_unload_deposit" | "card_unload_transfer" | "cashback_funding" | "company_referral" | "connected_account_negative_balance" | "cross_border_percentage_fee" | "currency_conversion_incoming" | "currency_conversion_outgoing" | "dispute_alert_fee" | "dispute_hold_adjustment" | "dispute_representment_fee" | "external_card_load_deposit" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "installment_default" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "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" | "misc_reversal" | "onboarding_reward" | "onchain_deposit" | "onchain_swap_source" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "onchain_withdrawal" | "orchestration_percentage_fee" | "passthrough_gmv" | "payment_dispute_adjustment" | "payment_dispute_fee" | "payment_dispute_reversal" | "payment_gross_reversal" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payment_referral" | "payment_referral_refund" | "payment_referral_reversal" | "payment_refund" | "payment_refund_reversal" | "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_fee" | "platform_balance_transfer_incoming" | "platform_covered_dispute" | "platform_earning" | "platform_markup_fee" | "platform_markup_fee_payout" | "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" | "swap_fee" | "three_ds_fixed_fee" | "topup_fee" | "topup_reversal" | "treasury_payin" | "whop_processing_fee" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "withdrawal_fee" | "withdrawal_fee_reversal" | "withdrawal_markup_fee" | "withdrawal_markup_fee_payout" | "withdrawal_markup_fee_payout_reversal" | "withdrawal_markup_fee_reversal" | "withdrawal_reclassification" | "withdrawal_reversal" | "withdrawal_topup_adjustment" | "deposit" | "wallet_transfer_incoming" | "wallet_transfer_outgoing" | "swap_source" | "swap_target";
|
|
1415
3014
|
/**
|
|
1416
3015
|
* Signed amount in the currency's smallest precision units.
|
|
1417
3016
|
*/
|
|
1418
3017
|
amount: string;
|
|
3018
|
+
/**
|
|
3019
|
+
* 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.
|
|
3020
|
+
*/
|
|
3021
|
+
usd_amount: string | null;
|
|
1419
3022
|
/**
|
|
1420
3023
|
* Currency for this ledger activity.
|
|
1421
3024
|
*/
|
|
@@ -1425,25 +3028,53 @@ export interface LedgerActivity {
|
|
|
1425
3028
|
*/
|
|
1426
3029
|
posted_at: string;
|
|
1427
3030
|
/**
|
|
1428
|
-
* 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
|
|
3031
|
+
* 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.
|
|
1429
3032
|
*/
|
|
1430
3033
|
available_at: string | null;
|
|
1431
|
-
/**
|
|
1432
|
-
* When the activity record was created.
|
|
1433
|
-
*/
|
|
1434
|
-
created_at: string | null;
|
|
1435
3034
|
/**
|
|
1436
3035
|
* Resource associated with this ledger activity.
|
|
1437
3036
|
*/
|
|
1438
3037
|
resource: { object: "account"; id: string; title: string | null; route: string | null; logo_url: string | null; } | { object: "user"; id: string; name: string | null; username: string | null; profile_picture_url: string | null; } | { object: "bounty"; id: string; title: string; status: string; } | { object: "ledger_account"; id: string; owner: { object: "account"; id: string; title: string | null; route: string | null; logo_url: string | null; } | { object: "user"; id: string; name: string | null; username: string | null; profile_picture_url: string | null; } | null; } | { object: "payment_method"; id: string; payment_method_type: string | null; gateway_type: string | null; card: { brand: string | null; last4: string | null; exp_month: number | null; exp_year: number | null; } | null; bank: { bank_name: string | null; account_name: string | null; last4: string | null; account_type: string | null; } | null; email_identifier: string | null; } | { object: "payout_method"; id: string; nickname: string | null; institution_name: string | null; account_reference: string | null; provider: string | null; destination_currency_code: string | null; } | { object: "card_transaction"; id: string; card_id: string | null; merchant_name: string | null; merchant_icon_url: string | null; merchant_category: string | null; status: string | null; usd_amount: string | null; local_amount: string | null; local_currency: string | null; cashback_usd: string | null; authorized_at: string | null; posted_at: string | null; declined_reason: string | null; } | null;
|
|
1439
3038
|
/**
|
|
1440
|
-
* Source of this ledger activity.
|
|
3039
|
+
* Source of this ledger activity. Platform markup fees use object platform_fee and the ledger activity ID.
|
|
1441
3040
|
*/
|
|
1442
|
-
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; 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;
|
|
3041
|
+
source: { object: string; id: string; fee_kind?: "transfer" | "card_spend" | "deposit" | "swap" | "payout" | null | undefined; 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;
|
|
1443
3042
|
/**
|
|
1444
3043
|
* Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.
|
|
1445
3044
|
*/
|
|
1446
|
-
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; created_at: string; } | null | undefined;
|
|
3045
|
+
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;
|
|
3046
|
+
/**
|
|
3047
|
+
* Payment ID for any payment-related activity, including refunds and disputes.
|
|
3048
|
+
*/
|
|
3049
|
+
payment_id?: string | null | undefined;
|
|
3050
|
+
/**
|
|
3051
|
+
* ID of the customer associated with the payment.
|
|
3052
|
+
*/
|
|
3053
|
+
user_id?: string | null | undefined;
|
|
3054
|
+
/**
|
|
3055
|
+
* Display name of the customer associated with the payment.
|
|
3056
|
+
*/
|
|
3057
|
+
user_name?: string | null | undefined;
|
|
3058
|
+
/**
|
|
3059
|
+
* Email of the customer associated with the payment. Requires member:email:read.
|
|
3060
|
+
*/
|
|
3061
|
+
user_email?: string | null | undefined;
|
|
3062
|
+
/**
|
|
3063
|
+
* ID of the product associated with the payment, when applicable.
|
|
3064
|
+
*/
|
|
3065
|
+
product_id?: string | null | undefined;
|
|
3066
|
+
/**
|
|
3067
|
+
* Name of the product associated with the payment, when applicable.
|
|
3068
|
+
*/
|
|
3069
|
+
product_name?: string | null | undefined;
|
|
3070
|
+
/**
|
|
3071
|
+
* ID of the plan associated with the payment, when applicable.
|
|
3072
|
+
*/
|
|
3073
|
+
plan_id?: string | null | undefined;
|
|
3074
|
+
/**
|
|
3075
|
+
* Name of the plan associated with the payment, when applicable.
|
|
3076
|
+
*/
|
|
3077
|
+
plan_name?: string | null | undefined;
|
|
1447
3078
|
/**
|
|
1448
3079
|
* The viewer account that owns this row's ledger. Present only when the response aggregates owned accounts (include_owned_accounts=true); omitted otherwise.
|
|
1449
3080
|
*/
|
|
@@ -1491,6 +3122,20 @@ export interface DepositCardFee {
|
|
|
1491
3122
|
radarFee: number;
|
|
1492
3123
|
}
|
|
1493
3124
|
|
|
3125
|
+
/**
|
|
3126
|
+
* Declared from the app's `DepositRailFee`, referenced by a host-capability surface.
|
|
3127
|
+
*/
|
|
3128
|
+
export interface DepositRailFee {
|
|
3129
|
+
/**
|
|
3130
|
+
* Percentage POINTS, not a fraction: `1.5` means 1.5%.
|
|
3131
|
+
*/
|
|
3132
|
+
percentageFee: number;
|
|
3133
|
+
/**
|
|
3134
|
+
* Flat fee in USD major units: `2` means $2.00, whatever the deposit currency.
|
|
3135
|
+
*/
|
|
3136
|
+
fixedFeeUsd: number;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
1494
3139
|
/**
|
|
1495
3140
|
* Declared from the app's `WithdrawalQuoteSpeed`, referenced by a host-capability surface.
|
|
1496
3141
|
*/
|
|
@@ -1515,6 +3160,7 @@ export interface WithdrawalQuote {
|
|
|
1515
3160
|
exchangeRate: number;
|
|
1516
3161
|
minLimit: number;
|
|
1517
3162
|
maxLimit?: number | null | undefined;
|
|
3163
|
+
instantUnavailableReason?: "minimum_crypto_sales_not_met" | null | undefined;
|
|
1518
3164
|
standard?: WithdrawalQuoteSpeed | null | undefined;
|
|
1519
3165
|
instant?: WithdrawalQuoteSpeed | null | undefined;
|
|
1520
3166
|
}
|
|
@@ -1524,12 +3170,14 @@ export interface WithdrawalQuote {
|
|
|
1524
3170
|
*/
|
|
1525
3171
|
export interface WithdrawalMethod {
|
|
1526
3172
|
id: string;
|
|
3173
|
+
createdAt?: string | null | undefined;
|
|
1527
3174
|
nickname?: string | null | undefined;
|
|
1528
3175
|
accountReference?: string | null | undefined;
|
|
1529
3176
|
payerName?: string | null | undefined;
|
|
1530
3177
|
destinationCurrency: string;
|
|
1531
3178
|
isDefault: boolean;
|
|
1532
3179
|
iconUrl?: string | null | undefined;
|
|
3180
|
+
name?: string | null | undefined;
|
|
1533
3181
|
deliveryType: string;
|
|
1534
3182
|
supportsStandard: boolean;
|
|
1535
3183
|
supportsInstant: boolean;
|
|
@@ -1574,8 +3222,50 @@ export interface WithdrawalSupportedMethod {
|
|
|
1574
3222
|
* Declared from the app's `WithdrawalLimits`, referenced by a host-capability surface.
|
|
1575
3223
|
*/
|
|
1576
3224
|
export interface WithdrawalLimits {
|
|
1577
|
-
standard: { maxAmount: number; errorMessage?: string | null | undefined; };
|
|
1578
|
-
instant: { maxAmount: number; dailyAmountRemaining?: number | null | undefined; errorMessage?: string | null | undefined; };
|
|
3225
|
+
standard: { maxAmount: number; errorCode?: string | null | undefined; errorMessage?: string | null | undefined; };
|
|
3226
|
+
instant: { maxAmount: number; dailyAmountRemaining?: number | null | undefined; errorCode?: string | null | undefined; errorMessage?: string | null | undefined; };
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
/**
|
|
3230
|
+
* Declared from the app's `WithdrawalMoney`, referenced by a host-capability surface.
|
|
3231
|
+
*/
|
|
3232
|
+
export interface WithdrawalMoney {
|
|
3233
|
+
currency: string;
|
|
3234
|
+
amount: string;
|
|
3235
|
+
decimals: number;
|
|
3236
|
+
display_decimals: number;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
/**
|
|
3240
|
+
* Declared from the app's `WithdrawalPayoutQuote`, referenced by a host-capability surface.
|
|
3241
|
+
*/
|
|
3242
|
+
export interface WithdrawalPayoutQuote {
|
|
3243
|
+
requestId: string;
|
|
3244
|
+
payoutMethodId: string;
|
|
3245
|
+
speed: "standard" | "instant";
|
|
3246
|
+
id: string;
|
|
3247
|
+
amount: WithdrawalMoney;
|
|
3248
|
+
fee: WithdrawalMoney;
|
|
3249
|
+
netAmount: WithdrawalMoney;
|
|
3250
|
+
destinationAmount: WithdrawalMoney;
|
|
3251
|
+
exchangeRate: number;
|
|
3252
|
+
expiresAt: string;
|
|
3253
|
+
quoteToken: string;
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
/**
|
|
3257
|
+
* Declared from the app's `WithdrawalRequest`, referenced by a host-capability surface.
|
|
3258
|
+
*/
|
|
3259
|
+
export interface WithdrawalRequest {
|
|
3260
|
+
amount: number;
|
|
3261
|
+
currency: string;
|
|
3262
|
+
payoutMethodId: string;
|
|
3263
|
+
presentedFee: number;
|
|
3264
|
+
quoteId?: string | undefined;
|
|
3265
|
+
quoteToken?: string | undefined;
|
|
3266
|
+
speed: "standard" | "instant";
|
|
3267
|
+
notes?: string | undefined;
|
|
3268
|
+
acknowledgeBankWarning?: boolean | undefined;
|
|
1579
3269
|
}
|
|
1580
3270
|
|
|
1581
3271
|
/**
|
|
@@ -1590,16 +3280,14 @@ export interface WithdrawalCreateMethodInput {
|
|
|
1590
3280
|
}
|
|
1591
3281
|
|
|
1592
3282
|
/**
|
|
1593
|
-
* Declared from the app's `
|
|
3283
|
+
* Declared from the app's `WithdrawalPayoutQuoteRequest`, referenced by a host-capability surface.
|
|
1594
3284
|
*/
|
|
1595
|
-
export interface
|
|
3285
|
+
export interface WithdrawalPayoutQuoteRequest {
|
|
3286
|
+
requestId: string;
|
|
1596
3287
|
amount: number;
|
|
1597
3288
|
currency: string;
|
|
1598
3289
|
payoutMethodId: string;
|
|
1599
|
-
presentedFee: number;
|
|
1600
3290
|
speed: "standard" | "instant";
|
|
1601
|
-
notes?: string | undefined;
|
|
1602
|
-
acknowledgeBankWarning?: boolean | undefined;
|
|
1603
3291
|
}
|
|
1604
3292
|
|
|
1605
3293
|
/**
|
|
@@ -1612,3 +3300,63 @@ export interface SendRecipient {
|
|
|
1612
3300
|
profilePicUrl: string | null;
|
|
1613
3301
|
kind: "business" | "user" | "email";
|
|
1614
3302
|
}
|
|
3303
|
+
|
|
3304
|
+
/**
|
|
3305
|
+
* The billing address.
|
|
3306
|
+
* Declared from the app's `Billing`, referenced by a host-capability surface.
|
|
3307
|
+
*/
|
|
3308
|
+
export interface Billing {
|
|
3309
|
+
/**
|
|
3310
|
+
* Billing city.
|
|
3311
|
+
*/
|
|
3312
|
+
city: string | null;
|
|
3313
|
+
/**
|
|
3314
|
+
* Billing country code.
|
|
3315
|
+
*/
|
|
3316
|
+
country_code: string | null;
|
|
3317
|
+
/**
|
|
3318
|
+
* Street address line 1.
|
|
3319
|
+
*/
|
|
3320
|
+
line1: string | null;
|
|
3321
|
+
/**
|
|
3322
|
+
* Street address line 2.
|
|
3323
|
+
*/
|
|
3324
|
+
line2: string | null;
|
|
3325
|
+
/**
|
|
3326
|
+
* Billing postal code.
|
|
3327
|
+
*/
|
|
3328
|
+
postal_code: string | null;
|
|
3329
|
+
/**
|
|
3330
|
+
* Billing region or state.
|
|
3331
|
+
*/
|
|
3332
|
+
region: string | null;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
/**
|
|
3336
|
+
* Declared from the app's `ReportActivityFilters`, referenced by a host-capability surface.
|
|
3337
|
+
*/
|
|
3338
|
+
export interface ReportActivityFilters {
|
|
3339
|
+
currency?: string | undefined;
|
|
3340
|
+
postedAfter?: string | undefined;
|
|
3341
|
+
postedBefore?: string | undefined;
|
|
3342
|
+
direction?: "money_in" | "money_out" | undefined;
|
|
3343
|
+
lineTypes?: ("platform_balance_transfer_outgoing" | "payment_gross" | "withdrawal" | "topup" | "payment_dispute" | "payment_revshare" | "card_spend_authorization" | "airdrop" | "onchain_swap_target" | "cashback" | "account_settlement" | "ad_budget_release" | "ad_campaign_budget" | "ad_publisher_payout" | "ad_publisher_payout_received" | "ad_spend_charge" | "affiliate_fee" | "airdrop_link_created" | "airdrop_link_redeemed" | "airdrop_link_returned" | "airdrop_reversal" | "application_fee" | "application_fee_payout" | "balance_reservation" | "balance_reservation_reversal" | "bank_transfer" | "billing_percentage_fee" | "buyer_fee" | "card_interchange" | "card_load_deposit" | "card_load_transfer" | "card_spend_authorization_void" | "card_spend_refund" | "card_unload_deposit" | "card_unload_transfer" | "cashback_funding" | "company_referral" | "connected_account_negative_balance" | "cross_border_percentage_fee" | "currency_conversion_incoming" | "currency_conversion_outgoing" | "dispute_alert_fee" | "dispute_hold_adjustment" | "dispute_representment_fee" | "external_card_load_deposit" | "fees" | "fraud_prevention_fee" | "fx_percentage_fee" | "high_risk_merchant_fee" | "installment_default" | "internal_balance_transfer_incoming" | "internal_balance_transfer_outgoing" | "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" | "misc_reversal" | "onboarding_reward" | "onchain_deposit" | "onchain_swap_source" | "onchain_wallet_transfer_incoming" | "onchain_wallet_transfer_outgoing" | "onchain_withdrawal" | "orchestration_percentage_fee" | "passthrough_gmv" | "payment_dispute_adjustment" | "payment_dispute_fee" | "payment_dispute_reversal" | "payment_gross_reversal" | "payment_processing_fixed_fee" | "payment_processing_percentage_fee" | "payment_referral" | "payment_referral_refund" | "payment_referral_reversal" | "payment_refund" | "payment_refund_reversal" | "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_fee" | "platform_balance_transfer_incoming" | "platform_covered_dispute" | "platform_earning" | "platform_markup_fee" | "platform_markup_fee_payout" | "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" | "swap_fee" | "three_ds_fixed_fee" | "topup_fee" | "topup_reversal" | "treasury_payin" | "whop_processing_fee" | "withdrawal_clawback" | "withdrawal_clawback_reversal" | "withdrawal_fee" | "withdrawal_fee_reversal" | "withdrawal_markup_fee" | "withdrawal_markup_fee_payout" | "withdrawal_markup_fee_payout_reversal" | "withdrawal_markup_fee_reversal" | "withdrawal_reclassification" | "withdrawal_reversal" | "withdrawal_topup_adjustment")[] | undefined;
|
|
3344
|
+
resourceId?: string | undefined;
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3347
|
+
/**
|
|
3348
|
+
* Declared from the app's `ReportPaymentsRequest`, referenced by a host-capability surface.
|
|
3349
|
+
*/
|
|
3350
|
+
export interface ReportPaymentsRequest {
|
|
3351
|
+
postedAfter: string;
|
|
3352
|
+
postedBefore: string;
|
|
3353
|
+
paymentMethod: string;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
/**
|
|
3357
|
+
* Declared from the app's `ReportExportReady`, referenced by a host-capability surface.
|
|
3358
|
+
*/
|
|
3359
|
+
export interface ReportExportReady {
|
|
3360
|
+
exportId: string;
|
|
3361
|
+
downloadUrl: string;
|
|
3362
|
+
}
|