@rash2x/bridge-widget 0.1.11 → 0.1.13
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 +23 -2
- package/dist/evaa-bridge.cjs +181 -480
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +109 -388
- package/dist/evaa-bridge.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -25,52 +25,97 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
26
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
27
27
|
const jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
const reactI18next = require("react-i18next");
|
|
29
28
|
const require$$0 = require("react");
|
|
29
|
+
const reactI18next = require("react-i18next");
|
|
30
|
+
const i18n = require("i18next");
|
|
30
31
|
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");
|
|
32
|
+
const button = require("@/components/ui/button");
|
|
33
|
+
const dialog = require("@/components/ui/dialog");
|
|
34
|
+
const tooltip = require("@/components/ui/tooltip");
|
|
35
|
+
const utils = require("@/lib/utils");
|
|
36
|
+
const input = require("@/components/ui/input");
|
|
38
37
|
const wagmi = require("wagmi");
|
|
39
38
|
const tronwalletAdapterReactHooks = require("@tronweb3/tronwallet-adapter-react-hooks");
|
|
40
39
|
const uiReact = require("@tonconnect/ui-react");
|
|
41
40
|
const reactQuery = require("@tanstack/react-query");
|
|
42
41
|
const core = require("@ton/core");
|
|
43
42
|
const reactWindow = require("react-window");
|
|
44
|
-
const
|
|
43
|
+
const skeleton = require("@/components/ui/skeleton");
|
|
44
|
+
const card = require("@/components/ui/card");
|
|
45
|
+
const _switch = require("@/components/ui/switch");
|
|
46
|
+
const lucideReact = require("lucide-react");
|
|
45
47
|
const framerMotion = require("framer-motion");
|
|
46
|
-
const
|
|
47
|
-
const i18next = require("i18next");
|
|
48
|
+
const accordion = require("@/components/ui/accordion");
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
const common$1 = { "connecting": "Connecting…", "initializing": "Initializing...", "loading": "Loading...", "paste": "paste", "close": "Close", "zeroPlaceholder": "0", "nativeToken": "Native Token" };
|
|
55
|
+
const wallets$1 = { "addTonWallet": "Add TON wallet", "addEvmWallet": "Add EVM wallet", "connectTonWallet": "Connect TON wallet", "connectEvmWallet": "Connect EVM wallet", "initializingMetamask": "Initializing MetaMask SDK...", "initializingTronlink": "Initializing TronLink...", "failedToConnectTon": "Failed to connect to TON wallet", "failedToDisconnect": "Failed to disconnect", "metamaskConnectionError": "MetaMask connection error", "failedToConnectMetamask": "Failed to connect to MetaMask", "failedToDisconnectMetamask": "Failed to disconnect from MetaMask", "selectWallet": "Select Wallet", "tonWallets": "TON", "evmWallets": "EVM", "tronWallets": "TRON", "tonKeeper": "TonKeeper", "metaMask": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Add Tron wallet", "comingSoon": "Coming Soon", "connected": "CONNECTED", "disconnect": "Disconnect", "chooseWallet": "Choose wallet", "oneWalletPerEnv": "You can only connect one wallet per environment.", "connect": "Connect", "connectTronWallet": "Connect Tron wallet", "connectWallet": "Connect wallet" };
|
|
56
|
+
const bridge$1 = { "sourceNetwork": "Source network", "destinationNetwork": "Destination network", "selectToken": "Select token", "selectNetwork": "Select network", "searchToken": "Search token", "searchDestinationChain": "Search destination chain", "myTokens": "My tokens", "allTokens": "All tokens", "willChangeSourceChain": "Will Change Source Chain", "noBalancesFound": "No balances found.", "noResults": "No results", "sendToAnotherAddress": "Send to another address", "youWillReceive": "You will receive", "tonAddressPlaceholder": "TON address", "evmAddressPlaceholder": "0x… EVM address", "addressDoesntMatch": "Address doesn't match the {{network}} network", "checkBeforeTransfer": "Check correctness before transfer" };
|
|
57
|
+
const transaction$1 = { "enterAmount": "Enter amount", "transfer": "Transfer", "getQuote": "Get quote", "failed": "Transaction Failed", "confirm": "Confirm transaction", "signTransaction": "Sign in transaction in wallet", "quoting": "Quoting...", "inProgress": "Processing...", "checkingBalance": "Checking balance...", "insufficientBalance": "Insufficient balance", "amountTooSmall": "Min {{min}}", "amountTooLarge": "Max {{max}}", "successTitle": "Success", "bridged": "Bridged", "transferTitle": "Transfer", "hash": "Hash", "route": "Route", "estTime": "Est. Time", "slippage": "Slippage", "minimumReceived": "Minimum received", "totalFee": "Total Fee", "noRouteFound": "No route found", "notEnoughGas": "Not enough gas", "noRouteFoundForSettings": "No route found for current settings.", "tryAdjustSettings": "Try disabling Gas on Destination, or adjust amount/networks.", "quoteError": "Quote error" };
|
|
58
|
+
const app$1 = { "stargateWidgetName": "Stargate Bridge Widget", "liveWidget": "Live Widget", "getStarted": "Get Started" };
|
|
59
|
+
const settings$1 = { "title": "Settings", "gasOnDestination": "Gas on destination", "slippageTolerance": "Slippage tolerance", "routePriority": "Route Priority", "highSlippageWarning": "High slippage warning", "gasPresets": { "auto": "Auto", "none": "None", "medium": "Medium", "max": "Max" }, "routePresets": { "fastest": "Fastest", "cheapest": "Cheapest", "recommended": "Recommended" } };
|
|
60
|
+
const en = {
|
|
61
|
+
common: common$1,
|
|
62
|
+
wallets: wallets$1,
|
|
63
|
+
bridge: bridge$1,
|
|
64
|
+
transaction: transaction$1,
|
|
65
|
+
app: app$1,
|
|
66
|
+
settings: settings$1
|
|
67
|
+
};
|
|
68
|
+
const common = { "connecting": "Подключение…", "initializing": "Инициализация...", "loading": "Загрузка...", "paste": "вставить", "close": "Закрыть", "zeroPlaceholder": "0", "nativeToken": "Нативный токен" };
|
|
69
|
+
const wallets = { "addTonWallet": "Добавить TON кошелёк", "addEvmWallet": "Добавить EVM кошелёк", "connectTonWallet": "Подключить TON кошелёк", "connectEvmWallet": "Подключить EVM кошелёк", "initializingMetamask": "Инициализация MetaMask SDK...", "initializingTronlink": "Инициализация TronLink...", "failedToConnectTon": "Не удалось подключиться к TON кошельку", "failedToDisconnect": "Не удалось отключиться", "metamaskConnectionError": "Ошибка подключения MetaMask", "failedToConnectMetamask": "Не удалось подключиться к MetaMask", "failedToDisconnectMetamask": "Не удалось отключиться от MetaMask", "selectWallet": "Выберите кошелёк", "tonWallets": "TON", "evmWallets": "EVM", "tronWallets": "TRON", "tonKeeper": "TonKeeper", "metaMask": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Добавить Tron кошелёк", "comingSoon": "Скоро", "connected": "ПОДКЛЮЧЕНО", "disconnect": "Отключить", "chooseWallet": "Выберите кошелёк", "oneWalletPerEnv": "Можно подключить только один кошелёк на окружение.", "connect": "Подключить", "connectTronWallet": "Подключить Tron кошелёк", "connectWallet": "Подключить кошелёк" };
|
|
70
|
+
const bridge = { "sourceNetwork": "Исходная сеть", "destinationNetwork": "Целевая сеть", "selectToken": "Выбрать токен", "selectNetwork": "Выбрать сеть", "searchToken": "Поиск токена", "searchDestinationChain": "Поиск целевой сети", "myTokens": "Мои токены", "allTokens": "Все токены", "willChangeSourceChain": "Сменит исходную сеть", "noBalancesFound": "Балансы не найдены.", "noResults": "Нет результатов", "sendToAnotherAddress": "Отправить на другой адрес", "youWillReceive": "Вы получите", "tonAddressPlaceholder": "TON адрес", "evmAddressPlaceholder": "0x… EVM адрес", "addressDoesntMatch": "Адрес не соответствует сети {{network}}", "checkBeforeTransfer": "Проверьте корректность перед переводом" };
|
|
71
|
+
const transaction = { "enterAmount": "Введите сумму", "transfer": "Перевести", "getQuote": "Получить котировку", "quoting": "Расчет котировки...", "failed": "Ошибка транзакции", "confirm": "Подтвердите транзакцию", "signTransaction": "Подпишите транзакцию в кошельке", "inProgress": "Выполнение...", "checkingBalance": "Проверка баланса...", "insufficientBalance": "Недостаточно средств", "amountTooSmall": "Минимум {{min}}", "amountTooLarge": "Максимум {{max}}", "successTitle": "Успех", "bridged": "Переведено", "transferTitle": "Перевод", "hash": "Хэш", "route": "Маршрут", "estTime": "Время", "slippage": "Проскальзывание", "minimumReceived": "Минимум к получению", "totalFee": "Общая комиссия", "noRouteFound": "Маршрут не найден", "notEnoughGas": "Недостаточно газа", "noRouteFoundForSettings": "Маршрут не найден для текущих настроек.", "tryAdjustSettings": "Попробуйте отключить Gas on Destination или измените сумму/сети.", "quoteError": "Ошибка котировки" };
|
|
72
|
+
const app = { "stargateWidgetName": "Виджет Stargate Bridge", "liveWidget": "Живой виджет", "getStarted": "Начало работы" };
|
|
73
|
+
const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "slippageTolerance": "Толерантность к проскальзыванию", "routePriority": "Приоритет маршрута", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрейший", "cheapest": "Дешевейший", "recommended": "Рекомендуемый" } };
|
|
74
|
+
const ru = {
|
|
75
|
+
common,
|
|
76
|
+
wallets,
|
|
77
|
+
bridge,
|
|
78
|
+
transaction,
|
|
79
|
+
app,
|
|
80
|
+
settings
|
|
81
|
+
};
|
|
82
|
+
const bridgeI18n = i18n.createInstance();
|
|
83
|
+
const resources = {
|
|
84
|
+
en: {
|
|
85
|
+
"evaa-bridge": en
|
|
86
|
+
},
|
|
87
|
+
ru: {
|
|
88
|
+
"evaa-bridge": ru
|
|
65
89
|
}
|
|
66
|
-
|
|
67
|
-
|
|
90
|
+
};
|
|
91
|
+
bridgeI18n.use(reactI18next.initReactI18next).init({
|
|
92
|
+
resources,
|
|
93
|
+
lng: "en",
|
|
94
|
+
// Will be overridden by defaultLanguage prop
|
|
95
|
+
fallbackLng: "en",
|
|
96
|
+
debug: false,
|
|
97
|
+
// Use a dedicated namespace to avoid conflicts
|
|
98
|
+
defaultNS: "evaa-bridge",
|
|
99
|
+
ns: ["evaa-bridge"],
|
|
100
|
+
interpolation: {
|
|
101
|
+
escapeValue: false
|
|
102
|
+
// react already does escaping
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function BridgeI18nProvider({
|
|
106
|
+
children,
|
|
107
|
+
defaultLanguage = "en"
|
|
108
|
+
}) {
|
|
109
|
+
require$$0.useEffect(() => {
|
|
110
|
+
if (bridgeI18n.language !== defaultLanguage) {
|
|
111
|
+
bridgeI18n.changeLanguage(defaultLanguage);
|
|
112
|
+
}
|
|
113
|
+
}, [defaultLanguage]);
|
|
114
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: bridgeI18n, children });
|
|
115
|
+
}
|
|
116
|
+
function useBridgeTranslation() {
|
|
117
|
+
return reactI18next.useTranslation("evaa-bridge", { i18n: bridgeI18n });
|
|
68
118
|
}
|
|
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
119
|
const norm = (s) => (s ?? "").toUpperCase().replace(/₮/g, "T").replace(/[^A-Z0-9]/g, "");
|
|
75
120
|
const POPULAR_ORDER = [
|
|
76
121
|
"USDT",
|
|
@@ -523,147 +568,6 @@ const ExitIcon = (props) => {
|
|
|
523
568
|
}
|
|
524
569
|
);
|
|
525
570
|
};
|
|
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
571
|
const TipIcon = (props) => {
|
|
668
572
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
669
573
|
"svg",
|
|
@@ -720,57 +624,11 @@ const TipIcon = (props) => {
|
|
|
720
624
|
}
|
|
721
625
|
);
|
|
722
626
|
};
|
|
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
627
|
const Tip = (props) => {
|
|
770
628
|
const { children, text } = props;
|
|
771
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
772
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { children }),
|
|
773
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
629
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
|
|
630
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { children }),
|
|
631
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
774
632
|
] });
|
|
775
633
|
};
|
|
776
634
|
async function getChains() {
|
|
@@ -1038,7 +896,7 @@ const routePresets = [
|
|
|
1038
896
|
RoutePriority.RECOMMENDED
|
|
1039
897
|
];
|
|
1040
898
|
const SettingModal = ({ isOpen, onClose }) => {
|
|
1041
|
-
const { t } =
|
|
899
|
+
const { t } = useBridgeTranslation();
|
|
1042
900
|
const { toChain } = useChainsStore();
|
|
1043
901
|
const { tokens } = useTokensStore();
|
|
1044
902
|
const {
|
|
@@ -1070,8 +928,8 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1070
928
|
);
|
|
1071
929
|
const activeBtn = "bg-settings-active hover:bg-settings-active/80 text-settings-active-foreground";
|
|
1072
930
|
const notActiveBtn = "bg-settings-button hover:bg-settings-button/80 text-settings-button-foreground";
|
|
1073
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { children: [
|
|
1074
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("settings.title", { defaultValue: "Settings" }) }) }),
|
|
931
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { children: [
|
|
932
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("settings.title", { defaultValue: "Settings" }) }) }),
|
|
1075
933
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
1076
934
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
1077
935
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
@@ -1096,11 +954,11 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1096
954
|
) }) })
|
|
1097
955
|
] }),
|
|
1098
956
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5", children: gasPresets.map((g) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1099
|
-
Button,
|
|
957
|
+
button.Button,
|
|
1100
958
|
{
|
|
1101
959
|
type: "button",
|
|
1102
960
|
onClick: () => setGasPreset(g),
|
|
1103
|
-
className: cn(
|
|
961
|
+
className: utils.cn(
|
|
1104
962
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1105
963
|
gasPreset === g ? activeBtn : notActiveBtn
|
|
1106
964
|
),
|
|
@@ -1124,14 +982,14 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1124
982
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-6", children: [
|
|
1125
983
|
/* @__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 }) }),
|
|
1126
984
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: slippagePresets.map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1127
|
-
Button,
|
|
985
|
+
button.Button,
|
|
1128
986
|
{
|
|
1129
987
|
type: "button",
|
|
1130
988
|
onClick: () => {
|
|
1131
989
|
const bps = parseFloat(p.replace("%", "")) * 100;
|
|
1132
990
|
setSlippageBps(bps);
|
|
1133
991
|
},
|
|
1134
|
-
className: cn(
|
|
992
|
+
className: utils.cn(
|
|
1135
993
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1136
994
|
activeSlippagePreset === p ? activeBtn : notActiveBtn
|
|
1137
995
|
),
|
|
@@ -1148,11 +1006,11 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1148
1006
|
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.routePriority"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "size-4 text-muted-foreground" }) })
|
|
1149
1007
|
] }) }),
|
|
1150
1008
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1151
|
-
Button,
|
|
1009
|
+
button.Button,
|
|
1152
1010
|
{
|
|
1153
1011
|
type: "button",
|
|
1154
1012
|
onClick: () => setRoutePriority(r),
|
|
1155
|
-
className: cn(
|
|
1013
|
+
className: utils.cn(
|
|
1156
1014
|
`cursor-pointer rounded-6 px-2 py-2.5 h-7 text-xs font-semibold leading-2 transition`,
|
|
1157
1015
|
routePriority === r ? activeBtn : notActiveBtn
|
|
1158
1016
|
),
|
|
@@ -1164,21 +1022,6 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1164
1022
|
] })
|
|
1165
1023
|
] }) });
|
|
1166
1024
|
};
|
|
1167
|
-
function Input({ className, type, ...props }) {
|
|
1168
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1169
|
-
"input",
|
|
1170
|
-
{
|
|
1171
|
-
type,
|
|
1172
|
-
"data-slot": "input",
|
|
1173
|
-
className: cn(
|
|
1174
|
-
"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",
|
|
1175
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
1176
|
-
className
|
|
1177
|
-
),
|
|
1178
|
-
...props
|
|
1179
|
-
}
|
|
1180
|
-
);
|
|
1181
|
-
}
|
|
1182
1025
|
function useAddresses() {
|
|
1183
1026
|
const { fromChain, toChain } = useChainsStore();
|
|
1184
1027
|
const { address: evmAddress } = wagmi.useAccount();
|
|
@@ -1570,9 +1413,6 @@ function useTokenSelectData(items) {
|
|
|
1570
1413
|
hasAnyWallet
|
|
1571
1414
|
};
|
|
1572
1415
|
}
|
|
1573
|
-
function Skeleton({ className }) {
|
|
1574
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-[#999]", className) });
|
|
1575
|
-
}
|
|
1576
1416
|
const TokenRow = ({
|
|
1577
1417
|
symbol,
|
|
1578
1418
|
name,
|
|
@@ -1584,7 +1424,7 @@ const TokenRow = ({
|
|
|
1584
1424
|
onPick
|
|
1585
1425
|
}) => {
|
|
1586
1426
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1587
|
-
Button,
|
|
1427
|
+
button.Button,
|
|
1588
1428
|
{
|
|
1589
1429
|
onClick: onPick,
|
|
1590
1430
|
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" : ""}`,
|
|
@@ -1604,8 +1444,8 @@ const TokenRow = ({
|
|
|
1604
1444
|
] })
|
|
1605
1445
|
] }),
|
|
1606
1446
|
/* @__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: [
|
|
1607
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-16 rounded-md" }),
|
|
1608
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-3 w-12 rounded-md" })
|
|
1447
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-16 rounded-md" }),
|
|
1448
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-12 rounded-md" })
|
|
1609
1449
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1610
1450
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-extrabold text-foreground text-lg leading-4 truncate", children: hasAnyWallet ? formatBalance(balance) : "—" }),
|
|
1611
1451
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 text-muted-foreground", children: hasAnyWallet && balance > 0 && usdValue > 0 ? formatUsd(usdValue) : "—" })
|
|
@@ -1683,7 +1523,7 @@ const TokenSelectModal = ({
|
|
|
1683
1523
|
items,
|
|
1684
1524
|
onChangeAsset
|
|
1685
1525
|
}) => {
|
|
1686
|
-
const { t } =
|
|
1526
|
+
const { t } = useBridgeTranslation();
|
|
1687
1527
|
const {
|
|
1688
1528
|
query,
|
|
1689
1529
|
setQuery,
|
|
@@ -1761,8 +1601,8 @@ const TokenSelectModal = ({
|
|
|
1761
1601
|
}
|
|
1762
1602
|
return out;
|
|
1763
1603
|
}, [effectiveTab, myTokens, groupedTokens, t]);
|
|
1764
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-auto", children: [
|
|
1765
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("bridge.selectToken") }) }),
|
|
1604
|
+
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: [
|
|
1605
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("bridge.selectToken") }) }),
|
|
1766
1606
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1767
1607
|
"div",
|
|
1768
1608
|
{
|
|
@@ -1770,7 +1610,7 @@ const TokenSelectModal = ({
|
|
|
1770
1610
|
children: [
|
|
1771
1611
|
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-input-icon" }),
|
|
1772
1612
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1773
|
-
Input,
|
|
1613
|
+
input.Input,
|
|
1774
1614
|
{
|
|
1775
1615
|
placeholder: t("bridge.searchToken"),
|
|
1776
1616
|
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",
|
|
@@ -1785,7 +1625,7 @@ const TokenSelectModal = ({
|
|
|
1785
1625
|
),
|
|
1786
1626
|
hasAnyWallet() && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1787
1627
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1788
|
-
Button,
|
|
1628
|
+
button.Button,
|
|
1789
1629
|
{
|
|
1790
1630
|
variant: tab === "my" ? "default" : "outline",
|
|
1791
1631
|
onClick: () => setTab("my"),
|
|
@@ -1794,7 +1634,7 @@ const TokenSelectModal = ({
|
|
|
1794
1634
|
}
|
|
1795
1635
|
),
|
|
1796
1636
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1797
|
-
Button,
|
|
1637
|
+
button.Button,
|
|
1798
1638
|
{
|
|
1799
1639
|
variant: tab === "all" ? "default" : "outline",
|
|
1800
1640
|
onClick: () => setTab("all"),
|
|
@@ -1895,7 +1735,7 @@ const RefreshButton = () => {
|
|
|
1895
1735
|
refresh();
|
|
1896
1736
|
}, [refresh]);
|
|
1897
1737
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1898
|
-
Button,
|
|
1738
|
+
button.Button,
|
|
1899
1739
|
{
|
|
1900
1740
|
onClick: handleRefresh,
|
|
1901
1741
|
disabled: spinning,
|
|
@@ -1917,12 +1757,12 @@ const SelectTokenButton = ({
|
|
|
1917
1757
|
onClick,
|
|
1918
1758
|
token
|
|
1919
1759
|
}) => {
|
|
1920
|
-
const { t } =
|
|
1760
|
+
const { t } = useBridgeTranslation();
|
|
1921
1761
|
const label = require$$0.useMemo(() => {
|
|
1922
1762
|
return token?.symbol ?? t("bridge.selectToken");
|
|
1923
1763
|
}, [token, t]);
|
|
1924
1764
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1925
|
-
Button,
|
|
1765
|
+
button.Button,
|
|
1926
1766
|
{
|
|
1927
1767
|
onClick,
|
|
1928
1768
|
size: "sm",
|
|
@@ -1946,77 +1786,8 @@ const SelectTokenButton = ({
|
|
|
1946
1786
|
}
|
|
1947
1787
|
);
|
|
1948
1788
|
};
|
|
1949
|
-
function Card({ className, ...props }) {
|
|
1950
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1951
|
-
"div",
|
|
1952
|
-
{
|
|
1953
|
-
"data-slot": "card",
|
|
1954
|
-
className: cn(
|
|
1955
|
-
"bg-card text-card-foreground flex flex-col gap-4 rounded-lg border py-4 shadow-sm",
|
|
1956
|
-
className
|
|
1957
|
-
),
|
|
1958
|
-
...props
|
|
1959
|
-
}
|
|
1960
|
-
);
|
|
1961
|
-
}
|
|
1962
|
-
function CardHeader({ className, ...props }) {
|
|
1963
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1964
|
-
"div",
|
|
1965
|
-
{
|
|
1966
|
-
"data-slot": "card-header",
|
|
1967
|
-
className: cn(
|
|
1968
|
-
"@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",
|
|
1969
|
-
className
|
|
1970
|
-
),
|
|
1971
|
-
...props
|
|
1972
|
-
}
|
|
1973
|
-
);
|
|
1974
|
-
}
|
|
1975
|
-
function CardTitle({ className, ...props }) {
|
|
1976
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1977
|
-
"div",
|
|
1978
|
-
{
|
|
1979
|
-
"data-slot": "card-title",
|
|
1980
|
-
className: cn("leading-none font-semibold", className),
|
|
1981
|
-
...props
|
|
1982
|
-
}
|
|
1983
|
-
);
|
|
1984
|
-
}
|
|
1985
|
-
function CardAction({ className, ...props }) {
|
|
1986
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1987
|
-
"div",
|
|
1988
|
-
{
|
|
1989
|
-
"data-slot": "card-action",
|
|
1990
|
-
className: cn(
|
|
1991
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
1992
|
-
className
|
|
1993
|
-
),
|
|
1994
|
-
...props
|
|
1995
|
-
}
|
|
1996
|
-
);
|
|
1997
|
-
}
|
|
1998
|
-
function CardContent({ className, ...props }) {
|
|
1999
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2000
|
-
"div",
|
|
2001
|
-
{
|
|
2002
|
-
"data-slot": "card-content",
|
|
2003
|
-
className: cn("px-4", className),
|
|
2004
|
-
...props
|
|
2005
|
-
}
|
|
2006
|
-
);
|
|
2007
|
-
}
|
|
2008
|
-
function CardFooter({ className, ...props }) {
|
|
2009
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2010
|
-
"div",
|
|
2011
|
-
{
|
|
2012
|
-
"data-slot": "card-footer",
|
|
2013
|
-
className: cn("flex items-center px-4 [.border-t]:pt-4", className),
|
|
2014
|
-
...props
|
|
2015
|
-
}
|
|
2016
|
-
);
|
|
2017
|
-
}
|
|
2018
1789
|
const FormHeaderComponent = () => {
|
|
2019
|
-
const { t } =
|
|
1790
|
+
const { t } = useBridgeTranslation();
|
|
2020
1791
|
const { isOpen, onClose, onOpen } = useModal();
|
|
2021
1792
|
const {
|
|
2022
1793
|
isOpen: isOpenSettings,
|
|
@@ -2031,14 +1802,14 @@ const FormHeaderComponent = () => {
|
|
|
2031
1802
|
const sum = selectedAssetSymbol.toUpperCase();
|
|
2032
1803
|
return assets.find((a) => a.symbol.toUpperCase() === sum) ?? assets[0];
|
|
2033
1804
|
}, [assets, selectedAssetSymbol]);
|
|
2034
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "gap-y-0 flex justify-between items-center", children: [
|
|
2035
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex items-center gap-2.5", children: [
|
|
1805
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(card.CardHeader, { className: "gap-y-0 flex justify-between items-center", children: [
|
|
1806
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardTitle, { className: "flex items-center gap-2.5", children: [
|
|
2036
1807
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal leading-3.5 text-muted-foreground", children: t("bridge.selectToken") }),
|
|
2037
1808
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTokenButton, { token: current, onClick: onOpen })
|
|
2038
1809
|
] }),
|
|
2039
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardAction, { className: "flex items-center gap-2.5", children: [
|
|
1810
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardAction, { className: "flex items-center gap-2.5", children: [
|
|
2040
1811
|
/* @__PURE__ */ jsxRuntime.jsx(RefreshButton, {}),
|
|
2041
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onOpenSettings, size: "sm", variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(BoltIcon, { stroke: "currentColor" }) })
|
|
1812
|
+
/* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: onOpenSettings, size: "sm", variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(BoltIcon, { stroke: "currentColor" }) })
|
|
2042
1813
|
] }),
|
|
2043
1814
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2044
1815
|
TokenSelectModal,
|
|
@@ -2134,7 +1905,7 @@ function useBridgeQuote() {
|
|
|
2134
1905
|
setNoRoute,
|
|
2135
1906
|
resetWithIdle
|
|
2136
1907
|
} = useBridgeQuoteStore();
|
|
2137
|
-
const
|
|
1908
|
+
const input2 = inputAmount;
|
|
2138
1909
|
const srcTokenOnFrom = require$$0.useMemo(
|
|
2139
1910
|
() => resolveTokenOnChainFromMatrix$2(
|
|
2140
1911
|
assetMatrix,
|
|
@@ -2153,11 +1924,11 @@ function useBridgeQuote() {
|
|
|
2153
1924
|
);
|
|
2154
1925
|
const [loading, setLoading] = require$$0.useState(false);
|
|
2155
1926
|
require$$0.useEffect(() => {
|
|
2156
|
-
if (!
|
|
1927
|
+
if (!input2 || input2 === "") {
|
|
2157
1928
|
setLoading(false);
|
|
2158
1929
|
resetWithIdle();
|
|
2159
1930
|
}
|
|
2160
|
-
}, [
|
|
1931
|
+
}, [input2, resetWithIdle]);
|
|
2161
1932
|
require$$0.useEffect(() => {
|
|
2162
1933
|
const resetUi = (withError) => {
|
|
2163
1934
|
setLoading(false);
|
|
@@ -2165,7 +1936,7 @@ function useBridgeQuote() {
|
|
|
2165
1936
|
resetWithIdle();
|
|
2166
1937
|
}
|
|
2167
1938
|
};
|
|
2168
|
-
if (!
|
|
1939
|
+
if (!input2 || Number(input2) <= 0 || !fromChain?.chainKey || !toChain?.chainKey || !srcTokenOnFrom || !dstTokenOnTo || !srcAddress || !dstAddress) {
|
|
2169
1940
|
resetUi();
|
|
2170
1941
|
return;
|
|
2171
1942
|
}
|
|
@@ -2191,7 +1962,7 @@ function useBridgeQuote() {
|
|
|
2191
1962
|
return;
|
|
2192
1963
|
}
|
|
2193
1964
|
}
|
|
2194
|
-
const srcAmountLD = toLD(
|
|
1965
|
+
const srcAmountLD = toLD(input2, srcTokenOnFrom.decimals);
|
|
2195
1966
|
const srcAddrApi = addrForApi(fromChain.chainKey, srcAddress);
|
|
2196
1967
|
const dstAddrApi = addrForApi(toChain.chainKey, dstAddress);
|
|
2197
1968
|
const dstNativeAmount = getDstNativeAmount(toChain.chainKey);
|
|
@@ -2236,7 +2007,7 @@ function useBridgeQuote() {
|
|
|
2236
2007
|
cancelled = true;
|
|
2237
2008
|
};
|
|
2238
2009
|
}, [
|
|
2239
|
-
|
|
2010
|
+
input2,
|
|
2240
2011
|
fromChain?.chainKey,
|
|
2241
2012
|
toChain?.chainKey,
|
|
2242
2013
|
srcTokenOnFrom,
|
|
@@ -2472,13 +2243,13 @@ const SwapButton = () => {
|
|
|
2472
2243
|
}, 300);
|
|
2473
2244
|
}, [canSwap, isSwapping, swapModel.actions]);
|
|
2474
2245
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2475
|
-
Button,
|
|
2246
|
+
button.Button,
|
|
2476
2247
|
{
|
|
2477
2248
|
onClick: handleSwap,
|
|
2478
2249
|
disabled: !canSwap || isSwapping,
|
|
2479
2250
|
variant: "secondary",
|
|
2480
2251
|
size: "sm",
|
|
2481
|
-
className: cn(
|
|
2252
|
+
className: utils.cn(
|
|
2482
2253
|
"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2",
|
|
2483
2254
|
!canSwap || isSwapping ? "opacity-50 cursor-not-allowed" : "hover:scale-110"
|
|
2484
2255
|
),
|
|
@@ -2499,7 +2270,7 @@ const WalletBalance = (props) => {
|
|
|
2499
2270
|
if (isLoading) {
|
|
2500
2271
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1.5 items-center", children: [
|
|
2501
2272
|
/* @__PURE__ */ jsxRuntime.jsx(WalletIcon, { className: "text-muted-foreground" }),
|
|
2502
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
2273
|
+
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
2503
2274
|
] });
|
|
2504
2275
|
}
|
|
2505
2276
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1.5 items-center", children: [
|
|
@@ -2521,12 +2292,12 @@ const SelectNetworkButton = ({
|
|
|
2521
2292
|
onClick,
|
|
2522
2293
|
network
|
|
2523
2294
|
}) => {
|
|
2524
|
-
const { t } =
|
|
2295
|
+
const { t } = useBridgeTranslation();
|
|
2525
2296
|
const label = require$$0.useMemo(() => {
|
|
2526
2297
|
return network?.name ?? t("bridge.selectNetwork");
|
|
2527
2298
|
}, [network, t]);
|
|
2528
2299
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2529
|
-
Button,
|
|
2300
|
+
button.Button,
|
|
2530
2301
|
{
|
|
2531
2302
|
onClick,
|
|
2532
2303
|
size: "sm",
|
|
@@ -2587,10 +2358,10 @@ const CurrencyInput = require$$0.forwardRef(
|
|
|
2587
2358
|
[max, onAmountChange]
|
|
2588
2359
|
);
|
|
2589
2360
|
if (showSkeleton && readOnly) {
|
|
2590
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: cn("h-8 w-1/3 rounded-md", className) });
|
|
2361
|
+
return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: utils.cn("h-8 w-1/3 rounded-md", className) });
|
|
2591
2362
|
}
|
|
2592
2363
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2593
|
-
Input,
|
|
2364
|
+
input.Input,
|
|
2594
2365
|
{
|
|
2595
2366
|
ref,
|
|
2596
2367
|
value: inputVal,
|
|
@@ -2600,7 +2371,7 @@ const CurrencyInput = require$$0.forwardRef(
|
|
|
2600
2371
|
inputMode: "decimal",
|
|
2601
2372
|
pattern: "[0-9]*[.,]?[0-9]*",
|
|
2602
2373
|
readOnly,
|
|
2603
|
-
className: cn(
|
|
2374
|
+
className: utils.cn(
|
|
2604
2375
|
"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",
|
|
2605
2376
|
className
|
|
2606
2377
|
),
|
|
@@ -2618,7 +2389,7 @@ const ChainSelectModal = ({
|
|
|
2618
2389
|
allowedItems,
|
|
2619
2390
|
onChangeChain
|
|
2620
2391
|
}) => {
|
|
2621
|
-
const { t } =
|
|
2392
|
+
const { t } = useBridgeTranslation();
|
|
2622
2393
|
const [query, setQuery] = require$$0.useState("");
|
|
2623
2394
|
const [isFocused, setIsFocused] = require$$0.useState(false);
|
|
2624
2395
|
const { setFromChain, chains, fromChain, toChain } = useChainsStore();
|
|
@@ -2682,7 +2453,7 @@ const ChainSelectModal = ({
|
|
|
2682
2453
|
const renderChainItem = (chain, willChangeSrc) => {
|
|
2683
2454
|
const isSelected = fromChain?.chainKey === chain.chainKey || toChain?.chainKey === chain.chainKey;
|
|
2684
2455
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2685
|
-
Button,
|
|
2456
|
+
button.Button,
|
|
2686
2457
|
{
|
|
2687
2458
|
onClick: () => onChainPick(chain, willChangeSrc),
|
|
2688
2459
|
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" : ""}`,
|
|
@@ -2701,8 +2472,8 @@ const ChainSelectModal = ({
|
|
|
2701
2472
|
chain.chainKey
|
|
2702
2473
|
);
|
|
2703
2474
|
};
|
|
2704
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-hidden", children: [
|
|
2705
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("bridge.selectNetwork") }) }),
|
|
2475
|
+
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: [
|
|
2476
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("bridge.selectNetwork") }) }),
|
|
2706
2477
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2707
2478
|
"div",
|
|
2708
2479
|
{
|
|
@@ -2710,7 +2481,7 @@ const ChainSelectModal = ({
|
|
|
2710
2481
|
children: [
|
|
2711
2482
|
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
|
|
2712
2483
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2713
|
-
Input,
|
|
2484
|
+
input.Input,
|
|
2714
2485
|
{
|
|
2715
2486
|
placeholder: t("bridge.searchDestinationChain"),
|
|
2716
2487
|
className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
|
|
@@ -2763,7 +2534,7 @@ const WalletButton = ({
|
|
|
2763
2534
|
wallet,
|
|
2764
2535
|
addressType
|
|
2765
2536
|
}) => {
|
|
2766
|
-
const { t } =
|
|
2537
|
+
const { t } = useBridgeTranslation();
|
|
2767
2538
|
const { onOpen } = useWalletSelectModal();
|
|
2768
2539
|
const { chainRegistry } = useChainStrategies();
|
|
2769
2540
|
const walletType = mapWalletToType(wallet);
|
|
@@ -2788,7 +2559,7 @@ const WalletButton = ({
|
|
|
2788
2559
|
const isButtonDisabled = (wallet === "metamask" || wallet === "tronlink") && !isInitialized || isConnecting;
|
|
2789
2560
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex flex-col items-start gap-1", children: [
|
|
2790
2561
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2791
|
-
Button,
|
|
2562
|
+
button.Button,
|
|
2792
2563
|
{
|
|
2793
2564
|
type: "button",
|
|
2794
2565
|
onClick: handleClick,
|
|
@@ -2865,7 +2636,7 @@ const SwapSection = ({
|
|
|
2865
2636
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2866
2637
|
"div",
|
|
2867
2638
|
{
|
|
2868
|
-
className: cn(
|
|
2639
|
+
className: utils.cn(
|
|
2869
2640
|
"p-4 flex flex-col gap-4 transition-colors bg-muted",
|
|
2870
2641
|
isSource && isFocused ? "bg-accent" : "",
|
|
2871
2642
|
className
|
|
@@ -2913,7 +2684,7 @@ const SwapSection = ({
|
|
|
2913
2684
|
addressType: isSource ? "src" : "dst"
|
|
2914
2685
|
}
|
|
2915
2686
|
),
|
|
2916
|
-
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 })
|
|
2687
|
+
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 })
|
|
2917
2688
|
] })
|
|
2918
2689
|
]
|
|
2919
2690
|
}
|
|
@@ -2930,31 +2701,6 @@ const SwapSection = ({
|
|
|
2930
2701
|
)
|
|
2931
2702
|
] });
|
|
2932
2703
|
};
|
|
2933
|
-
function Switch({
|
|
2934
|
-
className,
|
|
2935
|
-
...props
|
|
2936
|
-
}) {
|
|
2937
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2938
|
-
SwitchPrimitive__namespace.Root,
|
|
2939
|
-
{
|
|
2940
|
-
"data-slot": "switch",
|
|
2941
|
-
className: cn(
|
|
2942
|
-
"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",
|
|
2943
|
-
className
|
|
2944
|
-
),
|
|
2945
|
-
...props,
|
|
2946
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2947
|
-
SwitchPrimitive__namespace.Thumb,
|
|
2948
|
-
{
|
|
2949
|
-
"data-slot": "switch-thumb",
|
|
2950
|
-
className: cn(
|
|
2951
|
-
"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"
|
|
2952
|
-
)
|
|
2953
|
-
}
|
|
2954
|
-
)
|
|
2955
|
-
}
|
|
2956
|
-
);
|
|
2957
|
-
}
|
|
2958
2704
|
const useCustomAddressStore = zustand.create((set) => ({
|
|
2959
2705
|
customDstAddress: void 0,
|
|
2960
2706
|
setCustomDstAddress: (address) => set({ customDstAddress: address }),
|
|
@@ -2975,7 +2721,7 @@ const tonNormalize = (addr) => {
|
|
|
2975
2721
|
}
|
|
2976
2722
|
};
|
|
2977
2723
|
const ToggleRow = ({ enabled, onToggle }) => {
|
|
2978
|
-
const { t } =
|
|
2724
|
+
const { t } = useBridgeTranslation();
|
|
2979
2725
|
const { toChain } = useChainsStore();
|
|
2980
2726
|
const { dstAddress } = useAddresses();
|
|
2981
2727
|
const { setCustomDstAddress, clearCustomDstAddress } = useCustomAddressStore();
|
|
@@ -3035,7 +2781,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3035
2781
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3036
2782
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm leading-4.5 font-medium text-muted-foreground", children: t("bridge.sendToAnotherAddress") }),
|
|
3037
2783
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3038
|
-
Switch,
|
|
2784
|
+
_switch.Switch,
|
|
3039
2785
|
{
|
|
3040
2786
|
className: "data-[state=unchecked]:bg-switch-inactive data-[state=checked]:bg-switch-active",
|
|
3041
2787
|
"aria-pressed": enabled,
|
|
@@ -3059,7 +2805,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3059
2805
|
children: [
|
|
3060
2806
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
3061
2807
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3062
|
-
Input,
|
|
2808
|
+
input.Input,
|
|
3063
2809
|
{
|
|
3064
2810
|
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",
|
|
3065
2811
|
placeholder: toChain?.chainKey === "ton" ? t("bridge.tonAddressPlaceholder") : t("bridge.evmAddressPlaceholder"),
|
|
@@ -3075,7 +2821,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3075
2821
|
}) }) })
|
|
3076
2822
|
] }),
|
|
3077
2823
|
!value ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3078
|
-
Button,
|
|
2824
|
+
button.Button,
|
|
3079
2825
|
{
|
|
3080
2826
|
variant: "default",
|
|
3081
2827
|
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",
|
|
@@ -3083,7 +2829,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3083
2829
|
children: t("common.paste")
|
|
3084
2830
|
}
|
|
3085
2831
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3086
|
-
Button,
|
|
2832
|
+
button.Button,
|
|
3087
2833
|
{
|
|
3088
2834
|
variant: "ghost",
|
|
3089
2835
|
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",
|
|
@@ -3099,60 +2845,6 @@ const ToggleRow = ({ enabled, onToggle }) => {
|
|
|
3099
2845
|
) })
|
|
3100
2846
|
] });
|
|
3101
2847
|
};
|
|
3102
|
-
function Accordion({
|
|
3103
|
-
...props
|
|
3104
|
-
}) {
|
|
3105
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
3106
|
-
}
|
|
3107
|
-
function AccordionItem({
|
|
3108
|
-
className,
|
|
3109
|
-
...props
|
|
3110
|
-
}) {
|
|
3111
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3112
|
-
AccordionPrimitive__namespace.Item,
|
|
3113
|
-
{
|
|
3114
|
-
"data-slot": "accordion-item",
|
|
3115
|
-
className: cn("border-b last:border-b-0", className),
|
|
3116
|
-
...props
|
|
3117
|
-
}
|
|
3118
|
-
);
|
|
3119
|
-
}
|
|
3120
|
-
function AccordionTrigger({
|
|
3121
|
-
className,
|
|
3122
|
-
children,
|
|
3123
|
-
...props
|
|
3124
|
-
}) {
|
|
3125
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3126
|
-
AccordionPrimitive__namespace.Trigger,
|
|
3127
|
-
{
|
|
3128
|
-
"data-slot": "accordion-trigger",
|
|
3129
|
-
className: cn(
|
|
3130
|
-
"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",
|
|
3131
|
-
className
|
|
3132
|
-
),
|
|
3133
|
-
...props,
|
|
3134
|
-
children: [
|
|
3135
|
-
children,
|
|
3136
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0 transition-transform duration-200" })
|
|
3137
|
-
]
|
|
3138
|
-
}
|
|
3139
|
-
) });
|
|
3140
|
-
}
|
|
3141
|
-
function AccordionContent({
|
|
3142
|
-
className,
|
|
3143
|
-
children,
|
|
3144
|
-
...props
|
|
3145
|
-
}) {
|
|
3146
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3147
|
-
AccordionPrimitive__namespace.Content,
|
|
3148
|
-
{
|
|
3149
|
-
"data-slot": "accordion-content",
|
|
3150
|
-
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
3151
|
-
...props,
|
|
3152
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
3153
|
-
}
|
|
3154
|
-
);
|
|
3155
|
-
}
|
|
3156
2848
|
function getQuoteAmounts(quote, srcToken, dstToken) {
|
|
3157
2849
|
if (!quote || !srcToken || !dstToken) {
|
|
3158
2850
|
return {
|
|
@@ -3255,7 +2947,7 @@ function getRouteDisplayName(route) {
|
|
|
3255
2947
|
return route.split(/[/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3256
2948
|
}
|
|
3257
2949
|
const Details = () => {
|
|
3258
|
-
const { t } =
|
|
2950
|
+
const { t } = useBridgeTranslation();
|
|
3259
2951
|
const { selectedAssetSymbol, assetMatrix, tokens } = useTokensStore();
|
|
3260
2952
|
const { toChain, fromChain, chains } = useChainsStore();
|
|
3261
2953
|
const { quote, status } = useBridgeQuoteStore();
|
|
@@ -3299,19 +2991,19 @@ const Details = () => {
|
|
|
3299
2991
|
})();
|
|
3300
2992
|
const currentSlippageText = formatPercentage(slippageBps);
|
|
3301
2993
|
const routeText = quote?.route ? getRouteDisplayName(quote.route) : t(`settings.routePresets.${routePriority}`);
|
|
3302
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-lg", children: [
|
|
3303
|
-
/* @__PURE__ */ jsxRuntime.jsx(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: [
|
|
2994
|
+
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: [
|
|
2995
|
+
/* @__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: [
|
|
3304
2996
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-normal text-priority leading-3.5", children: t("bridge.youWillReceive", { defaultValue: "You will receive" }) }),
|
|
3305
2997
|
/* @__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: [
|
|
3306
2998
|
/* @__PURE__ */ jsxRuntime.jsx(TokenSymbol, { symbol, className: "w-4 h-4", alt: "token" }),
|
|
3307
|
-
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: [
|
|
2999
|
+
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: [
|
|
3308
3000
|
receiveText,
|
|
3309
3001
|
" ",
|
|
3310
3002
|
symbol
|
|
3311
3003
|
] })
|
|
3312
3004
|
] })
|
|
3313
3005
|
] }) }),
|
|
3314
|
-
/* @__PURE__ */ jsxRuntime.jsxs(AccordionContent, { className: "px-5 flex flex-col gap-3", children: [
|
|
3006
|
+
/* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionContent, { className: "px-5 flex flex-col gap-3", children: [
|
|
3315
3007
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3316
3008
|
DetailsRow,
|
|
3317
3009
|
{
|
|
@@ -3360,7 +3052,7 @@ const DetailsRow = ({
|
|
|
3360
3052
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-priority font-normal", children: label }),
|
|
3361
3053
|
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: label, children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "size-4 text-receive-icon" }) })
|
|
3362
3054
|
] }),
|
|
3363
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
3055
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
3364
3056
|
] });
|
|
3365
3057
|
const useTransactionStore = zustand.create((set, get) => ({
|
|
3366
3058
|
current: void 0,
|
|
@@ -3901,7 +3593,7 @@ function useSilentValidations(amountString) {
|
|
|
3901
3593
|
return validationResult;
|
|
3902
3594
|
}
|
|
3903
3595
|
const SubmitButton = () => {
|
|
3904
|
-
const { t } =
|
|
3596
|
+
const { t } = useBridgeTranslation();
|
|
3905
3597
|
const { chainRegistry } = useChainStrategies();
|
|
3906
3598
|
const { srcAddress, dstAddress } = useAddresses();
|
|
3907
3599
|
const { quote, status, inputAmount, noRoute } = useBridgeQuoteStore();
|
|
@@ -3996,13 +3688,22 @@ const SubmitButton = () => {
|
|
|
3996
3688
|
}
|
|
3997
3689
|
};
|
|
3998
3690
|
const disabled = isBusy || amountNum <= 0 || status === "loading" || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer;
|
|
3999
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3691
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3692
|
+
button.Button,
|
|
3693
|
+
{
|
|
3694
|
+
onClick: handleClick,
|
|
3695
|
+
disabled,
|
|
3696
|
+
size: "lg",
|
|
3697
|
+
className: "w-full mt-4",
|
|
3698
|
+
children: label
|
|
3699
|
+
}
|
|
3700
|
+
);
|
|
4000
3701
|
};
|
|
4001
3702
|
function short(addr) {
|
|
4002
3703
|
return addr.slice(0, 4) + "…" + addr.slice(-4);
|
|
4003
3704
|
}
|
|
4004
3705
|
const WalletSelectModal = () => {
|
|
4005
|
-
const { t } =
|
|
3706
|
+
const { t } = useBridgeTranslation();
|
|
4006
3707
|
const { isOpen, onClose } = useWalletSelectModal();
|
|
4007
3708
|
const { connect, connectors, isPending } = wagmi.useConnect();
|
|
4008
3709
|
const { chainRegistry } = useChainStrategies();
|
|
@@ -4101,17 +3802,17 @@ const WalletSelectModal = () => {
|
|
|
4101
3802
|
console.error("Failed to connect wallet:", error);
|
|
4102
3803
|
}
|
|
4103
3804
|
};
|
|
4104
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { children: [
|
|
4105
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
4106
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: t("wallets.chooseWallet") }),
|
|
4107
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: t("wallets.oneWalletPerEnv") })
|
|
3805
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { children: [
|
|
3806
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { children: [
|
|
3807
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t("wallets.chooseWallet") }),
|
|
3808
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: t("wallets.oneWalletPerEnv") })
|
|
4108
3809
|
] }),
|
|
4109
3810
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
4110
3811
|
connectedWallets.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4111
3812
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t("wallets.connected") }),
|
|
4112
3813
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: connectedWallets.map((wallet) => {
|
|
4113
3814
|
const IconComponent = wallet.icon;
|
|
4114
|
-
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: [
|
|
3815
|
+
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: [
|
|
4115
3816
|
/* @__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: [
|
|
4116
3817
|
/* @__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" }) }),
|
|
4117
3818
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
@@ -4140,7 +3841,7 @@ const WalletSelectModal = () => {
|
|
|
4140
3841
|
const isEvmConnector = category.title === t("wallets.evmWallets");
|
|
4141
3842
|
const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
|
|
4142
3843
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4143
|
-
Button,
|
|
3844
|
+
button.Button,
|
|
4144
3845
|
{
|
|
4145
3846
|
type: "button",
|
|
4146
3847
|
onClick: () => {
|
|
@@ -4227,7 +3928,7 @@ const TransactionProgressVector = (props) => {
|
|
|
4227
3928
|
] });
|
|
4228
3929
|
};
|
|
4229
3930
|
const ProgressStep = () => {
|
|
4230
|
-
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: [
|
|
3931
|
+
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: [
|
|
4231
3932
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionProgressVector, { className: "progress-rocket" }),
|
|
4232
3933
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-progress-small under-noise" }),
|
|
4233
3934
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-progress-big under-noise" }),
|
|
@@ -4239,7 +3940,7 @@ const ProgressStep = () => {
|
|
|
4239
3940
|
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
4240
3941
|
/* @__PURE__ */ jsxRuntime.jsx("span", {})
|
|
4241
3942
|
] }),
|
|
4242
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-display font-black relative z-10", children:
|
|
3943
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-display font-black relative z-10", children: i18n.t("transaction.inProgress") }),
|
|
4243
3944
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative mt-5 z-10", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute dot-vertical h-full left-5 top-0 bottom-0 z-0" }) })
|
|
4244
3945
|
] }) });
|
|
4245
3946
|
};
|
|
@@ -4491,15 +4192,15 @@ const TransactionFailedVector = (props) => {
|
|
|
4491
4192
|
};
|
|
4492
4193
|
const FailedStep = () => {
|
|
4493
4194
|
const { current, reset } = useTransactionStore();
|
|
4494
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "flex flex-col h-full border-none overflow-hidden bg-background rounded-none md:rounded-lg", children: [
|
|
4495
|
-
/* @__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: [
|
|
4195
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(card.Card, { className: "flex flex-col h-full border-none overflow-hidden bg-background rounded-none md:rounded-lg", children: [
|
|
4196
|
+
/* @__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: [
|
|
4496
4197
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionFailedVector, {}),
|
|
4497
4198
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-failed-small under-noise" }),
|
|
4498
4199
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-failed-big under-noise" }),
|
|
4499
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-display font-black relative z-10", children:
|
|
4200
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-display font-black relative z-10", children: i18n.t("transaction.failed") }),
|
|
4500
4201
|
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 }) })
|
|
4501
4202
|
] }),
|
|
4502
|
-
/* @__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:
|
|
4203
|
+
/* @__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: i18n.t("common.close") }) })
|
|
4503
4204
|
] });
|
|
4504
4205
|
};
|
|
4505
4206
|
const TransactionSuccessVector = (props) => {
|
|
@@ -5861,7 +5562,7 @@ var fireworksExports = requireFireworks();
|
|
|
5861
5562
|
const Fireworks = /* @__PURE__ */ getDefaultExportFromCjs(fireworksExports);
|
|
5862
5563
|
const SuccessStep = () => {
|
|
5863
5564
|
const { current, reset } = useTransactionStore();
|
|
5864
|
-
const { t } =
|
|
5565
|
+
const { t } = useBridgeTranslation();
|
|
5865
5566
|
const metadata = current?.metadata;
|
|
5866
5567
|
const srcTxHash = current?.srcTxHash;
|
|
5867
5568
|
const handleCopyHash = () => {
|
|
@@ -5870,8 +5571,8 @@ const SuccessStep = () => {
|
|
|
5870
5571
|
sonner.toast.success("Hash copied to clipboard");
|
|
5871
5572
|
}
|
|
5872
5573
|
};
|
|
5873
|
-
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: [
|
|
5874
|
-
/* @__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: [
|
|
5574
|
+
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: [
|
|
5575
|
+
/* @__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: [
|
|
5875
5576
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionSuccessVector, {}),
|
|
5876
5577
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5877
5578
|
Fireworks,
|
|
@@ -5935,7 +5636,7 @@ const SuccessStep = () => {
|
|
|
5935
5636
|
] })
|
|
5936
5637
|
] })
|
|
5937
5638
|
] }),
|
|
5938
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: "pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: reset, className: "w-full", children: t("done") }) })
|
|
5639
|
+
/* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { className: "pb-10 px-8", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t("done") }) })
|
|
5939
5640
|
] });
|
|
5940
5641
|
};
|
|
5941
5642
|
const TransactionConfirmVector = (props) => {
|
|
@@ -6080,9 +5781,9 @@ const useCountdown = (initialSeconds) => {
|
|
|
6080
5781
|
};
|
|
6081
5782
|
};
|
|
6082
5783
|
const ConfirmStep = () => {
|
|
6083
|
-
const { t } =
|
|
5784
|
+
const { t } = useBridgeTranslation();
|
|
6084
5785
|
const { formatTime } = useCountdown(90);
|
|
6085
|
-
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: [
|
|
5786
|
+
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: [
|
|
6086
5787
|
/* @__PURE__ */ jsxRuntime.jsx(TransactionConfirmVector, {}),
|
|
6087
5788
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-confirm-small under-noise" }),
|
|
6088
5789
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "on-circle on-circle-confirm-big under-noise" }),
|
|
@@ -6108,8 +5809,8 @@ const TransactionManager = () => {
|
|
|
6108
5809
|
if (status === "completed") {
|
|
6109
5810
|
step = /* @__PURE__ */ jsxRuntime.jsx(SuccessStep, {});
|
|
6110
5811
|
}
|
|
6111
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: true, onOpenChange: () => {
|
|
6112
|
-
}, 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 }) });
|
|
5812
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: true, onOpenChange: () => {
|
|
5813
|
+
}, 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 }) });
|
|
6113
5814
|
};
|
|
6114
5815
|
const useTokensRequest = () => {
|
|
6115
5816
|
const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
|
|
@@ -7055,12 +6756,12 @@ class TonChainStrategy {
|
|
|
7055
6756
|
payload: msg.payload
|
|
7056
6757
|
})
|
|
7057
6758
|
);
|
|
7058
|
-
const
|
|
6759
|
+
const transaction2 = {
|
|
7059
6760
|
validUntil: Math.floor(Date.now() / 1e3) + TON_CONFIG.validUntil,
|
|
7060
6761
|
messages: tonMessages
|
|
7061
6762
|
};
|
|
7062
6763
|
const result = await this.config.tonConnectUI.sendTransaction(
|
|
7063
|
-
|
|
6764
|
+
transaction2
|
|
7064
6765
|
);
|
|
7065
6766
|
return {
|
|
7066
6767
|
chainKey: "ton",
|
|
@@ -7649,8 +7350,8 @@ class TronChainStrategy {
|
|
|
7649
7350
|
shift += 7;
|
|
7650
7351
|
}
|
|
7651
7352
|
const dataBytes = bytes.slice(i, i + len);
|
|
7652
|
-
const
|
|
7653
|
-
return { contractAddress, input, callValue };
|
|
7353
|
+
const input2 = "0x" + Array.from(dataBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
7354
|
+
return { contractAddress, input: input2, callValue };
|
|
7654
7355
|
} catch {
|
|
7655
7356
|
return null;
|
|
7656
7357
|
}
|
|
@@ -7879,7 +7580,7 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
7879
7580
|
require$$0.useEffect(() => {
|
|
7880
7581
|
setTronConnected(!!tronConnected);
|
|
7881
7582
|
}, [tronConnected, setTronConnected]);
|
|
7882
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7583
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BridgeI18nProvider, { defaultLanguage: props.defaultLanguage, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7883
7584
|
ChainStrategyProvider,
|
|
7884
7585
|
{
|
|
7885
7586
|
evmWallet: {
|
|
@@ -7904,7 +7605,7 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
7904
7605
|
tonApiKey: props.tonApiKey,
|
|
7905
7606
|
children: /* @__PURE__ */ jsxRuntime.jsx(EvaaBridgeContent, { ...props })
|
|
7906
7607
|
}
|
|
7907
|
-
);
|
|
7608
|
+
) });
|
|
7908
7609
|
};
|
|
7909
7610
|
const EvaaBridgeContent = ({
|
|
7910
7611
|
className,
|
|
@@ -7912,7 +7613,7 @@ const EvaaBridgeContent = ({
|
|
|
7912
7613
|
onAmountChange,
|
|
7913
7614
|
onChainChange
|
|
7914
7615
|
} = {}) => {
|
|
7915
|
-
const { t } =
|
|
7616
|
+
const { t } = useBridgeTranslation();
|
|
7916
7617
|
useTokensRequest();
|
|
7917
7618
|
useChainsRequest();
|
|
7918
7619
|
const [sendToAnother, setSendToAnother] = require$$0.useState(false);
|
|
@@ -8005,15 +7706,15 @@ const EvaaBridgeContent = ({
|
|
|
8005
7706
|
}, [chains, assetMatrix, allowedFromChains]);
|
|
8006
7707
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8007
7708
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8008
|
-
Card,
|
|
7709
|
+
card.Card,
|
|
8009
7710
|
{
|
|
8010
|
-
className: cn(
|
|
7711
|
+
className: utils.cn(
|
|
8011
7712
|
"max-w-md w-full mx-auto flex flex-col relative",
|
|
8012
7713
|
className
|
|
8013
7714
|
),
|
|
8014
7715
|
children: [
|
|
8015
7716
|
/* @__PURE__ */ jsxRuntime.jsx(FormHeader, {}),
|
|
8016
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-[1px]", children: [
|
|
7717
|
+
/* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "space-y-[1px]", children: [
|
|
8017
7718
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8018
7719
|
SwapSection,
|
|
8019
7720
|
{
|
|
@@ -8052,7 +7753,7 @@ const EvaaBridgeContent = ({
|
|
|
8052
7753
|
),
|
|
8053
7754
|
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, {})
|
|
8054
7755
|
] }),
|
|
8055
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(Details, {}) })
|
|
7756
|
+
/* @__PURE__ */ jsxRuntime.jsx(card.CardFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(Details, {}) })
|
|
8056
7757
|
]
|
|
8057
7758
|
}
|
|
8058
7759
|
),
|