@unifold/ui-react 0.1.67 → 0.1.68-beta.1
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/dist/index.d.mts +279 -24
- package/dist/index.d.ts +279 -24
- package/dist/index.js +14849 -8170
- package/dist/index.mjs +14981 -8304
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +20 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { DirectExecutionSucceededEvent, DirectExecutionResponse, ChainType, EvmContractCall, DepositMethod, DepositEvent, Wallet, ProductType, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, ConfirmIntegrationTransferResult, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, SupportedDestinationTokensResponse, SupportedDepositTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
2
|
+
import { DirectExecutionSucceededEvent, DirectExecutionResponse, ChainType, EvmContractCall, DepositMethod, DepositEvent, Wallet, ProductType, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DefaultTokenResponse, ConfirmIntegrationTransferResult, CheckoutMethod, CheckoutPaymentIntent, CheckoutEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, SupportedDestinationTokensResponse, SupportedDepositTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
3
3
|
export { ChainType, DepositMethod } from '@unifold/core';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import { MutableRefObject } from 'react';
|
|
4
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
7
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
-
import * as React$1 from 'react';
|
|
7
8
|
import { VariantProps } from 'class-variance-authority';
|
|
8
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
10
11
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
11
12
|
import { ClassValue } from 'clsx';
|
|
12
13
|
|
|
13
|
-
type DepositConfirmationMode =
|
|
14
|
+
type DepositConfirmationMode = 'auto_ui' | 'auto_silent' | 'manual';
|
|
14
15
|
interface UseDepositPollingOptions {
|
|
15
16
|
userId: string | undefined;
|
|
16
17
|
publishableKey: string;
|
|
@@ -108,7 +109,7 @@ interface EthereumProvider {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
/** Quick amount chips on the browser wallet "Enter amount" step */
|
|
111
|
-
type BrowserWalletAmountQuickSelect =
|
|
112
|
+
type BrowserWalletAmountQuickSelect = 'usd' | 'percentage';
|
|
112
113
|
interface SolanaWalletProvider {
|
|
113
114
|
isPhantom?: boolean;
|
|
114
115
|
isConnected?: boolean;
|
|
@@ -141,7 +142,7 @@ interface EvmWalletProvider {
|
|
|
141
142
|
removeListener?(event: string, callback: (...args: unknown[]) => void): void;
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
type DepositModalInitialScreen =
|
|
145
|
+
type DepositModalInitialScreen = 'main' | 'transfer' | 'card' | 'cashapp' | 'apple_pay' | 'tracker' | 'pay_with_exchange' | 'exchange_connect' | 'wallet_connect' | 'bank_transfer' | 'stripe_link';
|
|
145
146
|
interface DepositModalProps {
|
|
146
147
|
open: boolean;
|
|
147
148
|
onOpenChange: (open: boolean) => void;
|
|
@@ -186,7 +187,7 @@ interface DepositModalProps {
|
|
|
186
187
|
/** Show balance in deposit modal header. Defaults to false */
|
|
187
188
|
showBalanceHeader?: boolean;
|
|
188
189
|
/** Input variant for Transfer Crypto view: "single_input" or "double_input" (default) */
|
|
189
|
-
transferInputVariant?:
|
|
190
|
+
transferInputVariant?: 'single_input' | 'double_input';
|
|
190
191
|
/** Controls when deposit polling starts and what UI is shown.
|
|
191
192
|
* - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
|
|
192
193
|
* - "auto_silent": After 10s, starts polling silently (no waiting UI)
|
|
@@ -210,10 +211,41 @@ interface DepositModalProps {
|
|
|
210
211
|
enableConnectExchange?: boolean;
|
|
211
212
|
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
212
213
|
enableCashApp?: boolean;
|
|
214
|
+
enableStripeLink?: boolean;
|
|
215
|
+
email?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides dashboard
|
|
218
|
+
* default. Resolves as flag ?? dashboard `apple_pay.enabled` ?? true. The
|
|
219
|
+
* server still gates per-region (US-only, NY excluded at launch) at the
|
|
220
|
+
* order-creation step.
|
|
221
|
+
*/
|
|
222
|
+
enableApplePay?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Title shown for the Apple Pay row in the main menu. @default `"Pay with Apple Pay"`
|
|
225
|
+
*/
|
|
226
|
+
applePayTitle?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Subtitle shown for the Apple Pay row in the main menu. @default `"Instant"`
|
|
229
|
+
*/
|
|
230
|
+
applePaySubTitle?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Enable the "Bank Transfer" section (SEPA, etc.). Overrides dashboard default.
|
|
233
|
+
* Resolves as flag ?? dashboard `bank_transfer.enabled` ?? true.
|
|
234
|
+
*
|
|
235
|
+
* Even when enabled, the rails listed inside are filtered by country —
|
|
236
|
+
* users outside the SEPA zone see a disabled "coming soon" card.
|
|
237
|
+
*/
|
|
238
|
+
enableBankTransfer?: boolean;
|
|
213
239
|
/** Deposit with Card — onramp step: hide the You use / You buy / You receive card. @default false */
|
|
214
240
|
hideDepositFlowInfo?: boolean;
|
|
215
241
|
/** Deposit with Card — onramp step: hide the temporary wallet address disclaimer. @default false */
|
|
216
242
|
hideDisplayDescription?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Pre-trusted email from the host platform's signed-in user. Used by the
|
|
245
|
+
* Apple Pay (headless Coinbase) flow to skip the email-OTP step and the
|
|
246
|
+
* localStorage email lookup. Phone OTP is always still required.
|
|
247
|
+
*/
|
|
248
|
+
externalUserEmail?: string;
|
|
217
249
|
onDepositSuccess?: (data: {
|
|
218
250
|
message: string;
|
|
219
251
|
transaction?: unknown;
|
|
@@ -230,7 +262,7 @@ interface DepositModalProps {
|
|
|
230
262
|
/** Which funding method produced this error event. */
|
|
231
263
|
method?: DepositMethod;
|
|
232
264
|
}) => void;
|
|
233
|
-
theme?:
|
|
265
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
234
266
|
/** Hide the dialog overlay and close button for inline/embedded mode */
|
|
235
267
|
hideOverlay?: boolean;
|
|
236
268
|
/** First screen when the modal opens. Default `main` (deposit menu). */
|
|
@@ -241,9 +273,9 @@ interface DepositModalProps {
|
|
|
241
273
|
* - `"tabs"`: options are grouped under "Use Crypto" / "Use Cash" tabs to keep
|
|
242
274
|
* the menu compact and mobile-friendly.
|
|
243
275
|
*/
|
|
244
|
-
displayMode?:
|
|
276
|
+
displayMode?: 'stacked' | 'tabs';
|
|
245
277
|
}
|
|
246
|
-
declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, displayMode, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, enableApplePay, applePayTitle, applePaySubTitle, enableBankTransfer, enableStripeLink, email: emailProp, hideDepositFlowInfo, hideDisplayDescription, externalUserEmail, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, displayMode, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
247
279
|
|
|
248
280
|
interface DepositHeaderProps {
|
|
249
281
|
title: string;
|
|
@@ -361,8 +393,8 @@ declare function TransferCryptoDoubleInput({ userId, publishableKey, recipientAd
|
|
|
361
393
|
interface BuyWithCardProps {
|
|
362
394
|
userId: string;
|
|
363
395
|
publishableKey: string;
|
|
364
|
-
view?:
|
|
365
|
-
onViewChange?: (view:
|
|
396
|
+
view?: 'amount' | 'quotes' | 'onramp';
|
|
397
|
+
onViewChange?: (view: 'amount' | 'quotes' | 'onramp', quotesCount?: number) => void;
|
|
366
398
|
maxAmountUsd?: number;
|
|
367
399
|
accentColor?: string;
|
|
368
400
|
destinationTokenSymbol?: string;
|
|
@@ -393,6 +425,85 @@ interface BuyWithCardProps {
|
|
|
393
425
|
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, // Keep prop for backward compatibility but don't use default
|
|
394
426
|
destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, onDepositSuccess, onDepositError, onEvent, themeClass, wallets: externalWallets, assetCdnUrl, hideDepositFlowInfo, hideDisplayDescription, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
395
427
|
|
|
428
|
+
type View = 'loading_config' | 'disabled' | 'email_input' | 'phone_input' | 'submitting_session' | 'email_otp' | 'phone_otp' | 'amount' | 'checking_deposit' | 'success' | 'guest_limit_reached';
|
|
429
|
+
interface BuyWithApplePayProps {
|
|
430
|
+
userId: string;
|
|
431
|
+
publishableKey: string;
|
|
432
|
+
recipientAddress?: string;
|
|
433
|
+
destinationChainType?: ChainType;
|
|
434
|
+
destinationChainId?: string;
|
|
435
|
+
destinationTokenAddress?: string;
|
|
436
|
+
destinationTokenSymbol?: string;
|
|
437
|
+
/** Host-platform-trusted email. Skips email screen + email OTP. */
|
|
438
|
+
externalUserEmail?: string;
|
|
439
|
+
/**
|
|
440
|
+
* SDK-level override for the dashboard `apple_pay.enabled` flag.
|
|
441
|
+
* Resolution order: this prop → `projectConfig.apple_pay.enabled` →
|
|
442
|
+
* default `true`. Set to `false` to render the disabled state, `true`
|
|
443
|
+
* to force enable regardless of the dashboard toggle.
|
|
444
|
+
*/
|
|
445
|
+
enableApplePay?: boolean;
|
|
446
|
+
/** Force the USD amount and skip the amount-entry step. */
|
|
447
|
+
amountUsd?: string;
|
|
448
|
+
minAmountUsd?: number;
|
|
449
|
+
maxAmountUsd?: number;
|
|
450
|
+
suggestedAmountsUsd?: number[];
|
|
451
|
+
/**
|
|
452
|
+
* Pre-fetched Unifold deposit wallets. When omitted, the component fetches
|
|
453
|
+
* them via `/deposit_addresses`. Coinbase sends the purchased crypto to
|
|
454
|
+
* the matching-chain wallet's address, then our backend forwards to
|
|
455
|
+
* `recipientAddress`.
|
|
456
|
+
*/
|
|
457
|
+
wallets?: Wallet[];
|
|
458
|
+
onDepositSuccess?: (data: {
|
|
459
|
+
message: string;
|
|
460
|
+
transaction?: unknown;
|
|
461
|
+
executionId?: string;
|
|
462
|
+
execution?: DirectExecutionSucceededEvent;
|
|
463
|
+
}) => void;
|
|
464
|
+
onDepositError?: (error: {
|
|
465
|
+
message: string;
|
|
466
|
+
error?: unknown;
|
|
467
|
+
code?: string;
|
|
468
|
+
}) => void;
|
|
469
|
+
onEvent?: (event: DepositEvent) => void;
|
|
470
|
+
/** Stream of the internal view for parent-header sync. */
|
|
471
|
+
onViewChange?: (view: View) => void;
|
|
472
|
+
/**
|
|
473
|
+
* Label for the exit button on terminal screens (currently the
|
|
474
|
+
* guest-limit error). `"Return"` when Apple Pay was reached via the
|
|
475
|
+
* deposit-method menu (`initialScreen` unset / `"main"`); `"Close"`
|
|
476
|
+
* when the modal was opened directly to Apple Pay.
|
|
477
|
+
*/
|
|
478
|
+
exitLabel?: 'Return' | 'Close';
|
|
479
|
+
/** Invoked when the user taps the exit button on a terminal screen. */
|
|
480
|
+
onExit?: () => void;
|
|
481
|
+
themeClass?: string;
|
|
482
|
+
}
|
|
483
|
+
/** Imperative handle: `requestBack` returns true when the child handled the back. */
|
|
484
|
+
interface BuyWithApplePayHandle {
|
|
485
|
+
requestBack: () => boolean;
|
|
486
|
+
}
|
|
487
|
+
declare const BuyWithApplePay: React$1.ForwardRefExoticComponent<BuyWithApplePayProps & React$1.RefAttributes<BuyWithApplePayHandle>>;
|
|
488
|
+
|
|
489
|
+
interface StoredApplePaySession {
|
|
490
|
+
email: string;
|
|
491
|
+
/** US phone in E.164 (e.g. +12345678901). */
|
|
492
|
+
phone: string;
|
|
493
|
+
termsAcceptedAt: string;
|
|
494
|
+
phoneVerifiedAt?: string;
|
|
495
|
+
emailVerifiedAt?: string;
|
|
496
|
+
/** Onramp verification JWT — skips OTP within its window. */
|
|
497
|
+
onrampToken?: string;
|
|
498
|
+
/** Epoch ms; treated as expired 60s before this to avoid order-race. */
|
|
499
|
+
onrampTokenExpiresAtMs?: number;
|
|
500
|
+
}
|
|
501
|
+
declare function getStoredApplePaySession(userId: string): StoredApplePaySession | null;
|
|
502
|
+
declare function setStoredApplePaySession(userId: string, contact: StoredApplePaySession): void;
|
|
503
|
+
declare function clearStoredApplePaySession(userId: string): void;
|
|
504
|
+
declare function isPhoneVerificationFresh(contact: StoredApplePaySession | null): boolean;
|
|
505
|
+
declare function isOnrampTokenFresh(contact: StoredApplePaySession | null): boolean;
|
|
506
|
+
|
|
396
507
|
interface CurrencyModalProps {
|
|
397
508
|
open: boolean;
|
|
398
509
|
onOpenChange: (open: boolean) => void;
|
|
@@ -492,6 +603,61 @@ interface DepositTrackerButtonProps {
|
|
|
492
603
|
}
|
|
493
604
|
declare function DepositTrackerButton({ onClick, title, subtitle, badge, }: DepositTrackerButtonProps): react_jsx_runtime.JSX.Element;
|
|
494
605
|
|
|
606
|
+
interface BankTransferButtonProps {
|
|
607
|
+
onClick: () => void;
|
|
608
|
+
title: string;
|
|
609
|
+
subtitle: string;
|
|
610
|
+
/** When true, renders the row as a disabled "coming soon" card (no click). */
|
|
611
|
+
comingSoon?: boolean;
|
|
612
|
+
}
|
|
613
|
+
declare function BankTransferButton({ onClick, title, subtitle, comingSoon, }: BankTransferButtonProps): react_jsx_runtime.JSX.Element;
|
|
614
|
+
|
|
615
|
+
interface StripeLinkButtonProps {
|
|
616
|
+
onClick: () => void;
|
|
617
|
+
title?: string;
|
|
618
|
+
subtitle?: string;
|
|
619
|
+
iconUrl?: string;
|
|
620
|
+
}
|
|
621
|
+
declare function StripeLinkButton({ onClick, title, subtitle, iconUrl, }: StripeLinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
622
|
+
|
|
623
|
+
type BankTransferView = 'providers' | 'amount' | 'pending';
|
|
624
|
+
interface BankTransferProps {
|
|
625
|
+
userId: string;
|
|
626
|
+
publishableKey: string;
|
|
627
|
+
view?: BankTransferView;
|
|
628
|
+
onViewChange?: (view: BankTransferView) => void;
|
|
629
|
+
recipientAddress?: string;
|
|
630
|
+
destinationChainType?: ChainType;
|
|
631
|
+
destinationChainId?: string;
|
|
632
|
+
destinationTokenAddress?: string;
|
|
633
|
+
destinationTokenSymbol?: string;
|
|
634
|
+
wallets?: Wallet[];
|
|
635
|
+
/** Pre-resolved default token (saves a network round-trip when provided). */
|
|
636
|
+
defaultToken?: DefaultTokenResponse | null;
|
|
637
|
+
assetCdnUrl?: string;
|
|
638
|
+
onDepositSuccess?: (data: {
|
|
639
|
+
message: string;
|
|
640
|
+
transaction?: unknown;
|
|
641
|
+
executionId?: string;
|
|
642
|
+
}) => void;
|
|
643
|
+
onEvent?: (event: DepositEvent) => void;
|
|
644
|
+
onDepositError?: (error: {
|
|
645
|
+
message: string;
|
|
646
|
+
error?: unknown;
|
|
647
|
+
code?: string;
|
|
648
|
+
}) => void;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Bank-transfer deposit flow. Three steps:
|
|
652
|
+
* 1. Provider list (returned by `getBankTransferProviders`)
|
|
653
|
+
* 2. Amount input (Swapped-only today; other providers may diverge later)
|
|
654
|
+
* 3. Pending — Swapped widget opens in a new tab, we poll for the deposit
|
|
655
|
+
*
|
|
656
|
+
* The widget itself handles KYC + IBAN entry + payment; we just collect the
|
|
657
|
+
* fiat amount up-front so users aren't surprised by the default in the widget.
|
|
658
|
+
*/
|
|
659
|
+
declare function BankTransfer({ userId, publishableKey, view: externalView, onViewChange, destinationChainType, destinationChainId, destinationTokenAddress, destinationTokenSymbol, wallets, defaultToken: externalDefaultToken, assetCdnUrl, onDepositSuccess, onEvent, onDepositError, }: BankTransferProps): react_jsx_runtime.JSX.Element;
|
|
660
|
+
|
|
495
661
|
interface DepositWallet {
|
|
496
662
|
id: string;
|
|
497
663
|
chain_type: string;
|
|
@@ -537,18 +703,72 @@ declare namespace CoinbaseConnect {
|
|
|
537
703
|
var displayName: string;
|
|
538
704
|
}
|
|
539
705
|
|
|
706
|
+
type StripeLinkStep = 'email' | 'register' | 'auth' | 'kyc' | 'kyc_form' | 'kyc_document' | 'wallet' | 'payment' | 'add_payment' | 'amount' | 'review' | 'checkout' | 'success' | 'error';
|
|
707
|
+
interface PayWithStripeLinkProps {
|
|
708
|
+
userId: string;
|
|
709
|
+
publishableKey: string;
|
|
710
|
+
recipientAddress?: string;
|
|
711
|
+
destinationChainType?: ChainType;
|
|
712
|
+
destinationChainId?: string;
|
|
713
|
+
destinationTokenAddress?: string;
|
|
714
|
+
/**
|
|
715
|
+
* Pre-created deposit intent wallets (one per chain type). When provided, the
|
|
716
|
+
* Stripe onramp delivers to the deposit intent address matching the Stripe
|
|
717
|
+
* default token's chain type, instead of sending directly to
|
|
718
|
+
* `recipientAddress`. When omitted, the component fetches them itself.
|
|
719
|
+
*/
|
|
720
|
+
wallets?: Wallet[];
|
|
721
|
+
/** Pre-fill email — skips the email screen and auto-submits against Stripe SDK */
|
|
722
|
+
email?: string;
|
|
723
|
+
/** URL for the Link logo icon (from CDN) */
|
|
724
|
+
iconUrl?: string;
|
|
725
|
+
/** Controlled step state (optional — for header back button coordination) */
|
|
726
|
+
step?: StripeLinkStep;
|
|
727
|
+
onStepChange?: (step: StripeLinkStep) => void;
|
|
728
|
+
/** Ref populated by the component with a custom back handler.
|
|
729
|
+
* Returns true if the back was handled internally (e.g. KYC form sub-step). */
|
|
730
|
+
backHandlerRef?: MutableRefObject<(() => boolean) | null>;
|
|
731
|
+
onEvent?: (event: DepositEvent) => void;
|
|
732
|
+
onDepositSuccess?: (data: {
|
|
733
|
+
message: string;
|
|
734
|
+
transaction?: unknown;
|
|
735
|
+
}) => void;
|
|
736
|
+
onDepositError?: (error: {
|
|
737
|
+
message: string;
|
|
738
|
+
error?: unknown;
|
|
739
|
+
}) => void;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Headless Stripe Link onramp component.
|
|
744
|
+
*
|
|
745
|
+
* Orchestrates the full flow:
|
|
746
|
+
* 1. Email → create auth intent via backend
|
|
747
|
+
* 2. Auth → Stripe SDK `authenticate()` for OTP consent
|
|
748
|
+
* 3. KYC → check status, submit KYC info / verify documents if needed
|
|
749
|
+
* 4. Wallet → register destination wallet
|
|
750
|
+
* 5. Payment → collect payment method via Stripe SDK
|
|
751
|
+
* 6. Amount → user enters fiat amount
|
|
752
|
+
* 7. Checkout → create session + confirm
|
|
753
|
+
* 8. Success / Error
|
|
754
|
+
*
|
|
755
|
+
* The Stripe publishable key is auto-fetched from the backend via GET /config,
|
|
756
|
+
* so consumers only need their Unifold publishable key.
|
|
757
|
+
*/
|
|
758
|
+
declare function PayWithStripeLink({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, wallets: externalWallets, email: emailProp, iconUrl, step: controlledStep, onStepChange, backHandlerRef, onDepositSuccess, onDepositError, }: PayWithStripeLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
759
|
+
|
|
540
760
|
interface DepositExecutionItemProps {
|
|
541
761
|
execution: DirectExecutionResponse;
|
|
542
762
|
onClick?: () => void;
|
|
543
763
|
}
|
|
544
|
-
declare function DepositExecutionItem({ execution, onClick
|
|
764
|
+
declare function DepositExecutionItem({ execution, onClick }: DepositExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
545
765
|
|
|
546
766
|
interface DepositDetailContentProps {
|
|
547
767
|
execution: DirectExecutionResponse;
|
|
548
768
|
/** Merged into root (e.g. wider horizontal padding in embedded deposit details). */
|
|
549
769
|
className?: string;
|
|
550
770
|
/** Use "withdraw" to show "Withdrawal Tx" instead of "Deposit Tx" in details. */
|
|
551
|
-
variant?:
|
|
771
|
+
variant?: 'deposit' | 'withdraw';
|
|
552
772
|
}
|
|
553
773
|
declare function DepositDetailContent({ execution, className, variant, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
|
|
554
774
|
|
|
@@ -607,18 +827,28 @@ interface CheckoutModalProps {
|
|
|
607
827
|
defaultSourceTokenAddress?: string;
|
|
608
828
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
|
|
609
829
|
defaultSourceSymbol?: string;
|
|
610
|
-
theme?:
|
|
830
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
611
831
|
onCheckoutSuccess?: (data: {
|
|
612
832
|
paymentIntentId: string;
|
|
613
833
|
status: string;
|
|
834
|
+
method?: CheckoutMethod;
|
|
835
|
+
/**
|
|
836
|
+
* The full payment intent at the time of the success callback, mapped to
|
|
837
|
+
* SDK camelCase. Present whenever the SDK has retrieved the PI (always for
|
|
838
|
+
* the terminal `succeeded` callback; may be undefined for intermediate
|
|
839
|
+
* wallet-confirmed `processing` callbacks fired before the PI is polled).
|
|
840
|
+
*/
|
|
841
|
+
paymentIntent?: CheckoutPaymentIntent;
|
|
614
842
|
}) => void;
|
|
615
843
|
onCheckoutError?: (error: {
|
|
616
844
|
message: string;
|
|
617
845
|
error?: unknown;
|
|
618
846
|
code?: string;
|
|
847
|
+
method?: CheckoutMethod;
|
|
619
848
|
}) => void;
|
|
849
|
+
onEvent?: (event: CheckoutEvent) => void;
|
|
620
850
|
}
|
|
621
|
-
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
851
|
+
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, onEvent, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
622
852
|
|
|
623
853
|
interface WithdrawTransactionInfo {
|
|
624
854
|
/** Source (sending) chain type */
|
|
@@ -681,7 +911,7 @@ interface WithdrawModalProps {
|
|
|
681
911
|
code?: string;
|
|
682
912
|
}) => void;
|
|
683
913
|
onEvent?: (event: WithdrawEvent) => void;
|
|
684
|
-
theme?:
|
|
914
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
685
915
|
hideOverlay?: boolean;
|
|
686
916
|
}
|
|
687
917
|
declare function WithdrawModal({ open, onOpenChange, publishableKey, modalTitle, externalUserId, sourceChainType, sourceChainId, sourceTokenAddress, sourceTokenSymbol, recipientAddress: recipientAddressProp, senderAddress, defaultDestinationChainType, defaultDestinationChainId, defaultDestinationTokenAddress, defaultDestinationSymbol, onWithdraw, onWithdrawSuccess, onWithdrawError, onEvent, theme, hideOverlay, }: WithdrawModalProps): react_jsx_runtime.JSX.Element;
|
|
@@ -691,7 +921,7 @@ interface WithdrawTokenSelectorProps {
|
|
|
691
921
|
onSelect: (token: DestinationToken, chain: DestinationTokenChain) => void;
|
|
692
922
|
onBack: () => void;
|
|
693
923
|
}
|
|
694
|
-
declare function WithdrawTokenSelector({ tokens, onSelect, onBack
|
|
924
|
+
declare function WithdrawTokenSelector({ tokens, onSelect, onBack }: WithdrawTokenSelectorProps): react_jsx_runtime.JSX.Element;
|
|
695
925
|
|
|
696
926
|
interface WithdrawDoubleInputProps {
|
|
697
927
|
tokens: DestinationToken[];
|
|
@@ -770,7 +1000,7 @@ interface WithdrawExecutionItemProps {
|
|
|
770
1000
|
execution: DirectExecutionResponse;
|
|
771
1001
|
onClick?: () => void;
|
|
772
1002
|
}
|
|
773
|
-
declare function WithdrawExecutionItem({ execution, onClick
|
|
1003
|
+
declare function WithdrawExecutionItem({ execution, onClick }: WithdrawExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
774
1004
|
|
|
775
1005
|
interface WithdrawConfirmingViewProps {
|
|
776
1006
|
txInfo: WithdrawTransactionInfo;
|
|
@@ -788,10 +1018,10 @@ type DetectedWallet = {
|
|
|
788
1018
|
name: string;
|
|
789
1019
|
address: string;
|
|
790
1020
|
} & ({
|
|
791
|
-
chainFamily:
|
|
1021
|
+
chainFamily: 'evm';
|
|
792
1022
|
provider: EvmWalletProvider;
|
|
793
1023
|
} | {
|
|
794
|
-
chainFamily:
|
|
1024
|
+
chainFamily: 'solana';
|
|
795
1025
|
provider: SolanaWalletProvider;
|
|
796
1026
|
});
|
|
797
1027
|
declare function sendEvmWithdraw(params: {
|
|
@@ -827,7 +1057,7 @@ interface CurrencyListItemProps {
|
|
|
827
1057
|
isSelected: boolean;
|
|
828
1058
|
onSelect: (currencyCode: string) => void;
|
|
829
1059
|
}
|
|
830
|
-
declare function CurrencyListItem({ currency, isSelected, onSelect
|
|
1060
|
+
declare function CurrencyListItem({ currency, isSelected, onSelect }: CurrencyListItemProps): react_jsx_runtime.JSX.Element;
|
|
831
1061
|
|
|
832
1062
|
interface CurrencyListSectionProps {
|
|
833
1063
|
title: string;
|
|
@@ -944,6 +1174,31 @@ interface AllowedCountryResult {
|
|
|
944
1174
|
*/
|
|
945
1175
|
declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
|
|
946
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* Returns `value` after it has stayed unchanged for `delay` milliseconds.
|
|
1179
|
+
* During the wait window the previously-settled value is returned, so a
|
|
1180
|
+
* downstream effect / API call keyed on the result only fires once the
|
|
1181
|
+
* input stops changing.
|
|
1182
|
+
*
|
|
1183
|
+
* Typical pattern:
|
|
1184
|
+
*
|
|
1185
|
+
* ```ts
|
|
1186
|
+
* const debouncedAmount = useDebounce(amount, 800);
|
|
1187
|
+
* useEffect(() => {
|
|
1188
|
+
* void prepareSession(debouncedAmount);
|
|
1189
|
+
* }, [debouncedAmount]);
|
|
1190
|
+
* ```
|
|
1191
|
+
*
|
|
1192
|
+
* For eager UI work that should run on every keystroke (e.g. clearing a
|
|
1193
|
+
* stale session), key that effect on the raw `value`; keep the debounced
|
|
1194
|
+
* effect on the returned value. The two concerns are then cleanly split.
|
|
1195
|
+
*
|
|
1196
|
+
* The hook is intentionally a value-debounce, not a callback-debounce —
|
|
1197
|
+
* value-debouncing composes with any side-effect, while a debounced
|
|
1198
|
+
* callback couples timing to a specific function.
|
|
1199
|
+
*/
|
|
1200
|
+
declare function useDebounce<T>(value: T, delay: number): T;
|
|
1201
|
+
|
|
947
1202
|
interface UsePaymentIntentParams {
|
|
948
1203
|
clientSecret: string;
|
|
949
1204
|
publishableKey: string;
|
|
@@ -1158,7 +1413,7 @@ declare const colors: {
|
|
|
1158
1413
|
};
|
|
1159
1414
|
};
|
|
1160
1415
|
type ThemeColors = typeof defaultColors.light;
|
|
1161
|
-
type ThemeMode =
|
|
1416
|
+
type ThemeMode = 'light' | 'dark';
|
|
1162
1417
|
/** Partial theme colors for customization */
|
|
1163
1418
|
type CustomThemeColors = Partial<ThemeColors>;
|
|
1164
1419
|
/** Theme customization options */
|
|
@@ -1317,7 +1572,7 @@ interface ThemeContextValue {
|
|
|
1317
1572
|
interface ThemeProviderProps {
|
|
1318
1573
|
children: React$1.ReactNode;
|
|
1319
1574
|
/** Force a specific theme mode, or 'auto' to use system preference */
|
|
1320
|
-
mode?: ThemeMode |
|
|
1575
|
+
mode?: ThemeMode | 'auto';
|
|
1321
1576
|
/** Simple accent/primary color override (applies to both light and dark) */
|
|
1322
1577
|
accentColor?: string;
|
|
1323
1578
|
/** Full theme customization per mode */
|
|
@@ -1349,4 +1604,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1349
1604
|
*/
|
|
1350
1605
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1351
1606
|
|
|
1352
|
-
export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, CheckingForDepositIndicator, CheckoutModal, type CheckoutModalProps, CoinbaseConnect, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, ConnectExchangeButton, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen,
|
|
1607
|
+
export { type AllowedCountryResult, BankTransfer, BankTransferButton, type BankTransferProps, type BankTransferView, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithApplePay, type BuyWithApplePayProps, BuyWithCard, type BuyWithCardProps, type CardTokens, CheckingForDepositIndicator, CheckoutModal, type CheckoutModalProps, CoinbaseConnect, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, ConnectExchangeButton, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, HYPERCORE_CHAIN_ID, type HeaderTokens, type InputTokens, type ListTokens, ManualDepositButton, PayWithStripeLink, type PayWithStripeLinkProps, QRCodeSkeleton, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, type StoredApplePaySession, StripeLinkButton, type StripeLinkStep, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, type UseDepositQuoteParams, type UsePaymentIntentParams, type UseSupportedDepositTokensOptions, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, clearStoredApplePaySession, cn, colors, defaultColors, detectBrowserWallet, getColors, getStoredApplePaySession, isHypercoreChain, isOnrampTokenFresh, isPhoneVerificationFresh, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, setStoredApplePaySession, truncateAddress, useAddressBalance, useAllowedCountry, useDebounce, useDepositPolling, useDepositQuote, usePaymentIntent, useSourceTokenValidation, useSupportedDepositTokens, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|