@unifold/ui-react 0.1.68-beta.0 → 0.1.68-beta.2
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 +206 -23
- package/dist/index.d.ts +206 -23
- package/dist/index.js +13846 -7288
- package/dist/index.mjs +13310 -6760
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +20 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
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,6 +211,32 @@ 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
|
+
/**
|
|
216
|
+
* Email for the host platform's signed-in user. Consolidated pre-fill / pre-trust
|
|
217
|
+
* address shared across onramp flows:
|
|
218
|
+
*
|
|
219
|
+
* - **Stripe Link:** pre-fills the email screen and auto-submits.
|
|
220
|
+
* - **Apple Pay (headless Coinbase):** treated as pre-trusted — skips the
|
|
221
|
+
* email-OTP step and the localStorage email lookup. Phone OTP is always
|
|
222
|
+
* still required.
|
|
223
|
+
*/
|
|
224
|
+
userEmail?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides dashboard
|
|
227
|
+
* default. Resolves as flag ?? dashboard `apple_pay.enabled` ?? true. The
|
|
228
|
+
* server still gates per-region (US-only, NY excluded at launch) at the
|
|
229
|
+
* order-creation step.
|
|
230
|
+
*/
|
|
231
|
+
enableApplePay?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Title shown for the Apple Pay row in the main menu. @default `"Pay with Apple Pay"`
|
|
234
|
+
*/
|
|
235
|
+
applePayTitle?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Subtitle shown for the Apple Pay row in the main menu. @default `"Instant"`
|
|
238
|
+
*/
|
|
239
|
+
applePaySubTitle?: string;
|
|
213
240
|
/**
|
|
214
241
|
* Enable the "Bank Transfer" section (SEPA, etc.). Overrides dashboard default.
|
|
215
242
|
* Resolves as flag ?? dashboard `bank_transfer.enabled` ?? true.
|
|
@@ -238,7 +265,7 @@ interface DepositModalProps {
|
|
|
238
265
|
/** Which funding method produced this error event. */
|
|
239
266
|
method?: DepositMethod;
|
|
240
267
|
}) => void;
|
|
241
|
-
theme?:
|
|
268
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
242
269
|
/** Hide the dialog overlay and close button for inline/embedded mode */
|
|
243
270
|
hideOverlay?: boolean;
|
|
244
271
|
/** First screen when the modal opens. Default `main` (deposit menu). */
|
|
@@ -249,9 +276,9 @@ interface DepositModalProps {
|
|
|
249
276
|
* - `"tabs"`: options are grouped under "Use Crypto" / "Use Cash" tabs to keep
|
|
250
277
|
* the menu compact and mobile-friendly.
|
|
251
278
|
*/
|
|
252
|
-
displayMode?:
|
|
279
|
+
displayMode?: 'stacked' | 'tabs';
|
|
253
280
|
}
|
|
254
|
-
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, enableBankTransfer, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, displayMode, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
281
|
+
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, userEmail, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, displayMode, transferCryptoTitle, depositWithCardTitle, payWithExchangeTitle, depositTrackerTitle, depositTrackerSubTitle, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
255
282
|
|
|
256
283
|
interface DepositHeaderProps {
|
|
257
284
|
title: string;
|
|
@@ -369,8 +396,8 @@ declare function TransferCryptoDoubleInput({ userId, publishableKey, recipientAd
|
|
|
369
396
|
interface BuyWithCardProps {
|
|
370
397
|
userId: string;
|
|
371
398
|
publishableKey: string;
|
|
372
|
-
view?:
|
|
373
|
-
onViewChange?: (view:
|
|
399
|
+
view?: 'amount' | 'quotes' | 'onramp';
|
|
400
|
+
onViewChange?: (view: 'amount' | 'quotes' | 'onramp', quotesCount?: number) => void;
|
|
374
401
|
maxAmountUsd?: number;
|
|
375
402
|
accentColor?: string;
|
|
376
403
|
destinationTokenSymbol?: string;
|
|
@@ -401,6 +428,75 @@ interface BuyWithCardProps {
|
|
|
401
428
|
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, // Keep prop for backward compatibility but don't use default
|
|
402
429
|
destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, onDepositSuccess, onDepositError, onEvent, themeClass, wallets: externalWallets, assetCdnUrl, hideDepositFlowInfo, hideDisplayDescription, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
403
430
|
|
|
431
|
+
type View = 'loading_config' | 'disabled' | 'email_input' | 'phone_input' | 'submitting_session' | 'email_otp' | 'phone_otp' | 'amount' | 'checking_deposit' | 'success' | 'guest_limit_reached' | 'limit_upgrade_intro' | 'limit_upgrade_form' | 'limit_upgrade_submitting' | 'limit_upgrade_failed';
|
|
432
|
+
interface BuyWithApplePayProps {
|
|
433
|
+
userId: string;
|
|
434
|
+
publishableKey: string;
|
|
435
|
+
recipientAddress?: string;
|
|
436
|
+
destinationChainType?: ChainType;
|
|
437
|
+
destinationChainId?: string;
|
|
438
|
+
destinationTokenAddress?: string;
|
|
439
|
+
/** Host-platform-trusted email. Skips email screen + email OTP. */
|
|
440
|
+
userEmail?: string;
|
|
441
|
+
/** Force the USD amount and skip the amount-entry step. */
|
|
442
|
+
amountUsd?: string;
|
|
443
|
+
minAmountUsd?: number;
|
|
444
|
+
maxAmountUsd?: number;
|
|
445
|
+
suggestedAmountsUsd?: number[];
|
|
446
|
+
/**
|
|
447
|
+
* Unifold deposit wallets from the parent modal.
|
|
448
|
+
* Coinbase sends purchased crypto to the matching-chain wallet, then
|
|
449
|
+
* backend auto-swap routes to `recipientAddress`.
|
|
450
|
+
*/
|
|
451
|
+
wallets?: Wallet[];
|
|
452
|
+
onDepositSuccess?: (data: {
|
|
453
|
+
message: string;
|
|
454
|
+
transaction?: unknown;
|
|
455
|
+
executionId?: string;
|
|
456
|
+
execution?: DirectExecutionSucceededEvent;
|
|
457
|
+
}) => void;
|
|
458
|
+
onDepositError?: (error: {
|
|
459
|
+
message: string;
|
|
460
|
+
error?: unknown;
|
|
461
|
+
code?: string;
|
|
462
|
+
}) => void;
|
|
463
|
+
onEvent?: (event: DepositEvent) => void;
|
|
464
|
+
/** Stream of the internal view for parent-header sync. */
|
|
465
|
+
onViewChange?: (view: View) => void;
|
|
466
|
+
/**
|
|
467
|
+
* Label for the exit button on terminal screens (currently the
|
|
468
|
+
* guest-limit error). `"Return"` when Apple Pay was reached via the
|
|
469
|
+
* deposit-method menu (`initialScreen` unset / `"main"`); `"Close"`
|
|
470
|
+
* when the modal was opened directly to Apple Pay.
|
|
471
|
+
*/
|
|
472
|
+
exitLabel?: 'Return' | 'Close';
|
|
473
|
+
/** Invoked when the user taps the exit button on a terminal screen. */
|
|
474
|
+
onExit?: () => void;
|
|
475
|
+
themeClass?: string;
|
|
476
|
+
}
|
|
477
|
+
/** Imperative handle: `requestBack` returns true when the child handled the back. */
|
|
478
|
+
interface BuyWithApplePayHandle {
|
|
479
|
+
requestBack: () => boolean;
|
|
480
|
+
}
|
|
481
|
+
declare const BuyWithApplePay: React$1.ForwardRefExoticComponent<BuyWithApplePayProps & React$1.RefAttributes<BuyWithApplePayHandle>>;
|
|
482
|
+
|
|
483
|
+
interface StoredApplePaySession {
|
|
484
|
+
email: string;
|
|
485
|
+
/** US phone in E.164 (e.g. +12345678901). */
|
|
486
|
+
phone: string;
|
|
487
|
+
termsAcceptedAt: string;
|
|
488
|
+
phoneVerifiedAt?: string;
|
|
489
|
+
emailVerifiedAt?: string;
|
|
490
|
+
/** Onramp verification JWT — skips OTP within its window. */
|
|
491
|
+
onrampToken?: string;
|
|
492
|
+
/** Epoch ms; treated as expired 60s before this to avoid order-race. */
|
|
493
|
+
onrampTokenExpiresAtMs?: number;
|
|
494
|
+
}
|
|
495
|
+
declare function getStoredApplePaySession(userId: string): StoredApplePaySession | null;
|
|
496
|
+
declare function setStoredApplePaySession(userId: string, contact: StoredApplePaySession): void;
|
|
497
|
+
declare function clearStoredApplePaySession(userId: string): void;
|
|
498
|
+
declare function isOnrampTokenFresh(contact: StoredApplePaySession | null): boolean;
|
|
499
|
+
|
|
404
500
|
interface CurrencyModalProps {
|
|
405
501
|
open: boolean;
|
|
406
502
|
onOpenChange: (open: boolean) => void;
|
|
@@ -509,7 +605,15 @@ interface BankTransferButtonProps {
|
|
|
509
605
|
}
|
|
510
606
|
declare function BankTransferButton({ onClick, title, subtitle, comingSoon, }: BankTransferButtonProps): react_jsx_runtime.JSX.Element;
|
|
511
607
|
|
|
512
|
-
|
|
608
|
+
interface StripeLinkButtonProps {
|
|
609
|
+
onClick: () => void;
|
|
610
|
+
title?: string;
|
|
611
|
+
subtitle?: string;
|
|
612
|
+
iconUrl?: string;
|
|
613
|
+
}
|
|
614
|
+
declare function StripeLinkButton({ onClick, title, subtitle, iconUrl, }: StripeLinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
615
|
+
|
|
616
|
+
type BankTransferView = 'providers' | 'amount' | 'pending';
|
|
513
617
|
interface BankTransferProps {
|
|
514
618
|
userId: string;
|
|
515
619
|
publishableKey: string;
|
|
@@ -592,18 +696,72 @@ declare namespace CoinbaseConnect {
|
|
|
592
696
|
var displayName: string;
|
|
593
697
|
}
|
|
594
698
|
|
|
699
|
+
type StripeLinkStep = 'email' | 'register' | 'auth' | 'kyc' | 'kyc_form' | 'kyc_document' | 'wallet' | 'payment' | 'add_payment' | 'amount' | 'review' | 'checkout' | 'success' | 'error';
|
|
700
|
+
interface PayWithStripeLinkProps {
|
|
701
|
+
userId: string;
|
|
702
|
+
publishableKey: string;
|
|
703
|
+
recipientAddress?: string;
|
|
704
|
+
destinationChainType?: ChainType;
|
|
705
|
+
destinationChainId?: string;
|
|
706
|
+
destinationTokenAddress?: string;
|
|
707
|
+
/**
|
|
708
|
+
* Pre-created deposit intent wallets (one per chain type). When provided, the
|
|
709
|
+
* Stripe onramp delivers to the deposit intent address matching the Stripe
|
|
710
|
+
* default token's chain type, instead of sending directly to
|
|
711
|
+
* `recipientAddress`. When omitted, the component fetches them itself.
|
|
712
|
+
*/
|
|
713
|
+
wallets?: Wallet[];
|
|
714
|
+
/** Pre-fill email — skips the email screen and auto-submits against Stripe SDK */
|
|
715
|
+
email?: string;
|
|
716
|
+
/** URL for the Link logo icon (from CDN) */
|
|
717
|
+
iconUrl?: string;
|
|
718
|
+
/** Controlled step state (optional — for header back button coordination) */
|
|
719
|
+
step?: StripeLinkStep;
|
|
720
|
+
onStepChange?: (step: StripeLinkStep) => void;
|
|
721
|
+
/** Ref populated by the component with a custom back handler.
|
|
722
|
+
* Returns true if the back was handled internally (e.g. KYC form sub-step). */
|
|
723
|
+
backHandlerRef?: MutableRefObject<(() => boolean) | null>;
|
|
724
|
+
onEvent?: (event: DepositEvent) => void;
|
|
725
|
+
onDepositSuccess?: (data: {
|
|
726
|
+
message: string;
|
|
727
|
+
transaction?: unknown;
|
|
728
|
+
}) => void;
|
|
729
|
+
onDepositError?: (error: {
|
|
730
|
+
message: string;
|
|
731
|
+
error?: unknown;
|
|
732
|
+
}) => void;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Headless Stripe Link onramp component.
|
|
737
|
+
*
|
|
738
|
+
* Orchestrates the full flow:
|
|
739
|
+
* 1. Email → create auth intent via backend
|
|
740
|
+
* 2. Auth → Stripe SDK `authenticate()` for OTP consent
|
|
741
|
+
* 3. KYC → check status, submit KYC info / verify documents if needed
|
|
742
|
+
* 4. Wallet → register destination wallet
|
|
743
|
+
* 5. Payment → collect payment method via Stripe SDK
|
|
744
|
+
* 6. Amount → user enters fiat amount
|
|
745
|
+
* 7. Checkout → create session + confirm
|
|
746
|
+
* 8. Success / Error
|
|
747
|
+
*
|
|
748
|
+
* The Stripe publishable key is auto-fetched from the backend via GET /config,
|
|
749
|
+
* so consumers only need their Unifold publishable key.
|
|
750
|
+
*/
|
|
751
|
+
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;
|
|
752
|
+
|
|
595
753
|
interface DepositExecutionItemProps {
|
|
596
754
|
execution: DirectExecutionResponse;
|
|
597
755
|
onClick?: () => void;
|
|
598
756
|
}
|
|
599
|
-
declare function DepositExecutionItem({ execution, onClick
|
|
757
|
+
declare function DepositExecutionItem({ execution, onClick }: DepositExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
600
758
|
|
|
601
759
|
interface DepositDetailContentProps {
|
|
602
760
|
execution: DirectExecutionResponse;
|
|
603
761
|
/** Merged into root (e.g. wider horizontal padding in embedded deposit details). */
|
|
604
762
|
className?: string;
|
|
605
763
|
/** Use "withdraw" to show "Withdrawal Tx" instead of "Deposit Tx" in details. */
|
|
606
|
-
variant?:
|
|
764
|
+
variant?: 'deposit' | 'withdraw';
|
|
607
765
|
}
|
|
608
766
|
declare function DepositDetailContent({ execution, className, variant, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
|
|
609
767
|
|
|
@@ -662,7 +820,7 @@ interface CheckoutModalProps {
|
|
|
662
820
|
defaultSourceTokenAddress?: string;
|
|
663
821
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
|
|
664
822
|
defaultSourceSymbol?: string;
|
|
665
|
-
theme?:
|
|
823
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
666
824
|
onCheckoutSuccess?: (data: {
|
|
667
825
|
paymentIntentId: string;
|
|
668
826
|
status: string;
|
|
@@ -746,7 +904,7 @@ interface WithdrawModalProps {
|
|
|
746
904
|
code?: string;
|
|
747
905
|
}) => void;
|
|
748
906
|
onEvent?: (event: WithdrawEvent) => void;
|
|
749
|
-
theme?:
|
|
907
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
750
908
|
hideOverlay?: boolean;
|
|
751
909
|
}
|
|
752
910
|
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;
|
|
@@ -756,7 +914,7 @@ interface WithdrawTokenSelectorProps {
|
|
|
756
914
|
onSelect: (token: DestinationToken, chain: DestinationTokenChain) => void;
|
|
757
915
|
onBack: () => void;
|
|
758
916
|
}
|
|
759
|
-
declare function WithdrawTokenSelector({ tokens, onSelect, onBack
|
|
917
|
+
declare function WithdrawTokenSelector({ tokens, onSelect, onBack }: WithdrawTokenSelectorProps): react_jsx_runtime.JSX.Element;
|
|
760
918
|
|
|
761
919
|
interface WithdrawDoubleInputProps {
|
|
762
920
|
tokens: DestinationToken[];
|
|
@@ -835,7 +993,7 @@ interface WithdrawExecutionItemProps {
|
|
|
835
993
|
execution: DirectExecutionResponse;
|
|
836
994
|
onClick?: () => void;
|
|
837
995
|
}
|
|
838
|
-
declare function WithdrawExecutionItem({ execution, onClick
|
|
996
|
+
declare function WithdrawExecutionItem({ execution, onClick }: WithdrawExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
839
997
|
|
|
840
998
|
interface WithdrawConfirmingViewProps {
|
|
841
999
|
txInfo: WithdrawTransactionInfo;
|
|
@@ -853,10 +1011,10 @@ type DetectedWallet = {
|
|
|
853
1011
|
name: string;
|
|
854
1012
|
address: string;
|
|
855
1013
|
} & ({
|
|
856
|
-
chainFamily:
|
|
1014
|
+
chainFamily: 'evm';
|
|
857
1015
|
provider: EvmWalletProvider;
|
|
858
1016
|
} | {
|
|
859
|
-
chainFamily:
|
|
1017
|
+
chainFamily: 'solana';
|
|
860
1018
|
provider: SolanaWalletProvider;
|
|
861
1019
|
});
|
|
862
1020
|
declare function sendEvmWithdraw(params: {
|
|
@@ -892,7 +1050,7 @@ interface CurrencyListItemProps {
|
|
|
892
1050
|
isSelected: boolean;
|
|
893
1051
|
onSelect: (currencyCode: string) => void;
|
|
894
1052
|
}
|
|
895
|
-
declare function CurrencyListItem({ currency, isSelected, onSelect
|
|
1053
|
+
declare function CurrencyListItem({ currency, isSelected, onSelect }: CurrencyListItemProps): react_jsx_runtime.JSX.Element;
|
|
896
1054
|
|
|
897
1055
|
interface CurrencyListSectionProps {
|
|
898
1056
|
title: string;
|
|
@@ -1009,6 +1167,31 @@ interface AllowedCountryResult {
|
|
|
1009
1167
|
*/
|
|
1010
1168
|
declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
|
|
1011
1169
|
|
|
1170
|
+
/**
|
|
1171
|
+
* Returns `value` after it has stayed unchanged for `delay` milliseconds.
|
|
1172
|
+
* During the wait window the previously-settled value is returned, so a
|
|
1173
|
+
* downstream effect / API call keyed on the result only fires once the
|
|
1174
|
+
* input stops changing.
|
|
1175
|
+
*
|
|
1176
|
+
* Typical pattern:
|
|
1177
|
+
*
|
|
1178
|
+
* ```ts
|
|
1179
|
+
* const debouncedAmount = useDebounce(amount, 800);
|
|
1180
|
+
* useEffect(() => {
|
|
1181
|
+
* void prepareSession(debouncedAmount);
|
|
1182
|
+
* }, [debouncedAmount]);
|
|
1183
|
+
* ```
|
|
1184
|
+
*
|
|
1185
|
+
* For eager UI work that should run on every keystroke (e.g. clearing a
|
|
1186
|
+
* stale session), key that effect on the raw `value`; keep the debounced
|
|
1187
|
+
* effect on the returned value. The two concerns are then cleanly split.
|
|
1188
|
+
*
|
|
1189
|
+
* The hook is intentionally a value-debounce, not a callback-debounce —
|
|
1190
|
+
* value-debouncing composes with any side-effect, while a debounced
|
|
1191
|
+
* callback couples timing to a specific function.
|
|
1192
|
+
*/
|
|
1193
|
+
declare function useDebounce<T>(value: T, delay: number): T;
|
|
1194
|
+
|
|
1012
1195
|
interface UsePaymentIntentParams {
|
|
1013
1196
|
clientSecret: string;
|
|
1014
1197
|
publishableKey: string;
|
|
@@ -1223,7 +1406,7 @@ declare const colors: {
|
|
|
1223
1406
|
};
|
|
1224
1407
|
};
|
|
1225
1408
|
type ThemeColors = typeof defaultColors.light;
|
|
1226
|
-
type ThemeMode =
|
|
1409
|
+
type ThemeMode = 'light' | 'dark';
|
|
1227
1410
|
/** Partial theme colors for customization */
|
|
1228
1411
|
type CustomThemeColors = Partial<ThemeColors>;
|
|
1229
1412
|
/** Theme customization options */
|
|
@@ -1382,7 +1565,7 @@ interface ThemeContextValue {
|
|
|
1382
1565
|
interface ThemeProviderProps {
|
|
1383
1566
|
children: React$1.ReactNode;
|
|
1384
1567
|
/** Force a specific theme mode, or 'auto' to use system preference */
|
|
1385
|
-
mode?: ThemeMode |
|
|
1568
|
+
mode?: ThemeMode | 'auto';
|
|
1386
1569
|
/** Simple accent/primary color override (applies to both light and dark) */
|
|
1387
1570
|
accentColor?: string;
|
|
1388
1571
|
/** Full theme customization per mode */
|
|
@@ -1414,4 +1597,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1414
1597
|
*/
|
|
1415
1598
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1416
1599
|
|
|
1417
|
-
export { type AllowedCountryResult, BankTransfer, BankTransferButton, type BankTransferProps, type BankTransferView, 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,
|
|
1600
|
+
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, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, setStoredApplePaySession, truncateAddress, useAddressBalance, useAllowedCountry, useDebounce, useDepositPolling, useDepositQuote, usePaymentIntent, useSourceTokenValidation, useSupportedDepositTokens, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|