@rash2x/bridge-widget 0.1.10 → 0.1.12
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/README.md +18 -0
- package/dist/evaa-bridge.cjs +91 -470
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +21 -380
- package/dist/evaa-bridge.mjs.map +1 -1
- package/package.json +1 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -28,49 +28,29 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
28
28
|
const reactI18next = require("react-i18next");
|
|
29
29
|
const require$$0 = require("react");
|
|
30
30
|
const zustand = require("zustand");
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const lucideReact = require("lucide-react");
|
|
37
|
-
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
31
|
+
const button = require("@/components/ui/button");
|
|
32
|
+
const dialog = require("@/components/ui/dialog");
|
|
33
|
+
const tooltip = require("@/components/ui/tooltip");
|
|
34
|
+
const utils = require("@/lib/utils");
|
|
35
|
+
const input = require("@/components/ui/input");
|
|
38
36
|
const wagmi = require("wagmi");
|
|
39
37
|
const tronwalletAdapterReactHooks = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
40
38
|
const uiReact = require("@tonconnect/ui-react");
|
|
41
39
|
const reactQuery = require("@tanstack/react-query");
|
|
42
40
|
const core = require("@ton/core");
|
|
43
41
|
const reactWindow = require("react-window");
|
|
44
|
-
const
|
|
42
|
+
const skeleton = require("@/components/ui/skeleton");
|
|
43
|
+
const card = require("@/components/ui/card");
|
|
44
|
+
const _switch = require("@/components/ui/switch");
|
|
45
|
+
const lucideReact = require("lucide-react");
|
|
45
46
|
const framerMotion = require("framer-motion");
|
|
46
|
-
const
|
|
47
|
+
const accordion = require("@/components/ui/accordion");
|
|
47
48
|
const i18next = require("i18next");
|
|
48
49
|
const sonner = require("sonner");
|
|
49
50
|
const ethers = require("ethers");
|
|
50
51
|
const viem = require("viem");
|
|
51
52
|
const ton = require("@ton/ton");
|
|
52
53
|
const tronwalletAdapters = require("@tronweb3/tronwallet-adapters");
|
|
53
|
-
function _interopNamespaceDefault(e) {
|
|
54
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
55
|
-
if (e) {
|
|
56
|
-
for (const k in e) {
|
|
57
|
-
if (k !== "default") {
|
|
58
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
59
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: () => e[k]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
n.default = e;
|
|
67
|
-
return Object.freeze(n);
|
|
68
|
-
}
|
|
69
|
-
const require$$0__namespace = /* @__PURE__ */ _interopNamespaceDefault(require$$0);
|
|
70
|
-
const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
|
|
71
|
-
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
72
|
-
const SwitchPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SwitchPrimitive);
|
|
73
|
-
const AccordionPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AccordionPrimitive);
|
|
74
54
|
const norm = (s) => (s ?? "").toUpperCase().replace(/₮/g, "T").replace(/[^A-Z0-9]/g, "");
|
|
75
55
|
const POPULAR_ORDER = [
|
|
76
56
|
"USDT",
|
|
@@ -523,147 +503,6 @@ const ExitIcon = (props) => {
|
|
|
523
503
|
}
|
|
524
504
|
);
|
|
525
505
|
};
|
|
526
|
-
function cn(...inputs) {
|
|
527
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
528
|
-
}
|
|
529
|
-
const buttonVariants = classVarianceAuthority.cva(
|
|
530
|
-
"inline-flex items-center rounded-full text-lg justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
531
|
-
{
|
|
532
|
-
variants: {
|
|
533
|
-
variant: {
|
|
534
|
-
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
535
|
-
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
536
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
537
|
-
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
538
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
539
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
540
|
-
},
|
|
541
|
-
size: {
|
|
542
|
-
default: "h-13 px-4 py-2 has-[>svg]:px-3",
|
|
543
|
-
sm: "h-9 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
544
|
-
lg: "h-15 font-semibold rounded-full text-lg px-6 has-[>svg]:px-4",
|
|
545
|
-
icon: "size-9"
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
defaultVariants: {
|
|
549
|
-
variant: "default",
|
|
550
|
-
size: "default"
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
);
|
|
554
|
-
const Button = require$$0__namespace.forwardRef(
|
|
555
|
-
({ className, variant, size, asChild = false, type, ...props }, ref) => {
|
|
556
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
557
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
558
|
-
Comp,
|
|
559
|
-
{
|
|
560
|
-
ref,
|
|
561
|
-
"data-slot": "button",
|
|
562
|
-
...!asChild ? { type: type ?? "button" } : null,
|
|
563
|
-
className: cn(buttonVariants({ variant, size }), className),
|
|
564
|
-
...props
|
|
565
|
-
}
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
);
|
|
569
|
-
Button.displayName = "Button";
|
|
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
|
-
}) {
|
|
584
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
585
|
-
DialogPrimitive__namespace.Overlay,
|
|
586
|
-
{
|
|
587
|
-
"data-slot": "dialog-overlay",
|
|
588
|
-
className: cn(
|
|
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",
|
|
590
|
-
className
|
|
591
|
-
),
|
|
592
|
-
...props
|
|
593
|
-
}
|
|
594
|
-
);
|
|
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 }) {
|
|
632
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
633
|
-
"div",
|
|
634
|
-
{
|
|
635
|
-
"data-slot": "dialog-header",
|
|
636
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
637
|
-
...props
|
|
638
|
-
}
|
|
639
|
-
);
|
|
640
|
-
}
|
|
641
|
-
function DialogTitle({
|
|
642
|
-
className,
|
|
643
|
-
...props
|
|
644
|
-
}) {
|
|
645
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
-
DialogPrimitive__namespace.Title,
|
|
647
|
-
{
|
|
648
|
-
"data-slot": "dialog-title",
|
|
649
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
650
|
-
...props
|
|
651
|
-
}
|
|
652
|
-
);
|
|
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
|
-
}
|
|
665
|
-
);
|
|
666
|
-
}
|
|
667
506
|
const TipIcon = (props) => {
|
|
668
507
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
669
508
|
"svg",
|
|
@@ -720,64 +559,11 @@ const TipIcon = (props) => {
|
|
|
720
559
|
}
|
|
721
560
|
);
|
|
722
561
|
};
|
|
723
|
-
function TooltipProvider({
|
|
724
|
-
delayDuration = 0,
|
|
725
|
-
...props
|
|
726
|
-
}) {
|
|
727
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
728
|
-
TooltipPrimitive__namespace.Provider,
|
|
729
|
-
{
|
|
730
|
-
"data-slot": "tooltip-provider",
|
|
731
|
-
delayDuration,
|
|
732
|
-
...props
|
|
733
|
-
}
|
|
734
|
-
);
|
|
735
|
-
}
|
|
736
|
-
function Tooltip({
|
|
737
|
-
...props
|
|
738
|
-
}) {
|
|
739
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props }) });
|
|
740
|
-
}
|
|
741
|
-
function TooltipTrigger({
|
|
742
|
-
...props
|
|
743
|
-
}) {
|
|
744
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
745
|
-
}
|
|
746
|
-
function TooltipContent({
|
|
747
|
-
className,
|
|
748
|
-
sideOffset = 0,
|
|
749
|
-
children,
|
|
750
|
-
...props
|
|
751
|
-
}) {
|
|
752
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
753
|
-
TooltipPrimitive__namespace.Content,
|
|
754
|
-
{
|
|
755
|
-
"data-slot": "tooltip-content",
|
|
756
|
-
sideOffset,
|
|
757
|
-
className: cn(
|
|
758
|
-
"bg-primary text-primary-foreground text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5",
|
|
759
|
-
className
|
|
760
|
-
),
|
|
761
|
-
...props,
|
|
762
|
-
children: [
|
|
763
|
-
children,
|
|
764
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
765
|
-
]
|
|
766
|
-
}
|
|
767
|
-
) });
|
|
768
|
-
}
|
|
769
562
|
const Tip = (props) => {
|
|
770
563
|
const { children, text } = props;
|
|
771
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
772
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, {
|
|
773
|
-
|
|
774
|
-
{
|
|
775
|
-
variant: "default",
|
|
776
|
-
className: "cursor-pointer rounded-none shadow-none shrink-0 !p-0 !m-0 !w-fit !h-auto !bg-transparent hover:bg-transparent",
|
|
777
|
-
children
|
|
778
|
-
}
|
|
779
|
-
) }),
|
|
780
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
564
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
|
|
565
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { children }),
|
|
566
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
781
567
|
] });
|
|
782
568
|
};
|
|
783
569
|
async function getChains() {
|
|
@@ -1077,8 +863,8 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1077
863
|
);
|
|
1078
864
|
const activeBtn = "bg-settings-active hover:bg-settings-active/80 text-settings-active-foreground";
|
|
1079
865
|
const notActiveBtn = "bg-settings-button hover:bg-settings-button/80 text-settings-button-foreground";
|
|
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" }) }) }),
|
|
866
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { children: [
|
|
867
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("settings.title", { defaultValue: "Settings" }) }) }),
|
|
1082
868
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
1083
869
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
1084
870
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
@@ -1103,11 +889,11 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1103
889
|
) }) })
|
|
1104
890
|
] }),
|
|
1105
891
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5", children: gasPresets.map((g) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
|
-
Button,
|
|
892
|
+
button.Button,
|
|
1107
893
|
{
|
|
1108
894
|
type: "button",
|
|
1109
895
|
onClick: () => setGasPreset(g),
|
|
1110
|
-
className: cn(
|
|
896
|
+
className: utils.cn(
|
|
1111
897
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1112
898
|
gasPreset === g ? activeBtn : notActiveBtn
|
|
1113
899
|
),
|
|
@@ -1131,14 +917,14 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1131
917
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-6", children: [
|
|
1132
918
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg text-foreground leading-4.5 font-semibold h-4.5", children: slippagePercent }) }),
|
|
1133
919
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: slippagePresets.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1134
|
-
Button,
|
|
920
|
+
button.Button,
|
|
1135
921
|
{
|
|
1136
922
|
type: "button",
|
|
1137
923
|
onClick: () => {
|
|
1138
924
|
const bps = parseFloat(p.replace("%", "")) * 100;
|
|
1139
925
|
setSlippageBps(bps);
|
|
1140
926
|
},
|
|
1141
|
-
className: cn(
|
|
927
|
+
className: utils.cn(
|
|
1142
928
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1143
929
|
activeSlippagePreset === p ? activeBtn : notActiveBtn
|
|
1144
930
|
),
|
|
@@ -1155,11 +941,11 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1155
941
|
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.routePriority"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "size-4 text-muted-foreground" }) })
|
|
1156
942
|
] }) }),
|
|
1157
943
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1158
|
-
Button,
|
|
944
|
+
button.Button,
|
|
1159
945
|
{
|
|
1160
946
|
type: "button",
|
|
1161
947
|
onClick: () => setRoutePriority(r),
|
|
1162
|
-
className: cn(
|
|
948
|
+
className: utils.cn(
|
|
1163
949
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1164
950
|
routePriority === r ? activeBtn : notActiveBtn
|
|
1165
951
|
),
|
|
@@ -1171,21 +957,6 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1171
957
|
] })
|
|
1172
958
|
] }) });
|
|
1173
959
|
};
|
|
1174
|
-
function Input({ className, type, ...props }) {
|
|
1175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1176
|
-
"input",
|
|
1177
|
-
{
|
|
1178
|
-
type,
|
|
1179
|
-
"data-slot": "input",
|
|
1180
|
-
className: cn(
|
|
1181
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1182
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
1183
|
-
className
|
|
1184
|
-
),
|
|
1185
|
-
...props
|
|
1186
|
-
}
|
|
1187
|
-
);
|
|
1188
|
-
}
|
|
1189
960
|
function useAddresses() {
|
|
1190
961
|
const { fromChain, toChain } = useChainsStore();
|
|
1191
962
|
const { address: evmAddress } = wagmi.useAccount();
|
|
@@ -1577,9 +1348,6 @@ function useTokenSelectData(items) {
|
|
|
1577
1348
|
hasAnyWallet
|
|
1578
1349
|
};
|
|
1579
1350
|
}
|
|
1580
|
-
function Skeleton({ className }) {
|
|
1581
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-[#999]", className) });
|
|
1582
|
-
}
|
|
1583
1351
|
const TokenRow = ({
|
|
1584
1352
|
symbol,
|
|
1585
1353
|
name,
|
|
@@ -1591,7 +1359,7 @@ const TokenRow = ({
|
|
|
1591
1359
|
onPick
|
|
1592
1360
|
}) => {
|
|
1593
1361
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1594
|
-
Button,
|
|
1362
|
+
button.Button,
|
|
1595
1363
|
{
|
|
1596
1364
|
onClick: onPick,
|
|
1597
1365
|
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" : ""}`,
|
|
@@ -1601,7 +1369,7 @@ const TokenRow = ({
|
|
|
1601
1369
|
TokenSymbol,
|
|
1602
1370
|
{
|
|
1603
1371
|
symbol,
|
|
1604
|
-
className: "
|
|
1372
|
+
className: "size-7.5 max-w-7.5 rounded-full",
|
|
1605
1373
|
alt: symbol
|
|
1606
1374
|
}
|
|
1607
1375
|
),
|
|
@@ -1611,8 +1379,8 @@ const TokenRow = ({
|
|
|
1611
1379
|
] })
|
|
1612
1380
|
] }),
|
|
1613
1381
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right space-y-1", children: isBalanceLoading && hasAnyWallet ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-1", children: [
|
|
1614
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-16 rounded-md" }),
|
|
1615
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-3 w-12 rounded-md" })
|
|
1382
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-16 rounded-md" }),
|
|
1383
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-12 rounded-md" })
|
|
1616
1384
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1617
1385
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-extrabold text-foreground text-lg leading-4 truncate", children: hasAnyWallet ? formatBalance(balance) : "—" }),
|
|
1618
1386
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 text-muted-foreground", children: hasAnyWallet && balance > 0 && usdValue > 0 ? formatUsd(usdValue) : "—" })
|
|
@@ -1768,8 +1536,8 @@ const TokenSelectModal = ({
|
|
|
1768
1536
|
}
|
|
1769
1537
|
return out;
|
|
1770
1538
|
}, [effectiveTab, myTokens, groupedTokens, t]);
|
|
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") }) }),
|
|
1539
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { className: "!max-h-[80dvh] overflow-auto", children: [
|
|
1540
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("bridge.selectToken") }) }),
|
|
1773
1541
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1774
1542
|
"div",
|
|
1775
1543
|
{
|
|
@@ -1777,7 +1545,7 @@ const TokenSelectModal = ({
|
|
|
1777
1545
|
children: [
|
|
1778
1546
|
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-input-icon" }),
|
|
1779
1547
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1780
|
-
Input,
|
|
1548
|
+
input.Input,
|
|
1781
1549
|
{
|
|
1782
1550
|
placeholder: t("bridge.searchToken"),
|
|
1783
1551
|
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",
|
|
@@ -1792,7 +1560,7 @@ const TokenSelectModal = ({
|
|
|
1792
1560
|
),
|
|
1793
1561
|
hasAnyWallet() && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1794
1562
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
|
-
Button,
|
|
1563
|
+
button.Button,
|
|
1796
1564
|
{
|
|
1797
1565
|
variant: tab === "my" ? "default" : "outline",
|
|
1798
1566
|
onClick: () => setTab("my"),
|
|
@@ -1801,7 +1569,7 @@ const TokenSelectModal = ({
|
|
|
1801
1569
|
}
|
|
1802
1570
|
),
|
|
1803
1571
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1804
|
-
Button,
|
|
1572
|
+
button.Button,
|
|
1805
1573
|
{
|
|
1806
1574
|
variant: tab === "all" ? "default" : "outline",
|
|
1807
1575
|
onClick: () => setTab("all"),
|
|
@@ -1902,7 +1670,7 @@ const RefreshButton = () => {
|
|
|
1902
1670
|
refresh();
|
|
1903
1671
|
}, [refresh]);
|
|
1904
1672
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1905
|
-
Button,
|
|
1673
|
+
button.Button,
|
|
1906
1674
|
{
|
|
1907
1675
|
onClick: handleRefresh,
|
|
1908
1676
|
disabled: spinning,
|
|
@@ -1929,7 +1697,7 @@ const SelectTokenButton = ({
|
|
|
1929
1697
|
return token?.symbol ?? t("bridge.selectToken");
|
|
1930
1698
|
}, [token, t]);
|
|
1931
1699
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1932
|
-
Button,
|
|
1700
|
+
button.Button,
|
|
1933
1701
|
{
|
|
1934
1702
|
onClick,
|
|
1935
1703
|
size: "sm",
|
|
@@ -1953,75 +1721,6 @@ const SelectTokenButton = ({
|
|
|
1953
1721
|
}
|
|
1954
1722
|
);
|
|
1955
1723
|
};
|
|
1956
|
-
function Card({ className, ...props }) {
|
|
1957
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1958
|
-
"div",
|
|
1959
|
-
{
|
|
1960
|
-
"data-slot": "card",
|
|
1961
|
-
className: cn(
|
|
1962
|
-
"bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-4 shadow-sm",
|
|
1963
|
-
className
|
|
1964
|
-
),
|
|
1965
|
-
...props
|
|
1966
|
-
}
|
|
1967
|
-
);
|
|
1968
|
-
}
|
|
1969
|
-
function CardHeader({ className, ...props }) {
|
|
1970
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1971
|
-
"div",
|
|
1972
|
-
{
|
|
1973
|
-
"data-slot": "card-header",
|
|
1974
|
-
className: cn(
|
|
1975
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4",
|
|
1976
|
-
className
|
|
1977
|
-
),
|
|
1978
|
-
...props
|
|
1979
|
-
}
|
|
1980
|
-
);
|
|
1981
|
-
}
|
|
1982
|
-
function CardTitle({ className, ...props }) {
|
|
1983
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1984
|
-
"div",
|
|
1985
|
-
{
|
|
1986
|
-
"data-slot": "card-title",
|
|
1987
|
-
className: cn("leading-none font-semibold", className),
|
|
1988
|
-
...props
|
|
1989
|
-
}
|
|
1990
|
-
);
|
|
1991
|
-
}
|
|
1992
|
-
function CardAction({ className, ...props }) {
|
|
1993
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1994
|
-
"div",
|
|
1995
|
-
{
|
|
1996
|
-
"data-slot": "card-action",
|
|
1997
|
-
className: cn(
|
|
1998
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
1999
|
-
className
|
|
2000
|
-
),
|
|
2001
|
-
...props
|
|
2002
|
-
}
|
|
2003
|
-
);
|
|
2004
|
-
}
|
|
2005
|
-
function CardContent({ className, ...props }) {
|
|
2006
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2007
|
-
"div",
|
|
2008
|
-
{
|
|
2009
|
-
"data-slot": "card-content",
|
|
2010
|
-
className: cn("px-4", className),
|
|
2011
|
-
...props
|
|
2012
|
-
}
|
|
2013
|
-
);
|
|
2014
|
-
}
|
|
2015
|
-
function CardFooter({ className, ...props }) {
|
|
2016
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2017
|
-
"div",
|
|
2018
|
-
{
|
|
2019
|
-
"data-slot": "card-footer",
|
|
2020
|
-
className: cn("flex items-center px-4 [.border-t]:pt-4", className),
|
|
2021
|
-
...props
|
|
2022
|
-
}
|
|
2023
|
-
);
|
|
2024
|
-
}
|
|
2025
1724
|
const FormHeaderComponent = () => {
|
|
2026
1725
|
const { t } = reactI18next.useTranslation();
|
|
2027
1726
|
const { isOpen, onClose, onOpen } = useModal();
|
|
@@ -2038,14 +1737,14 @@ const FormHeaderComponent = () => {
|
|
|
2038
1737
|
const sum = selectedAssetSymbol.toUpperCase();
|
|
2039
1738
|
return assets.find((a) => a.symbol.toUpperCase() === sum) ?? assets[0];
|
|
2040
1739
|
}, [assets, selectedAssetSymbol]);
|
|
2041
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "gap-y-0 flex justify-between items-center", children: [
|
|
2042
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex items-center gap-2.5", children: [
|
|
1740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(card.CardHeader, { className: "gap-y-0 flex justify-between items-center", children: [
|
|
1741
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardTitle, { className: "flex items-center gap-2.5", children: [
|
|
2043
1742
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal leading-3.5 text-muted-foreground", children: t("bridge.selectToken") }),
|
|
2044
1743
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTokenButton, { token: current, onClick: onOpen })
|
|
2045
1744
|
] }),
|
|
2046
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardAction, { className: "flex items-center gap-2.5", children: [
|
|
1745
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardAction, { className: "flex items-center gap-2.5", children: [
|
|
2047
1746
|
/* @__PURE__ */ jsxRuntime.jsx(RefreshButton, {}),
|
|
2048
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onOpenSettings, size: "sm", variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(BoltIcon, { stroke: "currentColor" }) })
|
|
1747
|
+
/* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: onOpenSettings, size: "sm", variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(BoltIcon, { stroke: "currentColor" }) })
|
|
2049
1748
|
] }),
|
|
2050
1749
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2051
1750
|
TokenSelectModal,
|
|
@@ -2141,7 +1840,7 @@ function useBridgeQuote() {
|
|
|
2141
1840
|
setNoRoute,
|
|
2142
1841
|
resetWithIdle
|
|
2143
1842
|
} = useBridgeQuoteStore();
|
|
2144
|
-
const
|
|
1843
|
+
const input2 = inputAmount;
|
|
2145
1844
|
const srcTokenOnFrom = require$$0.useMemo(
|
|
2146
1845
|
() => resolveTokenOnChainFromMatrix$2(
|
|
2147
1846
|
assetMatrix,
|
|
@@ -2160,11 +1859,11 @@ function useBridgeQuote() {
|
|
|
2160
1859
|
);
|
|
2161
1860
|
const [loading, setLoading] = require$$0.useState(false);
|
|
2162
1861
|
require$$0.useEffect(() => {
|
|
2163
|
-
if (!
|
|
1862
|
+
if (!input2 || input2 === "") {
|
|
2164
1863
|
setLoading(false);
|
|
2165
1864
|
resetWithIdle();
|
|
2166
1865
|
}
|
|
2167
|
-
}, [
|
|
1866
|
+
}, [input2, resetWithIdle]);
|
|
2168
1867
|
require$$0.useEffect(() => {
|
|
2169
1868
|
const resetUi = (withError) => {
|
|
2170
1869
|
setLoading(false);
|
|
@@ -2172,7 +1871,7 @@ function useBridgeQuote() {
|
|
|
2172
1871
|
resetWithIdle();
|
|
2173
1872
|
}
|
|
2174
1873
|
};
|
|
2175
|
-
if (!
|
|
1874
|
+
if (!input2 || Number(input2) <= 0 || !fromChain?.chainKey || !toChain?.chainKey || !srcTokenOnFrom || !dstTokenOnTo || !srcAddress || !dstAddress) {
|
|
2176
1875
|
resetUi();
|
|
2177
1876
|
return;
|
|
2178
1877
|
}
|
|
@@ -2198,7 +1897,7 @@ function useBridgeQuote() {
|
|
|
2198
1897
|
return;
|
|
2199
1898
|
}
|
|
2200
1899
|
}
|
|
2201
|
-
const srcAmountLD = toLD(
|
|
1900
|
+
const srcAmountLD = toLD(input2, srcTokenOnFrom.decimals);
|
|
2202
1901
|
const srcAddrApi = addrForApi(fromChain.chainKey, srcAddress);
|
|
2203
1902
|
const dstAddrApi = addrForApi(toChain.chainKey, dstAddress);
|
|
2204
1903
|
const dstNativeAmount = getDstNativeAmount(toChain.chainKey);
|
|
@@ -2243,7 +1942,7 @@ function useBridgeQuote() {
|
|
|
2243
1942
|
cancelled = true;
|
|
2244
1943
|
};
|
|
2245
1944
|
}, [
|
|
2246
|
-
|
|
1945
|
+
input2,
|
|
2247
1946
|
fromChain?.chainKey,
|
|
2248
1947
|
toChain?.chainKey,
|
|
2249
1948
|
srcTokenOnFrom,
|
|
@@ -2479,13 +2178,13 @@ const SwapButton = () => {
|
|
|
2479
2178
|
}, 300);
|
|
2480
2179
|
}, [canSwap, isSwapping, swapModel.actions]);
|
|
2481
2180
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2482
|
-
Button,
|
|
2181
|
+
button.Button,
|
|
2483
2182
|
{
|
|
2484
2183
|
onClick: handleSwap,
|
|
2485
2184
|
disabled: !canSwap || isSwapping,
|
|
2486
2185
|
variant: "secondary",
|
|
2487
2186
|
size: "sm",
|
|
2488
|
-
className: cn(
|
|
2187
|
+
className: utils.cn(
|
|
2489
2188
|
"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2",
|
|
2490
2189
|
!canSwap || isSwapping ? "opacity-50 cursor-not-allowed" : "hover:scale-110"
|
|
2491
2190
|
),
|
|
@@ -2506,7 +2205,7 @@ const WalletBalance = (props) => {
|
|
|
2506
2205
|
if (isLoading) {
|
|
2507
2206
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1.5 items-center", children: [
|
|
2508
2207
|
/* @__PURE__ */ jsxRuntime.jsx(WalletIcon, { className: "text-muted-foreground" }),
|
|
2509
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
2208
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
2510
2209
|
] });
|
|
2511
2210
|
}
|
|
2512
2211
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1.5 items-center", children: [
|
|
@@ -2533,7 +2232,7 @@ const SelectNetworkButton = ({
|
|
|
2533
2232
|
return network?.name ?? t("bridge.selectNetwork");
|
|
2534
2233
|
}, [network, t]);
|
|
2535
2234
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2536
|
-
Button,
|
|
2235
|
+
button.Button,
|
|
2537
2236
|
{
|
|
2538
2237
|
onClick,
|
|
2539
2238
|
size: "sm",
|
|
@@ -2594,10 +2293,10 @@ const CurrencyInput = require$$0.forwardRef(
|
|
|
2594
2293
|
[max, onAmountChange]
|
|
2595
2294
|
);
|
|
2596
2295
|
if (showSkeleton && readOnly) {
|
|
2597
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: cn("h-8 w-1/3 rounded-md", className) });
|
|
2296
|
+
return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: utils.cn("h-8 w-1/3 rounded-md", className) });
|
|
2598
2297
|
}
|
|
2599
2298
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2600
|
-
Input,
|
|
2299
|
+
input.Input,
|
|
2601
2300
|
{
|
|
2602
2301
|
ref,
|
|
2603
2302
|
value: inputVal,
|
|
@@ -2607,7 +2306,7 @@ const CurrencyInput = require$$0.forwardRef(
|
|
|
2607
2306
|
inputMode: "decimal",
|
|
2608
2307
|
pattern: "[0-9]*[.,]?[0-9]*",
|
|
2609
2308
|
readOnly,
|
|
2610
|
-
className: cn(
|
|
2309
|
+
className: utils.cn(
|
|
2611
2310
|
"text-[32px] h-8.5 font-medium leading-8.5 rounded-none text-end bg-transparent dark:bg-transparent text-foreground shadow-none border-none outline-none ring-0 focus:outline-none",
|
|
2612
2311
|
className
|
|
2613
2312
|
),
|
|
@@ -2689,7 +2388,7 @@ const ChainSelectModal = ({
|
|
|
2689
2388
|
const renderChainItem = (chain, willChangeSrc) => {
|
|
2690
2389
|
const isSelected = fromChain?.chainKey === chain.chainKey || toChain?.chainKey === chain.chainKey;
|
|
2691
2390
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2692
|
-
Button,
|
|
2391
|
+
button.Button,
|
|
2693
2392
|
{
|
|
2694
2393
|
onClick: () => onChainPick(chain, willChangeSrc),
|
|
2695
2394
|
className: `w-full cursor-pointer flex shadow-none items-center justify-between gap-2.5 px-5 py-3.5 h-12.5 font-extrabold capitalize hover:bg-muted bg-transparent rounded-12 transition-[300] ${isSelected ? "border border-ring" : ""}`,
|
|
@@ -2708,8 +2407,8 @@ const ChainSelectModal = ({
|
|
|
2708
2407
|
chain.chainKey
|
|
2709
2408
|
);
|
|
2710
2409
|
};
|
|
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") }) }),
|
|
2410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { className: "!max-h-[80dvh] overflow-hidden", children: [
|
|
2411
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("bridge.selectNetwork") }) }),
|
|
2713
2412
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2714
2413
|
"div",
|
|
2715
2414
|
{
|
|
@@ -2717,7 +2416,7 @@ const ChainSelectModal = ({
|
|
|
2717
2416
|
children: [
|
|
2718
2417
|
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
|
|
2719
2418
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2720
|
-
Input,
|
|
2419
|
+
input.Input,
|
|
2721
2420
|
{
|
|
2722
2421
|
placeholder: t("bridge.searchDestinationChain"),
|
|
2723
2422
|
className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
|
|
@@ -2795,7 +2494,7 @@ const WalletButton = ({
|
|
|
2795
2494
|
const isButtonDisabled = (wallet === "metamask" || wallet === "tronlink") && !isInitialized || isConnecting;
|
|
2796
2495
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex flex-col items-start gap-1", children: [
|
|
2797
2496
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2798
|
-
Button,
|
|
2497
|
+
button.Button,
|
|
2799
2498
|
{
|
|
2800
2499
|
type: "button",
|
|
2801
2500
|
onClick: handleClick,
|
|
@@ -2872,7 +2571,7 @@ const SwapSection = ({
|
|
|
2872
2571
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2873
2572
|
"div",
|
|
2874
2573
|
{
|
|
2875
|
-
className: cn(
|
|
2574
|
+
className: utils.cn(
|
|
2876
2575
|
"p-4 flex flex-col gap-4 transition-colors bg-muted",
|
|
2877
2576
|
isSource && isFocused ? "bg-accent" : "",
|
|
2878
2577
|
className
|
|
@@ -2920,7 +2619,7 @@ const SwapSection = ({
|
|
|
2920
2619
|
addressType: isSource ? "src" : "dst"
|
|
2921
2620
|
}
|
|
2922
2621
|
),
|
|
2923
|
-
isUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-12 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-4.5 text-sm font-medium text-muted-foreground", children: computedFiat })
|
|
2622
|
+
isUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-12 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-4.5 text-sm font-medium text-muted-foreground", children: computedFiat })
|
|
2924
2623
|
] })
|
|
2925
2624
|
]
|
|
2926
2625
|
}
|
|
@@ -2937,31 +2636,6 @@ const SwapSection = ({
|
|
|
2937
2636
|
)
|
|
2938
2637
|
] });
|
|
2939
2638
|
};
|
|
2940
|
-
function Switch({
|
|
2941
|
-
className,
|
|
2942
|
-
...props
|
|
2943
|
-
}) {
|
|
2944
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2945
|
-
SwitchPrimitive__namespace.Root,
|
|
2946
|
-
{
|
|
2947
|
-
"data-slot": "switch",
|
|
2948
|
-
className: cn(
|
|
2949
|
-
"peer data-[state=checked]:bg-[#0095F9] data-[state=unchecked]:bg-[#CACFD3] focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
2950
|
-
className
|
|
2951
|
-
),
|
|
2952
|
-
...props,
|
|
2953
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2954
|
-
SwitchPrimitive__namespace.Thumb,
|
|
2955
|
-
{
|
|
2956
|
-
"data-slot": "switch-thumb",
|
|
2957
|
-
className: cn(
|
|
2958
|
-
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
2959
|
-
)
|
|
2960
|
-
}
|
|
2961
|
-
)
|
|
2962
|
-
}
|
|
2963
|
-
);
|
|
2964
|
-
}
|
|
2965
2639
|
const useCustomAddressStore = zustand.create((set) => ({
|
|
2966
2640
|
customDstAddress: void 0,
|
|
2967
2641
|
setCustomDstAddress: (address) => set({ customDstAddress: address }),
|
|
@@ -3038,11 +2712,11 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3038
2712
|
} catch {
|
|
3039
2713
|
}
|
|
3040
2714
|
};
|
|
3041
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex flex-col rounded-b-
|
|
2715
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex flex-col rounded-b-lg gap-2 bg-muted", children: [
|
|
3042
2716
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3043
2717
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm leading-4.5 font-medium text-muted-foreground", children: t("bridge.sendToAnotherAddress") }),
|
|
3044
2718
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3045
|
-
Switch,
|
|
2719
|
+
_switch.Switch,
|
|
3046
2720
|
{
|
|
3047
2721
|
className: "data-[state=unchecked]:bg-switch-inactive data-[state=checked]:bg-switch-active",
|
|
3048
2722
|
"aria-pressed": enabled,
|
|
@@ -3066,7 +2740,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3066
2740
|
children: [
|
|
3067
2741
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
3068
2742
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3069
|
-
Input,
|
|
2743
|
+
input.Input,
|
|
3070
2744
|
{
|
|
3071
2745
|
className: "p-0 h-auto text-base leading-5 font-semibold w-full bg-transparent dark:bg-transparent placeholder:text-input-placeholder text-input-text border-none",
|
|
3072
2746
|
placeholder: toChain?.chainKey === "ton" ? t("bridge.tonAddressPlaceholder") : t("bridge.evmAddressPlaceholder"),
|
|
@@ -3082,7 +2756,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3082
2756
|
}) }) })
|
|
3083
2757
|
] }),
|
|
3084
2758
|
!value ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
|
-
Button,
|
|
2759
|
+
button.Button,
|
|
3086
2760
|
{
|
|
3087
2761
|
variant: "default",
|
|
3088
2762
|
className: "self-center py-2 h-8.5 px-3 hover:bg-input-button bg-input-button text-input-button-foreground text-sm leading-4.5 font-semibold uppercase !rounded-40",
|
|
@@ -3090,7 +2764,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3090
2764
|
children: t("common.paste")
|
|
3091
2765
|
}
|
|
3092
2766
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3093
|
-
Button,
|
|
2767
|
+
button.Button,
|
|
3094
2768
|
{
|
|
3095
2769
|
variant: "ghost",
|
|
3096
2770
|
className: "h-5 w-5 self-start\n bg-input-x-bg hover:bg-input-x-bg \n p-0.5 m-0 rounded-full\n border-0 shadow-none\n focus:outline-none focus:ring-0 has-[>svg]:px-0",
|
|
@@ -3106,60 +2780,6 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3106
2780
|
) })
|
|
3107
2781
|
] });
|
|
3108
2782
|
};
|
|
3109
|
-
function Accordion({
|
|
3110
|
-
...props
|
|
3111
|
-
}) {
|
|
3112
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
3113
|
-
}
|
|
3114
|
-
function AccordionItem({
|
|
3115
|
-
className,
|
|
3116
|
-
...props
|
|
3117
|
-
}) {
|
|
3118
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3119
|
-
AccordionPrimitive__namespace.Item,
|
|
3120
|
-
{
|
|
3121
|
-
"data-slot": "accordion-item",
|
|
3122
|
-
className: cn("border-b last:border-b-0", className),
|
|
3123
|
-
...props
|
|
3124
|
-
}
|
|
3125
|
-
);
|
|
3126
|
-
}
|
|
3127
|
-
function AccordionTrigger({
|
|
3128
|
-
className,
|
|
3129
|
-
children,
|
|
3130
|
-
...props
|
|
3131
|
-
}) {
|
|
3132
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3133
|
-
AccordionPrimitive__namespace.Trigger,
|
|
3134
|
-
{
|
|
3135
|
-
"data-slot": "accordion-trigger",
|
|
3136
|
-
className: cn(
|
|
3137
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
3138
|
-
className
|
|
3139
|
-
),
|
|
3140
|
-
...props,
|
|
3141
|
-
children: [
|
|
3142
|
-
children,
|
|
3143
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0 transition-transform duration-200" })
|
|
3144
|
-
]
|
|
3145
|
-
}
|
|
3146
|
-
) });
|
|
3147
|
-
}
|
|
3148
|
-
function AccordionContent({
|
|
3149
|
-
className,
|
|
3150
|
-
children,
|
|
3151
|
-
...props
|
|
3152
|
-
}) {
|
|
3153
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3154
|
-
AccordionPrimitive__namespace.Content,
|
|
3155
|
-
{
|
|
3156
|
-
"data-slot": "accordion-content",
|
|
3157
|
-
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
3158
|
-
...props,
|
|
3159
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
3160
|
-
}
|
|
3161
|
-
);
|
|
3162
|
-
}
|
|
3163
2783
|
function getQuoteAmounts(quote, srcToken, dstToken) {
|
|
3164
2784
|
if (!quote || !srcToken || !dstToken) {
|
|
3165
2785
|
return {
|
|
@@ -3306,19 +2926,19 @@ const Details = () => {
|
|
|
3306
2926
|
})();
|
|
3307
2927
|
const currentSlippageText = formatPercentage(slippageBps);
|
|
3308
2928
|
const routeText = quote?.route ? getRouteDisplayName(quote.route) : t(`settings.routePresets.${routePriority}`);
|
|
3309
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-
|
|
3310
|
-
/* @__PURE__ */ jsxRuntime.jsx(AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-
|
|
2929
|
+
return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionItem, { value: "item-1", className: "bg-muted rounded-lg", children: [
|
|
2930
|
+
/* @__PURE__ */ jsxRuntime.jsx(accordion.AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-lg data-[state=open]:pb-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex items-center justify-between", children: [
|
|
3311
2931
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-normal text-priority leading-3.5", children: t("bridge.youWillReceive", { defaultValue: "You will receive" }) }),
|
|
3312
2932
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-transparent hover:bg-transparent shadow-none h-4 p-0 px-0 py-0 flex items-center gap-1.5", children: [
|
|
3313
2933
|
/* @__PURE__ */ jsxRuntime.jsx(TokenSymbol, { symbol, className: "w-4 h-4", alt: "token" }),
|
|
3314
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-24 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold leading-3.5 text-foreground", children: [
|
|
2934
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-24 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold leading-3.5 text-foreground", children: [
|
|
3315
2935
|
receiveText,
|
|
3316
2936
|
" ",
|
|
3317
2937
|
symbol
|
|
3318
2938
|
] })
|
|
3319
2939
|
] })
|
|
3320
2940
|
] }) }),
|
|
3321
|
-
/* @__PURE__ */ jsxRuntime.jsxs(AccordionContent, { className: "px-5 flex flex-col gap-3", children: [
|
|
2941
|
+
/* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionContent, { className: "px-5 flex flex-col gap-3", children: [
|
|
3322
2942
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3323
2943
|
DetailsRow,
|
|
3324
2944
|
{
|
|
@@ -3367,7 +2987,7 @@ const DetailsRow = ({
|
|
|
3367
2987
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-priority font-normal", children: label }),
|
|
3368
2988
|
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: label, children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "size-4 text-receive-icon" }) })
|
|
3369
2989
|
] }),
|
|
3370
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
2990
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
3371
2991
|
] });
|
|
3372
2992
|
const useTransactionStore = zustand.create((set, get) => ({
|
|
3373
2993
|
current: void 0,
|
|
@@ -4003,7 +3623,7 @@ const SubmitButton = () => {
|
|
|
4003
3623
|
}
|
|
4004
3624
|
};
|
|
4005
3625
|
const disabled = isBusy || amountNum <= 0 || status === "loading" || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer;
|
|
4006
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleClick, disabled, className: "w-full mt-4", children: label });
|
|
3626
|
+
return /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: handleClick, disabled, className: "w-full mt-4", children: label });
|
|
4007
3627
|
};
|
|
4008
3628
|
function short(addr) {
|
|
4009
3629
|
return addr.slice(0, 4) + "…" + addr.slice(-4);
|
|
@@ -4108,17 +3728,17 @@ const WalletSelectModal = () => {
|
|
|
4108
3728
|
console.error("Failed to connect wallet:", error);
|
|
4109
3729
|
}
|
|
4110
3730
|
};
|
|
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") })
|
|
3731
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { children: [
|
|
3732
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { children: [
|
|
3733
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("wallets.chooseWallet") }),
|
|
3734
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: t("wallets.oneWalletPerEnv") })
|
|
4115
3735
|
] }),
|
|
4116
3736
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
4117
3737
|
connectedWallets.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4118
3738
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t("wallets.connected") }),
|
|
4119
3739
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: connectedWallets.map((wallet) => {
|
|
4120
3740
|
const IconComponent = wallet.icon;
|
|
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: [
|
|
3741
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mx-5", children: /* @__PURE__ */ jsxRuntime.jsxs(button.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: [
|
|
4122
3742
|
/* @__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: [
|
|
4123
3743
|
/* @__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" }) }),
|
|
4124
3744
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4147,7 +3767,7 @@ const WalletSelectModal = () => {
|
|
|
4147
3767
|
const isEvmConnector = category.title === t("wallets.evmWallets");
|
|
4148
3768
|
const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
|
|
4149
3769
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4150
|
-
Button,
|
|
3770
|
+
button.Button,
|
|
4151
3771
|
{
|
|
4152
3772
|
type: "button",
|
|
4153
3773
|
onClick: () => {
|
|
@@ -4234,7 +3854,7 @@ const TransactionProgressVector = (props) => {
|
|
|
4234
3854
|
] });
|
|
4235
3855
|
};
|
|
4236
3856
|
const ProgressStep = () => {
|
|
4237
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "flex flex-col border-none h-full overflow-hidden bg-background rounded-none md:rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex relative flex-col gap-4 py-10 px-8 flex-1 items-center justify-start text-center noise bg-background", children: [
|
|
3857
|
+
return /* @__PURE__ */ jsxRuntime.jsx(card.Card, { className: "flex flex-col border-none h-full overflow-hidden bg-background rounded-none md:rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "flex relative flex-col gap-4 py-10 px-8 flex-1 items-center justify-start text-center noise bg-background", children: [
|
|
4238
3858
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionProgressVector, { className: "progress-rocket" }),
|
|
4239
3859
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-progress-small under-noise" }),
|
|
4240
3860
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-progress-big under-noise" }),
|
|
@@ -4498,15 +4118,15 @@ const TransactionFailedVector = (props) => {
|
|
|
4498
4118
|
};
|
|
4499
4119
|
const FailedStep = () => {
|
|
4500
4120
|
const { current, reset } = useTransactionStore();
|
|
4501
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "flex flex-col h-full border-none overflow-hidden bg-background rounded-none md:rounded-lg", children: [
|
|
4502
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex flex-col relative gap-4 pt-10 px-8 flex-1 items-center justify-start text-center noise noise", children: [
|
|
4121
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(card.Card, { className: "flex flex-col h-full border-none overflow-hidden bg-background rounded-none md:rounded-lg", children: [
|
|
4122
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "flex flex-col relative gap-4 pt-10 px-8 flex-1 items-center justify-start text-center noise noise", children: [
|
|
4503
4123
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionFailedVector, {}),
|
|
4504
4124
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-failed-small under-noise" }),
|
|
4505
4125
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-failed-big under-noise" }),
|
|
4506
4126
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-display font-black relative z-10", children: i18next.t("transaction.failed") }),
|
|
4507
4127
|
current?.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full space-y-2 mt-6 relative z-10", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: current.error }) })
|
|
4508
4128
|
] }),
|
|
4509
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: "flex-col gap-3 pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", className: "w-full", onClick: reset, children: i18next.t("common.close") }) })
|
|
4129
|
+
/* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { className: "flex-col gap-3 pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", className: "w-full", onClick: reset, children: i18next.t("common.close") }) })
|
|
4510
4130
|
] });
|
|
4511
4131
|
};
|
|
4512
4132
|
const TransactionSuccessVector = (props) => {
|
|
@@ -5877,8 +5497,8 @@ const SuccessStep = () => {
|
|
|
5877
5497
|
sonner.toast.success("Hash copied to clipboard");
|
|
5878
5498
|
}
|
|
5879
5499
|
};
|
|
5880
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "flex flex-col h-full border-none relative overflow-hidden bg-background rounded-none md:rounded-lg min-h-[540px]", children: [
|
|
5881
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex flex-col gap-4 pt-10 px-8 flex-1 justify-start items-center text-center noise bg-background", children: [
|
|
5500
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(card.Card, { className: "flex flex-col h-full border-none relative overflow-hidden bg-background rounded-none md:rounded-lg min-h-[540px]", children: [
|
|
5501
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "flex flex-col gap-4 pt-10 px-8 flex-1 justify-start items-center text-center noise bg-background", children: [
|
|
5882
5502
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionSuccessVector, {}),
|
|
5883
5503
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5884
5504
|
Fireworks,
|
|
@@ -5942,7 +5562,7 @@ const SuccessStep = () => {
|
|
|
5942
5562
|
] })
|
|
5943
5563
|
] })
|
|
5944
5564
|
] }),
|
|
5945
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: "pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: reset, className: "w-full", children: t("done") }) })
|
|
5565
|
+
/* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { className: "pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t("done") }) })
|
|
5946
5566
|
] });
|
|
5947
5567
|
};
|
|
5948
5568
|
const TransactionConfirmVector = (props) => {
|
|
@@ -6089,7 +5709,7 @@ const useCountdown = (initialSeconds) => {
|
|
|
6089
5709
|
const ConfirmStep = () => {
|
|
6090
5710
|
const { t } = reactI18next.useTranslation();
|
|
6091
5711
|
const { formatTime } = useCountdown(90);
|
|
6092
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "flex flex-col border-none h-full bg-background overflow-hidden rounded-none md:rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "flex flex-col relative gap-4 py-10 px-8 flex-1 items-center justify-start text-center noise", children: [
|
|
5712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(card.Card, { className: "flex flex-col border-none h-full bg-background overflow-hidden rounded-none md:rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "flex flex-col relative gap-4 py-10 px-8 flex-1 items-center justify-start text-center noise", children: [
|
|
6093
5713
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionConfirmVector, {}),
|
|
6094
5714
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-confirm-small under-noise" }),
|
|
6095
5715
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-confirm-big under-noise" }),
|
|
@@ -6115,8 +5735,8 @@ const TransactionManager = () => {
|
|
|
6115
5735
|
if (status === "completed") {
|
|
6116
5736
|
step = /* @__PURE__ */ jsxRuntime.jsx(SuccessStep, {});
|
|
6117
5737
|
}
|
|
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 }) });
|
|
5738
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: true, onOpenChange: () => {
|
|
5739
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "p-0 gap-0 border-none max-w-[calc(100%-2rem)] sm:max-w-md", children: step }) });
|
|
6120
5740
|
};
|
|
6121
5741
|
const useTokensRequest = () => {
|
|
6122
5742
|
const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
|
|
@@ -6619,6 +6239,7 @@ class EvmChainStrategy {
|
|
|
6619
6239
|
console.warn("No publicClient available for balance query");
|
|
6620
6240
|
return {};
|
|
6621
6241
|
}
|
|
6242
|
+
console.log("publicClient", this.publicClient);
|
|
6622
6243
|
return await getEvmBalances(this.publicClient, address, tokens, priorityToken);
|
|
6623
6244
|
}
|
|
6624
6245
|
isAddressValid(address) {
|
|
@@ -7655,8 +7276,8 @@ class TronChainStrategy {
|
|
|
7655
7276
|
shift += 7;
|
|
7656
7277
|
}
|
|
7657
7278
|
const dataBytes = bytes.slice(i, i + len);
|
|
7658
|
-
const
|
|
7659
|
-
return { contractAddress, input, callValue };
|
|
7279
|
+
const input2 = "0x" + Array.from(dataBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
7280
|
+
return { contractAddress, input: input2, callValue };
|
|
7660
7281
|
} catch {
|
|
7661
7282
|
return null;
|
|
7662
7283
|
}
|
|
@@ -8011,19 +7632,19 @@ const EvaaBridgeContent = ({
|
|
|
8011
7632
|
}, [chains, assetMatrix, allowedFromChains]);
|
|
8012
7633
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8013
7634
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8014
|
-
Card,
|
|
7635
|
+
card.Card,
|
|
8015
7636
|
{
|
|
8016
|
-
className: cn(
|
|
7637
|
+
className: utils.cn(
|
|
8017
7638
|
"max-w-md w-full mx-auto flex flex-col relative",
|
|
8018
7639
|
className
|
|
8019
7640
|
),
|
|
8020
7641
|
children: [
|
|
8021
7642
|
/* @__PURE__ */ jsxRuntime.jsx(FormHeader, {}),
|
|
8022
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-[1px]", children: [
|
|
7643
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "space-y-[1px]", children: [
|
|
8023
7644
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8024
7645
|
SwapSection,
|
|
8025
7646
|
{
|
|
8026
|
-
className: "rounded-t-
|
|
7647
|
+
className: "rounded-t-lg",
|
|
8027
7648
|
label: t("bridge.sourceNetwork"),
|
|
8028
7649
|
balance: fromBalance,
|
|
8029
7650
|
chain: fromChain,
|
|
@@ -8058,7 +7679,7 @@ const EvaaBridgeContent = ({
|
|
|
8058
7679
|
),
|
|
8059
7680
|
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, {})
|
|
8060
7681
|
] }),
|
|
8061
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(Details, {}) })
|
|
7682
|
+
/* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(Details, {}) })
|
|
8062
7683
|
]
|
|
8063
7684
|
}
|
|
8064
7685
|
),
|