@unifold/ui-react 0.1.5 → 0.1.7

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 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;
@@ -267,10 +234,15 @@ interface MeldSessionResponse {
267
234
  * @param publishableKey - Optional publishable key, defaults to configured key
268
235
  */
269
236
  declare function createMeldSession(request: MeldSessionRequest, publishableKey?: string): Promise<MeldSessionResponse>;
237
+ interface IconUrl {
238
+ url: string;
239
+ format: "svg" | "png";
240
+ }
270
241
  interface FiatCurrency {
271
242
  currency_code: string;
272
243
  name: string;
273
244
  icon_url: string;
245
+ icon_urls?: IconUrl[];
274
246
  }
275
247
  interface FiatCurrenciesResponse {
276
248
  data: FiatCurrency[];
@@ -281,6 +253,49 @@ interface FiatCurrenciesResponse {
281
253
  * @param publishableKey - Optional publishable key, defaults to configured key
282
254
  */
283
255
  declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenciesResponse>;
256
+ interface FeaturedToken {
257
+ name: string;
258
+ position: number;
259
+ icon_urls: IconUrl[];
260
+ }
261
+ interface PaymentNetwork {
262
+ name: string;
263
+ icon_urls: IconUrl[];
264
+ }
265
+
266
+ interface TransferCryptoProps {
267
+ userId: string;
268
+ publishableKey: string;
269
+ recipientAddress?: string;
270
+ destinationChainType?: "ethereum" | "solana" | "bitcoin";
271
+ destinationChainId?: string;
272
+ destinationTokenAddress?: string;
273
+ copyButtonMode?: "compact" | "fullWidth";
274
+ onExecutionsChange?: (executions: any[]) => void;
275
+ onDepositSuccess?: (data: {
276
+ message: string;
277
+ transaction?: unknown;
278
+ executionId?: string;
279
+ }) => void;
280
+ onDepositError?: (error: {
281
+ message: string;
282
+ error?: unknown;
283
+ code?: string;
284
+ }) => void;
285
+ wallets?: Wallet[];
286
+ }
287
+ declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
288
+
289
+ interface TransferCrypto2Props {
290
+ userId: string;
291
+ publishableKey: string;
292
+ recipientAddress?: string;
293
+ destinationChainId?: string;
294
+ destinationTokenAddress?: string;
295
+ copyButtonMode?: "compact" | "fullWidth";
296
+ onExecutionsChange?: (executions: any[]) => void;
297
+ }
298
+ declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
284
299
 
285
300
  type LayoutVariant = "horizontal" | "vertical";
286
301
  interface TransferCryptoBaseProps {
@@ -304,8 +319,9 @@ interface TransferCryptoBaseProps {
304
319
  error?: unknown;
305
320
  code?: string;
306
321
  }) => void;
322
+ wallets?: Wallet[];
307
323
  }
308
- declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
324
+ declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
309
325
 
310
326
  interface BuyWithCardProps {
311
327
  userId: string;
@@ -330,8 +346,9 @@ interface BuyWithCardProps {
330
346
  code?: string;
331
347
  }) => void;
332
348
  themeClass?: string;
349
+ wallets?: Wallet[];
333
350
  }
334
- declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
351
+ declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, wallets: externalWallets, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
335
352
 
336
353
  interface CurrencyModalProps {
337
354
  open: boolean;
@@ -380,15 +397,17 @@ interface TransferCryptoButtonProps {
380
397
  onClick: () => void;
381
398
  title: string;
382
399
  subtitle: string;
400
+ featuredTokens?: FeaturedToken[];
383
401
  }
384
- declare function TransferCryptoButton({ onClick, title, subtitle, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
402
+ declare function TransferCryptoButton({ onClick, title, subtitle, featuredTokens, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
385
403
 
386
404
  interface DepositWithCardButtonProps {
387
405
  onClick: () => void;
388
406
  title: string;
389
407
  subtitle: string;
408
+ paymentNetworks?: PaymentNetwork[];
390
409
  }
391
- declare function DepositWithCardButton({ onClick, title, subtitle, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
410
+ declare function DepositWithCardButton({ onClick, title, subtitle, paymentNetworks, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
392
411
 
393
412
  interface DepositTrackerButtonProps {
394
413
  onClick: () => void;
@@ -472,19 +491,16 @@ interface UserIpInfo {
472
491
  /**
473
492
  * Hook to fetch user's IP-based location information
474
493
  *
475
- * Implements a two-tier fallback strategy:
476
- * 1. Primary: Moonpay IP API (if API key is provided)
477
- * 2. Fallback: ipapi.co
494
+ * Uses ipapi.co to detect the user's country and state.
478
495
  *
479
496
  * The result is cached in-memory using React Query:
480
497
  * - Data persists for the entire browser session
481
498
  * - Shared across all components using this hook
482
499
  * - Reduces API calls and protects against rate limiting
483
500
  *
484
- * @param moonpayApiKey - Optional Moonpay API key for primary lookup
485
501
  * @returns User IP information including country code
486
502
  */
487
- declare function useUserIp(moonpayApiKey?: string): {
503
+ declare function useUserIp(): {
488
504
  userIpInfo: UserIpInfo | undefined;
489
505
  isLoading: boolean;
490
506
  error: Error | null;
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;
@@ -267,10 +234,15 @@ interface MeldSessionResponse {
267
234
  * @param publishableKey - Optional publishable key, defaults to configured key
268
235
  */
269
236
  declare function createMeldSession(request: MeldSessionRequest, publishableKey?: string): Promise<MeldSessionResponse>;
237
+ interface IconUrl {
238
+ url: string;
239
+ format: "svg" | "png";
240
+ }
270
241
  interface FiatCurrency {
271
242
  currency_code: string;
272
243
  name: string;
273
244
  icon_url: string;
245
+ icon_urls?: IconUrl[];
274
246
  }
275
247
  interface FiatCurrenciesResponse {
276
248
  data: FiatCurrency[];
@@ -281,6 +253,49 @@ interface FiatCurrenciesResponse {
281
253
  * @param publishableKey - Optional publishable key, defaults to configured key
282
254
  */
283
255
  declare function getFiatCurrencies(publishableKey?: string): Promise<FiatCurrenciesResponse>;
256
+ interface FeaturedToken {
257
+ name: string;
258
+ position: number;
259
+ icon_urls: IconUrl[];
260
+ }
261
+ interface PaymentNetwork {
262
+ name: string;
263
+ icon_urls: IconUrl[];
264
+ }
265
+
266
+ interface TransferCryptoProps {
267
+ userId: string;
268
+ publishableKey: string;
269
+ recipientAddress?: string;
270
+ destinationChainType?: "ethereum" | "solana" | "bitcoin";
271
+ destinationChainId?: string;
272
+ destinationTokenAddress?: string;
273
+ copyButtonMode?: "compact" | "fullWidth";
274
+ onExecutionsChange?: (executions: any[]) => void;
275
+ onDepositSuccess?: (data: {
276
+ message: string;
277
+ transaction?: unknown;
278
+ executionId?: string;
279
+ }) => void;
280
+ onDepositError?: (error: {
281
+ message: string;
282
+ error?: unknown;
283
+ code?: string;
284
+ }) => void;
285
+ wallets?: Wallet[];
286
+ }
287
+ declare function TransferCrypto(props: TransferCryptoProps): react_jsx_runtime.JSX.Element;
288
+
289
+ interface TransferCrypto2Props {
290
+ userId: string;
291
+ publishableKey: string;
292
+ recipientAddress?: string;
293
+ destinationChainId?: string;
294
+ destinationTokenAddress?: string;
295
+ copyButtonMode?: "compact" | "fullWidth";
296
+ onExecutionsChange?: (executions: any[]) => void;
297
+ }
298
+ declare function TransferCrypto2(props: TransferCrypto2Props): react_jsx_runtime.JSX.Element;
284
299
 
285
300
  type LayoutVariant = "horizontal" | "vertical";
286
301
  interface TransferCryptoBaseProps {
@@ -304,8 +319,9 @@ interface TransferCryptoBaseProps {
304
319
  error?: unknown;
305
320
  code?: string;
306
321
  }) => void;
322
+ wallets?: Wallet[];
307
323
  }
308
- declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
324
+ declare function TransferCryptoBase({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, copyButtonMode, layoutVariant, showDetailedDropdowns, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoBaseProps): react_jsx_runtime.JSX.Element;
309
325
 
310
326
  interface BuyWithCardProps {
311
327
  userId: string;
@@ -330,8 +346,9 @@ interface BuyWithCardProps {
330
346
  code?: string;
331
347
  }) => void;
332
348
  themeClass?: string;
349
+ wallets?: Wallet[];
333
350
  }
334
- declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
351
+ declare function BuyWithCard({ userId, publishableKey, view: externalView, onViewChange, maxAmountUsd, accentColor, destinationTokenSymbol, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, themeClass, wallets: externalWallets, }: BuyWithCardProps): react_jsx_runtime.JSX.Element;
335
352
 
336
353
  interface CurrencyModalProps {
337
354
  open: boolean;
@@ -380,15 +397,17 @@ interface TransferCryptoButtonProps {
380
397
  onClick: () => void;
381
398
  title: string;
382
399
  subtitle: string;
400
+ featuredTokens?: FeaturedToken[];
383
401
  }
384
- declare function TransferCryptoButton({ onClick, title, subtitle, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
402
+ declare function TransferCryptoButton({ onClick, title, subtitle, featuredTokens, }: TransferCryptoButtonProps): react_jsx_runtime.JSX.Element;
385
403
 
386
404
  interface DepositWithCardButtonProps {
387
405
  onClick: () => void;
388
406
  title: string;
389
407
  subtitle: string;
408
+ paymentNetworks?: PaymentNetwork[];
390
409
  }
391
- declare function DepositWithCardButton({ onClick, title, subtitle, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
410
+ declare function DepositWithCardButton({ onClick, title, subtitle, paymentNetworks, }: DepositWithCardButtonProps): react_jsx_runtime.JSX.Element;
392
411
 
393
412
  interface DepositTrackerButtonProps {
394
413
  onClick: () => void;
@@ -472,19 +491,16 @@ interface UserIpInfo {
472
491
  /**
473
492
  * Hook to fetch user's IP-based location information
474
493
  *
475
- * Implements a two-tier fallback strategy:
476
- * 1. Primary: Moonpay IP API (if API key is provided)
477
- * 2. Fallback: ipapi.co
494
+ * Uses ipapi.co to detect the user's country and state.
478
495
  *
479
496
  * The result is cached in-memory using React Query:
480
497
  * - Data persists for the entire browser session
481
498
  * - Shared across all components using this hook
482
499
  * - Reduces API calls and protects against rate limiting
483
500
  *
484
- * @param moonpayApiKey - Optional Moonpay API key for primary lookup
485
501
  * @returns User IP information including country code
486
502
  */
487
- declare function useUserIp(moonpayApiKey?: string): {
503
+ declare function useUserIp(): {
488
504
  userIpInfo: UserIpInfo | undefined;
489
505
  isLoading: boolean;
490
506
  error: Error | null;