@unifold/ui-react 0.1.6 → 0.1.8
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 +82 -47
- package/dist/index.d.ts +82 -47
- package/dist/index.js +886 -541
- package/dist/index.mjs +882 -539
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -45,39 +45,6 @@ interface DepositHeaderProps {
|
|
|
45
45
|
}
|
|
46
46
|
declare function DepositHeader({ title, showBack, showClose, onBack, onClose, badge, }: DepositHeaderProps): react_jsx_runtime.JSX.Element;
|
|
47
47
|
|
|
48
|
-
interface TransferCryptoProps {
|
|
49
|
-
userId: string;
|
|
50
|
-
publishableKey: string;
|
|
51
|
-
recipientAddress?: string;
|
|
52
|
-
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
53
|
-
destinationChainId?: string;
|
|
54
|
-
destinationTokenAddress?: string;
|
|
55
|
-
copyButtonMode?: "compact" | "fullWidth";
|
|
56
|
-
onExecutionsChange?: (executions: any[]) => void;
|
|
57
|
-
onDepositSuccess?: (data: {
|
|
58
|
-
message: string;
|
|
59
|
-
transaction?: unknown;
|
|
60
|
-
executionId?: string;
|
|
61
|
-
}) => void;
|
|
62
|
-
onDepositError?: (error: {
|
|
63
|
-
message: string;
|
|
64
|
-
error?: unknown;
|
|
65
|
-
code?: string;
|
|
66
|
-
}) => void;
|
|
67
|
-
}
|
|
68
|
-
declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
|
|
69
|
-
|
|
70
|
-
interface TransferCrypto2Props {
|
|
71
|
-
userId: string;
|
|
72
|
-
publishableKey: string;
|
|
73
|
-
recipientAddress?: string;
|
|
74
|
-
destinationChainId?: string;
|
|
75
|
-
destinationTokenAddress?: string;
|
|
76
|
-
copyButtonMode?: "compact" | "fullWidth";
|
|
77
|
-
onExecutionsChange?: (executions: any[]) => void;
|
|
78
|
-
}
|
|
79
|
-
declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
|
|
80
|
-
|
|
81
48
|
declare function setApiConfig(config: {
|
|
82
49
|
baseUrl?: string;
|
|
83
50
|
publishableKey?: string;
|
|
@@ -94,6 +61,12 @@ declare function getApiBaseUrl(): string;
|
|
|
94
61
|
* like "http://localhost:3002/api/public/icons/networks/ethereum.svg"
|
|
95
62
|
*/
|
|
96
63
|
declare function getIconUrl(iconPath: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Build an icon URL using a custom CDN base URL
|
|
66
|
+
* Converts relative paths like "/icons/networks/ethereum.svg" to full CDN URLs
|
|
67
|
+
* Falls back to getIconUrl if no CDN URL is provided
|
|
68
|
+
*/
|
|
69
|
+
declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
|
|
97
70
|
interface Wallet {
|
|
98
71
|
id: string;
|
|
99
72
|
chain_type: "ethereum" | "solana" | "bitcoin";
|
|
@@ -154,6 +127,7 @@ interface AutoSwapResponse {
|
|
|
154
127
|
destination_chain_id: string;
|
|
155
128
|
destination_token_address: string;
|
|
156
129
|
source_amount_base_unit: string;
|
|
130
|
+
source_amount_usd?: string;
|
|
157
131
|
destination_amount_base_unit: string;
|
|
158
132
|
provider_metadata: unknown;
|
|
159
133
|
created_at?: string;
|
|
@@ -165,6 +139,9 @@ interface AutoSwapResponse {
|
|
|
165
139
|
source_token_metadata?: {
|
|
166
140
|
icon_url: string;
|
|
167
141
|
};
|
|
142
|
+
destination_token_metadata?: {
|
|
143
|
+
icon_url: string;
|
|
144
|
+
};
|
|
168
145
|
}
|
|
169
146
|
declare const SOLANA_USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
170
147
|
interface QueryExecutionsRequest {
|
|
@@ -267,10 +244,15 @@ interface MeldSessionResponse {
|
|
|
267
244
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
268
245
|
*/
|
|
269
246
|
declare function createMeldSession(request: MeldSessionRequest, publishableKey?: string): Promise<MeldSessionResponse>;
|
|
247
|
+
interface IconUrl {
|
|
248
|
+
url: string;
|
|
249
|
+
format: "svg" | "png";
|
|
250
|
+
}
|
|
270
251
|
interface FiatCurrency {
|
|
271
252
|
currency_code: string;
|
|
272
253
|
name: string;
|
|
273
254
|
icon_url: string;
|
|
255
|
+
icon_urls?: IconUrl[];
|
|
274
256
|
}
|
|
275
257
|
interface FiatCurrenciesResponse {
|
|
276
258
|
data: FiatCurrency[];
|
|
@@ -281,6 +263,49 @@ interface FiatCurrenciesResponse {
|
|
|
281
263
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
282
264
|
*/
|
|
283
265
|
declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenciesResponse>;
|
|
266
|
+
interface FeaturedToken {
|
|
267
|
+
name: string;
|
|
268
|
+
position: number;
|
|
269
|
+
icon_urls: IconUrl[];
|
|
270
|
+
}
|
|
271
|
+
interface PaymentNetwork {
|
|
272
|
+
name: string;
|
|
273
|
+
icon_urls: IconUrl[];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface TransferCryptoProps {
|
|
277
|
+
userId: string;
|
|
278
|
+
publishableKey: string;
|
|
279
|
+
recipientAddress?: string;
|
|
280
|
+
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
281
|
+
destinationChainId?: string;
|
|
282
|
+
destinationTokenAddress?: string;
|
|
283
|
+
copyButtonMode?: "compact" | "fullWidth";
|
|
284
|
+
onExecutionsChange?: (executions: any[]) => void;
|
|
285
|
+
onDepositSuccess?: (data: {
|
|
286
|
+
message: string;
|
|
287
|
+
transaction?: unknown;
|
|
288
|
+
executionId?: string;
|
|
289
|
+
}) => void;
|
|
290
|
+
onDepositError?: (error: {
|
|
291
|
+
message: string;
|
|
292
|
+
error?: unknown;
|
|
293
|
+
code?: string;
|
|
294
|
+
}) => void;
|
|
295
|
+
wallets?: Wallet[];
|
|
296
|
+
}
|
|
297
|
+
declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
interface TransferCrypto2Props {
|
|
300
|
+
userId: string;
|
|
301
|
+
publishableKey: string;
|
|
302
|
+
recipientAddress?: string;
|
|
303
|
+
destinationChainId?: string;
|
|
304
|
+
destinationTokenAddress?: string;
|
|
305
|
+
copyButtonMode?: "compact" | "fullWidth";
|
|
306
|
+
onExecutionsChange?: (executions: any[]) => void;
|
|
307
|
+
}
|
|
308
|
+
declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
|
|
284
309
|
|
|
285
310
|
type LayoutVariant = "horizontal" | "vertical";
|
|
286
311
|
interface TransferCryptoBaseProps {
|
|
@@ -304,8 +329,9 @@ interface TransferCryptoBaseProps {
|
|
|
304
329
|
error?: unknown;
|
|
305
330
|
code?: string;
|
|
306
331
|
}) => void;
|
|
332
|
+
wallets?: Wallet[];
|
|
307
333
|
}
|
|
308
|
-
declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
|
|
334
|
+
declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
|
|
309
335
|
|
|
310
336
|
interface BuyWithCardProps {
|
|
311
337
|
userId: string;
|
|
@@ -330,8 +356,10 @@ interface BuyWithCardProps {
|
|
|
330
356
|
code?: string;
|
|
331
357
|
}) => void;
|
|
332
358
|
themeClass?: string;
|
|
359
|
+
wallets?: Wallet[];
|
|
360
|
+
assetCdnUrl?: string;
|
|
333
361
|
}
|
|
334
|
-
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
362
|
+
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, wallets: externalWallets, assetCdnUrl, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
335
363
|
|
|
336
364
|
interface CurrencyModalProps {
|
|
337
365
|
open: boolean;
|
|
@@ -353,9 +381,10 @@ interface DepositSuccessToastProps {
|
|
|
353
381
|
completionExplorerUrl?: string;
|
|
354
382
|
status: ExecutionStatus;
|
|
355
383
|
tokenIconUrl?: string;
|
|
384
|
+
sourceAmountBaseUnit?: string;
|
|
356
385
|
onClose: () => void;
|
|
357
386
|
}
|
|
358
|
-
declare function DepositSuccessToast({ depositTx,
|
|
387
|
+
declare function DepositSuccessToast({ depositTx, orderSubmittedAt, status, tokenIconUrl, sourceAmountBaseUnit, onClose, }: DepositSuccessToastProps): react_jsx_runtime.JSX.Element;
|
|
359
388
|
|
|
360
389
|
interface DepositsModalProps {
|
|
361
390
|
open: boolean;
|
|
@@ -380,15 +409,17 @@ interface TransferCryptoButtonProps {
|
|
|
380
409
|
onClick: () => void;
|
|
381
410
|
title: string;
|
|
382
411
|
subtitle: string;
|
|
412
|
+
featuredTokens?: FeaturedToken[];
|
|
383
413
|
}
|
|
384
|
-
declare function TransferCryptoButton({ onClick, title, subtitle, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
declare function TransferCryptoButton({ onClick, title, subtitle, featuredTokens, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
|
|
385
415
|
|
|
386
416
|
interface DepositWithCardButtonProps {
|
|
387
417
|
onClick: () => void;
|
|
388
418
|
title: string;
|
|
389
419
|
subtitle: string;
|
|
420
|
+
paymentNetworks?: PaymentNetwork[];
|
|
390
421
|
}
|
|
391
|
-
declare function DepositWithCardButton({ onClick, title, subtitle, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
|
|
422
|
+
declare function DepositWithCardButton({ onClick, title, subtitle, paymentNetworks, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
|
|
392
423
|
|
|
393
424
|
interface DepositTrackerButtonProps {
|
|
394
425
|
onClick: () => void;
|
|
@@ -400,10 +431,17 @@ declare function DepositTrackerButton({ onClick, title, subtitle, badge, }: Depo
|
|
|
400
431
|
|
|
401
432
|
interface DepositExecutionItemProps {
|
|
402
433
|
execution: AutoSwapResponse;
|
|
403
|
-
|
|
404
|
-
|
|
434
|
+
onClick?: () => void;
|
|
435
|
+
}
|
|
436
|
+
declare function DepositExecutionItem({ execution, onClick, }: DepositExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
437
|
+
|
|
438
|
+
interface DepositDetailModalProps {
|
|
439
|
+
open: boolean;
|
|
440
|
+
onOpenChange: (open: boolean) => void;
|
|
441
|
+
execution: AutoSwapResponse | null;
|
|
442
|
+
themeClass?: string;
|
|
405
443
|
}
|
|
406
|
-
declare function
|
|
444
|
+
declare function DepositDetailModal({ open, onOpenChange, execution, themeClass, }: DepositDetailModalProps): react_jsx_runtime.JSX.Element | null;
|
|
407
445
|
|
|
408
446
|
interface CurrencyListItemProps {
|
|
409
447
|
currency: FiatCurrency;
|
|
@@ -472,19 +510,16 @@ interface UserIpInfo {
|
|
|
472
510
|
/**
|
|
473
511
|
* Hook to fetch user's IP-based location information
|
|
474
512
|
*
|
|
475
|
-
*
|
|
476
|
-
* 1. Primary: Moonpay IP API (if API key is provided)
|
|
477
|
-
* 2. Fallback: ipapi.co
|
|
513
|
+
* Uses ipapi.co to detect the user's country and state.
|
|
478
514
|
*
|
|
479
515
|
* The result is cached in-memory using React Query:
|
|
480
516
|
* - Data persists for the entire browser session
|
|
481
517
|
* - Shared across all components using this hook
|
|
482
518
|
* - Reduces API calls and protects against rate limiting
|
|
483
519
|
*
|
|
484
|
-
* @param moonpayApiKey - Optional Moonpay API key for primary lookup
|
|
485
520
|
* @returns User IP information including country code
|
|
486
521
|
*/
|
|
487
|
-
declare function useUserIp(
|
|
522
|
+
declare function useUserIp(): {
|
|
488
523
|
userIpInfo: UserIpInfo | undefined;
|
|
489
524
|
isLoading: boolean;
|
|
490
525
|
error: Error | null;
|
|
@@ -567,4 +602,4 @@ declare const i18n: {
|
|
|
567
602
|
};
|
|
568
603
|
type I18nStrings = typeof i18n;
|
|
569
604
|
|
|
570
|
-
export { type AutoSwapRequest, type AutoSwapResponse, Button, type ButtonProps, BuyWithCard, type CreateEOARequest, CurrencyListItem, CurrencyListSection, CurrencyModal, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EOAResponse, ExecutionStatus, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type MeldQuote, type MeldQuotesRequest, type MeldQuotesResponse, type MeldSessionRequest, type MeldSessionResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCrypto, TransferCrypto2, TransferCryptoBase, TransferCryptoButton, type UserIpInfo, type Wallet, buttonVariants, cn, createEOA, createMeldSession, getApiBaseUrl, getFiatCurrencies, getIconUrl, getMeldQuotes, getSupportedDepositTokens, getWalletByChainType, i18n, queryExecutions, setApiConfig, useTheme, useUserIp };
|
|
605
|
+
export { type AutoSwapRequest, type AutoSwapResponse, Button, type ButtonProps, BuyWithCard, type CreateEOARequest, CurrencyListItem, CurrencyListSection, CurrencyModal, DepositDetailModal, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EOAResponse, ExecutionStatus, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type MeldQuote, type MeldQuotesRequest, type MeldQuotesResponse, type MeldSessionRequest, type MeldSessionResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCrypto, TransferCrypto2, TransferCryptoBase, TransferCryptoButton, type UserIpInfo, type Wallet, buttonVariants, cn, createEOA, createMeldSession, getApiBaseUrl, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getMeldQuotes, getSupportedDepositTokens, getWalletByChainType, i18n, queryExecutions, setApiConfig, useTheme, useUserIp };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,39 +45,6 @@ interface DepositHeaderProps {
|
|
|
45
45
|
}
|
|
46
46
|
declare function DepositHeader({ title, showBack, showClose, onBack, onClose, badge, }: DepositHeaderProps): react_jsx_runtime.JSX.Element;
|
|
47
47
|
|
|
48
|
-
interface TransferCryptoProps {
|
|
49
|
-
userId: string;
|
|
50
|
-
publishableKey: string;
|
|
51
|
-
recipientAddress?: string;
|
|
52
|
-
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
53
|
-
destinationChainId?: string;
|
|
54
|
-
destinationTokenAddress?: string;
|
|
55
|
-
copyButtonMode?: "compact" | "fullWidth";
|
|
56
|
-
onExecutionsChange?: (executions: any[]) => void;
|
|
57
|
-
onDepositSuccess?: (data: {
|
|
58
|
-
message: string;
|
|
59
|
-
transaction?: unknown;
|
|
60
|
-
executionId?: string;
|
|
61
|
-
}) => void;
|
|
62
|
-
onDepositError?: (error: {
|
|
63
|
-
message: string;
|
|
64
|
-
error?: unknown;
|
|
65
|
-
code?: string;
|
|
66
|
-
}) => void;
|
|
67
|
-
}
|
|
68
|
-
declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
|
|
69
|
-
|
|
70
|
-
interface TransferCrypto2Props {
|
|
71
|
-
userId: string;
|
|
72
|
-
publishableKey: string;
|
|
73
|
-
recipientAddress?: string;
|
|
74
|
-
destinationChainId?: string;
|
|
75
|
-
destinationTokenAddress?: string;
|
|
76
|
-
copyButtonMode?: "compact" | "fullWidth";
|
|
77
|
-
onExecutionsChange?: (executions: any[]) => void;
|
|
78
|
-
}
|
|
79
|
-
declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
|
|
80
|
-
|
|
81
48
|
declare function setApiConfig(config: {
|
|
82
49
|
baseUrl?: string;
|
|
83
50
|
publishableKey?: string;
|
|
@@ -94,6 +61,12 @@ declare function getApiBaseUrl(): string;
|
|
|
94
61
|
* like "http://localhost:3002/api/public/icons/networks/ethereum.svg"
|
|
95
62
|
*/
|
|
96
63
|
declare function getIconUrl(iconPath: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Build an icon URL using a custom CDN base URL
|
|
66
|
+
* Converts relative paths like "/icons/networks/ethereum.svg" to full CDN URLs
|
|
67
|
+
* Falls back to getIconUrl if no CDN URL is provided
|
|
68
|
+
*/
|
|
69
|
+
declare function getIconUrlWithCdn(iconPath: string, assetCdnUrl?: string): string;
|
|
97
70
|
interface Wallet {
|
|
98
71
|
id: string;
|
|
99
72
|
chain_type: "ethereum" | "solana" | "bitcoin";
|
|
@@ -154,6 +127,7 @@ interface AutoSwapResponse {
|
|
|
154
127
|
destination_chain_id: string;
|
|
155
128
|
destination_token_address: string;
|
|
156
129
|
source_amount_base_unit: string;
|
|
130
|
+
source_amount_usd?: string;
|
|
157
131
|
destination_amount_base_unit: string;
|
|
158
132
|
provider_metadata: unknown;
|
|
159
133
|
created_at?: string;
|
|
@@ -165,6 +139,9 @@ interface AutoSwapResponse {
|
|
|
165
139
|
source_token_metadata?: {
|
|
166
140
|
icon_url: string;
|
|
167
141
|
};
|
|
142
|
+
destination_token_metadata?: {
|
|
143
|
+
icon_url: string;
|
|
144
|
+
};
|
|
168
145
|
}
|
|
169
146
|
declare const SOLANA_USDC_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
170
147
|
interface QueryExecutionsRequest {
|
|
@@ -267,10 +244,15 @@ interface MeldSessionResponse {
|
|
|
267
244
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
268
245
|
*/
|
|
269
246
|
declare function createMeldSession(request: MeldSessionRequest, publishableKey?: string): Promise<MeldSessionResponse>;
|
|
247
|
+
interface IconUrl {
|
|
248
|
+
url: string;
|
|
249
|
+
format: "svg" | "png";
|
|
250
|
+
}
|
|
270
251
|
interface FiatCurrency {
|
|
271
252
|
currency_code: string;
|
|
272
253
|
name: string;
|
|
273
254
|
icon_url: string;
|
|
255
|
+
icon_urls?: IconUrl[];
|
|
274
256
|
}
|
|
275
257
|
interface FiatCurrenciesResponse {
|
|
276
258
|
data: FiatCurrency[];
|
|
@@ -281,6 +263,49 @@ interface FiatCurrenciesResponse {
|
|
|
281
263
|
* @param publishableKey - Optional publishable key, defaults to configured key
|
|
282
264
|
*/
|
|
283
265
|
declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenciesResponse>;
|
|
266
|
+
interface FeaturedToken {
|
|
267
|
+
name: string;
|
|
268
|
+
position: number;
|
|
269
|
+
icon_urls: IconUrl[];
|
|
270
|
+
}
|
|
271
|
+
interface PaymentNetwork {
|
|
272
|
+
name: string;
|
|
273
|
+
icon_urls: IconUrl[];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface TransferCryptoProps {
|
|
277
|
+
userId: string;
|
|
278
|
+
publishableKey: string;
|
|
279
|
+
recipientAddress?: string;
|
|
280
|
+
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
281
|
+
destinationChainId?: string;
|
|
282
|
+
destinationTokenAddress?: string;
|
|
283
|
+
copyButtonMode?: "compact" | "fullWidth";
|
|
284
|
+
onExecutionsChange?: (executions: any[]) => void;
|
|
285
|
+
onDepositSuccess?: (data: {
|
|
286
|
+
message: string;
|
|
287
|
+
transaction?: unknown;
|
|
288
|
+
executionId?: string;
|
|
289
|
+
}) => void;
|
|
290
|
+
onDepositError?: (error: {
|
|
291
|
+
message: string;
|
|
292
|
+
error?: unknown;
|
|
293
|
+
code?: string;
|
|
294
|
+
}) => void;
|
|
295
|
+
wallets?: Wallet[];
|
|
296
|
+
}
|
|
297
|
+
declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
interface TransferCrypto2Props {
|
|
300
|
+
userId: string;
|
|
301
|
+
publishableKey: string;
|
|
302
|
+
recipientAddress?: string;
|
|
303
|
+
destinationChainId?: string;
|
|
304
|
+
destinationTokenAddress?: string;
|
|
305
|
+
copyButtonMode?: "compact" | "fullWidth";
|
|
306
|
+
onExecutionsChange?: (executions: any[]) => void;
|
|
307
|
+
}
|
|
308
|
+
declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
|
|
284
309
|
|
|
285
310
|
type LayoutVariant = "horizontal" | "vertical";
|
|
286
311
|
interface TransferCryptoBaseProps {
|
|
@@ -304,8 +329,9 @@ interface TransferCryptoBaseProps {
|
|
|
304
329
|
error?: unknown;
|
|
305
330
|
code?: string;
|
|
306
331
|
}) => void;
|
|
332
|
+
wallets?: Wallet[];
|
|
307
333
|
}
|
|
308
|
-
declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
|
|
334
|
+
declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
|
|
309
335
|
|
|
310
336
|
interface BuyWithCardProps {
|
|
311
337
|
userId: string;
|
|
@@ -330,8 +356,10 @@ interface BuyWithCardProps {
|
|
|
330
356
|
code?: string;
|
|
331
357
|
}) => void;
|
|
332
358
|
themeClass?: string;
|
|
359
|
+
wallets?: Wallet[];
|
|
360
|
+
assetCdnUrl?: string;
|
|
333
361
|
}
|
|
334
|
-
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
362
|
+
declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, wallets: externalWallets, assetCdnUrl, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
|
|
335
363
|
|
|
336
364
|
interface CurrencyModalProps {
|
|
337
365
|
open: boolean;
|
|
@@ -353,9 +381,10 @@ interface DepositSuccessToastProps {
|
|
|
353
381
|
completionExplorerUrl?: string;
|
|
354
382
|
status: ExecutionStatus;
|
|
355
383
|
tokenIconUrl?: string;
|
|
384
|
+
sourceAmountBaseUnit?: string;
|
|
356
385
|
onClose: () => void;
|
|
357
386
|
}
|
|
358
|
-
declare function DepositSuccessToast({ depositTx,
|
|
387
|
+
declare function DepositSuccessToast({ depositTx, orderSubmittedAt, status, tokenIconUrl, sourceAmountBaseUnit, onClose, }: DepositSuccessToastProps): react_jsx_runtime.JSX.Element;
|
|
359
388
|
|
|
360
389
|
interface DepositsModalProps {
|
|
361
390
|
open: boolean;
|
|
@@ -380,15 +409,17 @@ interface TransferCryptoButtonProps {
|
|
|
380
409
|
onClick: () => void;
|
|
381
410
|
title: string;
|
|
382
411
|
subtitle: string;
|
|
412
|
+
featuredTokens?: FeaturedToken[];
|
|
383
413
|
}
|
|
384
|
-
declare function TransferCryptoButton({ onClick, title, subtitle, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
declare function TransferCryptoButton({ onClick, title, subtitle, featuredTokens, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
|
|
385
415
|
|
|
386
416
|
interface DepositWithCardButtonProps {
|
|
387
417
|
onClick: () => void;
|
|
388
418
|
title: string;
|
|
389
419
|
subtitle: string;
|
|
420
|
+
paymentNetworks?: PaymentNetwork[];
|
|
390
421
|
}
|
|
391
|
-
declare function DepositWithCardButton({ onClick, title, subtitle, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
|
|
422
|
+
declare function DepositWithCardButton({ onClick, title, subtitle, paymentNetworks, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
|
|
392
423
|
|
|
393
424
|
interface DepositTrackerButtonProps {
|
|
394
425
|
onClick: () => void;
|
|
@@ -400,10 +431,17 @@ declare function DepositTrackerButton({ onClick, title, subtitle, badge, }: Depo
|
|
|
400
431
|
|
|
401
432
|
interface DepositExecutionItemProps {
|
|
402
433
|
execution: AutoSwapResponse;
|
|
403
|
-
|
|
404
|
-
|
|
434
|
+
onClick?: () => void;
|
|
435
|
+
}
|
|
436
|
+
declare function DepositExecutionItem({ execution, onClick, }: DepositExecutionItemProps): react_jsx_runtime.JSX.Element;
|
|
437
|
+
|
|
438
|
+
interface DepositDetailModalProps {
|
|
439
|
+
open: boolean;
|
|
440
|
+
onOpenChange: (open: boolean) => void;
|
|
441
|
+
execution: AutoSwapResponse | null;
|
|
442
|
+
themeClass?: string;
|
|
405
443
|
}
|
|
406
|
-
declare function
|
|
444
|
+
declare function DepositDetailModal({ open, onOpenChange, execution, themeClass, }: DepositDetailModalProps): react_jsx_runtime.JSX.Element | null;
|
|
407
445
|
|
|
408
446
|
interface CurrencyListItemProps {
|
|
409
447
|
currency: FiatCurrency;
|
|
@@ -472,19 +510,16 @@ interface UserIpInfo {
|
|
|
472
510
|
/**
|
|
473
511
|
* Hook to fetch user's IP-based location information
|
|
474
512
|
*
|
|
475
|
-
*
|
|
476
|
-
* 1. Primary: Moonpay IP API (if API key is provided)
|
|
477
|
-
* 2. Fallback: ipapi.co
|
|
513
|
+
* Uses ipapi.co to detect the user's country and state.
|
|
478
514
|
*
|
|
479
515
|
* The result is cached in-memory using React Query:
|
|
480
516
|
* - Data persists for the entire browser session
|
|
481
517
|
* - Shared across all components using this hook
|
|
482
518
|
* - Reduces API calls and protects against rate limiting
|
|
483
519
|
*
|
|
484
|
-
* @param moonpayApiKey - Optional Moonpay API key for primary lookup
|
|
485
520
|
* @returns User IP information including country code
|
|
486
521
|
*/
|
|
487
|
-
declare function useUserIp(
|
|
522
|
+
declare function useUserIp(): {
|
|
488
523
|
userIpInfo: UserIpInfo | undefined;
|
|
489
524
|
isLoading: boolean;
|
|
490
525
|
error: Error | null;
|
|
@@ -567,4 +602,4 @@ declare const i18n: {
|
|
|
567
602
|
};
|
|
568
603
|
type I18nStrings = typeof i18n;
|
|
569
604
|
|
|
570
|
-
export { type AutoSwapRequest, type AutoSwapResponse, Button, type ButtonProps, BuyWithCard, type CreateEOARequest, CurrencyListItem, CurrencyListSection, CurrencyModal, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EOAResponse, ExecutionStatus, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type MeldQuote, type MeldQuotesRequest, type MeldQuotesResponse, type MeldSessionRequest, type MeldSessionResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCrypto, TransferCrypto2, TransferCryptoBase, TransferCryptoButton, type UserIpInfo, type Wallet, buttonVariants, cn, createEOA, createMeldSession, getApiBaseUrl, getFiatCurrencies, getIconUrl, getMeldQuotes, getSupportedDepositTokens, getWalletByChainType, i18n, queryExecutions, setApiConfig, useTheme, useUserIp };
|
|
605
|
+
export { type AutoSwapRequest, type AutoSwapResponse, Button, type ButtonProps, BuyWithCard, type CreateEOARequest, CurrencyListItem, CurrencyListSection, CurrencyModal, DepositDetailModal, DepositExecutionItem, DepositHeader, DepositModal, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EOAResponse, ExecutionStatus, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type MeldQuote, type MeldQuotesRequest, type MeldQuotesResponse, type MeldSessionRequest, type MeldSessionResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, StyledQRCode, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCrypto, TransferCrypto2, TransferCryptoBase, TransferCryptoButton, type UserIpInfo, type Wallet, buttonVariants, cn, createEOA, createMeldSession, getApiBaseUrl, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getMeldQuotes, getSupportedDepositTokens, getWalletByChainType, i18n, queryExecutions, setApiConfig, useTheme, useUserIp };
|