@unifold/ui-react 0.1.68-beta.0 → 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 +213 -23
- package/dist/index.d.ts +213 -23
- package/dist/index.js +14815 -8972
- package/dist/index.mjs +14208 -8376
- 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,23 @@ 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;
|
|
213
231
|
/**
|
|
214
232
|
* Enable the "Bank Transfer" section (SEPA, etc.). Overrides dashboard default.
|
|
215
233
|
* Resolves as flag ?? dashboard `bank_transfer.enabled` ?? true.
|
|
@@ -222,6 +240,12 @@ interface DepositModalProps {
|
|
|
222
240
|
hideDepositFlowInfo?: boolean;
|
|
223
241
|
/** Deposit with Card — onramp step: hide the temporary wallet address disclaimer. @default false */
|
|
224
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;
|
|
225
249
|
onDepositSuccess?: (data: {
|
|
226
250
|
message: string;
|
|
227
251
|
transaction?: unknown;
|
|
@@ -238,7 +262,7 @@ interface DepositModalProps {
|
|
|
238
262
|
/** Which funding method produced this error event. */
|
|
239
263
|
method?: DepositMethod;
|
|
240
264
|
}) => void;
|
|
241
|
-
theme?:
|
|
265
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
242
266
|
/** Hide the dialog overlay and close button for inline/embedded mode */
|
|
243
267
|
hideOverlay?: boolean;
|
|
244
268
|
/** First screen when the modal opens. Default `main` (deposit menu). */
|
|
@@ -249,9 +273,9 @@ interface DepositModalProps {
|
|
|
249
273
|
* - `"tabs"`: options are grouped under "Use Crypto" / "Use Cash" tabs to keep
|
|
250
274
|
* the menu compact and mobile-friendly.
|
|
251
275
|
*/
|
|
252
|
-
displayMode?:
|
|
276
|
+
displayMode?: 'stacked' | 'tabs';
|
|
253
277
|
}
|
|
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;
|
|
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;
|
|
255
279
|
|
|
256
280
|
interface DepositHeaderProps {
|
|
257
281
|
title: string;
|
|
@@ -369,8 +393,8 @@ declare function TransferCryptoDoubleInput({ userId, publishableKey, recipientAd
|
|
|
369
393
|
interface BuyWithCardProps {
|
|
370
394
|
userId: string;
|
|
371
395
|
publishableKey: string;
|
|
372
|
-
view?:
|
|
373
|
-
onViewChange?: (view:
|
|
396
|
+
view?: 'amount' | 'quotes' | 'onramp';
|
|
397
|
+
onViewChange?: (view: 'amount' | 'quotes' | 'onramp', quotesCount?: number) => void;
|
|
374
398
|
maxAmountUsd?: number;
|
|
375
399
|
accentColor?: string;
|
|
376
400
|
destinationTokenSymbol?: string;
|
|
@@ -401,6 +425,85 @@ interface BuyWithCardProps {
|
|
|
401
425
|
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, // Keep prop for backward compatibility but don't use default
|
|
402
426
|
destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, onDepositSuccess, onDepositError, onEvent, themeClass, wallets: externalWallets, assetCdnUrl, hideDepositFlowInfo, hideDisplayDescription, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
403
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
|
+
|
|
404
507
|
interface CurrencyModalProps {
|
|
405
508
|
open: boolean;
|
|
406
509
|
onOpenChange: (open: boolean) => void;
|
|
@@ -509,7 +612,15 @@ interface BankTransferButtonProps {
|
|
|
509
612
|
}
|
|
510
613
|
declare function BankTransferButton({ onClick, title, subtitle, comingSoon, }: BankTransferButtonProps): react_jsx_runtime.JSX.Element;
|
|
511
614
|
|
|
512
|
-
|
|
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';
|
|
513
624
|
interface BankTransferProps {
|
|
514
625
|
userId: string;
|
|
515
626
|
publishableKey: string;
|
|
@@ -592,18 +703,72 @@ declare namespace CoinbaseConnect {
|
|
|
592
703
|
var displayName: string;
|
|
593
704
|
}
|
|
594
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
|
+
|
|
595
760
|
interface DepositExecutionItemProps {
|
|
596
761
|
execution: DirectExecutionResponse;
|
|
597
762
|
onClick?: () => void;
|
|
598
763
|
}
|
|
599
|
-
declare function DepositExecutionItem({ execution, onClick
|
|
764
|
+
declare function DepositExecutionItem({ execution, onClick }: DepositExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
600
765
|
|
|
601
766
|
interface DepositDetailContentProps {
|
|
602
767
|
execution: DirectExecutionResponse;
|
|
603
768
|
/** Merged into root (e.g. wider horizontal padding in embedded deposit details). */
|
|
604
769
|
className?: string;
|
|
605
770
|
/** Use "withdraw" to show "Withdrawal Tx" instead of "Deposit Tx" in details. */
|
|
606
|
-
variant?:
|
|
771
|
+
variant?: 'deposit' | 'withdraw';
|
|
607
772
|
}
|
|
608
773
|
declare function DepositDetailContent({ execution, className, variant, }: DepositDetailContentProps): react_jsx_runtime.JSX.Element;
|
|
609
774
|
|
|
@@ -662,7 +827,7 @@ interface CheckoutModalProps {
|
|
|
662
827
|
defaultSourceTokenAddress?: string;
|
|
663
828
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
|
|
664
829
|
defaultSourceSymbol?: string;
|
|
665
|
-
theme?:
|
|
830
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
666
831
|
onCheckoutSuccess?: (data: {
|
|
667
832
|
paymentIntentId: string;
|
|
668
833
|
status: string;
|
|
@@ -746,7 +911,7 @@ interface WithdrawModalProps {
|
|
|
746
911
|
code?: string;
|
|
747
912
|
}) => void;
|
|
748
913
|
onEvent?: (event: WithdrawEvent) => void;
|
|
749
|
-
theme?:
|
|
914
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
750
915
|
hideOverlay?: boolean;
|
|
751
916
|
}
|
|
752
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;
|
|
@@ -756,7 +921,7 @@ interface WithdrawTokenSelectorProps {
|
|
|
756
921
|
onSelect: (token: DestinationToken, chain: DestinationTokenChain) => void;
|
|
757
922
|
onBack: () => void;
|
|
758
923
|
}
|
|
759
|
-
declare function WithdrawTokenSelector({ tokens, onSelect, onBack
|
|
924
|
+
declare function WithdrawTokenSelector({ tokens, onSelect, onBack }: WithdrawTokenSelectorProps): react_jsx_runtime.JSX.Element;
|
|
760
925
|
|
|
761
926
|
interface WithdrawDoubleInputProps {
|
|
762
927
|
tokens: DestinationToken[];
|
|
@@ -835,7 +1000,7 @@ interface WithdrawExecutionItemProps {
|
|
|
835
1000
|
execution: DirectExecutionResponse;
|
|
836
1001
|
onClick?: () => void;
|
|
837
1002
|
}
|
|
838
|
-
declare function WithdrawExecutionItem({ execution, onClick
|
|
1003
|
+
declare function WithdrawExecutionItem({ execution, onClick }: WithdrawExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
839
1004
|
|
|
840
1005
|
interface WithdrawConfirmingViewProps {
|
|
841
1006
|
txInfo: WithdrawTransactionInfo;
|
|
@@ -853,10 +1018,10 @@ type DetectedWallet = {
|
|
|
853
1018
|
name: string;
|
|
854
1019
|
address: string;
|
|
855
1020
|
} & ({
|
|
856
|
-
chainFamily:
|
|
1021
|
+
chainFamily: 'evm';
|
|
857
1022
|
provider: EvmWalletProvider;
|
|
858
1023
|
} | {
|
|
859
|
-
chainFamily:
|
|
1024
|
+
chainFamily: 'solana';
|
|
860
1025
|
provider: SolanaWalletProvider;
|
|
861
1026
|
});
|
|
862
1027
|
declare function sendEvmWithdraw(params: {
|
|
@@ -892,7 +1057,7 @@ interface CurrencyListItemProps {
|
|
|
892
1057
|
isSelected: boolean;
|
|
893
1058
|
onSelect: (currencyCode: string) => void;
|
|
894
1059
|
}
|
|
895
|
-
declare function CurrencyListItem({ currency, isSelected, onSelect
|
|
1060
|
+
declare function CurrencyListItem({ currency, isSelected, onSelect }: CurrencyListItemProps): react_jsx_runtime.JSX.Element;
|
|
896
1061
|
|
|
897
1062
|
interface CurrencyListSectionProps {
|
|
898
1063
|
title: string;
|
|
@@ -1009,6 +1174,31 @@ interface AllowedCountryResult {
|
|
|
1009
1174
|
*/
|
|
1010
1175
|
declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
|
|
1011
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
|
+
|
|
1012
1202
|
interface UsePaymentIntentParams {
|
|
1013
1203
|
clientSecret: string;
|
|
1014
1204
|
publishableKey: string;
|
|
@@ -1223,7 +1413,7 @@ declare const colors: {
|
|
|
1223
1413
|
};
|
|
1224
1414
|
};
|
|
1225
1415
|
type ThemeColors = typeof defaultColors.light;
|
|
1226
|
-
type ThemeMode =
|
|
1416
|
+
type ThemeMode = 'light' | 'dark';
|
|
1227
1417
|
/** Partial theme colors for customization */
|
|
1228
1418
|
type CustomThemeColors = Partial<ThemeColors>;
|
|
1229
1419
|
/** Theme customization options */
|
|
@@ -1382,7 +1572,7 @@ interface ThemeContextValue {
|
|
|
1382
1572
|
interface ThemeProviderProps {
|
|
1383
1573
|
children: React$1.ReactNode;
|
|
1384
1574
|
/** Force a specific theme mode, or 'auto' to use system preference */
|
|
1385
|
-
mode?: ThemeMode |
|
|
1575
|
+
mode?: ThemeMode | 'auto';
|
|
1386
1576
|
/** Simple accent/primary color override (applies to both light and dark) */
|
|
1387
1577
|
accentColor?: string;
|
|
1388
1578
|
/** Full theme customization per mode */
|
|
@@ -1414,4 +1604,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1414
1604
|
*/
|
|
1415
1605
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1416
1606
|
|
|
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,
|
|
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 };
|