@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.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/components/deposits/DepositModal.tsx
2
2
  import { useState as useState5, useEffect as useEffect5 } from "react";
3
+ import { ChevronRight as ChevronRight7 } from "lucide-react";
3
4
 
4
5
  // src/components/shared/dialog.tsx
5
6
  import * as React2 from "react";
@@ -150,7 +151,7 @@ import {
150
151
  ShieldCheck,
151
152
  Clock,
152
153
  FileText,
153
- ChevronRight
154
+ ChevronRight as ChevronRight2
154
155
  } from "lucide-react";
155
156
 
156
157
  // src/components/deposits/StyledQRCode.tsx
@@ -285,7 +286,7 @@ function DepositHeader({
285
286
  }
286
287
 
287
288
  // src/components/deposits/DepositExecutionItem.tsx
288
- import { X as X3, ExternalLink } from "lucide-react";
289
+ import { ChevronRight } from "lucide-react";
289
290
 
290
291
  // src/lib/api.ts
291
292
  var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
@@ -309,6 +310,14 @@ function getIconUrl(iconPath) {
309
310
  const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
310
311
  return `${API_BASE_URL}/api/public${normalizedPath}`;
311
312
  }
313
+ function getIconUrlWithCdn(iconPath, assetCdnUrl) {
314
+ if (!assetCdnUrl) {
315
+ return getIconUrl(iconPath);
316
+ }
317
+ const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
318
+ const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
319
+ return `${baseUrl}/api/public${normalizedPath}`;
320
+ }
312
321
  async function createEOA(overrides, publishableKey) {
313
322
  if (!overrides?.user_id) {
314
323
  throw new Error("user_id is required");
@@ -427,6 +436,16 @@ async function createMeldSession(request, publishableKey) {
427
436
  }
428
437
  return response.json();
429
438
  }
439
+ function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
440
+ if (!iconUrls || iconUrls.length === 0) {
441
+ return void 0;
442
+ }
443
+ const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
444
+ if (preferred) {
445
+ return preferred.url;
446
+ }
447
+ return iconUrls[0]?.url;
448
+ }
430
449
  async function getFiatCurrencies(publishableKey) {
431
450
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
432
451
  const response = await fetch(
@@ -444,54 +463,84 @@ async function getFiatCurrencies(publishableKey) {
444
463
  }
445
464
  return response.json();
446
465
  }
466
+ async function getProjectConfig(publishableKey) {
467
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
468
+ const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
469
+ method: "GET",
470
+ headers: {
471
+ accept: "application/json",
472
+ "x-publishable-key": pk
473
+ }
474
+ });
475
+ if (!response.ok) {
476
+ throw new Error(`Failed to fetch project config: ${response.statusText}`);
477
+ }
478
+ return response.json();
479
+ }
447
480
 
448
481
  // src/components/deposits/DepositExecutionItem.tsx
449
482
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
450
483
  function DepositExecutionItem({
451
484
  execution,
452
- showCloseButton = false,
453
- onClose
485
+ onClick
454
486
  }) {
455
487
  const isPending = execution.status === "pending" /* PENDING */ || execution.status === "waiting" /* WAITING */ || execution.status === "delayed" /* DELAYED */;
456
- const formatTxHash = (hash) => {
457
- if (hash.length <= 12) return hash;
458
- return `${hash.slice(0, 10)}...${hash.slice(-8)}`;
459
- };
460
488
  const formatDateTime = (timestamp) => {
461
489
  try {
462
490
  const date = new Date(timestamp);
463
- return date.toLocaleDateString("en-US", { month: "short", day: "numeric" }) + " \xB7 " + date.toLocaleTimeString("en-US", {
491
+ const monthDay = date.toLocaleDateString("en-US", {
492
+ month: "short",
493
+ day: "numeric",
494
+ year: "numeric"
495
+ });
496
+ const time = date.toLocaleTimeString("en-US", {
464
497
  hour: "numeric",
465
498
  minute: "2-digit",
466
- second: "2-digit",
467
- hour12: false
468
- });
499
+ hour12: true
500
+ }).toLowerCase();
501
+ return `${monthDay} at ${time}`;
469
502
  } catch {
470
503
  return timestamp;
471
504
  }
472
505
  };
473
- return /* @__PURE__ */ jsxs3("div", { className: "uf-bg-card uf-border uf-border-border uf-rounded-xl uf-overflow-hidden uf-p-3", children: [
474
- /* @__PURE__ */ jsxs3("div", { className: "uf-flex uf-items-start uf-justify-between", children: [
475
- /* @__PURE__ */ jsxs3("div", { className: "uf-flex uf-items-center uf-gap-2.5 uf-flex-1", children: [
476
- /* @__PURE__ */ jsxs3("div", { className: "uf-relative uf-flex-shrink-0", children: [
506
+ const formatUsdAmount = (baseUnitAmount) => {
507
+ try {
508
+ const amount = Number(baseUnitAmount) / 1e6;
509
+ return new Intl.NumberFormat("en-US", {
510
+ style: "currency",
511
+ currency: "USD",
512
+ minimumFractionDigits: 2,
513
+ maximumFractionDigits: 2
514
+ }).format(amount);
515
+ } catch {
516
+ return "$0.00";
517
+ }
518
+ };
519
+ return /* @__PURE__ */ jsxs3(
520
+ "button",
521
+ {
522
+ onClick,
523
+ className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-gap-3 hover:uf-bg-secondary/80 uf-transition-colors uf-text-left",
524
+ children: [
525
+ /* @__PURE__ */ jsxs3("div", { className: "uf-relative uf-flex-shrink-0 uf-w-9 uf-h-9", children: [
477
526
  /* @__PURE__ */ jsx5(
478
527
  "img",
479
528
  {
480
529
  src: execution.source_token_metadata?.icon_url || getIconUrl("/icons/tokens/usdc.svg"),
481
530
  alt: "Token",
482
- width: 32,
483
- height: 32,
484
- className: "uf-rounded-full"
531
+ width: 36,
532
+ height: 36,
533
+ className: "uf-rounded-full uf-w-9 uf-h-9"
485
534
  }
486
535
  ),
487
- isPending ? /* @__PURE__ */ jsx5("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx5(
536
+ isPending ? /* @__PURE__ */ jsx5("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx5(
488
537
  "svg",
489
538
  {
490
539
  width: "10",
491
540
  height: "10",
492
541
  viewBox: "0 0 12 12",
493
542
  fill: "none",
494
- className: "uf-animate-spin",
543
+ className: "uf-animate-spin uf-block",
495
544
  children: /* @__PURE__ */ jsx5(
496
545
  "path",
497
546
  {
@@ -502,7 +551,7 @@ function DepositExecutionItem({
502
551
  }
503
552
  )
504
553
  }
505
- ) }) : /* @__PURE__ */ jsx5("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx5("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx5(
554
+ ) }) : /* @__PURE__ */ jsx5("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-blue-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx5("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ jsx5(
506
555
  "path",
507
556
  {
508
557
  d: "M10 3L4.5 8.5L2 6",
@@ -514,59 +563,249 @@ function DepositExecutionItem({
514
563
  ) }) })
515
564
  ] }),
516
565
  /* @__PURE__ */ jsxs3("div", { className: "uf-flex-1 uf-min-w-0", children: [
517
- /* @__PURE__ */ jsxs3("div", { className: "uf-flex uf-items-center uf-justify-between uf-mb-0.5", children: [
518
- /* @__PURE__ */ jsx5("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm", children: isPending ? "Deposit received" : "Deposit completed" }),
519
- /* @__PURE__ */ jsx5("span", { className: "uf-text-muted-foreground uf-text-xs uf-whitespace-nowrap uf-ml-2", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
566
+ /* @__PURE__ */ jsx5("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit received" : "Deposit completed" }),
567
+ /* @__PURE__ */ jsx5("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
568
+ ] }),
569
+ /* @__PURE__ */ jsx5("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
570
+ /* @__PURE__ */ jsx5(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground uf-flex-shrink-0" })
571
+ ]
572
+ }
573
+ );
574
+ }
575
+
576
+ // src/components/deposits/DepositDetailModal.tsx
577
+ import { ArrowDownCircle, CheckCircle, ExternalLink } from "lucide-react";
578
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
579
+ var CHAIN_NAMES = {
580
+ solana: "Solana",
581
+ ethereum: "Ethereum",
582
+ "1": "Ethereum",
583
+ "137": "Polygon",
584
+ "42161": "Arbitrum",
585
+ "10": "Optimism",
586
+ "8453": "Base",
587
+ "43114": "Avalanche",
588
+ "56": "BSC",
589
+ bitcoin: "Bitcoin",
590
+ mainnet: "Mainnet"
591
+ };
592
+ function DepositDetailModal({
593
+ open,
594
+ onOpenChange,
595
+ execution,
596
+ themeClass = ""
597
+ }) {
598
+ if (!execution) return null;
599
+ const isPending = execution.status === "pending" /* PENDING */ || execution.status === "waiting" /* WAITING */ || execution.status === "delayed" /* DELAYED */;
600
+ const formatDateTime = (timestamp) => {
601
+ try {
602
+ const date = new Date(timestamp);
603
+ const monthDay = date.toLocaleDateString("en-US", {
604
+ month: "short",
605
+ day: "numeric",
606
+ year: "numeric"
607
+ });
608
+ const time = date.toLocaleTimeString("en-US", {
609
+ hour: "numeric",
610
+ minute: "2-digit",
611
+ hour12: true
612
+ });
613
+ return `${monthDay} at ${time}`;
614
+ } catch {
615
+ return timestamp;
616
+ }
617
+ };
618
+ const formatAmount = (baseUnitAmount, decimals = 6) => {
619
+ try {
620
+ const amount = Number(baseUnitAmount) / Math.pow(10, decimals);
621
+ return amount.toFixed(2);
622
+ } catch {
623
+ return "0.00";
624
+ }
625
+ };
626
+ const formatUsdAmount = (usdAmount, baseUnitAmount) => {
627
+ if (usdAmount) {
628
+ try {
629
+ const amount = Number(usdAmount);
630
+ return new Intl.NumberFormat("en-US", {
631
+ style: "currency",
632
+ currency: "USD",
633
+ minimumFractionDigits: 2,
634
+ maximumFractionDigits: 2
635
+ }).format(amount);
636
+ } catch {
637
+ }
638
+ }
639
+ if (baseUnitAmount) {
640
+ try {
641
+ const amount = Number(baseUnitAmount) / 1e6;
642
+ return new Intl.NumberFormat("en-US", {
643
+ style: "currency",
644
+ currency: "USD",
645
+ minimumFractionDigits: 2,
646
+ maximumFractionDigits: 2
647
+ }).format(amount);
648
+ } catch {
649
+ }
650
+ }
651
+ return "$0.00";
652
+ };
653
+ const getNetworkName = (chainType, chainId) => {
654
+ return CHAIN_NAMES[chainId] || CHAIN_NAMES[chainType] || chainType;
655
+ };
656
+ const getSourceTokenSymbol = () => {
657
+ return "USDC";
658
+ };
659
+ const getDestinationTokenSymbol = () => {
660
+ return "USDC";
661
+ };
662
+ const handleClose = () => {
663
+ onOpenChange(false);
664
+ };
665
+ return /* @__PURE__ */ jsx6(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs4(
666
+ DialogContent,
667
+ {
668
+ className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`,
669
+ children: [
670
+ /* @__PURE__ */ jsx6(DepositHeader, { title: "Deposit Details", onClose: handleClose }),
671
+ /* @__PURE__ */ jsxs4("div", { className: "uf-px-4 uf-pb-4", children: [
672
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
673
+ /* @__PURE__ */ jsxs4("div", { className: "uf-relative uf-mb-3", children: [
674
+ /* @__PURE__ */ jsx6(
675
+ "img",
676
+ {
677
+ src: execution.source_token_metadata?.icon_url || getIconUrl("/icons/tokens/usdc.svg"),
678
+ alt: "Token",
679
+ width: 64,
680
+ height: 64,
681
+ className: "uf-rounded-full"
682
+ }
683
+ ),
684
+ isPending ? /* @__PURE__ */ jsx6("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx6(
685
+ "svg",
686
+ {
687
+ width: "16",
688
+ height: "16",
689
+ viewBox: "0 0 12 12",
690
+ fill: "none",
691
+ className: "uf-animate-spin uf-block",
692
+ children: /* @__PURE__ */ jsx6(
693
+ "path",
694
+ {
695
+ d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
696
+ stroke: "white",
697
+ strokeWidth: "2",
698
+ strokeLinecap: "round"
699
+ }
700
+ )
701
+ }
702
+ ) }) : /* @__PURE__ */ jsx6("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx6(
703
+ "svg",
704
+ {
705
+ width: "16",
706
+ height: "16",
707
+ viewBox: "0 0 12 12",
708
+ fill: "none",
709
+ className: "uf-block",
710
+ children: /* @__PURE__ */ jsx6(
711
+ "path",
712
+ {
713
+ d: "M10 3L4.5 8.5L2 6",
714
+ stroke: "white",
715
+ strokeWidth: "2",
716
+ strokeLinecap: "round",
717
+ strokeLinejoin: "round"
718
+ }
719
+ )
720
+ }
721
+ ) })
722
+ ] }),
723
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
724
+ /* @__PURE__ */ jsx6(
725
+ "div",
726
+ {
727
+ className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
728
+ }
729
+ ),
730
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
731
+ ] }),
732
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
520
733
  ] }),
521
- /* @__PURE__ */ jsx5("p", { className: "uf-text-muted-foreground uf-text-xs", children: isPending ? "Your account will be credited shortly." : "Your account has been credited successfully." })
734
+ /* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
735
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
736
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
737
+ /* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
738
+ formatAmount(execution.source_amount_base_unit),
739
+ " ",
740
+ getSourceTokenSymbol()
741
+ ] })
742
+ ] }),
743
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
744
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
745
+ /* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
746
+ formatAmount(execution.destination_amount_base_unit),
747
+ " ",
748
+ getDestinationTokenSymbol()
749
+ ] })
750
+ ] }),
751
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
752
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
753
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
754
+ ] })
755
+ ] }),
756
+ /* @__PURE__ */ jsxs4("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
757
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
758
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
759
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
760
+ ] }),
761
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
762
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
763
+ /* @__PURE__ */ jsx6("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
764
+ ] })
765
+ ] }),
766
+ /* @__PURE__ */ jsxs4("div", { className: "uf-space-y-2", children: [
767
+ execution.explorer_url && /* @__PURE__ */ jsxs4(
768
+ "a",
769
+ {
770
+ href: execution.explorer_url,
771
+ target: "_blank",
772
+ rel: "noopener noreferrer",
773
+ className: "uf-flex uf-items-center uf-justify-between uf-w-full uf-bg-blue-400 hover:uf-bg-blue-500 uf-text-white uf-rounded-xl uf-px-4 uf-py-3 uf-transition-colors",
774
+ children: [
775
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
776
+ /* @__PURE__ */ jsx6(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
777
+ /* @__PURE__ */ jsx6("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
778
+ ] }),
779
+ /* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-4 uf-h-4" })
780
+ ]
781
+ }
782
+ ),
783
+ !isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ jsxs4(
784
+ "a",
785
+ {
786
+ href: execution.destination_explorer_url,
787
+ target: "_blank",
788
+ rel: "noopener noreferrer",
789
+ className: "uf-flex uf-items-center uf-justify-between uf-w-full uf-bg-blue-600 hover:uf-bg-blue-700 uf-text-white uf-rounded-xl uf-px-4 uf-py-3 uf-transition-colors",
790
+ children: [
791
+ /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
792
+ /* @__PURE__ */ jsx6(CheckCircle, { className: "uf-w-5 uf-h-5" }),
793
+ /* @__PURE__ */ jsx6("span", { className: "uf-font-medium", children: "View Completion Transaction" })
794
+ ] }),
795
+ /* @__PURE__ */ jsx6(ExternalLink, { className: "uf-w-4 uf-h-4" })
796
+ ]
797
+ }
798
+ )
799
+ ] }),
800
+ /* @__PURE__ */ jsx6("p", { className: "uf-text-center uf-text-muted-foreground uf-text-xs uf-mt-4", children: "Links open in external browser" })
522
801
  ] })
523
- ] }),
524
- showCloseButton && onClose && /* @__PURE__ */ jsx5(
525
- "button",
526
- {
527
- onClick: onClose,
528
- className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-p-0.5 uf-flex-shrink-0 uf-ml-2",
529
- children: /* @__PURE__ */ jsx5(X3, { className: "uf-w-4 uf-h-4" })
530
- }
531
- )
532
- ] }),
533
- !isPending && execution.explorer_url && /* @__PURE__ */ jsxs3("div", { className: "uf-flex uf-justify-between uf-items-center uf-gap-1.5 uf-mt-2 uf-pt-2 uf-border-t uf-border-secondary uf-text-xs uf-ml-[42px]", children: [
534
- /* @__PURE__ */ jsx5("span", { className: "uf-text-muted-foreground", children: "Deposit tx:" }),
535
- /* @__PURE__ */ jsxs3(
536
- "a",
537
- {
538
- href: execution.explorer_url,
539
- target: "_blank",
540
- rel: "noopener noreferrer",
541
- className: "uf-flex uf-items-center uf-gap-1 uf-text-blue-400 hover:uf-text-blue-300 uf-transition-colors uf-font-mono",
542
- children: [
543
- formatTxHash(execution.transaction_hash),
544
- /* @__PURE__ */ jsx5(ExternalLink, { className: "uf-w-3 uf-h-3" })
545
- ]
546
- }
547
- )
548
- ] }),
549
- !isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ jsxs3("div", { className: "uf-flex uf-justify-between uf-items-center uf-gap-1.5 uf-mt-1 uf-text-xs uf-ml-[42px]", children: [
550
- /* @__PURE__ */ jsx5("span", { className: "uf-text-muted-foreground", children: "Completion tx:" }),
551
- /* @__PURE__ */ jsxs3(
552
- "a",
553
- {
554
- href: execution.destination_explorer_url,
555
- target: "_blank",
556
- rel: "noopener noreferrer",
557
- className: "uf-flex uf-items-center uf-gap-1 uf-text-blue-400 hover:uf-text-blue-300 uf-transition-colors uf-font-mono",
558
- children: [
559
- formatTxHash(execution.destination_transaction_hashes[execution.destination_transaction_hashes.length - 1]),
560
- /* @__PURE__ */ jsx5(ExternalLink, { className: "uf-w-3 uf-h-3" })
561
- ]
562
- }
563
- )
564
- ] })
565
- ] });
802
+ ]
803
+ }
804
+ ) });
566
805
  }
567
806
 
568
807
  // src/components/deposits/DepositsModal.tsx
569
- import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
808
+ import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
570
809
  function DepositsModal({
571
810
  open,
572
811
  onOpenChange,
@@ -576,6 +815,8 @@ function DepositsModal({
576
815
  themeClass = ""
577
816
  }) {
578
817
  const [allExecutions, setAllExecutions] = useState(sessionExecutions);
818
+ const [selectedExecution, setSelectedExecution] = useState(null);
819
+ const [detailModalOpen, setDetailModalOpen] = useState(false);
579
820
  useEffect2(() => {
580
821
  if (!open || !userId) return;
581
822
  const fetchExecutions = async () => {
@@ -601,54 +842,143 @@ function DepositsModal({
601
842
  const handleClose = () => {
602
843
  onOpenChange(false);
603
844
  };
604
- return /* @__PURE__ */ jsx6(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs4(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
605
- /* @__PURE__ */ jsx6(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
606
- /* @__PURE__ */ jsx6("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsx6("div", { className: "uf-space-y-3", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx6("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx6("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx6(Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx6(DepositExecutionItem, { execution }, execution.id)) }) }) })
607
- ] }) });
845
+ const handleExecutionClick = (execution) => {
846
+ setSelectedExecution(execution);
847
+ setDetailModalOpen(true);
848
+ };
849
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
850
+ /* @__PURE__ */ jsx7(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs5(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
851
+ /* @__PURE__ */ jsx7(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
852
+ /* @__PURE__ */ jsx7("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden uf-pb-4", children: /* @__PURE__ */ jsx7("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx7("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx7("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx7(Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx7(
853
+ DepositExecutionItem,
854
+ {
855
+ execution,
856
+ onClick: () => handleExecutionClick(execution)
857
+ },
858
+ execution.id
859
+ )) }) }) })
860
+ ] }) }),
861
+ /* @__PURE__ */ jsx7(
862
+ DepositDetailModal,
863
+ {
864
+ open: detailModalOpen,
865
+ onOpenChange: setDetailModalOpen,
866
+ execution: selectedExecution,
867
+ themeClass
868
+ }
869
+ )
870
+ ] });
608
871
  }
609
872
 
610
873
  // src/components/deposits/DepositSuccessToast.tsx
611
- import { jsx as jsx7 } from "react/jsx-runtime";
874
+ import { X as X3 } from "lucide-react";
875
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
612
876
  function DepositSuccessToast({
613
877
  depositTx,
614
- completionTx,
615
878
  orderSubmittedAt,
616
- orderFilledAt,
617
- explorerUrl,
618
- completionExplorerUrl,
619
879
  status,
620
880
  tokenIconUrl,
881
+ sourceAmountBaseUnit = "0",
621
882
  onClose
622
883
  }) {
623
- const execution = {
624
- id: depositTx,
625
- transaction_hash: depositTx,
626
- explorer_url: explorerUrl,
627
- destination_transaction_hashes: completionTx ? [completionTx] : void 0,
628
- status,
629
- created_at: orderSubmittedAt,
630
- updated_at: orderFilledAt,
631
- source_token_metadata: tokenIconUrl ? { icon_url: tokenIconUrl } : void 0
884
+ const isPending = status === "pending" /* PENDING */ || status === "waiting" /* WAITING */ || status === "delayed" /* DELAYED */;
885
+ const formatDateTime = (timestamp) => {
886
+ try {
887
+ const date = new Date(timestamp);
888
+ const monthDay = date.toLocaleDateString("en-US", {
889
+ month: "short",
890
+ day: "numeric",
891
+ year: "numeric"
892
+ });
893
+ const time = date.toLocaleTimeString("en-US", {
894
+ hour: "numeric",
895
+ minute: "2-digit",
896
+ hour12: true
897
+ }).toLowerCase();
898
+ return `${monthDay} at ${time}`;
899
+ } catch {
900
+ return timestamp;
901
+ }
632
902
  };
633
- return /* @__PURE__ */ jsx7("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ jsx7(
634
- DepositExecutionItem,
635
- {
636
- execution,
637
- showCloseButton: true,
638
- onClose
903
+ const formatUsdAmount = (baseUnitAmount) => {
904
+ try {
905
+ const amount = Number(baseUnitAmount) / 1e6;
906
+ return new Intl.NumberFormat("en-US", {
907
+ style: "currency",
908
+ currency: "USD",
909
+ minimumFractionDigits: 2,
910
+ maximumFractionDigits: 2
911
+ }).format(amount);
912
+ } catch {
913
+ return "$0.00";
639
914
  }
640
- ) });
915
+ };
916
+ return /* @__PURE__ */ jsx8("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ jsxs6("div", { className: "uf-bg-card uf-border uf-border-border uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-gap-3", children: [
917
+ /* @__PURE__ */ jsxs6("div", { className: "uf-relative uf-flex-shrink-0", children: [
918
+ /* @__PURE__ */ jsx8(
919
+ "img",
920
+ {
921
+ src: tokenIconUrl || getIconUrl("/icons/tokens/usdc.svg"),
922
+ alt: "Token",
923
+ width: 36,
924
+ height: 36,
925
+ className: "uf-rounded-full"
926
+ }
927
+ ),
928
+ isPending ? /* @__PURE__ */ jsx8("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx8(
929
+ "svg",
930
+ {
931
+ width: "10",
932
+ height: "10",
933
+ viewBox: "0 0 12 12",
934
+ fill: "none",
935
+ className: "uf-animate-spin",
936
+ children: /* @__PURE__ */ jsx8(
937
+ "path",
938
+ {
939
+ d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
940
+ stroke: "white",
941
+ strokeWidth: "2",
942
+ strokeLinecap: "round"
943
+ }
944
+ )
945
+ }
946
+ ) }) : /* @__PURE__ */ jsx8("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx8("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx8(
947
+ "path",
948
+ {
949
+ d: "M10 3L4.5 8.5L2 6",
950
+ stroke: "white",
951
+ strokeWidth: "2",
952
+ strokeLinecap: "round",
953
+ strokeLinejoin: "round"
954
+ }
955
+ ) }) })
956
+ ] }),
957
+ /* @__PURE__ */ jsxs6("div", { className: "uf-flex-1 uf-min-w-0", children: [
958
+ /* @__PURE__ */ jsx8("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm", children: isPending ? "Deposit received" : "Deposit completed" }),
959
+ /* @__PURE__ */ jsx8("p", { className: "uf-text-muted-foreground uf-text-xs", children: formatDateTime(orderSubmittedAt) })
960
+ ] }),
961
+ /* @__PURE__ */ jsx8("div", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
962
+ /* @__PURE__ */ jsx8(
963
+ "button",
964
+ {
965
+ onClick: onClose,
966
+ className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
967
+ children: /* @__PURE__ */ jsx8(X3, { className: "uf-w-4 uf-h-4" })
968
+ }
969
+ )
970
+ ] }) });
641
971
  }
642
972
 
643
973
  // src/components/shared/select.tsx
644
974
  import * as React3 from "react";
645
975
  import * as SelectPrimitive from "@radix-ui/react-select";
646
976
  import { Check, ChevronDown, ChevronUp } from "lucide-react";
647
- import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
977
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
648
978
  var Select = SelectPrimitive.Root;
649
979
  var SelectGroup = SelectPrimitive.Group;
650
980
  var SelectValue = SelectPrimitive.Value;
651
- var SelectTrigger = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
981
+ var SelectTrigger = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(
652
982
  SelectPrimitive.Trigger,
653
983
  {
654
984
  ref,
@@ -659,12 +989,12 @@ var SelectTrigger = React3.forwardRef(({ className, children, ...props }, ref) =
659
989
  ...props,
660
990
  children: [
661
991
  children,
662
- /* @__PURE__ */ jsx8(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx8(ChevronDown, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
992
+ /* @__PURE__ */ jsx9(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx9(ChevronDown, { className: "uf-h-4 uf-w-4 uf-opacity-50" }) })
663
993
  ]
664
994
  }
665
995
  ));
666
996
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
667
- var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
997
+ var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
668
998
  SelectPrimitive.ScrollUpButton,
669
999
  {
670
1000
  ref,
@@ -673,11 +1003,11 @@ var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /
673
1003
  className
674
1004
  ),
675
1005
  ...props,
676
- children: /* @__PURE__ */ jsx8(ChevronUp, { className: "uf-h-4 uf-w-4" })
1006
+ children: /* @__PURE__ */ jsx9(ChevronUp, { className: "uf-h-4 uf-w-4" })
677
1007
  }
678
1008
  ));
679
1009
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
680
- var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
1010
+ var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
681
1011
  SelectPrimitive.ScrollDownButton,
682
1012
  {
683
1013
  ref,
@@ -686,13 +1016,13 @@ var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) =>
686
1016
  className
687
1017
  ),
688
1018
  ...props,
689
- children: /* @__PURE__ */ jsx8(ChevronDown, { className: "uf-h-4 uf-w-4" })
1019
+ children: /* @__PURE__ */ jsx9(ChevronDown, { className: "uf-h-4 uf-w-4" })
690
1020
  }
691
1021
  ));
692
1022
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
693
1023
  var SelectContent = React3.forwardRef(({ className, children, position = "popper", ...props }, ref) => {
694
1024
  const { themeClass } = useTheme();
695
- return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
1025
+ return /* @__PURE__ */ jsx9(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs7(
696
1026
  SelectPrimitive.Content,
697
1027
  {
698
1028
  ref,
@@ -705,8 +1035,8 @@ var SelectContent = React3.forwardRef(({ className, children, position = "popper
705
1035
  position,
706
1036
  ...props,
707
1037
  children: [
708
- /* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
709
- /* @__PURE__ */ jsx8(
1038
+ /* @__PURE__ */ jsx9(SelectScrollUpButton, {}),
1039
+ /* @__PURE__ */ jsx9(
710
1040
  SelectPrimitive.Viewport,
711
1041
  {
712
1042
  className: cn(
@@ -716,13 +1046,13 @@ var SelectContent = React3.forwardRef(({ className, children, position = "popper
716
1046
  children
717
1047
  }
718
1048
  ),
719
- /* @__PURE__ */ jsx8(SelectScrollDownButton, {})
1049
+ /* @__PURE__ */ jsx9(SelectScrollDownButton, {})
720
1050
  ]
721
1051
  }
722
1052
  ) });
723
1053
  });
724
1054
  SelectContent.displayName = SelectPrimitive.Content.displayName;
725
- var SelectLabel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
1055
+ var SelectLabel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
726
1056
  SelectPrimitive.Label,
727
1057
  {
728
1058
  ref,
@@ -731,7 +1061,7 @@ var SelectLabel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
731
1061
  }
732
1062
  ));
733
1063
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
734
- var SelectItem = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
1064
+ var SelectItem = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(
735
1065
  SelectPrimitive.Item,
736
1066
  {
737
1067
  ref,
@@ -741,13 +1071,13 @@ var SelectItem = React3.forwardRef(({ className, children, ...props }, ref) => /
741
1071
  ),
742
1072
  ...props,
743
1073
  children: [
744
- /* @__PURE__ */ jsx8("span", { className: "uf-absolute uf-left-2 uf-flex uf-h-3.5 uf-w-3.5 uf-items-center uf-justify-center", children: /* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx8(Check, { className: "uf-h-4 uf-w-4" }) }) }),
745
- /* @__PURE__ */ jsx8(SelectPrimitive.ItemText, { children })
1074
+ /* @__PURE__ */ jsx9("span", { className: "uf-absolute uf-left-2 uf-flex uf-h-3.5 uf-w-3.5 uf-items-center uf-justify-center", children: /* @__PURE__ */ jsx9(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx9(Check, { className: "uf-h-4 uf-w-4" }) }) }),
1075
+ /* @__PURE__ */ jsx9(SelectPrimitive.ItemText, { children })
746
1076
  ]
747
1077
  }
748
1078
  ));
749
1079
  SelectItem.displayName = SelectPrimitive.Item.displayName;
750
- var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
1080
+ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
751
1081
  SelectPrimitive.Separator,
752
1082
  {
753
1083
  ref,
@@ -761,7 +1091,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
761
1091
  import * as React4 from "react";
762
1092
  import { Slot } from "@radix-ui/react-slot";
763
1093
  import { cva } from "class-variance-authority";
764
- import { jsx as jsx9 } from "react/jsx-runtime";
1094
+ import { jsx as jsx10 } from "react/jsx-runtime";
765
1095
  var buttonVariants = cva(
766
1096
  "uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
767
1097
  {
@@ -790,7 +1120,7 @@ var buttonVariants = cva(
790
1120
  var Button = React4.forwardRef(
791
1121
  ({ className, variant, size, asChild = false, ...props }, ref) => {
792
1122
  const Comp = asChild ? Slot : "button";
793
- return /* @__PURE__ */ jsx9(
1123
+ return /* @__PURE__ */ jsx10(
794
1124
  Comp,
795
1125
  {
796
1126
  className: cn(buttonVariants({ variant, size, className })),
@@ -805,13 +1135,13 @@ Button.displayName = "Button";
805
1135
  // src/components/shared/tooltip.tsx
806
1136
  import * as React5 from "react";
807
1137
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
808
- import { jsx as jsx10 } from "react/jsx-runtime";
1138
+ import { jsx as jsx11 } from "react/jsx-runtime";
809
1139
  var TooltipProvider = TooltipPrimitive.Provider;
810
1140
  var Tooltip = TooltipPrimitive.Root;
811
1141
  var TooltipTrigger = TooltipPrimitive.Trigger;
812
1142
  var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
813
1143
  const { themeClass } = useTheme();
814
- return /* @__PURE__ */ jsx10(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
1144
+ return /* @__PURE__ */ jsx11(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx11(
815
1145
  TooltipPrimitive.Content,
816
1146
  {
817
1147
  ref,
@@ -897,7 +1227,7 @@ var en_default = {
897
1227
  var i18n = en_default;
898
1228
 
899
1229
  // src/components/deposits/TransferCryptoBase.tsx
900
- import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
1230
+ import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
901
1231
  var t = i18n.transferCrypto;
902
1232
  var getChainKey = (chainId, chainType) => {
903
1233
  return `${chainType}:${chainId}`;
@@ -918,15 +1248,17 @@ function TransferCryptoBase({
918
1248
  showDetailedDropdowns = false,
919
1249
  onExecutionsChange,
920
1250
  onDepositSuccess,
921
- onDepositError
1251
+ onDepositError,
1252
+ wallets: externalWallets
922
1253
  }) {
923
1254
  const { themeClass } = useTheme();
924
1255
  const isDarkMode = themeClass.includes("uf-dark");
925
1256
  const [token, setToken] = useState2("USDC");
926
1257
  const [chain, setChain] = useState2("solana:mainnet");
927
1258
  const [copied, setCopied] = useState2(false);
928
- const [wallets, setWallets] = useState2([]);
929
- const [loading, setLoading] = useState2(true);
1259
+ const [internalWallets, setInternalWallets] = useState2([]);
1260
+ const [loading, setLoading] = useState2(!externalWallets?.length);
1261
+ const wallets = externalWallets?.length ? externalWallets : internalWallets;
930
1262
  const [error, setError] = useState2(null);
931
1263
  const [depositExecutions, setDepositExecutions] = useState2([]);
932
1264
  const [trackedExecutions, setTrackedExecutions] = useState2(/* @__PURE__ */ new Map());
@@ -990,9 +1322,16 @@ function TransferCryptoBase({
990
1322
  }
991
1323
  }, [depositExecutions, onExecutionsChange]);
992
1324
  useEffect3(() => {
993
- async function fetchWallets() {
1325
+ if (externalWallets?.length) {
1326
+ setLoading(false);
1327
+ return;
1328
+ }
1329
+ let retryTimeout = null;
1330
+ let isCancelled = false;
1331
+ const fetchWallets = async () => {
1332
+ if (isCancelled) return;
1333
+ setLoading(true);
994
1334
  try {
995
- setLoading(true);
996
1335
  const response = await createEOA(
997
1336
  {
998
1337
  user_id: userId,
@@ -1003,23 +1342,35 @@ function TransferCryptoBase({
1003
1342
  },
1004
1343
  publishableKey
1005
1344
  );
1006
- setWallets(response.data);
1007
- setError(null);
1345
+ if (!isCancelled) {
1346
+ setInternalWallets(response.data);
1347
+ setError(null);
1348
+ setLoading(false);
1349
+ }
1008
1350
  } catch (err) {
1009
- setError(err instanceof Error ? err.message : "Failed to load wallets");
1010
- console.error("Error fetching wallets:", err);
1011
- } finally {
1012
- setLoading(false);
1351
+ console.error("Error fetching wallets, retrying in 5s:", err);
1352
+ if (!isCancelled) {
1353
+ setError(err instanceof Error ? err.message : "Failed to load wallets");
1354
+ setLoading(false);
1355
+ retryTimeout = setTimeout(fetchWallets, 5e3);
1356
+ }
1013
1357
  }
1014
- }
1358
+ };
1015
1359
  fetchWallets();
1360
+ return () => {
1361
+ isCancelled = true;
1362
+ if (retryTimeout) {
1363
+ clearTimeout(retryTimeout);
1364
+ }
1365
+ };
1016
1366
  }, [
1017
1367
  userId,
1018
1368
  recipientAddress,
1019
1369
  destinationChainType,
1020
1370
  destinationChainId,
1021
1371
  destinationTokenAddress,
1022
- publishableKey
1372
+ publishableKey,
1373
+ externalWallets
1023
1374
  ]);
1024
1375
  useEffect3(() => {
1025
1376
  if (!supportedTokens.length) return;
@@ -1142,8 +1493,8 @@ function TransferCryptoBase({
1142
1493
  const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
1143
1494
  const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
1144
1495
  const renderTokenItem = (tokenData) => {
1145
- return /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1146
- /* @__PURE__ */ jsx11(
1496
+ return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1497
+ /* @__PURE__ */ jsx12(
1147
1498
  "img",
1148
1499
  {
1149
1500
  src: tokenData.icon_url,
@@ -1153,13 +1504,13 @@ function TransferCryptoBase({
1153
1504
  className: "uf-rounded-full uf-flex-shrink-0"
1154
1505
  }
1155
1506
  ),
1156
- /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
1157
- showDetailedDropdowns && /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
1507
+ /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
1508
+ showDetailedDropdowns && /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
1158
1509
  ] });
1159
1510
  };
1160
1511
  const renderChainItem = (chainData) => {
1161
- return /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1162
- /* @__PURE__ */ jsx11(
1512
+ return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1513
+ /* @__PURE__ */ jsx12(
1163
1514
  "img",
1164
1515
  {
1165
1516
  src: chainData.icon_url,
@@ -1169,24 +1520,24 @@ function TransferCryptoBase({
1169
1520
  className: "uf-rounded-full uf-flex-shrink-0"
1170
1521
  }
1171
1522
  ),
1172
- /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
1173
- showDetailedDropdowns && /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
1523
+ /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
1524
+ showDetailedDropdowns && /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
1174
1525
  ] });
1175
1526
  };
1176
1527
  const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
1177
- return /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs6("div", { className: "uf-space-y-3", children: [
1178
- /* @__PURE__ */ jsxs6("div", { className: selectContainerClass, children: [
1179
- /* @__PURE__ */ jsxs6("div", { children: [
1180
- /* @__PURE__ */ jsx11("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
1181
- /* @__PURE__ */ jsxs6(
1528
+ return /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs8("div", { className: "uf-space-y-3", children: [
1529
+ /* @__PURE__ */ jsxs8("div", { className: selectContainerClass, children: [
1530
+ /* @__PURE__ */ jsxs8("div", { children: [
1531
+ /* @__PURE__ */ jsx12("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
1532
+ /* @__PURE__ */ jsxs8(
1182
1533
  Select,
1183
1534
  {
1184
1535
  value: token,
1185
1536
  onValueChange: setToken,
1186
1537
  disabled: tokensLoading || supportedTokens.length === 0,
1187
1538
  children: [
1188
- /* @__PURE__ */ jsx11(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx11(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
1189
- /* @__PURE__ */ jsx11(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ jsx11(
1539
+ /* @__PURE__ */ jsx12(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx12(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx12("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ jsx12("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
1540
+ /* @__PURE__ */ jsx12(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ jsx12(
1190
1541
  SelectItem,
1191
1542
  {
1192
1543
  value: tokenData.symbol,
@@ -1199,51 +1550,51 @@ function TransferCryptoBase({
1199
1550
  }
1200
1551
  )
1201
1552
  ] }),
1202
- /* @__PURE__ */ jsxs6("div", { children: [
1203
- /* @__PURE__ */ jsxs6("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
1553
+ /* @__PURE__ */ jsxs8("div", { children: [
1554
+ /* @__PURE__ */ jsxs8("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
1204
1555
  t.supportedChain,
1205
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-[10px]", children: [
1556
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-[10px]", children: [
1206
1557
  "$",
1207
1558
  minDepositUsd,
1208
1559
  " ",
1209
1560
  t.minDeposit.label
1210
1561
  ] }),
1211
- /* @__PURE__ */ jsxs6(Tooltip, { children: [
1212
- /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
1562
+ /* @__PURE__ */ jsxs8(Tooltip, { children: [
1563
+ /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
1213
1564
  "span",
1214
1565
  {
1215
1566
  className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
1216
1567
  tabIndex: 0,
1217
1568
  role: "button",
1218
1569
  "aria-label": "Minimum deposit information",
1219
- children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
1570
+ children: /* @__PURE__ */ jsx12(Info, { className: "uf-w-3 uf-h-3" })
1220
1571
  }
1221
1572
  ) }),
1222
- /* @__PURE__ */ jsx11(
1573
+ /* @__PURE__ */ jsx12(
1223
1574
  TooltipContent,
1224
1575
  {
1225
1576
  side: "left",
1226
1577
  align: "center",
1227
1578
  className: "uf-max-w-[200px]",
1228
- children: /* @__PURE__ */ jsx11("p", { children: t.minDeposit.tooltip })
1579
+ children: /* @__PURE__ */ jsx12("p", { children: t.minDeposit.tooltip })
1229
1580
  }
1230
1581
  )
1231
1582
  ] })
1232
1583
  ] }),
1233
- /* @__PURE__ */ jsxs6(
1584
+ /* @__PURE__ */ jsxs8(
1234
1585
  Select,
1235
1586
  {
1236
1587
  value: chain,
1237
1588
  onValueChange: setChain,
1238
1589
  disabled: tokensLoading || availableChainsForToken.length === 0,
1239
1590
  children: [
1240
- /* @__PURE__ */ jsx11(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx11(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
1241
- /* @__PURE__ */ jsx11(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ jsx11("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
1591
+ /* @__PURE__ */ jsx12(SelectTrigger, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx12(SelectValue, { children: tokensLoading ? /* @__PURE__ */ jsx12("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ jsx12("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx12("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
1592
+ /* @__PURE__ */ jsx12(SelectContent, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
1242
1593
  const chainKey = getChainKey(
1243
1594
  chainData.chain_id,
1244
1595
  chainData.chain_type
1245
1596
  );
1246
- return /* @__PURE__ */ jsx11(
1597
+ return /* @__PURE__ */ jsx12(
1247
1598
  SelectItem,
1248
1599
  {
1249
1600
  value: chainKey,
@@ -1258,110 +1609,110 @@ function TransferCryptoBase({
1258
1609
  )
1259
1610
  ] })
1260
1611
  ] }),
1261
- /* @__PURE__ */ jsx11("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ jsx11("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx11(
1612
+ /* @__PURE__ */ jsx12("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ jsx12("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx12(
1262
1613
  "div",
1263
1614
  {
1264
1615
  className: "uf-flex uf-items-center uf-justify-center",
1265
1616
  style: { width: 180, height: 180 },
1266
- children: /* @__PURE__ */ jsx11("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
1617
+ children: /* @__PURE__ */ jsx12("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
1267
1618
  }
1268
- ) : depositAddress ? /* @__PURE__ */ jsx11(
1619
+ ) : depositAddress ? /* @__PURE__ */ jsx12(
1269
1620
  StyledQRCode,
1270
1621
  {
1271
1622
  value: depositAddress,
1272
1623
  size: 180,
1273
- imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url || getIconUrl("/icons/networks/ethereum.svg"),
1624
+ imageUrl: currentChainData?.icon_url || currentChainFromBackend?.icon_url,
1274
1625
  imageSize: 45,
1275
1626
  darkMode: isDarkMode
1276
1627
  },
1277
1628
  `qr-${depositAddress}-${chain}`
1278
- ) : /* @__PURE__ */ jsx11(
1629
+ ) : /* @__PURE__ */ jsx12(
1279
1630
  "div",
1280
1631
  {
1281
1632
  className: "uf-flex uf-items-center uf-justify-center",
1282
1633
  style: { width: 180, height: 180 },
1283
- children: /* @__PURE__ */ jsx11("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
1634
+ children: /* @__PURE__ */ jsx12("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
1284
1635
  }
1285
1636
  ) }) }),
1286
- /* @__PURE__ */ jsxs6("div", { children: [
1287
- /* @__PURE__ */ jsxs6("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
1288
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
1637
+ /* @__PURE__ */ jsxs8("div", { children: [
1638
+ /* @__PURE__ */ jsxs8("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
1639
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
1289
1640
  t.depositAddress.label,
1290
- /* @__PURE__ */ jsxs6(Tooltip, { children: [
1291
- /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
1641
+ /* @__PURE__ */ jsxs8(Tooltip, { children: [
1642
+ /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
1292
1643
  "span",
1293
1644
  {
1294
1645
  className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
1295
1646
  tabIndex: 0,
1296
1647
  role: "button",
1297
1648
  "aria-label": "Deposit address information",
1298
- children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
1649
+ children: /* @__PURE__ */ jsx12(Info, { className: "uf-w-3 uf-h-3" })
1299
1650
  }
1300
1651
  ) }),
1301
- /* @__PURE__ */ jsx11(
1652
+ /* @__PURE__ */ jsx12(
1302
1653
  TooltipContent,
1303
1654
  {
1304
1655
  side: "top",
1305
1656
  align: "center",
1306
1657
  className: "uf-max-w-[240px]",
1307
- children: /* @__PURE__ */ jsx11("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
1658
+ children: /* @__PURE__ */ jsx12("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
1308
1659
  }
1309
1660
  )
1310
1661
  ] })
1311
1662
  ] }),
1312
- copyButtonMode === "compact" && /* @__PURE__ */ jsx11(
1663
+ copyButtonMode === "compact" && /* @__PURE__ */ jsx12(
1313
1664
  "button",
1314
1665
  {
1315
1666
  onClick: handleCopyAddress,
1316
1667
  disabled: loading || !depositAddress,
1317
1668
  className: "uf-flex uf-items-center uf-gap-1 uf-text-xs uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
1318
- children: copied ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
1319
- /* @__PURE__ */ jsx11(Check2, { className: "uf-w-3 uf-h-3" }),
1320
- /* @__PURE__ */ jsx11("span", { children: t.copied })
1321
- ] }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
1322
- /* @__PURE__ */ jsx11(Copy, { className: "uf-w-3 uf-h-3" }),
1323
- /* @__PURE__ */ jsx11("span", { children: t.copyAddress })
1669
+ children: copied ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
1670
+ /* @__PURE__ */ jsx12(Check2, { className: "uf-w-3 uf-h-3" }),
1671
+ /* @__PURE__ */ jsx12("span", { children: t.copied })
1672
+ ] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
1673
+ /* @__PURE__ */ jsx12(Copy, { className: "uf-w-3 uf-h-3" }),
1674
+ /* @__PURE__ */ jsx12("span", { children: t.copyAddress })
1324
1675
  ] })
1325
1676
  }
1326
1677
  )
1327
1678
  ] }),
1328
- loading ? /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
1679
+ loading ? /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
1329
1680
  ] }),
1330
- copyButtonMode === "fullWidth" && /* @__PURE__ */ jsx11(
1681
+ copyButtonMode === "fullWidth" && /* @__PURE__ */ jsx12(
1331
1682
  Button,
1332
1683
  {
1333
1684
  onClick: handleCopyAddress,
1334
1685
  disabled: loading || !depositAddress,
1335
1686
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-text-foreground uf-rounded-lg uf-h-9 uf-text-sm uf-font-medium disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
1336
- children: copied ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
1337
- /* @__PURE__ */ jsx11(Check2, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
1687
+ children: copied ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
1688
+ /* @__PURE__ */ jsx12(Check2, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
1338
1689
  t.copied
1339
- ] }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
1340
- /* @__PURE__ */ jsx11(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
1690
+ ] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
1691
+ /* @__PURE__ */ jsx12(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
1341
1692
  t.copyAddress
1342
1693
  ] })
1343
1694
  }
1344
1695
  ),
1345
- /* @__PURE__ */ jsxs6("div", { className: "uf-border-t uf-border-border", children: [
1346
- /* @__PURE__ */ jsxs6(
1696
+ /* @__PURE__ */ jsxs8("div", { className: "uf-border-t uf-border-border", children: [
1697
+ /* @__PURE__ */ jsxs8(
1347
1698
  "button",
1348
1699
  {
1349
1700
  onClick: () => setDetailsExpanded(!detailsExpanded),
1350
1701
  className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
1351
1702
  children: [
1352
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1353
- /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
1354
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-xs", children: [
1703
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1704
+ /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx12(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
1705
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
1355
1706
  t.priceImpact.label,
1356
1707
  ":",
1357
1708
  " ",
1358
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-foreground", children: [
1709
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-foreground", children: [
1359
1710
  priceImpact.toFixed(2),
1360
1711
  "%"
1361
1712
  ] })
1362
1713
  ] }),
1363
- /* @__PURE__ */ jsxs6(Tooltip, { children: [
1364
- /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
1714
+ /* @__PURE__ */ jsxs8(Tooltip, { children: [
1715
+ /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
1365
1716
  "span",
1366
1717
  {
1367
1718
  className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
@@ -1374,75 +1725,75 @@ function TransferCryptoBase({
1374
1725
  tabIndex: 0,
1375
1726
  role: "button",
1376
1727
  "aria-label": "Price impact information",
1377
- children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
1728
+ children: /* @__PURE__ */ jsx12(Info, { className: "uf-w-3 uf-h-3" })
1378
1729
  }
1379
1730
  ) }),
1380
- /* @__PURE__ */ jsx11(
1731
+ /* @__PURE__ */ jsx12(
1381
1732
  TooltipContent,
1382
1733
  {
1383
1734
  side: "top",
1384
1735
  align: "center",
1385
1736
  className: "uf-max-w-[240px]",
1386
- children: /* @__PURE__ */ jsx11("p", { children: t.priceImpact.tooltip })
1737
+ children: /* @__PURE__ */ jsx12("p", { children: t.priceImpact.tooltip })
1387
1738
  }
1388
1739
  )
1389
1740
  ] })
1390
1741
  ] }),
1391
- detailsExpanded ? /* @__PURE__ */ jsx11(ChevronUp2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx11(ChevronDown2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
1742
+ detailsExpanded ? /* @__PURE__ */ jsx12(ChevronUp2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx12(ChevronDown2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
1392
1743
  ]
1393
1744
  }
1394
1745
  ),
1395
- detailsExpanded && /* @__PURE__ */ jsxs6("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
1396
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1397
- /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
1398
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-xs", children: [
1746
+ detailsExpanded && /* @__PURE__ */ jsxs8("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
1747
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1748
+ /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx12(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
1749
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
1399
1750
  t.slippage.label,
1400
1751
  ":",
1401
1752
  " ",
1402
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-foreground", children: [
1753
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-foreground", children: [
1403
1754
  t.slippage.auto,
1404
1755
  " \u2022 ",
1405
1756
  maxSlippage.toFixed(2),
1406
1757
  "%"
1407
1758
  ] })
1408
1759
  ] }),
1409
- /* @__PURE__ */ jsxs6(Tooltip, { children: [
1410
- /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(
1760
+ /* @__PURE__ */ jsxs8(Tooltip, { children: [
1761
+ /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
1411
1762
  "span",
1412
1763
  {
1413
1764
  className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
1414
1765
  tabIndex: 0,
1415
1766
  role: "button",
1416
1767
  "aria-label": "Slippage information",
1417
- children: /* @__PURE__ */ jsx11(Info, { className: "uf-w-3 uf-h-3" })
1768
+ children: /* @__PURE__ */ jsx12(Info, { className: "uf-w-3 uf-h-3" })
1418
1769
  }
1419
1770
  ) }),
1420
- /* @__PURE__ */ jsx11(
1771
+ /* @__PURE__ */ jsx12(
1421
1772
  TooltipContent,
1422
1773
  {
1423
1774
  side: "top",
1424
1775
  align: "center",
1425
1776
  className: "uf-max-w-[240px]",
1426
- children: /* @__PURE__ */ jsx11("p", { children: t.slippage.tooltip })
1777
+ children: /* @__PURE__ */ jsx12("p", { children: t.slippage.tooltip })
1427
1778
  }
1428
1779
  )
1429
1780
  ] })
1430
1781
  ] }),
1431
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1432
- /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(Clock, { className: "uf-w-3 uf-h-3" }) }),
1433
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-xs", children: [
1782
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1783
+ /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx12(Clock, { className: "uf-w-3 uf-h-3" }) }),
1784
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
1434
1785
  t.processingTime.label,
1435
1786
  ":",
1436
1787
  " ",
1437
- /* @__PURE__ */ jsx11("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
1788
+ /* @__PURE__ */ jsx12("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
1438
1789
  ] })
1439
1790
  ] }),
1440
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1441
- /* @__PURE__ */ jsx11("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx11(FileText, { className: "uf-w-3 uf-h-3" }) }),
1442
- /* @__PURE__ */ jsxs6("span", { className: "uf-text-xs", children: [
1791
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
1792
+ /* @__PURE__ */ jsx12("div", { className: "uf-bg-secondary uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx12(FileText, { className: "uf-w-3 uf-h-3" }) }),
1793
+ /* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
1443
1794
  t.help.needHelp,
1444
1795
  " ",
1445
- /* @__PURE__ */ jsx11(
1796
+ /* @__PURE__ */ jsx12(
1446
1797
  "a",
1447
1798
  {
1448
1799
  href: "#",
@@ -1453,8 +1804,8 @@ function TransferCryptoBase({
1453
1804
  ] })
1454
1805
  ] })
1455
1806
  ] }),
1456
- /* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
1457
- /* @__PURE__ */ jsx11(
1807
+ /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
1808
+ /* @__PURE__ */ jsx12(
1458
1809
  "a",
1459
1810
  {
1460
1811
  href: "https://unifold.io/terms",
@@ -1463,38 +1814,37 @@ function TransferCryptoBase({
1463
1814
  children: t.terms.termsApply
1464
1815
  }
1465
1816
  ),
1466
- depositExecutions.length > 1 && /* @__PURE__ */ jsxs6(
1817
+ depositExecutions.length > 1 && /* @__PURE__ */ jsxs8(
1467
1818
  "button",
1468
1819
  {
1469
1820
  onClick: () => setDepositsModalOpen(true),
1470
1821
  className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
1471
1822
  children: [
1472
- /* @__PURE__ */ jsx11(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
1823
+ /* @__PURE__ */ jsx12(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
1473
1824
  "Track deposits (",
1474
1825
  depositExecutions.length,
1475
1826
  ")",
1476
- /* @__PURE__ */ jsx11(ChevronRight, { className: "uf-w-3 uf-h-3" })
1827
+ /* @__PURE__ */ jsx12(ChevronRight2, { className: "uf-w-3 uf-h-3" })
1477
1828
  ]
1478
1829
  }
1479
1830
  )
1480
1831
  ] })
1481
1832
  ] }),
1482
- depositExecutions.length === 1 && /* @__PURE__ */ jsx11("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ jsx11(
1833
+ depositExecutions.length === 1 && /* @__PURE__ */ jsx12("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ jsx12(
1483
1834
  DepositSuccessToast,
1484
1835
  {
1485
1836
  depositTx: depositExecutions[0].transaction_hash,
1486
- completionTx: depositExecutions[0].destination_transaction_hashes?.[0] || (depositExecutions[0].status === "succeeded" /* SUCCEEDED */ ? depositExecutions[0].transaction_hash : void 0),
1487
1837
  orderSubmittedAt: depositExecutions[0].created_at || (/* @__PURE__ */ new Date()).toISOString(),
1488
1838
  orderFilledAt: depositExecutions[0].updated_at || (/* @__PURE__ */ new Date()).toISOString(),
1489
1839
  explorerUrl: depositExecutions[0].explorer_url,
1490
- completionExplorerUrl: depositExecutions[0].destination_transaction_hashes?.[0] ? `https://polygonscan.com/tx/${depositExecutions[0].destination_transaction_hashes[0]}` : depositExecutions[0].status === "succeeded" /* SUCCEEDED */ ? depositExecutions[0].explorer_url : void 0,
1491
1840
  status: depositExecutions[0].status,
1492
1841
  tokenIconUrl: depositExecutions[0].source_token_metadata?.icon_url,
1842
+ sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
1493
1843
  onClose: () => setDepositExecutions([])
1494
1844
  },
1495
1845
  depositExecutions[0].id
1496
1846
  ) }),
1497
- /* @__PURE__ */ jsx11(
1847
+ /* @__PURE__ */ jsx12(
1498
1848
  DepositsModal,
1499
1849
  {
1500
1850
  open: depositsModalOpen,
@@ -1509,9 +1859,9 @@ function TransferCryptoBase({
1509
1859
  }
1510
1860
 
1511
1861
  // src/components/deposits/TransferCrypto.tsx
1512
- import { jsx as jsx12 } from "react/jsx-runtime";
1862
+ import { jsx as jsx13 } from "react/jsx-runtime";
1513
1863
  function TransferCrypto(props) {
1514
- return /* @__PURE__ */ jsx12(
1864
+ return /* @__PURE__ */ jsx13(
1515
1865
  TransferCryptoBase,
1516
1866
  {
1517
1867
  ...props,
@@ -1523,7 +1873,7 @@ function TransferCrypto(props) {
1523
1873
 
1524
1874
  // src/components/deposits/BuyWithCard.tsx
1525
1875
  import { useState as useState4, useEffect as useEffect4 } from "react";
1526
- import { ChevronDown as ChevronDown3, ChevronRight as ChevronRight2 } from "lucide-react";
1876
+ import { ChevronDown as ChevronDown3, ChevronRight as ChevronRight3 } from "lucide-react";
1527
1877
 
1528
1878
  // src/components/deposits/CurrencyModal.tsx
1529
1879
  import { useState as useState3 } from "react";
@@ -1531,42 +1881,41 @@ import { Search } from "lucide-react";
1531
1881
 
1532
1882
  // src/components/currency/CurrencyListItem.tsx
1533
1883
  import { Check as Check3 } from "lucide-react";
1534
- import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1884
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1535
1885
  function CurrencyListItem({
1536
1886
  currency,
1537
1887
  isSelected,
1538
1888
  onSelect
1539
1889
  }) {
1540
- return /* @__PURE__ */ jsxs7(
1890
+ const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
1891
+ return /* @__PURE__ */ jsxs9(
1541
1892
  "button",
1542
1893
  {
1543
1894
  onClick: () => onSelect(currency.currency_code),
1544
1895
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
1545
1896
  children: [
1546
- /* @__PURE__ */ jsxs7("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
1547
- /* @__PURE__ */ jsx13("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0 uf-rounded-full uf-overflow-hidden uf-bg-card", children: /* @__PURE__ */ jsx13(
1897
+ /* @__PURE__ */ jsxs9("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
1898
+ /* @__PURE__ */ jsx14(
1548
1899
  "img",
1549
1900
  {
1550
- src: currency.icon_url,
1901
+ src: iconUrl,
1551
1902
  alt: currency.name,
1552
- width: 40,
1553
- height: 40,
1554
- className: "uf-w-full uf-h-full uf-object-cover uf-rounded-full"
1903
+ className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
1555
1904
  }
1556
- ) }),
1557
- /* @__PURE__ */ jsxs7("div", { className: "uf-text-left", children: [
1558
- /* @__PURE__ */ jsx13("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
1559
- /* @__PURE__ */ jsx13("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
1905
+ ),
1906
+ /* @__PURE__ */ jsxs9("div", { className: "uf-text-left", children: [
1907
+ /* @__PURE__ */ jsx14("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
1908
+ /* @__PURE__ */ jsx14("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
1560
1909
  ] })
1561
1910
  ] }),
1562
- isSelected && /* @__PURE__ */ jsx13(Check3, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
1911
+ isSelected && /* @__PURE__ */ jsx14(Check3, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
1563
1912
  ]
1564
1913
  }
1565
1914
  );
1566
1915
  }
1567
1916
 
1568
1917
  // src/components/currency/CurrencyListSection.tsx
1569
- import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1918
+ import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1570
1919
  function CurrencyListSection({
1571
1920
  title,
1572
1921
  currencies,
@@ -1574,9 +1923,9 @@ function CurrencyListSection({
1574
1923
  onSelect
1575
1924
  }) {
1576
1925
  if (currencies.length === 0) return null;
1577
- return /* @__PURE__ */ jsxs8(Fragment3, { children: [
1578
- /* @__PURE__ */ jsx14("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ jsx14("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
1579
- currencies.map((currency) => /* @__PURE__ */ jsx14(
1926
+ return /* @__PURE__ */ jsxs10(Fragment3, { children: [
1927
+ /* @__PURE__ */ jsx15("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ jsx15("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
1928
+ currencies.map((currency) => /* @__PURE__ */ jsx15(
1580
1929
  CurrencyListItem,
1581
1930
  {
1582
1931
  currency,
@@ -1589,7 +1938,7 @@ function CurrencyListSection({
1589
1938
  }
1590
1939
 
1591
1940
  // src/components/deposits/CurrencyModal.tsx
1592
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1941
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1593
1942
  function CurrencyModal({
1594
1943
  open,
1595
1944
  onOpenChange,
@@ -1626,8 +1975,8 @@ function CurrencyModal({
1626
1975
  onOpenChange(false);
1627
1976
  setSearchQuery("");
1628
1977
  };
1629
- return /* @__PURE__ */ jsx15(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs9(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
1630
- /* @__PURE__ */ jsx15(
1978
+ return /* @__PURE__ */ jsx16(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs11(DialogContent, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
1979
+ /* @__PURE__ */ jsx16(
1631
1980
  DepositHeader,
1632
1981
  {
1633
1982
  title: "Currency",
@@ -1636,9 +1985,9 @@ function CurrencyModal({
1636
1985
  onClose: handleClose
1637
1986
  }
1638
1987
  ),
1639
- /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsxs9("div", { className: "uf-relative", children: [
1640
- /* @__PURE__ */ jsx15(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
1641
- /* @__PURE__ */ jsx15(
1988
+ /* @__PURE__ */ jsx16("div", { children: /* @__PURE__ */ jsxs11("div", { className: "uf-relative", children: [
1989
+ /* @__PURE__ */ jsx16(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
1990
+ /* @__PURE__ */ jsx16(
1642
1991
  "input",
1643
1992
  {
1644
1993
  type: "text",
@@ -1649,8 +1998,8 @@ function CurrencyModal({
1649
1998
  }
1650
1999
  )
1651
2000
  ] }) }),
1652
- /* @__PURE__ */ jsx15("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsxs9("div", { className: "uf-space-y-2", children: [
1653
- /* @__PURE__ */ jsx15(
2001
+ /* @__PURE__ */ jsx16("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsxs11("div", { className: "uf-space-y-2", children: [
2002
+ /* @__PURE__ */ jsx16(
1654
2003
  CurrencyListSection,
1655
2004
  {
1656
2005
  title: "Popular currencies",
@@ -1659,8 +2008,8 @@ function CurrencyModal({
1659
2008
  onSelect: handleSelect
1660
2009
  }
1661
2010
  ),
1662
- filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ jsx15("div", { className: "uf-h-2" }),
1663
- /* @__PURE__ */ jsx15(
2011
+ filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ jsx16("div", { className: "uf-h-2" }),
2012
+ /* @__PURE__ */ jsx16(
1664
2013
  CurrencyListSection,
1665
2014
  {
1666
2015
  title: "All currencies",
@@ -1669,25 +2018,13 @@ function CurrencyModal({
1669
2018
  onSelect: handleSelect
1670
2019
  }
1671
2020
  ),
1672
- filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ jsx15("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
2021
+ filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ jsx16("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
1673
2022
  ] }) })
1674
2023
  ] }) });
1675
2024
  }
1676
2025
 
1677
2026
  // src/hooks/use-user-ip.ts
1678
2027
  import { useQuery } from "@tanstack/react-query";
1679
- async function getIpViaMoonpay(moonpayApiKey) {
1680
- const url = `https://api.moonpay.com/v3/ip_address?apiKey=${moonpayApiKey}`;
1681
- const response = await fetch(url);
1682
- if (!response.ok) {
1683
- throw new Error(`Moonpay IP API failed: ${response.statusText}`);
1684
- }
1685
- const data = await response.json();
1686
- return {
1687
- alpha2: data.alpha2.toLowerCase(),
1688
- state: data.state?.toLowerCase()
1689
- };
1690
- }
1691
2028
  async function getIpViaIpApi() {
1692
2029
  const url = "https://ipapi.co/json";
1693
2030
  const response = await fetch(url);
@@ -1700,7 +2037,7 @@ async function getIpViaIpApi() {
1700
2037
  state: data.region_code?.toLowerCase()
1701
2038
  };
1702
2039
  }
1703
- function useUserIp(moonpayApiKey) {
2040
+ function useUserIp() {
1704
2041
  const {
1705
2042
  data: userIpInfo,
1706
2043
  isLoading,
@@ -1708,21 +2045,12 @@ function useUserIp(moonpayApiKey) {
1708
2045
  } = useQuery({
1709
2046
  queryKey: ["getUserIpInfo"],
1710
2047
  queryFn: async () => {
1711
- if (moonpayApiKey) {
1712
- try {
1713
- const moonpayIpData = await getIpViaMoonpay(moonpayApiKey);
1714
- console.log("IP detected via Moonpay:", moonpayIpData);
1715
- return moonpayIpData;
1716
- } catch (error2) {
1717
- console.warn("Moonpay IP API failed, trying fallback:", error2);
1718
- }
1719
- }
1720
2048
  try {
1721
2049
  const ipApiData = await getIpViaIpApi();
1722
2050
  console.log("IP detected via ipapi.co:", ipApiData);
1723
2051
  return ipApiData;
1724
2052
  } catch (ipApiError) {
1725
- console.error("All IP detection methods failed:", ipApiError);
2053
+ console.error("IP detection failed:", ipApiError);
1726
2054
  throw ipApiError;
1727
2055
  }
1728
2056
  },
@@ -1744,7 +2072,7 @@ function useUserIp(moonpayApiKey) {
1744
2072
  }
1745
2073
 
1746
2074
  // src/components/deposits/BuyWithCard.tsx
1747
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
2075
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
1748
2076
  var t2 = i18n.buyWithCard;
1749
2077
  var QUICK_AMOUNTS = [100, 500, 1e3];
1750
2078
  function getCurrencySymbol(currencyCode) {
@@ -1771,7 +2099,9 @@ function BuyWithCard({
1771
2099
  destinationChainType,
1772
2100
  destinationChainId,
1773
2101
  destinationTokenAddress,
1774
- themeClass = ""
2102
+ themeClass = "",
2103
+ wallets: externalWallets,
2104
+ assetCdnUrl
1775
2105
  }) {
1776
2106
  const [amount, setAmount] = useState4("500.00");
1777
2107
  const [currency, setCurrency] = useState4("usd");
@@ -1806,8 +2136,9 @@ function BuyWithCard({
1806
2136
  const [isAutoSelected, setIsAutoSelected] = useState4(true);
1807
2137
  const [autoSelectedProvider, setAutoSelectedProvider] = useState4(null);
1808
2138
  const [hasManualSelection, setHasManualSelection] = useState4(false);
1809
- const [wallets, setWallets] = useState4([]);
1810
- const [walletsLoading, setWalletsLoading] = useState4(true);
2139
+ const [internalWallets, setInternalWallets] = useState4([]);
2140
+ const [walletsLoading, setWalletsLoading] = useState4(!externalWallets?.length);
2141
+ const wallets = externalWallets?.length ? externalWallets : internalWallets;
1811
2142
  const [countdown, setCountdown] = useState4(60);
1812
2143
  const [fiatCurrencies, setFiatCurrencies] = useState4([]);
1813
2144
  const [preferredCurrencyCodes, setPreferredCurrencyCodes] = useState4([]);
@@ -1836,7 +2167,15 @@ function BuyWithCard({
1836
2167
  fetchFiatCurrencies();
1837
2168
  }, [publishableKey]);
1838
2169
  useEffect4(() => {
1839
- async function fetchWallets() {
2170
+ if (externalWallets?.length) {
2171
+ setWalletsLoading(false);
2172
+ return;
2173
+ }
2174
+ let retryTimeout = null;
2175
+ let isCancelled = false;
2176
+ const fetchWallets = async () => {
2177
+ if (isCancelled) return;
2178
+ setWalletsLoading(true);
1840
2179
  try {
1841
2180
  const response = await createEOA(
1842
2181
  {
@@ -1848,16 +2187,26 @@ function BuyWithCard({
1848
2187
  },
1849
2188
  publishableKey
1850
2189
  );
1851
- setWallets(response.data);
2190
+ if (!isCancelled) {
2191
+ setInternalWallets(response.data);
2192
+ setWalletsLoading(false);
2193
+ }
1852
2194
  } catch (err) {
1853
- console.error("Error fetching wallets:", err);
1854
- setQuotesError("Failed to load wallet addresses");
1855
- } finally {
1856
- setWalletsLoading(false);
2195
+ console.error("Error fetching wallets, retrying in 5s:", err);
2196
+ if (!isCancelled) {
2197
+ setWalletsLoading(false);
2198
+ retryTimeout = setTimeout(fetchWallets, 5e3);
2199
+ }
1857
2200
  }
1858
- }
2201
+ };
1859
2202
  fetchWallets();
1860
- }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
2203
+ return () => {
2204
+ isCancelled = true;
2205
+ if (retryTimeout) {
2206
+ clearTimeout(retryTimeout);
2207
+ }
2208
+ };
2209
+ }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
1861
2210
  useEffect4(() => {
1862
2211
  async function fetchSupportedTokens() {
1863
2212
  try {
@@ -2024,38 +2373,36 @@ function BuyWithCard({
2024
2373
  (a, b) => b.destination_amount - a.destination_amount
2025
2374
  );
2026
2375
  const currencySymbol = getCurrencySymbol(currency);
2027
- return /* @__PURE__ */ jsxs10("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
2028
- /* @__PURE__ */ jsxs10(
2376
+ return /* @__PURE__ */ jsxs12("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
2377
+ /* @__PURE__ */ jsxs12(
2029
2378
  "div",
2030
2379
  {
2031
2380
  className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
2032
2381
  children: [
2033
- /* @__PURE__ */ jsxs10("div", { className: "uf-mb-6 uf-pt-4", children: [
2034
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsxs10(
2382
+ /* @__PURE__ */ jsxs12("div", { className: "uf-mb-6 uf-pt-4", children: [
2383
+ /* @__PURE__ */ jsx17("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsxs12(
2035
2384
  "button",
2036
2385
  {
2037
2386
  onClick: () => setShowCurrencyModal(true),
2038
2387
  disabled: currenciesLoading,
2039
2388
  className: "uf-flex uf-items-center uf-gap-1.5 uf-px-3 uf-py-1.5 uf-rounded-lg uf-bg-secondary hover:uf-bg-accent uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
2040
2389
  children: [
2041
- selectedCurrencyData && /* @__PURE__ */ jsx16("div", { className: "uf-w-4 uf-h-4 uf-rounded-full uf-overflow-hidden uf-flex uf-items-center uf-justify-center", children: /* @__PURE__ */ jsx16(
2390
+ selectedCurrencyData && /* @__PURE__ */ jsx17(
2042
2391
  "img",
2043
2392
  {
2044
- src: selectedCurrencyData.icon_url,
2393
+ src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
2045
2394
  alt: selectedCurrencyData.name,
2046
- width: 16,
2047
- height: 16,
2048
- className: "uf-w-full uf-h-full uf-object-cover uf-rounded-full"
2395
+ className: "uf-w-4 uf-h-4"
2049
2396
  }
2050
- ) }),
2051
- /* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
2052
- /* @__PURE__ */ jsx16(ChevronDown3, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
2397
+ ),
2398
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
2399
+ /* @__PURE__ */ jsx17(ChevronDown3, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
2053
2400
  ]
2054
2401
  }
2055
2402
  ) }),
2056
- /* @__PURE__ */ jsxs10("div", { className: "uf-text-center uf-mb-4", children: [
2057
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
2058
- /* @__PURE__ */ jsx16(
2403
+ /* @__PURE__ */ jsxs12("div", { className: "uf-text-center uf-mb-4", children: [
2404
+ /* @__PURE__ */ jsx17("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
2405
+ /* @__PURE__ */ jsx17(
2059
2406
  "span",
2060
2407
  {
2061
2408
  className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
@@ -2065,7 +2412,7 @@ function BuyWithCard({
2065
2412
  children: currencySymbol
2066
2413
  }
2067
2414
  ),
2068
- /* @__PURE__ */ jsx16(
2415
+ /* @__PURE__ */ jsx17(
2069
2416
  "input",
2070
2417
  {
2071
2418
  type: "text",
@@ -2081,12 +2428,12 @@ function BuyWithCard({
2081
2428
  }
2082
2429
  )
2083
2430
  ] }) }),
2084
- quotesLoading ? /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ jsx16("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ jsxs10("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
2431
+ quotesLoading ? /* @__PURE__ */ jsx17("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ jsx17("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ jsxs12("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
2085
2432
  calculateUSDC(),
2086
2433
  " USDC (Perps)"
2087
2434
  ] })
2088
2435
  ] }),
2089
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ jsxs10(
2436
+ /* @__PURE__ */ jsx17("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ jsxs12(
2090
2437
  "button",
2091
2438
  {
2092
2439
  onClick: () => handleQuickAmount(quickAmount),
@@ -2099,31 +2446,31 @@ function BuyWithCard({
2099
2446
  quickAmount
2100
2447
  )) })
2101
2448
  ] }),
2102
- /* @__PURE__ */ jsxs10("div", { className: "uf-mb-6", children: [
2103
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
2104
- /* @__PURE__ */ jsx16("span", { className: "uf-text-foreground", children: "Provider" }),
2105
- quotes.length > 0 && !quotesLoading && /* @__PURE__ */ jsxs10("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
2449
+ /* @__PURE__ */ jsxs12("div", { className: "uf-mb-6", children: [
2450
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
2451
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-foreground", children: "Provider" }),
2452
+ quotes.length > 0 && !quotesLoading && /* @__PURE__ */ jsxs12("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
2106
2453
  "Refreshing in ",
2107
2454
  countdown,
2108
2455
  "s"
2109
2456
  ] })
2110
2457
  ] }),
2111
- /* @__PURE__ */ jsx16(
2458
+ /* @__PURE__ */ jsx17(
2112
2459
  "button",
2113
2460
  {
2114
2461
  onClick: () => handleViewChange("quotes"),
2115
2462
  disabled: quotesLoading || quotes.length === 0,
2116
2463
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-4 uf-group disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
2117
- children: quotesLoading ? /* @__PURE__ */ jsxs10("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
2118
- /* @__PURE__ */ jsx16("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
2119
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2120
- /* @__PURE__ */ jsx16("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
2121
- /* @__PURE__ */ jsx16("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
2464
+ children: quotesLoading ? /* @__PURE__ */ jsxs12("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
2465
+ /* @__PURE__ */ jsx17("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
2466
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2467
+ /* @__PURE__ */ jsx17("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
2468
+ /* @__PURE__ */ jsx17("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
2122
2469
  ] })
2123
- ] }) : /* @__PURE__ */ jsxs10("div", { className: "uf-w-full uf-text-left", children: [
2124
- isAutoSelected && /* @__PURE__ */ jsx16("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
2125
- selectedProvider && /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2126
- /* @__PURE__ */ jsx16(
2470
+ ] }) : /* @__PURE__ */ jsxs12("div", { className: "uf-w-full uf-text-left", children: [
2471
+ isAutoSelected && /* @__PURE__ */ jsx17("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
2472
+ selectedProvider && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2473
+ /* @__PURE__ */ jsx17(
2127
2474
  "img",
2128
2475
  {
2129
2476
  src: selectedProvider.icon_url,
@@ -2133,22 +2480,22 @@ function BuyWithCard({
2133
2480
  className: "uf-rounded-full uf-flex-shrink-0"
2134
2481
  }
2135
2482
  ),
2136
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex-1 uf-min-w-0", children: [
2137
- /* @__PURE__ */ jsx16("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
2138
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
2139
- isAutoSelected && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
2140
- isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
2141
- selectedProvider.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
2483
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex-1 uf-min-w-0", children: [
2484
+ /* @__PURE__ */ jsx17("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
2485
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
2486
+ isAutoSelected && /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
2487
+ isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
2488
+ selectedProvider.low_kyc === false && /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
2142
2489
  ] })
2143
2490
  ] }),
2144
- quotes.length > 0 && /* @__PURE__ */ jsx16(ChevronRight2, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
2491
+ quotes.length > 0 && /* @__PURE__ */ jsx17(ChevronRight3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
2145
2492
  ] })
2146
2493
  ] })
2147
2494
  }
2148
2495
  ),
2149
- quotesError && /* @__PURE__ */ jsx16("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
2496
+ quotesError && /* @__PURE__ */ jsx17("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
2150
2497
  ] }),
2151
- /* @__PURE__ */ jsx16(
2498
+ /* @__PURE__ */ jsx17(
2152
2499
  "button",
2153
2500
  {
2154
2501
  onClick: handleContinue,
@@ -2163,15 +2510,15 @@ function BuyWithCard({
2163
2510
  ]
2164
2511
  }
2165
2512
  ),
2166
- /* @__PURE__ */ jsx16(
2513
+ /* @__PURE__ */ jsx17(
2167
2514
  "div",
2168
2515
  {
2169
2516
  className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
2170
- children: /* @__PURE__ */ jsx16("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index) => {
2517
+ children: /* @__PURE__ */ jsx17("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index) => {
2171
2518
  const badges = getProviderBadges(quote, sortedQuotes);
2172
2519
  const displayName = quote.service_provider_display_name;
2173
2520
  const isSelected = selectedProvider?.service_provider === quote.service_provider;
2174
- return /* @__PURE__ */ jsxs10(
2521
+ return /* @__PURE__ */ jsxs12(
2175
2522
  "button",
2176
2523
  {
2177
2524
  onClick: () => {
@@ -2184,8 +2531,8 @@ function BuyWithCard({
2184
2531
  },
2185
2532
  className: `uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group ${isSelected ? "uf-ring-2 uf-ring-inset uf-ring-primary" : ""}`,
2186
2533
  children: [
2187
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2188
- /* @__PURE__ */ jsx16("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ jsx16(
2534
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2535
+ /* @__PURE__ */ jsx17("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ jsx17(
2189
2536
  "img",
2190
2537
  {
2191
2538
  src: quote.icon_url,
@@ -2195,10 +2542,10 @@ function BuyWithCard({
2195
2542
  className: "uf-rounded-full"
2196
2543
  }
2197
2544
  ) }),
2198
- /* @__PURE__ */ jsxs10("div", { className: "uf-text-left", children: [
2199
- /* @__PURE__ */ jsx16("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
2200
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
2201
- badges.map((badge, i) => /* @__PURE__ */ jsxs10(
2545
+ /* @__PURE__ */ jsxs12("div", { className: "uf-text-left", children: [
2546
+ /* @__PURE__ */ jsx17("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
2547
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
2548
+ badges.map((badge, i) => /* @__PURE__ */ jsxs12(
2202
2549
  "span",
2203
2550
  {
2204
2551
  className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
@@ -2209,17 +2556,17 @@ function BuyWithCard({
2209
2556
  },
2210
2557
  i
2211
2558
  )),
2212
- quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
2213
- quote.low_kyc === false && /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
2559
+ quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
2560
+ quote.low_kyc === false && /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
2214
2561
  ] })
2215
2562
  ] })
2216
2563
  ] }),
2217
- /* @__PURE__ */ jsxs10("div", { className: "uf-text-right", children: [
2218
- /* @__PURE__ */ jsxs10("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
2564
+ /* @__PURE__ */ jsxs12("div", { className: "uf-text-right", children: [
2565
+ /* @__PURE__ */ jsxs12("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
2219
2566
  quote.destination_amount.toFixed(2),
2220
2567
  " USDC"
2221
2568
  ] }),
2222
- /* @__PURE__ */ jsxs10("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
2569
+ /* @__PURE__ */ jsxs12("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
2223
2570
  currencySymbol,
2224
2571
  " ",
2225
2572
  amount
@@ -2232,12 +2579,12 @@ function BuyWithCard({
2232
2579
  }) })
2233
2580
  }
2234
2581
  ),
2235
- /* @__PURE__ */ jsx16(
2582
+ /* @__PURE__ */ jsx17(
2236
2583
  "div",
2237
2584
  {
2238
2585
  className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
2239
- children: onrampSession && /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
2240
- /* @__PURE__ */ jsx16("div", { className: "uf-mb-6", children: /* @__PURE__ */ jsx16(
2586
+ children: onrampSession && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
2587
+ /* @__PURE__ */ jsx17("div", { className: "uf-mb-6", children: /* @__PURE__ */ jsx17(
2241
2588
  "img",
2242
2589
  {
2243
2590
  src: onrampSession.provider.icon_url,
@@ -2247,88 +2594,79 @@ function BuyWithCard({
2247
2594
  className: "uf-rounded-2xl"
2248
2595
  }
2249
2596
  ) }),
2250
- /* @__PURE__ */ jsx16("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
2597
+ /* @__PURE__ */ jsx17("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
2251
2598
  "{{provider}}",
2252
2599
  onrampSession.provider.service_provider_display_name
2253
2600
  ) }),
2254
- /* @__PURE__ */ jsx16("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
2255
- /* @__PURE__ */ jsx16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ jsxs10("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2256
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex-1 uf-flex uf-flex-col uf-items-center", children: [
2257
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-items-center uf-gap-2 uf-mb-1", children: /* @__PURE__ */ jsx16(
2601
+ /* @__PURE__ */ jsx17("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
2602
+ /* @__PURE__ */ jsx17("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
2603
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
2604
+ /* @__PURE__ */ jsx17("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsx17(
2258
2605
  "img",
2259
2606
  {
2260
- src: getIconUrl(
2261
- `/icons/currencies/${onrampSession.sourceCurrency.toLowerCase()}.svg`
2607
+ src: getIconUrlWithCdn(
2608
+ `/icons/currencies/svg/${onrampSession.sourceCurrency.toLowerCase()}.svg`,
2609
+ assetCdnUrl
2262
2610
  ),
2263
2611
  alt: onrampSession.sourceCurrency.toUpperCase(),
2264
- width: 28,
2265
- height: 28,
2266
- className: "uf-rounded-full"
2612
+ className: "uf-w-7 uf-h-7 uf-rounded-full"
2267
2613
  }
2268
2614
  ) }),
2269
- /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: t2.onramp.youUse }),
2270
- /* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: onrampSession.sourceCurrency.toUpperCase() })
2615
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
2616
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
2271
2617
  ] }),
2272
- /* @__PURE__ */ jsx16("div", { className: "uf-text-muted-foreground uf-flex-shrink-0", children: /* @__PURE__ */ jsx16(ChevronRight2, { className: "uf-w-5 uf-h-5" }) }),
2273
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex-1 uf-flex uf-flex-col uf-items-center", children: [
2274
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-items-center uf-gap-2 uf-mb-1", children: /* @__PURE__ */ jsxs10("div", { className: "uf-relative", children: [
2275
- /* @__PURE__ */ jsx16(
2618
+ /* @__PURE__ */ jsx17("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx17(ChevronRight3, { className: "uf-w-4 uf-h-4" }) }),
2619
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
2620
+ /* @__PURE__ */ jsx17("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
2621
+ /* @__PURE__ */ jsx17(
2276
2622
  "img",
2277
2623
  {
2278
- src: getIconUrl("/icons/tokens/usdc.svg"),
2624
+ src: getIconUrlWithCdn("/icons/tokens/svg/usdc.svg", assetCdnUrl),
2279
2625
  alt: "USDC",
2280
- width: 28,
2281
- height: 28,
2282
- className: "uf-rounded-full"
2626
+ className: "uf-w-7 uf-h-7 uf-rounded-full"
2283
2627
  }
2284
2628
  ),
2285
- /* @__PURE__ */ jsx16(
2629
+ /* @__PURE__ */ jsx17(
2286
2630
  "img",
2287
2631
  {
2288
- src: getIconUrl("/icons/networks/polygon.svg"),
2632
+ src: getIconUrlWithCdn("/icons/networks/svg/polygon.svg", assetCdnUrl),
2289
2633
  alt: "Polygon",
2290
- width: 14,
2291
- height: 14,
2292
- className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-rounded-full"
2634
+ className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
2293
2635
  }
2294
2636
  )
2295
2637
  ] }) }),
2296
- /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: t2.onramp.youBuy }),
2297
- /* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: "USDC" })
2638
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
2639
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
2298
2640
  ] }),
2299
- /* @__PURE__ */ jsx16("div", { className: "uf-text-muted-foreground uf-flex-shrink-0", children: /* @__PURE__ */ jsx16(ChevronRight2, { className: "uf-w-5 uf-h-5" }) }),
2300
- /* @__PURE__ */ jsxs10("div", { className: "uf-flex-1 uf-flex uf-flex-col uf-items-center", children: [
2301
- /* @__PURE__ */ jsx16("div", { className: "uf-flex uf-items-center uf-gap-2 uf-mb-1", children: /* @__PURE__ */ jsxs10("div", { className: "uf-relative", children: [
2302
- /* @__PURE__ */ jsx16(
2641
+ /* @__PURE__ */ jsx17("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx17(ChevronRight3, { className: "uf-w-4 uf-h-4" }) }),
2642
+ /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
2643
+ /* @__PURE__ */ jsx17("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
2644
+ /* @__PURE__ */ jsx17(
2303
2645
  "img",
2304
2646
  {
2305
- src: destinationToken?.icon_url || getIconUrl("/icons/tokens/usdc.svg"),
2647
+ src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/svg/usdc.svg", assetCdnUrl),
2306
2648
  alt: displayTokenSymbol,
2307
- width: 28,
2308
- height: 28,
2309
- className: "uf-rounded-full"
2649
+ className: "uf-w-7 uf-h-7 uf-rounded-full"
2310
2650
  }
2311
2651
  ),
2312
- destinationChain?.icon_url && /* @__PURE__ */ jsx16(
2652
+ destinationChain?.icon_url && /* @__PURE__ */ jsx17(
2313
2653
  "img",
2314
2654
  {
2315
2655
  src: destinationChain.icon_url,
2316
2656
  alt: destinationChain.chain_name,
2317
- width: 14,
2318
- height: 14,
2319
- className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-rounded-full"
2657
+ className: "uf-w-3.5 uf-h-3.5 uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-rounded-full"
2320
2658
  }
2321
2659
  )
2322
2660
  ] }) }),
2323
- /* @__PURE__ */ jsx16("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: t2.onramp.youReceive }),
2324
- /* @__PURE__ */ jsx16("span", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayTokenSymbol })
2661
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
2662
+ /* @__PURE__ */ jsx17("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
2325
2663
  ] })
2326
2664
  ] }) }),
2327
- /* @__PURE__ */ jsx16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ jsx16("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
2665
+ /* @__PURE__ */ jsx17("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ jsx17("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
2328
2666
  ] })
2329
2667
  }
2330
2668
  ),
2331
- /* @__PURE__ */ jsx16(
2669
+ /* @__PURE__ */ jsx17(
2332
2670
  CurrencyModal,
2333
2671
  {
2334
2672
  open: showCurrencyModal,
@@ -2346,110 +2684,44 @@ function BuyWithCard({
2346
2684
  }
2347
2685
 
2348
2686
  // src/components/deposits/buttons/TransferCryptoButton.tsx
2349
- import { Zap, ChevronRight as ChevronRight3 } from "lucide-react";
2350
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
2687
+ import { Zap, ChevronRight as ChevronRight4 } from "lucide-react";
2688
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
2351
2689
  function TransferCryptoButton({
2352
2690
  onClick,
2353
2691
  title,
2354
- subtitle
2692
+ subtitle,
2693
+ featuredTokens
2355
2694
  }) {
2356
- return /* @__PURE__ */ jsxs11(
2695
+ const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
2696
+ return /* @__PURE__ */ jsxs13(
2357
2697
  "button",
2358
2698
  {
2359
2699
  onClick,
2360
2700
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
2361
2701
  children: [
2362
- /* @__PURE__ */ jsxs11("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2363
- /* @__PURE__ */ jsx17("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx17(Zap, { className: "uf-w-5 uf-h-5" }) }),
2364
- /* @__PURE__ */ jsxs11("div", { className: "uf-text-left", children: [
2365
- /* @__PURE__ */ jsx17("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2366
- /* @__PURE__ */ jsx17("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2702
+ /* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2703
+ /* @__PURE__ */ jsx18("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx18(Zap, { className: "uf-w-5 uf-h-5" }) }),
2704
+ /* @__PURE__ */ jsxs13("div", { className: "uf-text-left", children: [
2705
+ /* @__PURE__ */ jsx18("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2706
+ /* @__PURE__ */ jsx18("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2367
2707
  ] })
2368
2708
  ] }),
2369
- /* @__PURE__ */ jsxs11("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2370
- /* @__PURE__ */ jsxs11("div", { className: "uf-flex uf--space-x-1", children: [
2371
- /* @__PURE__ */ jsx17(
2372
- "img",
2373
- {
2374
- src: getIconUrl("/icons/networks/ethereum.svg"),
2375
- alt: "ETH",
2376
- width: 20,
2377
- height: 20,
2378
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2379
- }
2380
- ),
2381
- /* @__PURE__ */ jsx17(
2382
- "img",
2383
- {
2384
- src: getIconUrl("/icons/networks/optimism.svg"),
2385
- alt: "OP",
2386
- width: 20,
2387
- height: 20,
2388
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2389
- }
2390
- ),
2391
- /* @__PURE__ */ jsx17(
2392
- "img",
2393
- {
2394
- src: getIconUrl("/icons/networks/polygon.svg"),
2395
- alt: "MATIC",
2396
- width: 20,
2397
- height: 20,
2398
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2399
- }
2400
- ),
2401
- /* @__PURE__ */ jsx17(
2402
- "img",
2403
- {
2404
- src: getIconUrl("/icons/networks/arbitrum.svg"),
2405
- alt: "ARB",
2406
- width: 20,
2407
- height: 20,
2408
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2409
- }
2410
- ),
2411
- /* @__PURE__ */ jsx17(
2412
- "img",
2413
- {
2414
- src: getIconUrl("/icons/tokens/usdc.svg"),
2415
- alt: "USDC",
2416
- width: 20,
2417
- height: 20,
2418
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2419
- }
2420
- ),
2421
- /* @__PURE__ */ jsx17(
2422
- "img",
2423
- {
2424
- src: getIconUrl("/icons/networks/solana.svg"),
2425
- alt: "SOL",
2426
- width: 20,
2427
- height: 20,
2428
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2429
- }
2430
- ),
2431
- /* @__PURE__ */ jsx17(
2432
- "img",
2433
- {
2434
- src: getIconUrl("/icons/tokens/avax.svg"),
2435
- alt: "AVAX",
2436
- width: 20,
2437
- height: 20,
2438
- className: "uf-rounded-full uf-border-2 uf-border-secondary"
2439
- }
2440
- ),
2441
- /* @__PURE__ */ jsx17(
2709
+ /* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2710
+ /* @__PURE__ */ jsx18("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
2711
+ const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
2712
+ return /* @__PURE__ */ jsx18(
2442
2713
  "img",
2443
2714
  {
2444
- src: getIconUrl("/icons/networks/bitcoin.svg"),
2445
- alt: "BTC",
2715
+ src: iconUrl,
2716
+ alt: token.name,
2446
2717
  width: 20,
2447
2718
  height: 20,
2448
2719
  className: "uf-rounded-full uf-border-2 uf-border-secondary"
2449
- }
2450
- )
2451
- ] }),
2452
- /* @__PURE__ */ jsx17(ChevronRight3, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2720
+ },
2721
+ token.name
2722
+ );
2723
+ }) }),
2724
+ /* @__PURE__ */ jsx18(ChevronRight4, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2453
2725
  ] })
2454
2726
  ]
2455
2727
  }
@@ -2457,50 +2729,43 @@ function TransferCryptoButton({
2457
2729
  }
2458
2730
 
2459
2731
  // src/components/deposits/buttons/DepositWithCardButton.tsx
2460
- import { CreditCard, ChevronRight as ChevronRight4 } from "lucide-react";
2461
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
2732
+ import { CreditCard, ChevronRight as ChevronRight5 } from "lucide-react";
2733
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
2462
2734
  function DepositWithCardButton({
2463
2735
  onClick,
2464
2736
  title,
2465
- subtitle
2737
+ subtitle,
2738
+ paymentNetworks
2466
2739
  }) {
2467
- return /* @__PURE__ */ jsxs12(
2740
+ return /* @__PURE__ */ jsxs14(
2468
2741
  "button",
2469
2742
  {
2470
2743
  onClick,
2471
2744
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
2472
2745
  children: [
2473
- /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2474
- /* @__PURE__ */ jsx18("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx18(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
2475
- /* @__PURE__ */ jsxs12("div", { className: "uf-text-left", children: [
2476
- /* @__PURE__ */ jsx18("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2477
- /* @__PURE__ */ jsx18("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2746
+ /* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2747
+ /* @__PURE__ */ jsx19("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx19(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
2748
+ /* @__PURE__ */ jsxs14("div", { className: "uf-text-left", children: [
2749
+ /* @__PURE__ */ jsx19("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2750
+ /* @__PURE__ */ jsx19("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2478
2751
  ] })
2479
2752
  ] }),
2480
- /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2481
- /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: [
2482
- /* @__PURE__ */ jsx18(
2753
+ /* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2754
+ /* @__PURE__ */ jsx19("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
2755
+ const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
2756
+ return /* @__PURE__ */ jsx19(
2483
2757
  "img",
2484
2758
  {
2485
- src: getIconUrl("/icons/networks/mastercard.svg"),
2486
- alt: "Mastercard",
2759
+ src: iconUrl,
2760
+ alt: network.name,
2487
2761
  width: 32,
2488
2762
  height: 32,
2489
2763
  className: "uf-rounded"
2490
- }
2491
- ),
2492
- /* @__PURE__ */ jsx18(
2493
- "img",
2494
- {
2495
- src: getIconUrl("/icons/networks/visa.svg"),
2496
- alt: "Visa",
2497
- width: 32,
2498
- height: 32,
2499
- className: "uf-rounded"
2500
- }
2501
- )
2502
- ] }),
2503
- /* @__PURE__ */ jsx18(ChevronRight4, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2764
+ },
2765
+ network.name
2766
+ );
2767
+ }) }),
2768
+ /* @__PURE__ */ jsx19(ChevronRight5, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2504
2769
  ] })
2505
2770
  ]
2506
2771
  }
@@ -2508,38 +2773,53 @@ function DepositWithCardButton({
2508
2773
  }
2509
2774
 
2510
2775
  // src/components/deposits/buttons/DepositTrackerButton.tsx
2511
- import { Clock as Clock2, ChevronRight as ChevronRight5 } from "lucide-react";
2512
- import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
2776
+ import { Clock as Clock2, ChevronRight as ChevronRight6 } from "lucide-react";
2777
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
2513
2778
  function DepositTrackerButton({
2514
2779
  onClick,
2515
2780
  title,
2516
2781
  subtitle,
2517
2782
  badge
2518
2783
  }) {
2519
- return /* @__PURE__ */ jsxs13(
2784
+ return /* @__PURE__ */ jsxs15(
2520
2785
  "button",
2521
2786
  {
2522
2787
  onClick,
2523
2788
  className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
2524
2789
  children: [
2525
- /* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2526
- /* @__PURE__ */ jsxs13("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
2527
- /* @__PURE__ */ jsx19(Clock2, { className: "uf-w-5 uf-h-5" }),
2528
- badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx19("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
2790
+ /* @__PURE__ */ jsxs15("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2791
+ /* @__PURE__ */ jsxs15("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
2792
+ /* @__PURE__ */ jsx20(Clock2, { className: "uf-w-5 uf-h-5" }),
2793
+ badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx20("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
2529
2794
  ] }),
2530
- /* @__PURE__ */ jsxs13("div", { className: "uf-text-left", children: [
2531
- /* @__PURE__ */ jsx19("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2532
- /* @__PURE__ */ jsx19("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2795
+ /* @__PURE__ */ jsxs15("div", { className: "uf-text-left", children: [
2796
+ /* @__PURE__ */ jsx20("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
2797
+ /* @__PURE__ */ jsx20("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
2533
2798
  ] })
2534
2799
  ] }),
2535
- /* @__PURE__ */ jsx19(ChevronRight5, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2800
+ /* @__PURE__ */ jsx20(ChevronRight6, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
2536
2801
  ]
2537
2802
  }
2538
2803
  );
2539
2804
  }
2540
2805
 
2541
2806
  // src/components/deposits/DepositModal.tsx
2542
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
2807
+ import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
2808
+ function SkeletonButton({ variant = "default" }) {
2809
+ return /* @__PURE__ */ jsxs16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
2810
+ /* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
2811
+ /* @__PURE__ */ jsx21("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
2812
+ /* @__PURE__ */ jsxs16("div", { className: "uf-space-y-1.5", children: [
2813
+ /* @__PURE__ */ jsx21("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
2814
+ /* @__PURE__ */ jsx21("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
2815
+ ] })
2816
+ ] }),
2817
+ /* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
2818
+ variant === "with-icons" && /* @__PURE__ */ jsx21("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx21("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
2819
+ /* @__PURE__ */ jsx21(ChevronRight7, { className: "uf-w-4 uf-h-4 uf-text-muted" })
2820
+ ] })
2821
+ ] });
2822
+ }
2543
2823
  var t3 = i18n.depositModal;
2544
2824
  function DepositModal({
2545
2825
  open,
@@ -2564,6 +2844,15 @@ function DepositModal({
2564
2844
  const [quotesCount, setQuotesCount] = useState5(0);
2565
2845
  const [depositsModalOpen, setDepositsModalOpen] = useState5(false);
2566
2846
  const [depositExecutions, setDepositExecutions] = useState5([]);
2847
+ const [projectConfig, setProjectConfig] = useState5(null);
2848
+ const [wallets, setWallets] = useState5([]);
2849
+ const [walletsLoading, setWalletsLoading] = useState5(false);
2850
+ useEffect5(() => {
2851
+ setProjectConfig(null);
2852
+ }, [publishableKey]);
2853
+ useEffect5(() => {
2854
+ setWallets([]);
2855
+ }, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
2567
2856
  const [resolvedTheme, setResolvedTheme] = useState5(theme === "auto" ? "dark" : theme);
2568
2857
  useEffect5(() => {
2569
2858
  if (theme === "auto") {
@@ -2578,6 +2867,49 @@ function DepositModal({
2578
2867
  setResolvedTheme(theme);
2579
2868
  }
2580
2869
  }, [theme]);
2870
+ useEffect5(() => {
2871
+ if (open && !projectConfig) {
2872
+ getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
2873
+ }
2874
+ }, [open, publishableKey, projectConfig]);
2875
+ useEffect5(() => {
2876
+ if (!open || wallets.length > 0) return;
2877
+ let retryTimeout = null;
2878
+ let isCancelled = false;
2879
+ const fetchWallets = async () => {
2880
+ if (isCancelled) return;
2881
+ setWalletsLoading(true);
2882
+ try {
2883
+ const response = await createEOA(
2884
+ {
2885
+ user_id: userId,
2886
+ recipient_address: recipientAddress,
2887
+ destination_chain_type: destinationChainType,
2888
+ destination_chain_id: destinationChainId,
2889
+ destination_token_address: destinationTokenAddress
2890
+ },
2891
+ publishableKey
2892
+ );
2893
+ if (!isCancelled) {
2894
+ setWallets(response.data);
2895
+ setWalletsLoading(false);
2896
+ }
2897
+ } catch (error) {
2898
+ console.error("Error fetching wallets, retrying in 5s:", error);
2899
+ if (!isCancelled) {
2900
+ setWalletsLoading(false);
2901
+ retryTimeout = setTimeout(fetchWallets, 5e3);
2902
+ }
2903
+ }
2904
+ };
2905
+ fetchWallets();
2906
+ return () => {
2907
+ isCancelled = true;
2908
+ if (retryTimeout) {
2909
+ clearTimeout(retryTimeout);
2910
+ }
2911
+ };
2912
+ }, [open, userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, wallets.length]);
2581
2913
  const themeClass = resolvedTheme === "dark" ? "uf-dark" : "";
2582
2914
  const handleClose = () => {
2583
2915
  onOpenChange(false);
@@ -2602,39 +2934,45 @@ function DepositModal({
2602
2934
  setQuotesCount(count);
2603
2935
  }
2604
2936
  };
2605
- return /* @__PURE__ */ jsx20(ThemeProvider, { themeClass, children: /* @__PURE__ */ jsxs14(Dialog, { open, onOpenChange: handleClose, children: [
2606
- /* @__PURE__ */ jsx20(
2937
+ return /* @__PURE__ */ jsx21(ThemeProvider, { themeClass, children: /* @__PURE__ */ jsxs16(Dialog, { open, onOpenChange: handleClose, children: [
2938
+ /* @__PURE__ */ jsx21(
2607
2939
  DialogContent,
2608
2940
  {
2609
2941
  className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${themeClass}`,
2610
2942
  onPointerDownOutside: (e) => e.preventDefault(),
2611
2943
  onInteractOutside: (e) => e.preventDefault(),
2612
- children: view === "main" ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
2613
- /* @__PURE__ */ jsx20(
2944
+ children: view === "main" ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
2945
+ /* @__PURE__ */ jsx21(
2614
2946
  DepositHeader,
2615
2947
  {
2616
2948
  title: modalTitle || "Deposit",
2617
2949
  onClose: handleClose
2618
2950
  }
2619
2951
  ),
2620
- /* @__PURE__ */ jsxs14("div", { className: "uf-pb-4 uf-space-y-3", children: [
2621
- /* @__PURE__ */ jsx20(
2952
+ /* @__PURE__ */ jsx21("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
2953
+ /* @__PURE__ */ jsx21(SkeletonButton, { variant: "with-icons" }),
2954
+ /* @__PURE__ */ jsx21(SkeletonButton, { variant: "with-icons" }),
2955
+ !hideDepositTracker && /* @__PURE__ */ jsx21(SkeletonButton, {})
2956
+ ] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
2957
+ /* @__PURE__ */ jsx21(
2622
2958
  TransferCryptoButton,
2623
2959
  {
2624
2960
  onClick: () => setView("transfer"),
2625
2961
  title: t3.transferCrypto.title,
2626
- subtitle: t3.transferCrypto.subtitle
2962
+ subtitle: t3.transferCrypto.subtitle,
2963
+ featuredTokens: projectConfig.transfer_crypto.networks
2627
2964
  }
2628
2965
  ),
2629
- /* @__PURE__ */ jsx20(
2966
+ /* @__PURE__ */ jsx21(
2630
2967
  DepositWithCardButton,
2631
2968
  {
2632
2969
  onClick: () => setView("card"),
2633
2970
  title: t3.depositWithCard.title,
2634
- subtitle: t3.depositWithCard.subtitle
2971
+ subtitle: t3.depositWithCard.subtitle,
2972
+ paymentNetworks: projectConfig.payment_networks.networks
2635
2973
  }
2636
2974
  ),
2637
- !hideDepositTracker && /* @__PURE__ */ jsx20(
2975
+ !hideDepositTracker && /* @__PURE__ */ jsx21(
2638
2976
  DepositTrackerButton,
2639
2977
  {
2640
2978
  onClick: () => setDepositsModalOpen(true),
@@ -2643,9 +2981,9 @@ function DepositModal({
2643
2981
  badge: depositExecutions.length > 0 ? depositExecutions.length : void 0
2644
2982
  }
2645
2983
  )
2646
- ] })
2647
- ] }) : view === "transfer" ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
2648
- /* @__PURE__ */ jsx20(
2984
+ ] }) })
2985
+ ] }) : view === "transfer" ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
2986
+ /* @__PURE__ */ jsx21(
2649
2987
  DepositHeader,
2650
2988
  {
2651
2989
  title: t3.transferCrypto.title,
@@ -2654,7 +2992,7 @@ function DepositModal({
2654
2992
  onClose: handleClose
2655
2993
  }
2656
2994
  ),
2657
- /* @__PURE__ */ jsx20(
2995
+ /* @__PURE__ */ jsx21(
2658
2996
  TransferCrypto,
2659
2997
  {
2660
2998
  userId,
@@ -2665,11 +3003,12 @@ function DepositModal({
2665
3003
  destinationTokenAddress,
2666
3004
  onExecutionsChange: setDepositExecutions,
2667
3005
  onDepositSuccess,
2668
- onDepositError
3006
+ onDepositError,
3007
+ wallets
2669
3008
  }
2670
3009
  )
2671
- ] }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
2672
- /* @__PURE__ */ jsx20(
3010
+ ] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
3011
+ /* @__PURE__ */ jsx21(
2673
3012
  DepositHeader,
2674
3013
  {
2675
3014
  title: cardView === "quotes" ? t3.quotes : modalTitle || "Deposit",
@@ -2679,7 +3018,7 @@ function DepositModal({
2679
3018
  badge: cardView === "quotes" ? { count: quotesCount } : void 0
2680
3019
  }
2681
3020
  ),
2682
- /* @__PURE__ */ jsx20(
3021
+ /* @__PURE__ */ jsx21(
2683
3022
  BuyWithCard,
2684
3023
  {
2685
3024
  userId,
@@ -2693,13 +3032,15 @@ function DepositModal({
2693
3032
  destinationTokenAddress,
2694
3033
  onDepositSuccess,
2695
3034
  onDepositError,
2696
- themeClass
3035
+ themeClass,
3036
+ wallets,
3037
+ assetCdnUrl: projectConfig?.asset_cdn_url
2697
3038
  }
2698
3039
  )
2699
3040
  ] })
2700
3041
  }
2701
3042
  ),
2702
- /* @__PURE__ */ jsx20(
3043
+ /* @__PURE__ */ jsx21(
2703
3044
  DepositsModal,
2704
3045
  {
2705
3046
  open: depositsModalOpen,
@@ -2714,9 +3055,9 @@ function DepositModal({
2714
3055
  }
2715
3056
 
2716
3057
  // src/components/deposits/TransferCrypto2.tsx
2717
- import { jsx as jsx21 } from "react/jsx-runtime";
3058
+ import { jsx as jsx22 } from "react/jsx-runtime";
2718
3059
  function TransferCrypto2(props) {
2719
- return /* @__PURE__ */ jsx21(
3060
+ return /* @__PURE__ */ jsx22(
2720
3061
  TransferCryptoBase,
2721
3062
  {
2722
3063
  ...props,
@@ -2731,6 +3072,7 @@ export {
2731
3072
  CurrencyListItem,
2732
3073
  CurrencyListSection,
2733
3074
  CurrencyModal,
3075
+ DepositDetailModal,
2734
3076
  DepositExecutionItem,
2735
3077
  DepositHeader,
2736
3078
  DepositModal,
@@ -2777,6 +3119,7 @@ export {
2777
3119
  getApiBaseUrl,
2778
3120
  getFiatCurrencies,
2779
3121
  getIconUrl,
3122
+ getIconUrlWithCdn,
2780
3123
  getMeldQuotes,
2781
3124
  getSupportedDepositTokens,
2782
3125
  getWalletByChainType,