@unifold/ui-react 0.1.80 → 0.1.82
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 +455 -70
- package/dist/index.d.ts +455 -70
- package/dist/index.js +7035 -4875
- package/dist/index.mjs +6709 -4582
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { DirectExecutionSucceededEvent, DirectExecutionFailedEvent, DirectExecutionResponse, ChainType, EvmContractCall, DepositMethod, DepositEvent, Wallet, ProductType, WalletPayMethod, CoinbaseWalletPaySessionResponse, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DefaultTokenResponse, ConfirmIntegrationTransferResult, CheckoutMethod, CheckoutPaymentIntent, CheckoutEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, PublicIncidentResponse, WithdrawDirectExecutionFailedEvent, ActionType, SupportedDestinationTokensResponse, SupportedDepositTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
2
|
+
import { DirectExecutionSucceededEvent, DirectExecutionFailedEvent, DirectExecutionResponse, ChainType, EvmContractCall, DepositMethod, DepositEvent, Wallet, ProductType, WalletPayMethod, CoinbaseWalletPaySessionResponse, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DefaultTokenResponse, ConfirmIntegrationTransferResult, CheckoutMethod, CheckoutPaymentIntent, CheckoutEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, TokenMetadata, PublicIncidentResponse, WithdrawDirectExecutionFailedEvent, ActionType, SupportedDestinationTokensResponse, SupportedDepositTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
3
3
|
export { ChainType, DepositMethod } from '@unifold/core';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import { MutableRefObject } from 'react';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
|
+
import { BrowserWalletProviderErrorStage, EventTracker, AnalyticsProperties, AnalyticsEvent } from '@unifold/analytics';
|
|
8
|
+
import { Wallet as Wallet$1, WalletAccount } from '@wallet-standard/base';
|
|
7
9
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
10
|
import { VariantProps } from 'class-variance-authority';
|
|
9
11
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
10
12
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
11
13
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
12
|
-
import { EventTracker, AnalyticsProperties, AnalyticsEvent } from '@unifold/analytics';
|
|
13
14
|
import { ClassValue } from 'clsx';
|
|
14
15
|
|
|
15
16
|
/** The two tabs the deposit menu splits funding methods across. */
|
|
@@ -96,52 +97,25 @@ interface UseDepositPollingResult {
|
|
|
96
97
|
}
|
|
97
98
|
declare function useDepositPolling({ userId, publishableKey, clientSecret, depositConfirmationMode, depositWalletId, depositWalletIds, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
declare global {
|
|
120
|
-
interface Window {
|
|
121
|
-
phantom?: {
|
|
122
|
-
solana?: PhantomSolanaProvider;
|
|
123
|
-
ethereum?: EthereumProvider;
|
|
124
|
-
};
|
|
125
|
-
solana?: PhantomSolanaProvider;
|
|
126
|
-
ethereum?: EthereumProvider;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
interface PhantomSolanaProvider {
|
|
130
|
-
isPhantom?: boolean;
|
|
131
|
-
isConnected?: boolean;
|
|
132
|
-
publicKey?: {
|
|
133
|
-
toString(): string;
|
|
100
|
+
type WalletType = 'phantom-solana' | 'phantom-ethereum' | 'metamask' | 'coinbase' | 'solflare' | 'backpack' | 'glow' | 'trust' | 'trust-solana' | 'rainbow' | 'rabby' | 'okx' | 'robinhood';
|
|
101
|
+
interface BrowserWalletInfo {
|
|
102
|
+
type: WalletType;
|
|
103
|
+
name: string;
|
|
104
|
+
address: string;
|
|
105
|
+
balance?: string;
|
|
106
|
+
balanceUsd?: string;
|
|
107
|
+
icon: string;
|
|
108
|
+
depositWallet?: {
|
|
109
|
+
id: string;
|
|
110
|
+
chain_type: ChainType;
|
|
111
|
+
address_type: string | null;
|
|
112
|
+
address: string;
|
|
113
|
+
destination_chain_type: ChainType;
|
|
114
|
+
destination_chain_id: string;
|
|
115
|
+
destination_token_address: string;
|
|
116
|
+
recipient_address: string;
|
|
117
|
+
is_primary: boolean;
|
|
134
118
|
};
|
|
135
|
-
connect(opts?: {
|
|
136
|
-
onlyIfTrusted?: boolean;
|
|
137
|
-
}): Promise<{
|
|
138
|
-
publicKey: {
|
|
139
|
-
toString(): string;
|
|
140
|
-
};
|
|
141
|
-
}>;
|
|
142
|
-
disconnect(): Promise<void>;
|
|
143
|
-
on(event: string, callback: (...args: unknown[]) => void): void;
|
|
144
|
-
off(event: string, callback: (...args: unknown[]) => void): void;
|
|
145
119
|
}
|
|
146
120
|
|
|
147
121
|
/** Quick amount chips on the browser wallet "Enter amount" step */
|
|
@@ -229,6 +203,8 @@ interface DepositModalProps {
|
|
|
229
203
|
showBalanceHeader?: boolean;
|
|
230
204
|
/** Input variant for Transfer Crypto view: "single_input" or "double_input" (default) */
|
|
231
205
|
transferInputVariant?: 'single_input' | 'double_input';
|
|
206
|
+
/** Transfer Crypto: show the reference exchange-rate row. @default false */
|
|
207
|
+
showTransferCryptoExchangeRate?: boolean;
|
|
232
208
|
/** Controls when deposit polling starts and what UI is shown.
|
|
233
209
|
* - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
|
|
234
210
|
* - "auto_silent": After 10s, starts polling silently (no waiting UI)
|
|
@@ -368,7 +344,7 @@ interface DepositModalProps {
|
|
|
368
344
|
*/
|
|
369
345
|
displayMode?: DepositMenuLayoutType;
|
|
370
346
|
}
|
|
371
|
-
declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, prefilledAmountUsd, hideDepositTracker, showBalanceHeader, transferInputVariant, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, enableApplePay, applePayTitle: applePayTitleProp, applePaySubTitle: applePaySubTitleProp, enableGooglePay, googlePayTitle: googlePayTitleProp, googlePaySubTitle: googlePaySubTitleProp, enableBankTransfer, enableIncidentBanner, enableStripeLink, onrampDestinationAmount, userEmail, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, layout, displayMode, transferCryptoTitle: transferCryptoTitleProp, depositWithCardTitle: depositWithCardTitleProp, payWithExchangeTitle: payWithExchangeTitleProp, depositTrackerTitle: depositTrackerTitleProp, depositTrackerSubTitle: depositTrackerSubTitleProp, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
347
|
+
declare function DepositModal({ open, onOpenChange, userId, publishableKey, modalTitle, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, contractCalls, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, prefilledAmountUsd, hideDepositTracker, showBalanceHeader, transferInputVariant, showTransferCryptoExchangeRate, depositConfirmationMode, enableTransferCrypto, enableConnectWallet, browserWalletAmountQuickSelect, enablePayWithExchange, enableFiatOnramp, enableConnectExchange, enableCashApp, enableApplePay, applePayTitle: applePayTitleProp, applePaySubTitle: applePaySubTitleProp, enableGooglePay, googlePayTitle: googlePayTitleProp, googlePaySubTitle: googlePaySubTitleProp, enableBankTransfer, enableIncidentBanner, enableStripeLink, onrampDestinationAmount, userEmail, hideDepositFlowInfo, hideDisplayDescription, onDepositSuccess, onDepositError, onEvent, theme, hideOverlay, initialScreen, layout, displayMode, transferCryptoTitle: transferCryptoTitleProp, depositWithCardTitle: depositWithCardTitleProp, payWithExchangeTitle: payWithExchangeTitleProp, depositTrackerTitle: depositTrackerTitleProp, depositTrackerSubTitle: depositTrackerSubTitleProp, }: DepositModalProps): react_jsx_runtime.JSX.Element;
|
|
372
348
|
|
|
373
349
|
interface DepositHeaderProps {
|
|
374
350
|
title: string;
|
|
@@ -439,7 +415,7 @@ interface TransferCryptoSingleInputProps {
|
|
|
439
415
|
minimumDepositAmountUsd: number;
|
|
440
416
|
isStablecoin: boolean;
|
|
441
417
|
}) => void;
|
|
442
|
-
/** Optional USD
|
|
418
|
+
/** Optional USD prefill. You send is omitted when this is set. */
|
|
443
419
|
prefilledAmountUsd?: string;
|
|
444
420
|
/** Checkout mode: estimated source amount to send (from /public/quotes). Shown above the QR code. */
|
|
445
421
|
checkoutQuote?: {
|
|
@@ -455,8 +431,10 @@ interface TransferCryptoSingleInputProps {
|
|
|
455
431
|
persistCheckingIndicator?: boolean;
|
|
456
432
|
/** Product context sent to the API — "deposit" (default) or "payment". */
|
|
457
433
|
productType?: ProductType;
|
|
434
|
+
/** Show the reference exchange-rate row between selected and destination token. */
|
|
435
|
+
showExchangeRate?: boolean;
|
|
458
436
|
}
|
|
459
|
-
declare function TransferCryptoSingleInput({ userId, publishableKey, clientSecret, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, onSourceTokenChange, prefilledAmountUsd, checkoutQuote, isCheckoutQuoteLoading, persistCheckingIndicator, productType, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
437
|
+
declare function TransferCryptoSingleInput({ userId, publishableKey, clientSecret, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, onSourceTokenChange, prefilledAmountUsd, checkoutQuote, isCheckoutQuoteLoading, persistCheckingIndicator, productType, showExchangeRate, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
460
438
|
|
|
461
439
|
interface TransferCryptoDoubleInputProps {
|
|
462
440
|
userId: string;
|
|
@@ -469,7 +447,7 @@ interface TransferCryptoDoubleInputProps {
|
|
|
469
447
|
defaultSourceChainId?: string;
|
|
470
448
|
defaultSourceTokenAddress?: string;
|
|
471
449
|
defaultSourceSymbol?: string;
|
|
472
|
-
/** Optional USD
|
|
450
|
+
/** Optional USD prefill. You send is omitted when this is set. */
|
|
473
451
|
prefilledAmountUsd?: string;
|
|
474
452
|
/** Controls when polling starts and whether a waiting UI is shown.
|
|
475
453
|
* - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
|
|
@@ -490,14 +468,20 @@ interface TransferCryptoDoubleInputProps {
|
|
|
490
468
|
code?: string;
|
|
491
469
|
}) => void;
|
|
492
470
|
wallets?: Wallet[];
|
|
471
|
+
/** Show the reference exchange-rate row between selected and destination token. */
|
|
472
|
+
showExchangeRate?: boolean;
|
|
493
473
|
}
|
|
494
|
-
declare function TransferCryptoDoubleInput({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol,
|
|
474
|
+
declare function TransferCryptoDoubleInput({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, showExchangeRate, }: TransferCryptoDoubleInputProps): react_jsx_runtime.JSX.Element;
|
|
475
|
+
|
|
476
|
+
type CardOnrampView = 'amount' | 'quotes' | 'review';
|
|
495
477
|
|
|
478
|
+
type CardView = CardOnrampView;
|
|
496
479
|
interface BuyWithCardProps {
|
|
497
480
|
userId: string;
|
|
498
481
|
publishableKey: string;
|
|
499
|
-
view?:
|
|
500
|
-
onViewChange?: (view:
|
|
482
|
+
view?: CardView;
|
|
483
|
+
onViewChange?: (view: CardView, quotesCount?: number) => void;
|
|
484
|
+
projectName?: string;
|
|
501
485
|
maxAmountUsd?: number;
|
|
502
486
|
accentColor?: string;
|
|
503
487
|
destinationTokenSymbol?: string;
|
|
@@ -535,10 +519,10 @@ interface BuyWithCardProps {
|
|
|
535
519
|
*/
|
|
536
520
|
destinationAmount?: string;
|
|
537
521
|
}
|
|
538
|
-
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, // Keep prop for backward compatibility but don't use default
|
|
539
|
-
destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, onDepositSuccess, onDepositError, onEvent, themeClass, wallets: externalWallets, assetCdnUrl, hideDepositFlowInfo, hideDisplayDescription, prefilledAmountUsd, destinationAmount, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
522
|
+
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, projectName, maxAmountUsd, accentColor, // Keep prop for backward compatibility but don't use default
|
|
523
|
+
destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, onDepositSuccess, onDepositError, onEvent, themeClass, wallets: externalWallets, assetCdnUrl, hideDepositFlowInfo: _hideDepositFlowInfo, hideDisplayDescription: _hideDisplayDescription, prefilledAmountUsd, destinationAmount, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
540
524
|
|
|
541
|
-
type WalletPayView = 'loading_config' | 'disabled' | '
|
|
525
|
+
type WalletPayView = 'loading_config' | 'disabled' | 'contact_input' | 'submitting_session' | 'email_otp' | 'phone_otp' | 'amount' | 'creating_order' | 'payment' | 'checking_deposit' | 'delivering' | 'success' | 'guest_limit_reached' | 'limit_upgrade_intro' | 'limit_upgrade_form' | 'limit_upgrade_submitting' | 'limit_upgrade_failed';
|
|
542
526
|
type View = WalletPayView;
|
|
543
527
|
interface BuyWithWalletPayProps {
|
|
544
528
|
/**
|
|
@@ -645,6 +629,13 @@ interface WalletPayQrCheckoutProps {
|
|
|
645
629
|
/** Coinbase-hosted checkout page for this order. */
|
|
646
630
|
paymentUrl: string;
|
|
647
631
|
quote: WalletPayQuote;
|
|
632
|
+
/**
|
|
633
|
+
* Final-dest Amount Received. When passed (including `null`), replaces the
|
|
634
|
+
* Coinbase session routing currency so we don't label USDC as the project dest.
|
|
635
|
+
*/
|
|
636
|
+
amountReceived?: string | null;
|
|
637
|
+
/** Final-dest chain name. When passed, replaces the Coinbase routing network. */
|
|
638
|
+
destinationNetwork?: string | null;
|
|
648
639
|
}
|
|
649
640
|
/**
|
|
650
641
|
* Desktop hand-off for the headless Coinbase device wallets: the code to scan,
|
|
@@ -659,7 +650,7 @@ interface WalletPayQrCheckoutProps {
|
|
|
659
650
|
* Payment happens entirely on Coinbase's side, on another device, so nothing
|
|
660
651
|
* here reports back — the parent polls the provider and the chain.
|
|
661
652
|
*/
|
|
662
|
-
declare function WalletPayQrCheckout({ method, paymentUrl, quote }: WalletPayQrCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
653
|
+
declare function WalletPayQrCheckout({ method, paymentUrl, quote, amountReceived: amountReceivedOverride, destinationNetwork: destinationNetworkOverride, }: WalletPayQrCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
663
654
|
|
|
664
655
|
type MobilePlatform = 'ios' | 'android';
|
|
665
656
|
|
|
@@ -779,6 +770,17 @@ interface QRCodeSkeletonProps {
|
|
|
779
770
|
darkMode?: boolean;
|
|
780
771
|
}
|
|
781
772
|
declare function QRCodeSkeleton({ size, darkMode }: QRCodeSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
773
|
+
/**
|
|
774
|
+
* Themed QR used on Transfer Crypto: card border + shadow, 180px code,
|
|
775
|
+
* theme-aware modules. Wallet Pay and Binance Pay use this instead of the
|
|
776
|
+
* larger Cash App white tile.
|
|
777
|
+
*/
|
|
778
|
+
declare function TransferQrCode({ value, imageUrl, errorCorrectionLevel, loading, }: {
|
|
779
|
+
value: string;
|
|
780
|
+
imageUrl?: string;
|
|
781
|
+
errorCorrectionLevel?: ErrorCorrectionLevel;
|
|
782
|
+
loading?: boolean;
|
|
783
|
+
}): react_jsx_runtime.JSX.Element;
|
|
782
784
|
declare function StyledQRCode({ value, size, imageUrl, imageSize, darkMode, errorCorrectionLevel, }: StyledQRCodeProps): react_jsx_runtime.JSX.Element;
|
|
783
785
|
|
|
784
786
|
interface TransferCryptoButtonProps {
|
|
@@ -956,6 +958,9 @@ interface PayWithStripeLinkProps {
|
|
|
956
958
|
email?: string;
|
|
957
959
|
/** URL for the Link logo icon (from CDN) */
|
|
958
960
|
iconUrl?: string;
|
|
961
|
+
projectName?: string;
|
|
962
|
+
assetCdnUrl?: string;
|
|
963
|
+
destinationTokenSymbol?: string;
|
|
959
964
|
/** Controlled step state (optional — for header back button coordination) */
|
|
960
965
|
step?: StripeLinkStep;
|
|
961
966
|
onStepChange?: (step: StripeLinkStep) => void;
|
|
@@ -995,7 +1000,7 @@ interface PayWithStripeLinkProps {
|
|
|
995
1000
|
* The Stripe publishable key is auto-fetched from the backend via GET /config,
|
|
996
1001
|
* so consumers only need their Unifold publishable key.
|
|
997
1002
|
*/
|
|
998
|
-
declare function PayWithStripeLink({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, countryCode, subdivisionCode, wallets: externalWallets, email: emailProp, iconUrl, step: controlledStep, onStepChange, backHandlerRef, onDepositSuccess, onDepositError, onEvent, }: PayWithStripeLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1003
|
+
declare function PayWithStripeLink({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, countryCode, subdivisionCode, wallets: externalWallets, email: emailProp, iconUrl, projectName, assetCdnUrl, destinationTokenSymbol, step: controlledStep, onStepChange, backHandlerRef, onDepositSuccess, onDepositError, onEvent, }: PayWithStripeLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
999
1004
|
|
|
1000
1005
|
interface DepositExecutionItemProps {
|
|
1001
1006
|
execution: DirectExecutionResponse;
|
|
@@ -1075,6 +1080,8 @@ interface CheckoutModalProps {
|
|
|
1075
1080
|
defaultSourceTokenAddress?: string;
|
|
1076
1081
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId`. */
|
|
1077
1082
|
defaultSourceSymbol?: string;
|
|
1083
|
+
/** Transfer Crypto: show the reference exchange-rate row. @default false */
|
|
1084
|
+
showTransferCryptoExchangeRate?: boolean;
|
|
1078
1085
|
theme?: 'light' | 'dark' | 'auto';
|
|
1079
1086
|
onCheckoutSuccess?: (data: {
|
|
1080
1087
|
paymentIntentId: string;
|
|
@@ -1096,7 +1103,7 @@ interface CheckoutModalProps {
|
|
|
1096
1103
|
}) => void;
|
|
1097
1104
|
onEvent?: (event: CheckoutEvent) => void;
|
|
1098
1105
|
}
|
|
1099
|
-
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, enableIncidentBanner, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, theme, onCheckoutSuccess, onCheckoutError, onEvent, externalUserId, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
1106
|
+
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableTransferCrypto, enableConnectWallet, enableIncidentBanner, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, showTransferCryptoExchangeRate, theme, onCheckoutSuccess, onCheckoutError, onEvent, externalUserId, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
1100
1107
|
|
|
1101
1108
|
interface WithdrawTransactionInfo {
|
|
1102
1109
|
/** Source (sending) chain type */
|
|
@@ -1354,6 +1361,106 @@ declare function sendHypercoreWithdraw(params: {
|
|
|
1354
1361
|
|
|
1355
1362
|
declare function detectBrowserWallet(chainType: string, senderAddress?: string): Promise<DetectedWallet | null>;
|
|
1356
1363
|
|
|
1364
|
+
type BrowserWalletErrorReporter = (error: unknown, metadata: {
|
|
1365
|
+
stage: BrowserWalletProviderErrorStage;
|
|
1366
|
+
chainType?: 'ethereum' | 'solana';
|
|
1367
|
+
providerSource?: string;
|
|
1368
|
+
componentStack?: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The provider threw but we still obtained a usable value, so the wallet
|
|
1371
|
+
* stays available and only telemetry records the incompatibility.
|
|
1372
|
+
*/
|
|
1373
|
+
recovered?: boolean;
|
|
1374
|
+
}) => void;
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* Silently detects an already-connected injected browser wallet without triggering
|
|
1378
|
+
* any wallet popups. Solana reads authorized Wallet Standard accounts; Ethereum
|
|
1379
|
+
* uses the read-only `eth_accounts`.
|
|
1380
|
+
* Returns the connected wallet, or `null` when none is connected (or the user
|
|
1381
|
+
* previously disconnected explicitly).
|
|
1382
|
+
*
|
|
1383
|
+
* When the user has previously connected a wallet, its `WalletType` is persisted
|
|
1384
|
+
* in localStorage; on subsequent refreshes we move that candidate to the front of
|
|
1385
|
+
* the scan so multi-wallet setups (e.g. MetaMask + Phantom installed, Phantom
|
|
1386
|
+
* Solana also connected) don't always resolve to whichever provider happens to be
|
|
1387
|
+
* iterated first.
|
|
1388
|
+
*/
|
|
1389
|
+
declare function detectConnectedBrowserWallet(chainType?: 'ethereum' | 'solana', reportError?: BrowserWalletErrorReporter): Promise<BrowserWalletInfo | null>;
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Inline this in `<head>` so announce events that fire before React boots
|
|
1393
|
+
* (MetaMask/Rainbow at document_start) are not lost. Splits Connect often
|
|
1394
|
+
* `stopImmediatePropagation`s `eip6963:requestProvider`, so a late
|
|
1395
|
+
* `requestProvider` will not get those wallets to re-announce.
|
|
1396
|
+
*/
|
|
1397
|
+
declare const EIP6963_BOOTSTRAP_SCRIPT: string;
|
|
1398
|
+
/** Start discovery as soon as the SDK mounts — do not wait for the modal. */
|
|
1399
|
+
declare function startBrowserWalletDiscovery(): void;
|
|
1400
|
+
/** Ask installed wallets to announce again. Safe to call more than once. */
|
|
1401
|
+
declare function requestEip6963Providers(): void;
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Shared Solana Wallet Standard discovery — the Solana counterpart to our
|
|
1405
|
+
* guarded EIP-6963 registry.
|
|
1406
|
+
*
|
|
1407
|
+
* Wallets announce themselves to the page through the Wallet Standard registry,
|
|
1408
|
+
* so every installed Solana wallet is enumerated without reading `window.solana`
|
|
1409
|
+
* (one global that only ever holds a single wallet, so multi-extension setups
|
|
1410
|
+
* race to own it) and without ever calling `connect()`.
|
|
1411
|
+
*
|
|
1412
|
+
* Everything here is read-only: `wallet.accounts` is populated by the wallet only
|
|
1413
|
+
* for origins the user has already authorized, which makes it a silent
|
|
1414
|
+
* already-connected check with no approval prompt.
|
|
1415
|
+
*/
|
|
1416
|
+
|
|
1417
|
+
interface SolanaStandardWallet {
|
|
1418
|
+
walletId: string;
|
|
1419
|
+
name: string;
|
|
1420
|
+
/** Data-URI icon supplied by the wallet itself. */
|
|
1421
|
+
icon: string;
|
|
1422
|
+
wallet: Wallet$1;
|
|
1423
|
+
}
|
|
1424
|
+
interface SolanaStandardAccount extends SolanaStandardWallet {
|
|
1425
|
+
/** Base58 address of the wallet's first authorized account for this origin. */
|
|
1426
|
+
address: string;
|
|
1427
|
+
account: WalletAccount;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* All registered Solana wallets. Purely a registry read — safe to call on mount
|
|
1431
|
+
* and on every render.
|
|
1432
|
+
*/
|
|
1433
|
+
declare function getSolanaStandardWallets(): SolanaStandardWallet[];
|
|
1434
|
+
/** Find a registered Solana wallet by our internal wallet ID. */
|
|
1435
|
+
declare function findSolanaStandardWallet(walletId: string): SolanaStandardWallet | undefined;
|
|
1436
|
+
/** Whether a Solana wallet is installed, by our internal wallet ID. */
|
|
1437
|
+
declare function isSolanaWalletDetectedViaWalletStandard(walletId: string): boolean;
|
|
1438
|
+
/**
|
|
1439
|
+
* Solana wallets that already have an authorized account for this origin.
|
|
1440
|
+
*
|
|
1441
|
+
* The Wallet Standard equivalent of EVM's `eth_accounts`: wallets only publish
|
|
1442
|
+
* `accounts` once the user has approved the origin, so this reports existing
|
|
1443
|
+
* connections without prompting. Wallets the user has never approved simply
|
|
1444
|
+
* expose an empty array.
|
|
1445
|
+
*/
|
|
1446
|
+
declare function getAuthorizedSolanaStandardAccounts(): SolanaStandardAccount[];
|
|
1447
|
+
/** Connect a selected Wallet Standard wallet. Call only from a user gesture. */
|
|
1448
|
+
declare function connectSolanaStandardWallet(walletId: string): Promise<SolanaStandardAccount | null>;
|
|
1449
|
+
/** Sign a serialized Solana transaction through Wallet Standard when supported. */
|
|
1450
|
+
declare function signSolanaStandardTransaction(walletId: string, address: string, transaction: Uint8Array): Promise<Uint8Array | null>;
|
|
1451
|
+
/**
|
|
1452
|
+
* Fires whenever a wallet registers or unregisters. Wallets register
|
|
1453
|
+
* asynchronously after page load, so callers that enumerate wallets on mount need
|
|
1454
|
+
* this to pick up late arrivals.
|
|
1455
|
+
*/
|
|
1456
|
+
declare function subscribeSolanaStandardWallets(listener: () => void): () => void;
|
|
1457
|
+
/**
|
|
1458
|
+
* Fires when any registered Solana wallet changes its accounts — connect,
|
|
1459
|
+
* disconnect, or account switch. Replaces per-wallet `provider.on('connect')`
|
|
1460
|
+
* listeners for wallets that implement `standard:events`.
|
|
1461
|
+
*/
|
|
1462
|
+
declare function subscribeSolanaStandardAccountChanges(listener: () => void): () => void;
|
|
1463
|
+
|
|
1357
1464
|
interface CurrencyListItemProps {
|
|
1358
1465
|
currency: FiatCurrency;
|
|
1359
1466
|
isSelected: boolean;
|
|
@@ -1439,13 +1546,18 @@ var common = {
|
|
|
1439
1546
|
loading: "Loading...",
|
|
1440
1547
|
search: "Search",
|
|
1441
1548
|
close: "Close",
|
|
1549
|
+
noResults: "No matches found",
|
|
1550
|
+
selectCountry: "Select country",
|
|
1551
|
+
selectState: "Select state",
|
|
1442
1552
|
review: "Review",
|
|
1443
1553
|
tryAgain: "Try Again",
|
|
1444
1554
|
somethingWentWrong: "Something went wrong",
|
|
1555
|
+
quoteFailed: "Failed to fetch quote, please try again later",
|
|
1445
1556
|
seeMoreDetails: "See more details",
|
|
1446
1557
|
seeLess: "See less",
|
|
1447
1558
|
dateTime: "{{date}} at {{time}}",
|
|
1448
1559
|
"continue": "Continue",
|
|
1560
|
+
confirm: "Confirm",
|
|
1449
1561
|
processing: "Processing",
|
|
1450
1562
|
checkingFor: "Checking for {{target}}",
|
|
1451
1563
|
depositTarget: "deposit",
|
|
@@ -1455,6 +1567,9 @@ var common = {
|
|
|
1455
1567
|
help: "Help",
|
|
1456
1568
|
done: "Done",
|
|
1457
1569
|
from: "From",
|
|
1570
|
+
to: "To",
|
|
1571
|
+
youPay: "You pay",
|
|
1572
|
+
intentAddressDisclaimer: "The address shown in the provider is an intent address. Funds will be automatically deposited into your account.",
|
|
1458
1573
|
max: "Max",
|
|
1459
1574
|
or: "or",
|
|
1460
1575
|
minimumAmount: "Minimum amount is {{amount}}",
|
|
@@ -1528,8 +1643,7 @@ var connectWallet = {
|
|
|
1528
1643
|
confirming: "Confirming...",
|
|
1529
1644
|
minimumForTokenOnChain: "Minimum for {{token}} on {{chain}} is ${{amount}}",
|
|
1530
1645
|
amountAdjusted: "Amount adjusted from remaining ${{amount}}",
|
|
1531
|
-
minimumDeposit: "Minimum deposit: ${{amount}}"
|
|
1532
|
-
walletWillPrompt: "{{wallet}} wallet will ask you to approve this transaction."
|
|
1646
|
+
minimumDeposit: "Minimum deposit: ${{amount}}"
|
|
1533
1647
|
},
|
|
1534
1648
|
confirming: {
|
|
1535
1649
|
waitingTitle: "Waiting for confirmation...",
|
|
@@ -1657,6 +1771,7 @@ var transferCrypto = {
|
|
|
1657
1771
|
not_opted_in: "Please make sure you opt-in {{token_symbol}}({{chain_name}}) before receiving funds",
|
|
1658
1772
|
insufficient_balance: "Recipient account does not meet the minimum balance requirement",
|
|
1659
1773
|
account_not_found: "Recipient account does not exist on {{chain_name}}",
|
|
1774
|
+
destination_tag_required: "This {{chain_name}} address requires a memo tag. Please provide your memo tag as well, in the format address:memotag",
|
|
1660
1775
|
validation_error: "Unable to verify recipient address on {{chain_name}}"
|
|
1661
1776
|
},
|
|
1662
1777
|
defaultError: "The recipient address cannot receive funds for the selected token"
|
|
@@ -1759,6 +1874,7 @@ var depositModal = {
|
|
|
1759
1874
|
cash: "Use Cash"
|
|
1760
1875
|
},
|
|
1761
1876
|
applePayHeader: {
|
|
1877
|
+
enterContact: "Verification",
|
|
1762
1878
|
enterEmail: "Enter your email",
|
|
1763
1879
|
enterPhone: "Enter your phone",
|
|
1764
1880
|
verifyEmail: "Verify your email",
|
|
@@ -1841,7 +1957,7 @@ var connectExchange = {
|
|
|
1841
1957
|
connectingDesc: "Complete authorization in the popup window",
|
|
1842
1958
|
connected: {
|
|
1843
1959
|
title: "Connected to {{exchange}}",
|
|
1844
|
-
subtitle: "Your
|
|
1960
|
+
subtitle: "Your account is linked and ready to use.",
|
|
1845
1961
|
exchange: "Exchange",
|
|
1846
1962
|
status: "Status",
|
|
1847
1963
|
statusConnected: "Connected",
|
|
@@ -1850,8 +1966,7 @@ var connectExchange = {
|
|
|
1850
1966
|
flowSource: "Source",
|
|
1851
1967
|
flowTransfer: "Transfer",
|
|
1852
1968
|
flowDirect: "Direct",
|
|
1853
|
-
flowDestination: "Destination"
|
|
1854
|
-
secureNote: "All transfers are secured with two-factor authentication and encrypted end-to-end."
|
|
1969
|
+
flowDestination: "Destination"
|
|
1855
1970
|
},
|
|
1856
1971
|
holdings: {
|
|
1857
1972
|
title: "Select asset"
|
|
@@ -1870,7 +1985,7 @@ var connectExchange = {
|
|
|
1870
1985
|
mfaEnrollmentTitle: "Enable SMS or Authy 2FA",
|
|
1871
1986
|
mfaEnrollmentMessage: "Please make sure you enable SMS or Authy 2FA in your Coinbase account. Press Continue after you enable it.",
|
|
1872
1987
|
mfaEnrollmentSettingsLink: "Open Coinbase security settings",
|
|
1873
|
-
termsNoticePrefix: "By clicking on Confirm
|
|
1988
|
+
termsNoticePrefix: "By clicking on Confirm, you agree to our ",
|
|
1874
1989
|
termsNoticeLink: "terms",
|
|
1875
1990
|
termsNoticeSuffix: "."
|
|
1876
1991
|
},
|
|
@@ -2235,12 +2350,18 @@ var withdrawModal = {
|
|
|
2235
2350
|
receiveChain: "Receive chain",
|
|
2236
2351
|
recipientAddress: "Recipient address",
|
|
2237
2352
|
recipientAddressPlaceholder: "Enter wallet address",
|
|
2353
|
+
recipientAddressPlaceholderXrpl: "Enter wallet address, or address:memotag",
|
|
2238
2354
|
amount: "Amount",
|
|
2239
2355
|
amountPlaceholder: "0.00",
|
|
2240
2356
|
balance: "Balance",
|
|
2241
2357
|
minimum: "min",
|
|
2242
2358
|
withdraw: "Withdraw",
|
|
2243
2359
|
invalidAddress: "Please enter a valid address",
|
|
2360
|
+
invalidXrplAddress: "Please enter a valid {{chain_name}} address. If your recipient requires a memo tag, please provide it as well, in the format address:memotag",
|
|
2361
|
+
memoTag: "Memo tag",
|
|
2362
|
+
memoTagPlaceholder: "e.g. 12345",
|
|
2363
|
+
memoTagRequiredHint: "This {{chain_name}} address requires a memo tag before it can receive funds",
|
|
2364
|
+
invalidMemoTag: "Memo tag must be a whole number between 0 and 4294967295",
|
|
2244
2365
|
invalidAmount: "Please enter a valid amount",
|
|
2245
2366
|
verifyingAddress: "Verifying address...",
|
|
2246
2367
|
loading: "Loading...",
|
|
@@ -2336,13 +2457,18 @@ declare const i18n: {
|
|
|
2336
2457
|
loading: string;
|
|
2337
2458
|
search: string;
|
|
2338
2459
|
close: string;
|
|
2460
|
+
noResults: string;
|
|
2461
|
+
selectCountry: string;
|
|
2462
|
+
selectState: string;
|
|
2339
2463
|
review: string;
|
|
2340
2464
|
tryAgain: string;
|
|
2341
2465
|
somethingWentWrong: string;
|
|
2466
|
+
quoteFailed: string;
|
|
2342
2467
|
seeMoreDetails: string;
|
|
2343
2468
|
seeLess: string;
|
|
2344
2469
|
dateTime: string;
|
|
2345
2470
|
continue: string;
|
|
2471
|
+
confirm: string;
|
|
2346
2472
|
processing: string;
|
|
2347
2473
|
checkingFor: string;
|
|
2348
2474
|
depositTarget: string;
|
|
@@ -2352,6 +2478,9 @@ declare const i18n: {
|
|
|
2352
2478
|
help: string;
|
|
2353
2479
|
done: string;
|
|
2354
2480
|
from: string;
|
|
2481
|
+
to: string;
|
|
2482
|
+
youPay: string;
|
|
2483
|
+
intentAddressDisclaimer: string;
|
|
2355
2484
|
max: string;
|
|
2356
2485
|
or: string;
|
|
2357
2486
|
minimumAmount: string;
|
|
@@ -2426,7 +2555,6 @@ declare const i18n: {
|
|
|
2426
2555
|
minimumForTokenOnChain: string;
|
|
2427
2556
|
amountAdjusted: string;
|
|
2428
2557
|
minimumDeposit: string;
|
|
2429
|
-
walletWillPrompt: string;
|
|
2430
2558
|
};
|
|
2431
2559
|
confirming: {
|
|
2432
2560
|
waitingTitle: string;
|
|
@@ -2554,6 +2682,7 @@ declare const i18n: {
|
|
|
2554
2682
|
not_opted_in: string;
|
|
2555
2683
|
insufficient_balance: string;
|
|
2556
2684
|
account_not_found: string;
|
|
2685
|
+
destination_tag_required: string;
|
|
2557
2686
|
validation_error: string;
|
|
2558
2687
|
};
|
|
2559
2688
|
defaultError: string;
|
|
@@ -2656,6 +2785,7 @@ declare const i18n: {
|
|
|
2656
2785
|
cash: string;
|
|
2657
2786
|
};
|
|
2658
2787
|
applePayHeader: {
|
|
2788
|
+
enterContact: string;
|
|
2659
2789
|
enterEmail: string;
|
|
2660
2790
|
enterPhone: string;
|
|
2661
2791
|
verifyEmail: string;
|
|
@@ -2748,7 +2878,6 @@ declare const i18n: {
|
|
|
2748
2878
|
flowTransfer: string;
|
|
2749
2879
|
flowDirect: string;
|
|
2750
2880
|
flowDestination: string;
|
|
2751
|
-
secureNote: string;
|
|
2752
2881
|
};
|
|
2753
2882
|
holdings: {
|
|
2754
2883
|
title: string;
|
|
@@ -3132,12 +3261,18 @@ declare const i18n: {
|
|
|
3132
3261
|
receiveChain: string;
|
|
3133
3262
|
recipientAddress: string;
|
|
3134
3263
|
recipientAddressPlaceholder: string;
|
|
3264
|
+
recipientAddressPlaceholderXrpl: string;
|
|
3135
3265
|
amount: string;
|
|
3136
3266
|
amountPlaceholder: string;
|
|
3137
3267
|
balance: string;
|
|
3138
3268
|
minimum: string;
|
|
3139
3269
|
withdraw: string;
|
|
3140
3270
|
invalidAddress: string;
|
|
3271
|
+
invalidXrplAddress: string;
|
|
3272
|
+
memoTag: string;
|
|
3273
|
+
memoTagPlaceholder: string;
|
|
3274
|
+
memoTagRequiredHint: string;
|
|
3275
|
+
invalidMemoTag: string;
|
|
3141
3276
|
invalidAmount: string;
|
|
3142
3277
|
verifyingAddress: string;
|
|
3143
3278
|
loading: string;
|
|
@@ -3245,6 +3380,243 @@ declare function I18nProvider({ children, locale }: I18nProviderProps): react_js
|
|
|
3245
3380
|
*/
|
|
3246
3381
|
declare function useI18n(): I18nContextValue;
|
|
3247
3382
|
|
|
3383
|
+
/**
|
|
3384
|
+
* Canonical country table for the SDK.
|
|
3385
|
+
*
|
|
3386
|
+
* One row per ISO 3166-1 assigned country or territory (249). Every other
|
|
3387
|
+
* country list in the SDK — region groups, residence pickers, nationality
|
|
3388
|
+
* selectors, dial-code pickers — is derived from this one, so a country's name,
|
|
3389
|
+
* code and calling code can't drift between flows.
|
|
3390
|
+
*
|
|
3391
|
+
* Codes are ISO 3166-1 alpha-2 only. Providers that store the three-letter
|
|
3392
|
+
* form convert at the API, so the client never maps between the two.
|
|
3393
|
+
*
|
|
3394
|
+
* Display names follow Stripe's EU KYC reference tables. Calling codes are
|
|
3395
|
+
* ITU E.164 country codes, without the leading `+`; the six uninhabited
|
|
3396
|
+
* territories have none.
|
|
3397
|
+
*/
|
|
3398
|
+
interface Country {
|
|
3399
|
+
/** ISO 3166-1 alpha-2, e.g. `US`. */
|
|
3400
|
+
alpha2: string;
|
|
3401
|
+
/** English display name. */
|
|
3402
|
+
name: string;
|
|
3403
|
+
/** E.164 calling code without `+`, e.g. `1`. Absent for uninhabited territories. */
|
|
3404
|
+
dialCode?: string;
|
|
3405
|
+
}
|
|
3406
|
+
/** Every ISO 3166-1 country, in alpha-2 order. Use {@link ALL_COUNTRIES} for display. */
|
|
3407
|
+
declare const COUNTRIES: readonly Country[];
|
|
3408
|
+
/** Every country, sorted by display name for pickers. */
|
|
3409
|
+
declare const ALL_COUNTRIES: readonly Country[];
|
|
3410
|
+
/** Look a country up by ISO 3166-1 alpha-2, case-insensitively. */
|
|
3411
|
+
declare function findCountry(code: string | undefined | null): Country | undefined;
|
|
3412
|
+
/** Canonical alpha-2, or `undefined` when unknown. */
|
|
3413
|
+
declare function toAlpha2(code: string | undefined | null): string | undefined;
|
|
3414
|
+
/** Display name for a code, falling back to the code itself when unknown. */
|
|
3415
|
+
declare function countryName(code: string): string;
|
|
3416
|
+
/** Calling code for a country, without the leading `+`. */
|
|
3417
|
+
declare function dialCode(code: string): string | undefined;
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* Region groups a KYC or payment flow can be scoped to.
|
|
3421
|
+
*
|
|
3422
|
+
* Groups nest where the everyday meaning nests: `ASIA` contains `SEA` and
|
|
3423
|
+
* `INDIA`, `EEA` contains `EU`, `LATAM` contains `CARIBBEAN`. Asking for a
|
|
3424
|
+
* parent returns its children too, so a flow that is "open across Asia" can say
|
|
3425
|
+
* `['ASIA']` rather than enumerating the pieces, while one that is only open in
|
|
3426
|
+
* South East Asia can say `['SEA']`.
|
|
3427
|
+
*
|
|
3428
|
+
* Membership is by ISO 3166-1 alpha-2. Dependent territories sit with the
|
|
3429
|
+
* region they are geographically in, not with their sovereign — French Guiana is
|
|
3430
|
+
* `LATAM`, not `EU`, because that is where its residents are.
|
|
3431
|
+
*/
|
|
3432
|
+
type CountryGroup = 'US' | 'CANADA' | 'UK' | 'EU' | 'EEA' | 'EUROPE' | 'INDIA' | 'SEA' | 'ASIA' | 'MENA' | 'AFRICA' | 'CARIBBEAN' | 'LATAM' | 'OCEANIA';
|
|
3433
|
+
/** Alpha-2 members of each group, children included. */
|
|
3434
|
+
declare const COUNTRY_GROUPS: Record<CountryGroup, readonly string[]>;
|
|
3435
|
+
/** True when the country is in the group. Alpha-2, case-insensitive. */
|
|
3436
|
+
declare function isInGroup(code: string | undefined | null, group: CountryGroup): boolean;
|
|
3437
|
+
interface GetKycCountryListOptions {
|
|
3438
|
+
/** Regions to include. Omit for every supported country. */
|
|
3439
|
+
group?: readonly CountryGroup[];
|
|
3440
|
+
/** Individual countries to include on top of `group`, ISO 3166-1 alpha-2. */
|
|
3441
|
+
whitelisted?: readonly string[];
|
|
3442
|
+
/**
|
|
3443
|
+
* Countries to leave out, ISO 3166-1 alpha-2. Applied last, so it removes a
|
|
3444
|
+
* country that `group` or `whitelisted` would otherwise bring in — an explicit
|
|
3445
|
+
* exclusion outranks an inclusion.
|
|
3446
|
+
*/
|
|
3447
|
+
blacklisted?: readonly string[];
|
|
3448
|
+
}
|
|
3449
|
+
/**
|
|
3450
|
+
* Build a flat, de-duplicated country list for a picker.
|
|
3451
|
+
*
|
|
3452
|
+
* `getKycCountryList()` is every supported country. `getKycCountryList({ group: ['EU'],
|
|
3453
|
+
* whitelisted: ['US'] })` is the EU plus the United States. Unknown codes in
|
|
3454
|
+
* `whitelisted` or `blacklisted` are ignored rather than thrown on, since the
|
|
3455
|
+
* lists are usually configuration.
|
|
3456
|
+
*
|
|
3457
|
+
* Sorted by display name.
|
|
3458
|
+
*/
|
|
3459
|
+
declare function getKycCountryList(options?: GetKycCountryListOptions): Country[];
|
|
3460
|
+
|
|
3461
|
+
/** A US state or territory: USPS / ISO 3166-2:US code and display name. */
|
|
3462
|
+
interface UsState {
|
|
3463
|
+
code: string;
|
|
3464
|
+
name: string;
|
|
3465
|
+
}
|
|
3466
|
+
/**
|
|
3467
|
+
* USPS/ISO 3166-2:US codes for the `state` field of a US address.
|
|
3468
|
+
*
|
|
3469
|
+
* Both Stripe and our identity API want the two-letter code, not the name, and
|
|
3470
|
+
* reject anything else — so this list is the only way a state reaches the API,
|
|
3471
|
+
* replacing a free-text box that accepted any two characters.
|
|
3472
|
+
*
|
|
3473
|
+
* Includes DC and the five inhabited territories: their addresses are US
|
|
3474
|
+
* addresses with US ZIP codes, so someone living there has no other code to
|
|
3475
|
+
* give. Sorted by name, which is the order the picker shows them in.
|
|
3476
|
+
*/
|
|
3477
|
+
declare const US_STATES: readonly UsState[];
|
|
3478
|
+
/** Display name for a state code, or the code itself if it isn't one we list. */
|
|
3479
|
+
declare function usStateName(code: string): string;
|
|
3480
|
+
|
|
3481
|
+
/** Same CDN convention as `/icons/currencies/svg/{code}.svg`. Native ratio, long side 28. */
|
|
3482
|
+
declare function countryFlagIconPath(alpha2: string): string;
|
|
3483
|
+
/** Raster of the same flag. Native ratio, long side 128. */
|
|
3484
|
+
declare function countryFlagPngPath(alpha2: string): string;
|
|
3485
|
+
/**
|
|
3486
|
+
* Flag emoji for a country, built from the two regional indicator symbols the
|
|
3487
|
+
* alpha-2 code maps to. Kept for callers that want a text-only flag; the picker
|
|
3488
|
+
* itself uses {@link CountryFlag} because Windows ships no flag glyphs and
|
|
3489
|
+
* renders these as a letter pair.
|
|
3490
|
+
*/
|
|
3491
|
+
declare function countryFlag(code: string): string;
|
|
3492
|
+
/**
|
|
3493
|
+
* Flag image served from the asset CDN.
|
|
3494
|
+
*
|
|
3495
|
+
* An image rather than an emoji so the same artwork renders on every platform:
|
|
3496
|
+
* emoji flags depend on the system font, which on Windows has none. Each flag is
|
|
3497
|
+
* ~1.4 KB and `loading="lazy"`, so a long picker only fetches the rows on
|
|
3498
|
+
* screen, and the browser cache makes later opens free.
|
|
3499
|
+
*
|
|
3500
|
+
* Unknown or non-alpha-2 codes render nothing.
|
|
3501
|
+
*/
|
|
3502
|
+
declare function CountryFlag({ code, assetCdnUrl, size, className, }: {
|
|
3503
|
+
code: string;
|
|
3504
|
+
assetCdnUrl?: string;
|
|
3505
|
+
/** Width in px. Height follows the flag's native ratio. */
|
|
3506
|
+
size?: number;
|
|
3507
|
+
className?: string;
|
|
3508
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
3509
|
+
|
|
3510
|
+
/** One row of the sheet: a country, or a subdivision such as a US state. */
|
|
3511
|
+
interface RegionOption {
|
|
3512
|
+
/**
|
|
3513
|
+
* Value handed back from `onSelect` — an ISO 3166-1 country code or an
|
|
3514
|
+
* ISO 3166-2 subdivision code, in whatever form the surrounding API speaks.
|
|
3515
|
+
*/
|
|
3516
|
+
code: string;
|
|
3517
|
+
name: string;
|
|
3518
|
+
/**
|
|
3519
|
+
* Alpha-2 country code for the flag when `code` isn't one — a subdivision
|
|
3520
|
+
* whose parent flag should show. Defaults to `code`.
|
|
3521
|
+
*/
|
|
3522
|
+
flagCode?: string;
|
|
3523
|
+
}
|
|
3524
|
+
/**
|
|
3525
|
+
* Marks the element a sheet should cover. The sheet portals into the nearest
|
|
3526
|
+
* ancestor carrying this attribute, so a form several components deep can raise
|
|
3527
|
+
* a picker over the whole modal body — footer included — without every layer in
|
|
3528
|
+
* between having to know about it. With no anchor in the tree the sheet renders
|
|
3529
|
+
* in place, against the nearest positioned ancestor.
|
|
3530
|
+
*/
|
|
3531
|
+
declare const REGION_SHEET_ANCHOR_ATTR = "data-uf-sheet-anchor";
|
|
3532
|
+
/**
|
|
3533
|
+
* Match options against what someone typed.
|
|
3534
|
+
*
|
|
3535
|
+
* Deliberately literal rather than fuzzy: with a couple of hundred countries and
|
|
3536
|
+
* two-letter codes, fuzzy matching surfaces confusing near-misses. People search
|
|
3537
|
+
* a list like this by typing the start of a name, its ISO code, or — in the phone
|
|
3538
|
+
* picker — the calling code, with or without the leading `+`.
|
|
3539
|
+
*
|
|
3540
|
+
* Calling codes are only matched when the sheet is actually showing them.
|
|
3541
|
+
* Subdivision codes collide with country ones (`DE` is both Delaware and
|
|
3542
|
+
* Germany), so an unconditional dial lookup would let "49" surface Delaware.
|
|
3543
|
+
*/
|
|
3544
|
+
declare function filterRegions(options: readonly RegionOption[], query: string, matchDialCode?: boolean): RegionOption[];
|
|
3545
|
+
interface RegionSelectorSheetProps {
|
|
3546
|
+
open: boolean;
|
|
3547
|
+
onOpenChange: (open: boolean) => void;
|
|
3548
|
+
options: readonly RegionOption[];
|
|
3549
|
+
/** Currently selected code, if any. */
|
|
3550
|
+
selectedCode: string;
|
|
3551
|
+
onSelect: (code: string) => void;
|
|
3552
|
+
title: string;
|
|
3553
|
+
/**
|
|
3554
|
+
* Show each country's E.164 calling code instead of its ISO code, turning the
|
|
3555
|
+
* same sheet into the phone country-code picker.
|
|
3556
|
+
*/
|
|
3557
|
+
showDialCode?: boolean;
|
|
3558
|
+
/**
|
|
3559
|
+
* Off for lists whose codes aren't countries — a US state has no flag, and
|
|
3560
|
+
* the CDN would be asked for Germany's for Delaware.
|
|
3561
|
+
*/
|
|
3562
|
+
showFlags?: boolean;
|
|
3563
|
+
/** Asset CDN override for the flag images, as passed to the modal. */
|
|
3564
|
+
assetCdnUrl?: string;
|
|
3565
|
+
}
|
|
3566
|
+
/**
|
|
3567
|
+
* Full-panel picker for a country or a subdivision, replacing a native
|
|
3568
|
+
* `<select>`.
|
|
3569
|
+
*
|
|
3570
|
+
* A native dropdown renders with the browser's own chrome, which ignores the
|
|
3571
|
+
* theme entirely — a light popup over a dark modal — and is painful with a list
|
|
3572
|
+
* this long. This follows the same shape as `TokenSelectorSheet`: a title row, a
|
|
3573
|
+
* search field, and a scrollable themed list.
|
|
3574
|
+
*
|
|
3575
|
+
* Positioned `absolute` against the nearest positioned ancestor, so the host
|
|
3576
|
+
* flow needs a `relative` wrapper around the area the sheet should cover —
|
|
3577
|
+
* `DepositModal` provides one around its body.
|
|
3578
|
+
*/
|
|
3579
|
+
declare function RegionSelectorSheet({ open, onOpenChange, options, selectedCode, onSelect, title, showDialCode, showFlags, assetCdnUrl, }: RegionSelectorSheetProps): react_jsx_runtime.JSX.Element | null;
|
|
3580
|
+
|
|
3581
|
+
interface RegionPickerButtonProps {
|
|
3582
|
+
/** Text to show — the selected region, or a placeholder when nothing is set. */
|
|
3583
|
+
label: string;
|
|
3584
|
+
/** Dim the label when it stands in for an empty selection. */
|
|
3585
|
+
placeholder?: boolean;
|
|
3586
|
+
/** Country code of the current selection, to show its flag alongside the label. */
|
|
3587
|
+
flagCode?: string;
|
|
3588
|
+
/** Asset CDN override for the flag image, as passed to the modal. */
|
|
3589
|
+
assetCdnUrl?: string;
|
|
3590
|
+
onClick: () => void;
|
|
3591
|
+
/**
|
|
3592
|
+
* Size to the label rather than filling the row, for the calling-code control
|
|
3593
|
+
* that sits beside a phone input. Dial codes run from one to three digits, and
|
|
3594
|
+
* the flag, gaps and chevron around them take up most of the control, so a
|
|
3595
|
+
* width that suits `+1` ellipsises `+372`.
|
|
3596
|
+
*/
|
|
3597
|
+
fitContent?: boolean;
|
|
3598
|
+
/**
|
|
3599
|
+
* Match the shorter inputs used by the KYC forms (`py-2.5`) rather than the
|
|
3600
|
+
* taller registration ones (`py-3`), so the control lines up with whatever
|
|
3601
|
+
* field sits beside it.
|
|
3602
|
+
*/
|
|
3603
|
+
dense?: boolean;
|
|
3604
|
+
/**
|
|
3605
|
+
* There is only one possible value, so render the selection as a read-only
|
|
3606
|
+
* field: no chevron, nothing to click. A disabled button would still invite
|
|
3607
|
+
* the click and read as temporarily unavailable rather than absent.
|
|
3608
|
+
*/
|
|
3609
|
+
locked?: boolean;
|
|
3610
|
+
/**
|
|
3611
|
+
* Overrides merged last, so a form whose text inputs are styled differently
|
|
3612
|
+
* from the theme's default input (the KYC form uses the card surface) can make
|
|
3613
|
+
* the trigger match the fields beside it.
|
|
3614
|
+
*/
|
|
3615
|
+
style?: React$1.CSSProperties;
|
|
3616
|
+
}
|
|
3617
|
+
/** Trigger that opens a {@link RegionSelectorSheet}, styled as an input. */
|
|
3618
|
+
declare function RegionPickerButton({ label, placeholder, flagCode, assetCdnUrl, onClick, fitContent, dense, locked, style: styleOverride, }: RegionPickerButtonProps): react_jsx_runtime.JSX.Element;
|
|
3619
|
+
|
|
3248
3620
|
/**
|
|
3249
3621
|
* Result of the useAllowedCountry hook
|
|
3250
3622
|
*/
|
|
@@ -3364,10 +3736,23 @@ interface UseDepositQuoteParams {
|
|
|
3364
3736
|
* that destination amount. Exact-in (`sourceAmount`): estimated destination
|
|
3365
3737
|
* amount received for that source amount. The response includes the project's
|
|
3366
3738
|
* platform fee from billing (`platform_fee_percent`).
|
|
3367
|
-
* Server-side cached for 1 minute; client
|
|
3739
|
+
* Server-side cached for 1 minute; client treats a quote as fresh for 5 minutes.
|
|
3368
3740
|
*/
|
|
3369
3741
|
declare function useDepositQuote(params: UseDepositQuoteParams): _tanstack_react_query.UseQueryResult<DepositQuote, Error>;
|
|
3370
3742
|
|
|
3743
|
+
interface UseTokenMetadataParams {
|
|
3744
|
+
chainType?: string;
|
|
3745
|
+
chainId?: string;
|
|
3746
|
+
tokenAddress?: string;
|
|
3747
|
+
publishableKey: string;
|
|
3748
|
+
enabled?: boolean;
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Token metadata (symbol, icons, decimals, chain) for a chain/token address.
|
|
3752
|
+
* Shared query key so transfer, card, and other surfaces reuse the same cache.
|
|
3753
|
+
*/
|
|
3754
|
+
declare function useTokenMetadata(params: UseTokenMetadataParams): _tanstack_react_query.UseQueryResult<TokenMetadata | null, Error>;
|
|
3755
|
+
|
|
3371
3756
|
interface UsePublicIncidentOptions {
|
|
3372
3757
|
publishableKey: string;
|
|
3373
3758
|
enabled?: boolean;
|
|
@@ -3786,4 +4171,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
3786
4171
|
*/
|
|
3787
4172
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
3788
4173
|
|
|
3789
|
-
export { type AllowedCountryResult, AnalyticsProvider, type AnalyticsProviderProps, BankTransfer, BankTransferButton, type BankTransferProps, type BankTransferView, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithApplePay, type BuyWithApplePayProps, BuyWithCard, type BuyWithCardProps, BuyWithGooglePay, type BuyWithGooglePayProps, BuyWithWalletPay, type BuyWithWalletPayHandle, type BuyWithWalletPayProps, 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, type DepositMenuLayout, type DepositMenuLayoutType, DepositModal, type DepositModalInitialScreen, DepositSuccessToast, type DepositTab, 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 I18nContextValue, I18nProvider, type I18nProviderProps, type I18nStrings, type InputTokens, type ListTokens, type LocaleCode, ManualDepositButton, type MobilePlatform, PayWithStripeLink, type PayWithStripeLinkProps, QRCodeSkeleton, type ResolvedFonts, SUPPORTED_LOCALES, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, type StoredWalletPaySession as StoredApplePaySession, type StoredWalletPaySession, 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, WalletPayQrCheckout, type WalletPayQrCheckoutProps, type WalletPayQuote, type WalletPayView, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buildWalletPayQuote, buttonVariants, clearStoredWalletPaySession as clearStoredApplePaySession, clearStoredWalletPaySession, cn, colors, defaultColors, detectBrowserLocale, detectBrowserWallet, formatCryptoAmount, formatFiat, getActiveLocale, getActiveStrings, getColors, getStoredWalletPaySession as getStoredApplePaySession, getStoredWalletPaySession, getStrings, i18n, interpolate, isHypercoreChain, isOnrampTokenFresh, mergeColors, normalizeLocale, platformSupportsWalletPay, qrErrorCorrectionLevel, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, setActiveLocale, setStoredWalletPaySession as setStoredApplePaySession, setStoredWalletPaySession, truncateAddress, useAddressBalance, useAllowedCountry, useAnalytics, useDebounce, useDepositPolling, useDepositQuote, useI18n, useMobilePlatform, usePaymentIntent, usePublicIncident, useSourceTokenValidation, useSupportedDepositTokens, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|
|
4174
|
+
export { ALL_COUNTRIES, type AllowedCountryResult, AnalyticsProvider, type AnalyticsProviderProps, BankTransfer, BankTransferButton, type BankTransferProps, type BankTransferView, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithApplePay, type BuyWithApplePayProps, BuyWithCard, type BuyWithCardProps, BuyWithGooglePay, type BuyWithGooglePayProps, BuyWithWalletPay, type BuyWithWalletPayHandle, type BuyWithWalletPayProps, COUNTRIES, COUNTRY_GROUPS, type CardTokens, CheckingForDepositIndicator, CheckoutModal, type CheckoutModalProps, CoinbaseConnect, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, ConnectExchangeButton, type ContainerTokens, type Country, CountryFlag, type CountryGroup, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, type DepositMenuLayout, type DepositMenuLayoutType, DepositModal, type DepositModalInitialScreen, DepositSuccessToast, type DepositTab, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EIP6963_BOOTSTRAP_SCRIPT, type EvmWalletProvider, type FontConfig, type GetKycCountryListOptions, HYPERCORE_CHAIN_ID, type HeaderTokens, type I18nContextValue, I18nProvider, type I18nProviderProps, type I18nStrings, type InputTokens, type ListTokens, type LocaleCode, ManualDepositButton, type MobilePlatform, PayWithStripeLink, type PayWithStripeLinkProps, QRCodeSkeleton, REGION_SHEET_ANCHOR_ATTR, type RegionOption, RegionPickerButton, type RegionPickerButtonProps, RegionSelectorSheet, type RegionSelectorSheetProps, type ResolvedFonts, SUPPORTED_LOCALES, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaStandardAccount, type SolanaStandardWallet, type SolanaWalletProvider, type StoredWalletPaySession as StoredApplePaySession, type StoredWalletPaySession, StripeLinkButton, type StripeLinkStep, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, TransferQrCode, US_STATES, type UsState, type UseDepositQuoteParams, type UsePaymentIntentParams, type UseSupportedDepositTokensOptions, type UseTokenMetadataParams, WalletPayQrCheckout, type WalletPayQrCheckoutProps, type WalletPayQuote, type WalletPayView, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buildWalletPayQuote, buttonVariants, clearStoredWalletPaySession as clearStoredApplePaySession, clearStoredWalletPaySession, cn, colors, connectSolanaStandardWallet, countryFlag, countryFlagIconPath, countryFlagPngPath, countryName, defaultColors, detectBrowserLocale, detectBrowserWallet, detectConnectedBrowserWallet, dialCode, filterRegions, findCountry, findSolanaStandardWallet, formatCryptoAmount, formatFiat, getActiveLocale, getActiveStrings, getAuthorizedSolanaStandardAccounts, getColors, getKycCountryList, getSolanaStandardWallets, getStoredWalletPaySession as getStoredApplePaySession, getStoredWalletPaySession, getStrings, i18n, interpolate, isHypercoreChain, isInGroup, isOnrampTokenFresh, isSolanaWalletDetectedViaWalletStandard, mergeColors, normalizeLocale, platformSupportsWalletPay, qrErrorCorrectionLevel, requestEip6963Providers, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, setActiveLocale, setStoredWalletPaySession as setStoredApplePaySession, setStoredWalletPaySession, signSolanaStandardTransaction, startBrowserWalletDiscovery, subscribeSolanaStandardAccountChanges, subscribeSolanaStandardWallets, toAlpha2, truncateAddress, usStateName, useAddressBalance, useAllowedCountry, useAnalytics, useDebounce, useDepositPolling, useDepositQuote, useI18n, useMobilePlatform, usePaymentIntent, usePublicIncident, useSourceTokenValidation, useSupportedDepositTokens, useSupportedDestinationTokens, useTheme, useTokenMetadata, useVerifyRecipientAddress, useWithdrawPolling };
|