@rash2x/bridge-widget 0.1.8 → 0.1.10
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/evaa-bridge.cjs +197 -287
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +197 -288
- package/dist/evaa-bridge.mjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/styles.css +11 -13
- package/package.json +1 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -32,8 +32,8 @@ const reactSlot = require("@radix-ui/react-slot");
|
|
|
32
32
|
const classVarianceAuthority = require("class-variance-authority");
|
|
33
33
|
const clsx = require("clsx");
|
|
34
34
|
const tailwindMerge = require("tailwind-merge");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const DialogPrimitive = require("@radix-ui/react-dialog");
|
|
36
|
+
const lucideReact = require("lucide-react");
|
|
37
37
|
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
38
38
|
const wagmi = require("wagmi");
|
|
39
39
|
const tronwalletAdapterReactHooks = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
@@ -42,7 +42,7 @@ const reactQuery = require("@tanstack/react-query");
|
|
|
42
42
|
const core = require("@ton/core");
|
|
43
43
|
const reactWindow = require("react-window");
|
|
44
44
|
const SwitchPrimitive = require("@radix-ui/react-switch");
|
|
45
|
-
const
|
|
45
|
+
const framerMotion = require("framer-motion");
|
|
46
46
|
const AccordionPrimitive = require("@radix-ui/react-accordion");
|
|
47
47
|
const i18next = require("i18next");
|
|
48
48
|
const sonner = require("sonner");
|
|
@@ -67,6 +67,7 @@ function _interopNamespaceDefault(e) {
|
|
|
67
67
|
return Object.freeze(n);
|
|
68
68
|
}
|
|
69
69
|
const require$$0__namespace = /* @__PURE__ */ _interopNamespaceDefault(require$$0);
|
|
70
|
+
const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
|
|
70
71
|
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
71
72
|
const SwitchPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SwitchPrimitive);
|
|
72
73
|
const AccordionPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AccordionPrimitive);
|
|
@@ -309,32 +310,6 @@ const ArrowSwapIcon = (props) => {
|
|
|
309
310
|
}
|
|
310
311
|
);
|
|
311
312
|
};
|
|
312
|
-
const CloseIcon = (props) => {
|
|
313
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
314
|
-
"svg",
|
|
315
|
-
{
|
|
316
|
-
width: "24",
|
|
317
|
-
height: "24",
|
|
318
|
-
viewBox: "0 0 24 24",
|
|
319
|
-
fill: "none",
|
|
320
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
321
|
-
...props,
|
|
322
|
-
children: [
|
|
323
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "24", height: "24", rx: "12", fill: "black", fillOpacity: "0.8" }),
|
|
324
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
325
|
-
"path",
|
|
326
|
-
{
|
|
327
|
-
d: "M16 8.00005L8 16M16 16L8 8",
|
|
328
|
-
stroke: "white",
|
|
329
|
-
strokeWidth: "1.5",
|
|
330
|
-
strokeLinecap: "round",
|
|
331
|
-
strokeLinejoin: "round"
|
|
332
|
-
}
|
|
333
|
-
)
|
|
334
|
-
]
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
};
|
|
338
313
|
const SearchIcon = (props) => {
|
|
339
314
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
340
315
|
"svg",
|
|
@@ -592,142 +567,103 @@ const Button = require$$0__namespace.forwardRef(
|
|
|
592
567
|
}
|
|
593
568
|
);
|
|
594
569
|
Button.displayName = "Button";
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
return document.getElementById(containerId) || document.body;
|
|
611
|
-
};
|
|
612
|
-
const ModalContent = ({ children, className }) => {
|
|
613
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-5 flex flex-col h-full", className), children });
|
|
614
|
-
};
|
|
615
|
-
const ModalHeader = ({ children, className }) => {
|
|
616
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
617
|
-
"div",
|
|
618
|
-
{
|
|
619
|
-
className: cn("relative flex gap-4 flex-col justify-between", className),
|
|
620
|
-
children
|
|
621
|
-
}
|
|
622
|
-
);
|
|
623
|
-
};
|
|
624
|
-
const ModalTitle = ({ children, className }) => {
|
|
570
|
+
function Dialog({
|
|
571
|
+
...props
|
|
572
|
+
}) {
|
|
573
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
|
|
574
|
+
}
|
|
575
|
+
function DialogPortal({
|
|
576
|
+
...props
|
|
577
|
+
}) {
|
|
578
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
579
|
+
}
|
|
580
|
+
function DialogOverlay({
|
|
581
|
+
className,
|
|
582
|
+
...props
|
|
583
|
+
}) {
|
|
625
584
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
626
|
-
|
|
585
|
+
DialogPrimitive__namespace.Overlay,
|
|
627
586
|
{
|
|
587
|
+
"data-slot": "dialog-overlay",
|
|
628
588
|
className: cn(
|
|
629
|
-
"
|
|
589
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
630
590
|
className
|
|
631
591
|
),
|
|
632
|
-
|
|
592
|
+
...props
|
|
633
593
|
}
|
|
634
594
|
);
|
|
635
|
-
}
|
|
636
|
-
|
|
595
|
+
}
|
|
596
|
+
function DialogContent({
|
|
597
|
+
className,
|
|
598
|
+
children,
|
|
599
|
+
showCloseButton = true,
|
|
600
|
+
...props
|
|
601
|
+
}) {
|
|
602
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
603
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
604
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
605
|
+
DialogPrimitive__namespace.Content,
|
|
606
|
+
{
|
|
607
|
+
"data-slot": "dialog-content",
|
|
608
|
+
className: cn(
|
|
609
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
610
|
+
className
|
|
611
|
+
),
|
|
612
|
+
...props,
|
|
613
|
+
children: [
|
|
614
|
+
children,
|
|
615
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
616
|
+
DialogPrimitive__namespace.Close,
|
|
617
|
+
{
|
|
618
|
+
"data-slot": "dialog-close",
|
|
619
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
620
|
+
children: [
|
|
621
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
|
|
622
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
]
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
] });
|
|
630
|
+
}
|
|
631
|
+
function DialogHeader({ className, ...props }) {
|
|
637
632
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
638
|
-
"
|
|
633
|
+
"div",
|
|
639
634
|
{
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
),
|
|
644
|
-
children
|
|
635
|
+
"data-slot": "dialog-header",
|
|
636
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
637
|
+
...props
|
|
645
638
|
}
|
|
646
639
|
);
|
|
647
|
-
}
|
|
648
|
-
|
|
640
|
+
}
|
|
641
|
+
function DialogTitle({
|
|
642
|
+
className,
|
|
643
|
+
...props
|
|
644
|
+
}) {
|
|
649
645
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
-
|
|
646
|
+
DialogPrimitive__namespace.Title,
|
|
651
647
|
{
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
),
|
|
656
|
-
onClick,
|
|
657
|
-
children
|
|
648
|
+
"data-slot": "dialog-title",
|
|
649
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
650
|
+
...props
|
|
658
651
|
}
|
|
659
652
|
);
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
lastActiveRef.current = document.activeElement;
|
|
673
|
-
const t = setTimeout(() => {
|
|
674
|
-
panelRef.current?.focus();
|
|
675
|
-
}, 0);
|
|
676
|
-
return () => {
|
|
677
|
-
clearTimeout(t);
|
|
678
|
-
lastActiveRef.current?.focus?.();
|
|
679
|
-
};
|
|
680
|
-
}, [isOpen]);
|
|
681
|
-
require$$0.useEffect(() => {
|
|
682
|
-
if (!isOpen) return;
|
|
683
|
-
window.document.body.style.overflow = "hidden";
|
|
684
|
-
const onKey = (e) => {
|
|
685
|
-
if (e.key === "Escape") onClose();
|
|
686
|
-
};
|
|
687
|
-
window.addEventListener("keydown", onKey);
|
|
688
|
-
return () => window.removeEventListener("keydown", onKey);
|
|
689
|
-
}, [isOpen, onClose]);
|
|
690
|
-
if (typeof document === "undefined") return null;
|
|
691
|
-
return reactDom.createPortal(
|
|
692
|
-
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
693
|
-
framerMotion.motion.div,
|
|
694
|
-
{
|
|
695
|
-
className: "fixed m-auto border border-border max-w-md max-h-[80%] z-[100] bg-dialog sm:absolute sm:inset-0 sm:top-0 sm:bottom-0 sm:w-full rounded-xl",
|
|
696
|
-
initial: { opacity: 0 },
|
|
697
|
-
animate: { opacity: 1 },
|
|
698
|
-
exit: { opacity: 0 },
|
|
699
|
-
children: [
|
|
700
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
701
|
-
framerMotion.motion.div,
|
|
702
|
-
{
|
|
703
|
-
ref: panelRef,
|
|
704
|
-
role: "dialog",
|
|
705
|
-
"aria-modal": "true",
|
|
706
|
-
tabIndex: -1,
|
|
707
|
-
className: cn(
|
|
708
|
-
"outline-none overflow-auto relative z-30 w-screen h-screen rounded-none sm:w-full sm:h-full sm:rounded-3xl",
|
|
709
|
-
className
|
|
710
|
-
),
|
|
711
|
-
initial: { opacity: 0, scale: 0.9 },
|
|
712
|
-
animate: { opacity: 1, scale: 1 },
|
|
713
|
-
exit: { opacity: 0, scale: 0.9 },
|
|
714
|
-
transition: {
|
|
715
|
-
type: "spring",
|
|
716
|
-
stiffness: 480,
|
|
717
|
-
damping: 32,
|
|
718
|
-
mass: 0.6
|
|
719
|
-
},
|
|
720
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
721
|
-
children
|
|
722
|
-
}
|
|
723
|
-
),
|
|
724
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 backdrop-blur-sm bg-background/10 z-10" })
|
|
725
|
-
]
|
|
726
|
-
}
|
|
727
|
-
) }),
|
|
728
|
-
container
|
|
653
|
+
}
|
|
654
|
+
function DialogDescription({
|
|
655
|
+
className,
|
|
656
|
+
...props
|
|
657
|
+
}) {
|
|
658
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
659
|
+
DialogPrimitive__namespace.Description,
|
|
660
|
+
{
|
|
661
|
+
"data-slot": "dialog-description",
|
|
662
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
663
|
+
...props
|
|
664
|
+
}
|
|
729
665
|
);
|
|
730
|
-
}
|
|
666
|
+
}
|
|
731
667
|
const TipIcon = (props) => {
|
|
732
668
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
733
669
|
"svg",
|
|
@@ -1108,10 +1044,7 @@ const routePresets = [
|
|
|
1108
1044
|
RoutePriority.CHEAPEST,
|
|
1109
1045
|
RoutePriority.RECOMMENDED
|
|
1110
1046
|
];
|
|
1111
|
-
const SettingModal = ({
|
|
1112
|
-
isOpen,
|
|
1113
|
-
onClose
|
|
1114
|
-
}) => {
|
|
1047
|
+
const SettingModal = ({ isOpen, onClose }) => {
|
|
1115
1048
|
const { t } = reactI18next.useTranslation();
|
|
1116
1049
|
const { toChain } = useChainsStore();
|
|
1117
1050
|
const { tokens } = useTokensStore();
|
|
@@ -1144,13 +1077,10 @@ const SettingModal = ({
|
|
|
1144
1077
|
);
|
|
1145
1078
|
const activeBtn = "bg-settings-active hover:bg-settings-active/80 text-settings-active-foreground";
|
|
1146
1079
|
const notActiveBtn = "bg-settings-button hover:bg-settings-button/80 text-settings-button-foreground";
|
|
1147
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1149
|
-
|
|
1150
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5 mt-7.5", children: [
|
|
1153
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2.5 flex flex-col gap-5", children: [
|
|
1080
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { children: [
|
|
1081
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("settings.title", { defaultValue: "Settings" }) }) }),
|
|
1082
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
1083
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
1154
1084
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
1155
1085
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
1156
1086
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-3.5", children: t("settings.gasOnDestination") }),
|
|
@@ -1664,7 +1594,7 @@ const TokenRow = ({
|
|
|
1664
1594
|
Button,
|
|
1665
1595
|
{
|
|
1666
1596
|
onClick: onPick,
|
|
1667
|
-
className: `w-full h-
|
|
1597
|
+
className: `w-full h-12.5 rounded-md cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-modal-item-hover transition-[300] ${isSelected ? "border border-ring" : ""}`,
|
|
1668
1598
|
children: [
|
|
1669
1599
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1670
1600
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1719,7 +1649,7 @@ const VirtualizedTokenList = ({
|
|
|
1719
1649
|
const bal = getBalance(node.token.symbol);
|
|
1720
1650
|
const usd = getTokenUsdValue(node.token.symbol, node.token.price?.usd);
|
|
1721
1651
|
const isSelected = selectedAssetSymbol?.toUpperCase() === node.token.symbol.toUpperCase();
|
|
1722
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
1653
|
TokenRow,
|
|
1724
1654
|
{
|
|
1725
1655
|
symbol: node.token.symbol,
|
|
@@ -1731,7 +1661,7 @@ const VirtualizedTokenList = ({
|
|
|
1731
1661
|
isBalanceLoading: balancesLoading,
|
|
1732
1662
|
onPick: () => onPick(node.token.symbol, node.willChangeSrc)
|
|
1733
1663
|
}
|
|
1734
|
-
)
|
|
1664
|
+
);
|
|
1735
1665
|
};
|
|
1736
1666
|
const getItemSize = (index) => {
|
|
1737
1667
|
const node = nodes[index];
|
|
@@ -1838,72 +1768,64 @@ const TokenSelectModal = ({
|
|
|
1838
1768
|
}
|
|
1839
1769
|
return out;
|
|
1840
1770
|
}, [effectiveTab, myTokens, groupedTokens, t]);
|
|
1841
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1849
|
-
/* @__PURE__ */ jsxRuntime.jsx(ModalClose, { onClick: handleClose, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
|
|
1850
|
-
] }),
|
|
1851
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1852
|
-
"div",
|
|
1853
|
-
{
|
|
1854
|
-
className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-12 mt-6 h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
|
|
1855
|
-
children: [
|
|
1856
|
-
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-input-icon" }),
|
|
1857
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1858
|
-
Input,
|
|
1859
|
-
{
|
|
1860
|
-
placeholder: t("bridge.searchToken"),
|
|
1861
|
-
className: "w-full outline-none leading-0 p-0 h-6 text-base text-input-text placeholder:text-input-placeholder bg-none dark:bg-transparent",
|
|
1862
|
-
value: query,
|
|
1863
|
-
onChange: (e) => setQuery(e.target.value),
|
|
1864
|
-
onFocus: () => setIsFocused(true),
|
|
1865
|
-
onBlur: () => setIsFocused(false)
|
|
1866
|
-
}
|
|
1867
|
-
)
|
|
1868
|
-
]
|
|
1869
|
-
}
|
|
1870
|
-
),
|
|
1871
|
-
hasAnyWallet() && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 flex gap-2", children: [
|
|
1872
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1873
|
-
Button,
|
|
1874
|
-
{
|
|
1875
|
-
className: `px-5 py-2.5 rounded-full text-sm font-bold hover:bg-filter-active hover:text-filter-active-foreground cursor-pointer ${tab === "my" ? "bg-filter-active text-filter-active-foreground" : "bg-filter text-filter-foreground"}`,
|
|
1876
|
-
onClick: () => setTab("my"),
|
|
1877
|
-
children: t("bridge.myTokens")
|
|
1878
|
-
}
|
|
1879
|
-
),
|
|
1880
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1881
|
-
Button,
|
|
1882
|
-
{
|
|
1883
|
-
className: `px-4 py-2 rounded-full text-sm font-bold hover:bg-filter-active hover:text-filter-active-foreground cursor-pointer ${tab === "all" ? "bg-filter-active text-filter-active-foreground" : "bg-filter text-filter-foreground"}`,
|
|
1884
|
-
onClick: () => setTab("all"),
|
|
1885
|
-
children: t("bridge.allTokens")
|
|
1886
|
-
}
|
|
1887
|
-
)
|
|
1888
|
-
] }),
|
|
1889
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 flex-1 overflow-hidden", children: virtualNodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground px-5 py-3.5", children: t("bridge.noResults") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1890
|
-
effectiveTab === "my" && myTokens.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "leading-4 text-base font-semibold text-muted-foreground uppercase px-5 py-2", children: t("bridge.noBalancesFound") }),
|
|
1771
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-auto", children: [
|
|
1772
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("bridge.selectToken") }) }),
|
|
1773
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1774
|
+
"div",
|
|
1775
|
+
{
|
|
1776
|
+
className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-12 h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
|
|
1777
|
+
children: [
|
|
1778
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-input-icon" }),
|
|
1891
1779
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1892
|
-
|
|
1780
|
+
Input,
|
|
1893
1781
|
{
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
onPick
|
|
1782
|
+
placeholder: t("bridge.searchToken"),
|
|
1783
|
+
className: "w-full outline-none leading-0 p-0 h-6 text-base text-input-text placeholder:text-input-placeholder bg-none dark:bg-transparent",
|
|
1784
|
+
value: query,
|
|
1785
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1786
|
+
onFocus: () => setIsFocused(true),
|
|
1787
|
+
onBlur: () => setIsFocused(false)
|
|
1901
1788
|
}
|
|
1902
1789
|
)
|
|
1903
|
-
]
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1790
|
+
]
|
|
1791
|
+
}
|
|
1792
|
+
),
|
|
1793
|
+
hasAnyWallet() && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1794
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
|
+
Button,
|
|
1796
|
+
{
|
|
1797
|
+
variant: tab === "my" ? "default" : "outline",
|
|
1798
|
+
onClick: () => setTab("my"),
|
|
1799
|
+
size: "sm",
|
|
1800
|
+
children: t("bridge.myTokens")
|
|
1801
|
+
}
|
|
1802
|
+
),
|
|
1803
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1804
|
+
Button,
|
|
1805
|
+
{
|
|
1806
|
+
variant: tab === "all" ? "default" : "outline",
|
|
1807
|
+
onClick: () => setTab("all"),
|
|
1808
|
+
size: "sm",
|
|
1809
|
+
children: t("bridge.allTokens")
|
|
1810
|
+
}
|
|
1811
|
+
)
|
|
1812
|
+
] }),
|
|
1813
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden -mx-5", children: virtualNodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground px-5 py-3.5", children: t("bridge.noResults") }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1814
|
+
effectiveTab === "my" && myTokens.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "leading-4 text-base font-semibold text-muted-foreground uppercase px-5 py-2", children: t("bridge.noBalancesFound") }),
|
|
1815
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1816
|
+
VirtualizedTokenList,
|
|
1817
|
+
{
|
|
1818
|
+
nodes: virtualNodes,
|
|
1819
|
+
balancesLoading: balancesQuery.isLoading || balancesQuery.isFetching,
|
|
1820
|
+
hasAnyWallet: hasAnyWallet(),
|
|
1821
|
+
selectedAssetSymbol,
|
|
1822
|
+
getBalance,
|
|
1823
|
+
getTokenUsdValue,
|
|
1824
|
+
onPick
|
|
1825
|
+
}
|
|
1826
|
+
)
|
|
1827
|
+
] }) })
|
|
1828
|
+
] }) });
|
|
1907
1829
|
};
|
|
1908
1830
|
const useBridgeQuoteStore = zustand.create((set) => ({
|
|
1909
1831
|
inputAmount: "",
|
|
@@ -2766,7 +2688,7 @@ const ChainSelectModal = ({
|
|
|
2766
2688
|
};
|
|
2767
2689
|
const renderChainItem = (chain, willChangeSrc) => {
|
|
2768
2690
|
const isSelected = fromChain?.chainKey === chain.chainKey || toChain?.chainKey === chain.chainKey;
|
|
2769
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2691
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2770
2692
|
Button,
|
|
2771
2693
|
{
|
|
2772
2694
|
onClick: () => onChainPick(chain, willChangeSrc),
|
|
@@ -2782,52 +2704,43 @@ const ChainSelectModal = ({
|
|
|
2782
2704
|
),
|
|
2783
2705
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-start", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 ", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-base font-extrabold leading-[100%]", children: chain.name }) }) })
|
|
2784
2706
|
] })
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2707
|
+
},
|
|
2708
|
+
chain.chainKey
|
|
2709
|
+
);
|
|
2787
2710
|
};
|
|
2788
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2796
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: t("bridge.willChangeSourceChain") }),
|
|
2822
|
-
groupedChains.willChangeSrc.length > 0 && groupedChains.willChangeSrc.map(
|
|
2823
|
-
(c) => renderChainItem(c, true)
|
|
2824
|
-
)
|
|
2825
|
-
] }),
|
|
2826
|
-
groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5 py-3.5 text-sm text-muted-foreground", children: t("bridge.noResults") })
|
|
2827
|
-
] })
|
|
2828
|
-
] })
|
|
2829
|
-
}
|
|
2830
|
-
);
|
|
2711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-hidden", children: [
|
|
2712
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("bridge.selectNetwork") }) }),
|
|
2713
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2714
|
+
"div",
|
|
2715
|
+
{
|
|
2716
|
+
className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-md h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
|
|
2717
|
+
children: [
|
|
2718
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
|
|
2719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2720
|
+
Input,
|
|
2721
|
+
{
|
|
2722
|
+
placeholder: t("bridge.searchDestinationChain"),
|
|
2723
|
+
className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
|
|
2724
|
+
value: query,
|
|
2725
|
+
onChange: (e) => setQuery(e.target.value),
|
|
2726
|
+
onFocus: () => setIsFocused(true),
|
|
2727
|
+
onBlur: () => setIsFocused(false)
|
|
2728
|
+
}
|
|
2729
|
+
)
|
|
2730
|
+
]
|
|
2731
|
+
}
|
|
2732
|
+
),
|
|
2733
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2734
|
+
groupedChains.available.length > 0 && groupedChains.available.map((c) => renderChainItem(c, false)),
|
|
2735
|
+
groupedChains.available.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
|
|
2736
|
+
groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: t("bridge.willChangeSourceChain") }),
|
|
2737
|
+
groupedChains.willChangeSrc.length > 0 && groupedChains.willChangeSrc.map(
|
|
2738
|
+
(c) => renderChainItem(c, true)
|
|
2739
|
+
)
|
|
2740
|
+
] }),
|
|
2741
|
+
groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5 py-3.5 text-sm text-muted-foreground", children: t("bridge.noResults") })
|
|
2742
|
+
] })
|
|
2743
|
+
] }) });
|
|
2831
2744
|
};
|
|
2832
2745
|
const useWalletSelectModal = zustand.create((set) => ({
|
|
2833
2746
|
isOpen: false,
|
|
@@ -4195,20 +4108,17 @@ const WalletSelectModal = () => {
|
|
|
4195
4108
|
console.error("Failed to connect wallet:", error);
|
|
4196
4109
|
}
|
|
4197
4110
|
};
|
|
4198
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4199
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4200
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4201
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4202
|
-
defaultValue: "You can only connect one wallet per environment."
|
|
4203
|
-
}) }),
|
|
4204
|
-
/* @__PURE__ */ jsxRuntime.jsx(ModalClose, { onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
|
|
4111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { children: [
|
|
4112
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
4113
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("wallets.chooseWallet") }),
|
|
4114
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: t("wallets.oneWalletPerEnv") })
|
|
4205
4115
|
] }),
|
|
4206
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
4116
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
4207
4117
|
connectedWallets.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4208
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
4118
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t("wallets.connected") }),
|
|
4209
4119
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: connectedWallets.map((wallet) => {
|
|
4210
4120
|
const IconComponent = wallet.icon;
|
|
4211
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300]", children: [
|
|
4121
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mx-5", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300]", children: [
|
|
4212
4122
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
4213
4123
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "size-7.5" }) }),
|
|
4214
4124
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4231,8 +4141,8 @@ const WalletSelectModal = () => {
|
|
|
4231
4141
|
}) })
|
|
4232
4142
|
] }),
|
|
4233
4143
|
categories.map((category) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4234
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
4235
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: category.wallets.map((wallet) => {
|
|
4144
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: category.title }),
|
|
4145
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mx-5", children: category.wallets.map((wallet) => {
|
|
4236
4146
|
const IconComponent = wallet.icon;
|
|
4237
4147
|
const isEvmConnector = category.title === t("wallets.evmWallets");
|
|
4238
4148
|
const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
|
|
@@ -6205,8 +6115,8 @@ const TransactionManager = () => {
|
|
|
6205
6115
|
if (status === "completed") {
|
|
6206
6116
|
step = /* @__PURE__ */ jsxRuntime.jsx(SuccessStep, {});
|
|
6207
6117
|
}
|
|
6208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6209
|
-
}, children: step });
|
|
6118
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: true, onOpenChange: () => {
|
|
6119
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { showCloseButton: false, className: "p-0 gap-0 border-none max-w-[calc(100%-2rem)] sm:max-w-md", children: step }) });
|
|
6210
6120
|
};
|
|
6211
6121
|
const useTokensRequest = () => {
|
|
6212
6122
|
const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
|
|
@@ -7975,7 +7885,7 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
7975
7885
|
require$$0.useEffect(() => {
|
|
7976
7886
|
setTronConnected(!!tronConnected);
|
|
7977
7887
|
}, [tronConnected, setTronConnected]);
|
|
7978
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7888
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7979
7889
|
ChainStrategyProvider,
|
|
7980
7890
|
{
|
|
7981
7891
|
evmWallet: {
|
|
@@ -8000,7 +7910,7 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
8000
7910
|
tonApiKey: props.tonApiKey,
|
|
8001
7911
|
children: /* @__PURE__ */ jsxRuntime.jsx(EvaaBridgeContent, { ...props })
|
|
8002
7912
|
}
|
|
8003
|
-
)
|
|
7913
|
+
);
|
|
8004
7914
|
};
|
|
8005
7915
|
const EvaaBridgeContent = ({
|
|
8006
7916
|
className,
|