@rash2x/bridge-widget 0.7.5 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evaa-bridge.cjs +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-HUIu1V_6.js → index-D2IOd6mV.js} +2 -2
- package/dist/{index-HUIu1V_6.js.map → index-D2IOd6mV.js.map} +1 -1
- package/dist/{index-DXcV5o9h.cjs → index-DnrWUlYr.cjs} +34 -43
- package/dist/index-DnrWUlYr.cjs.map +1 -0
- package/dist/{index-CeW-ueEx.js → index-KQ4SsUup.js} +34 -43
- package/dist/index-KQ4SsUup.js.map +1 -0
- package/dist/{index-CQTSauOr.cjs → index-x-S2vNi4.cjs} +2 -2
- package/dist/{index-CQTSauOr.cjs.map → index-x-S2vNi4.cjs.map} +1 -1
- package/dist/index.d.ts +32 -2
- package/package.json +1 -1
- package/dist/index-CeW-ueEx.js.map +0 -1
- package/dist/index-DXcV5o9h.cjs.map +0 -1
|
@@ -35,7 +35,7 @@ const reactWindow = require("react-window");
|
|
|
35
35
|
const common$1 = { "connecting": "Connecting…", "initializing": "Initializing...", "loading": "Loading...", "paste": "paste", "close": "Close", "zeroPlaceholder": "0", "nativeToken": "Native Token" };
|
|
36
36
|
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", "tonconnect": "TonConnect", "metaMask": "WalletConnect", "walletConnect": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Add Tron wallet", "comingSoon": "Coming Soon", "connected": "CONNECTED", "connectedStatus": "Connected", "disconnect": "Disconnect", "chooseWallet": "Connect wallet", "oneWalletPerEnv": "You can only connect one wallet per environment.", "connect": "Connect", "connectTronWallet": "Connect Tron wallet", "connectWallet": "Connect wallet" };
|
|
37
37
|
const bridge$1 = { "max": "Max", "sourceNetwork": "Source network", "destinationNetwork": "Destination network", "selectToken": "Select token", "selectNetwork": "Select network", "selectSourceNetwork": "Select source network", "selectDestinationNetwork": "Select destination network", "searchToken": "Search token", "myTokens": "My tokens", "allTokens": "All tokens", "search": "Search", "select": "Select", "willChangeSourceChain": "Will change source network", "willChangeDestinationChain": "Will change destination network", "willChangeBothChains": "Will change both networks", "willChangeSourceNetworkAndToken": "Will change source token", "noBalancesFound": "No balances found.", "noResults": "No results", "tokenNotFound": "We couldn't find a token with that name or symbol. Please try again.", "chainNotFound": "We couldn't find a chain with that name. Please try again.", "sendToAnotherAddress": "Send to another address", "youWillReceive": "You will receive", "anotherAddressPlaceholder": "Address", "addressDoesntMatch": "Address doesn't match the {{network}} network", "checkBeforeTransfer": "Check correctness before transfer" };
|
|
38
|
-
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": "Transaction in progress...", "checkingBalance": "Checking balance...", "insufficientBalance": "Insufficient balance", "amountTooSmall": "Min {{min}}", "amountTooLarge": "Max {{max}}", "success": "Success", "successTitle": "Success", "done": "Done", "hashCopied": "Hash copied to clipboard", "bridged": "Bridged", "transferTitle": "Transfer", "hash": "Hash", "layerzeroScan": "TxHash", "finalFee": "Final Fee", "route": "Route", "routeTooltip": "Route is the path your transfer takes between networks. The bridge is powered by LayerZero, and the specific path can affect the fee, slippage, and estimated time.", "estTime": "Est. Time", "estTimeTooltip": "Estimated time is the approximate completion time. It depends on the route and network load; actual time may vary.", "slippage": "Slippage", "slippageTooltip": "If the received amount goes below this tolerance, the transaction will be reverted.", "minimumReceived": "Minimum received", "messageFee": "Message Fee", "messageFeeTooltip": "Message fee is the LayerZero cross-chain messaging cost paid to relay your transaction between networks.", "bridgeFee": "Bridge Fee", "bridgeFeeTooltip": "Bridge fee is the difference between the amount you send and the amount you receive, charged by the bridge protocol.", "totalFee": "Total Fee", "totalFeeTooltip": "Total fee is the estimated total cost of the transfer, including message and bridge fees. The final fee may vary slightly.", "gasEstimate": "Gas: {{gas}}", "noRouteFound": "No route found", "notEnoughGas": "Not enough gas", "pasteAddressToTransfer": "Paste address to transfer", "noRouteFoundForSettings": "No route found for current settings.", "tryAdjustSettings": "Try disabling Gas on Destination, or adjust amount/networks.", "quoteError": "Quote error", "steps": { "sent": "Sent", "approving": "Approving Token", "approvingNote": "Step {{current}} of {{total}}: Confirm approval in wallet", "bridging": "Bridging", "processing": "Processing", "processingNote": "Up to 2 minutes", "completed": "Completed" } };
|
|
38
|
+
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": "Transaction in progress...", "checkingBalance": "Checking balance...", "insufficientBalance": "Insufficient balance", "amountTooSmall": "Min {{min}}", "amountTooLarge": "Max {{max}}", "success": "Success", "successTitle": "Success", "done": "Done", "hashCopied": "Hash copied to clipboard", "bridged": "Bridged", "transferTitle": "Transfer", "hash": "Hash", "layerzeroScan": "TxHash", "finalFee": "Final Fee", "route": "Route", "routeTooltip": "Route is the path your transfer takes between networks. The bridge is powered by LayerZero, and the specific path can affect the fee, slippage, and estimated time.", "estTime": "Est. Time", "estTimeTooltip": "Estimated time is the approximate completion time. It depends on the route and network load; actual time may vary.", "slippage": "Slippage", "slippageTooltip": "If the received amount goes below this tolerance, the transaction will be reverted.", "minimumReceived": "Minimum received", "messageFee": "Message Fee", "messageFeeTooltip": "Message fee is the LayerZero cross-chain messaging cost paid to relay your transaction between networks.", "bridgeFee": "Bridge Fee", "bridgeFeeTooltip": "Bridge fee is the difference between the amount you send and the amount you receive, charged by the bridge protocol.", "totalFee": "Total Fee", "totalFeeTooltip": "Total fee is the estimated total cost of the transfer, including message and bridge fees. The final fee may vary slightly.", "gasEstimate": "Gas: {{gas}}", "noRouteFound": "No route found", "noRouteAlert": "No supported route found. Choose a different source or destination network.", "notEnoughGas": "Not enough gas", "pasteAddressToTransfer": "Paste address to transfer", "noRouteFoundForSettings": "No route found for current settings.", "tryAdjustSettings": "Try disabling Gas on Destination, or adjust amount/networks.", "quoteError": "Quote error", "steps": { "sent": "Sent", "approving": "Approving Token", "approvingNote": "Step {{current}} of {{total}}: Confirm approval in wallet", "bridging": "Bridging", "processing": "Processing", "processingNote": "Up to 2 minutes", "completed": "Completed" } };
|
|
39
39
|
const telegram$1 = { "openWebVersion": "Open EVAA Web to Bridge", "restrictionMessage": "You can bridge between the chosen networks on EVAA web version" };
|
|
40
40
|
const app$1 = { "stargateWidgetName": "Stargate Bridge Widget", "liveWidget": "Live Widget", "getStarted": "Get Started" };
|
|
41
41
|
const settings$1 = { "title": "Settings", "gasOnDestination": "Gas on destination", "gasOnDestinationTooltip": "Adds the destination network's native token to cover fees for transactions after bridging. Increases the total fee.", "slippageTolerance": "Slippage tolerance", "slippageToleranceTooltip": "If the received amount goes below this tolerance, the transaction will be reverted.", "routePriority": "Route Priority", "routePriorityTooltip": "Select how the bridge chooses a route. Recommended balances options to find the best overall cost. Fastest prioritizes completion speed over everything else.", "highSlippageWarning": "High slippage warning", "gasPresets": { "auto": "Auto", "none": "None", "medium": "Medium", "max": "Max" }, "routePresets": { "fastest": "Fastest", "cheapest": "Cheapest", "recommended": "Recommended" } };
|
|
@@ -53,7 +53,7 @@ const en$3 = {
|
|
|
53
53
|
const common = { "connecting": "Подключение…", "initializing": "Инициализация...", "loading": "Загрузка...", "paste": "вставить", "close": "Закрыть", "zeroPlaceholder": "0", "nativeToken": "Нативный токен" };
|
|
54
54
|
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", "tonconnect": "TonConnect", "metaMask": "WalletConnect", "walletConnect": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Добавить Tron кошелёк", "comingSoon": "Скоро", "connected": "ПОДКЛЮЧЕНО", "connectedStatus": "Подключён", "disconnect": "Отключить", "chooseWallet": "Подключите кошелек", "oneWalletPerEnv": "Можно подключить только один кошелёк на окружение.", "connect": "Подключить", "connectTronWallet": "Подключить Tron кошелёк", "connectWallet": "Подключить кошелёк" };
|
|
55
55
|
const bridge = { "max": "Макс", "sourceNetwork": "Исходная сеть", "destinationNetwork": "Целевая сеть", "selectToken": "Выбрать токен", "selectNetwork": "Выбрать сеть", "selectSourceNetwork": "Выбрать исходную сеть", "selectDestinationNetwork": "Выбрать целевую сеть", "searchToken": "Поиск токена", "myTokens": "Мои токены", "allTokens": "Все токены", "search": "Поиск", "select": "Выбрать", "willChangeSourceChain": "Сменит исходную сеть", "willChangeDestinationChain": "Сменит целевую сеть", "willChangeBothChains": "Сменит обе сети", "willChangeSourceNetworkAndToken": "Сменит исходный токен", "noBalancesFound": "Балансы не найдены.", "noResults": "Нет результатов", "tokenNotFound": "Мы не смогли найти токен с таким названием или символом. Пожалуйста, попробуйте снова.", "chainNotFound": "Мы не смогли найти сеть с таким названием. Пожалуйста, попробуйте снова.", "sendToAnotherAddress": "Отправить на другой адрес", "youWillReceive": "Вы получите", "anotherAddressPlaceholder": "Адрес", "addressDoesntMatch": "Адрес не соответствует сети {{network}}", "checkBeforeTransfer": "Проверьте корректность перед переводом" };
|
|
56
|
-
const transaction = { "enterAmount": "Введите сумму", "transfer": "Перевести", "getQuote": "Получить котировку", "quoting": "Расчет котировки...", "failed": "Ошибка транзакции", "confirm": "Подтвердите транзакцию", "signTransaction": "Подпишите транзакцию в кошельке", "inProgress": "Транзакция выполняется...", "checkingBalance": "Проверка баланса...", "insufficientBalance": "Недостаточно средств", "amountTooSmall": "Минимум {{min}}", "amountTooLarge": "Максимум {{max}}", "success": "Успех", "successTitle": "Успех", "done": "Готово", "hashCopied": "Хэш скопирован в буфер обмена", "bridged": "Переведено", "transferTitle": "Перевод", "hash": "Хэш", "layerzeroScan": "TxHash", "finalFee": "Итоговая комиссия", "route": "Маршрут", "routeTooltip": "Маршрут — это путь, по которому будет выполнен перевод. Мост работает на базе LayerZero, а конкретный путь передачи между сетями может влиять на комиссию, проскальзывание и время.", "estTime": "Время", "estTimeTooltip": "Среднее время — примерное время завершения перевода. Зависит от маршрута и нагрузки сети; фактическое время может отличаться.", "slippage": "Проскальзывание", "slippageTooltip": "Если получаемая сумма окажется ниже этого допуска, транзакция будет отклонена.", "minimumReceived": "Минимум к получению", "messageFee": "Комиссия сообщения", "messageFeeTooltip": "Комиссия сообщения — стоимость кросс-чейн передачи через LayerZero для ретрансляции транзакции между сетями.", "bridgeFee": "Комиссия моста", "bridgeFeeTooltip": "Комиссия моста — разница между отправленной и полученной суммой, взимаемая протоколом моста.", "totalFee": "Общая комиссия", "totalFeeTooltip": "Общая комиссия за перевод, включая комиссию сообщения и моста. Фактическая сумма может немного измениться.", "gasEstimate": "Газ: {{gas}}", "noRouteFound": "Маршрут не найден", "notEnoughGas": "Недостаточно газа", "pasteAddressToTransfer": "Укажите адрес получателя", "noRouteFoundForSettings": "Маршрут не найден для текущих настроек.", "tryAdjustSettings": "Попробуйте отключить Gas on Destination или измените сумму/сети.", "quoteError": "Ошибка котировки", "steps": { "sent": "Отправлено", "approving": "Одобрение токена", "approvingNote": "Шаг {{current}} из {{total}}: Подтвердите одобрение в кошельке", "bridging": "Перевод через мост", "processing": "Обработка", "processingNote": "До 2 минут", "completed": "Завершено" } };
|
|
56
|
+
const transaction = { "enterAmount": "Введите сумму", "transfer": "Перевести", "getQuote": "Получить котировку", "quoting": "Расчет котировки...", "failed": "Ошибка транзакции", "confirm": "Подтвердите транзакцию", "signTransaction": "Подпишите транзакцию в кошельке", "inProgress": "Транзакция выполняется...", "checkingBalance": "Проверка баланса...", "insufficientBalance": "Недостаточно средств", "amountTooSmall": "Минимум {{min}}", "amountTooLarge": "Максимум {{max}}", "success": "Успех", "successTitle": "Успех", "done": "Готово", "hashCopied": "Хэш скопирован в буфер обмена", "bridged": "Переведено", "transferTitle": "Перевод", "hash": "Хэш", "layerzeroScan": "TxHash", "finalFee": "Итоговая комиссия", "route": "Маршрут", "routeTooltip": "Маршрут — это путь, по которому будет выполнен перевод. Мост работает на базе LayerZero, а конкретный путь передачи между сетями может влиять на комиссию, проскальзывание и время.", "estTime": "Время", "estTimeTooltip": "Среднее время — примерное время завершения перевода. Зависит от маршрута и нагрузки сети; фактическое время может отличаться.", "slippage": "Проскальзывание", "slippageTooltip": "Если получаемая сумма окажется ниже этого допуска, транзакция будет отклонена.", "minimumReceived": "Минимум к получению", "messageFee": "Комиссия сообщения", "messageFeeTooltip": "Комиссия сообщения — стоимость кросс-чейн передачи через LayerZero для ретрансляции транзакции между сетями.", "bridgeFee": "Комиссия моста", "bridgeFeeTooltip": "Комиссия моста — разница между отправленной и полученной суммой, взимаемая протоколом моста.", "totalFee": "Общая комиссия", "totalFeeTooltip": "Общая комиссия за перевод, включая комиссию сообщения и моста. Фактическая сумма может немного измениться.", "gasEstimate": "Газ: {{gas}}", "noRouteFound": "Маршрут не найден", "noRouteAlert": "Маршрут не найден. Выберите другую сеть отправления или получения.", "notEnoughGas": "Недостаточно газа", "pasteAddressToTransfer": "Укажите адрес получателя", "noRouteFoundForSettings": "Маршрут не найден для текущих настроек.", "tryAdjustSettings": "Попробуйте отключить Gas on Destination или измените сумму/сети.", "quoteError": "Ошибка котировки", "steps": { "sent": "Отправлено", "approving": "Одобрение токена", "approvingNote": "Шаг {{current}} из {{total}}: Подтвердите одобрение в кошельке", "bridging": "Перевод через мост", "processing": "Обработка", "processingNote": "До 2 минут", "completed": "Завершено" } };
|
|
57
57
|
const telegram = { "openWebVersion": "Открыть EVAA веб для трансфера", "restrictionMessage": "Трансфер между выбранными сетями доступен только в веб-версии EVAA" };
|
|
58
58
|
const app = { "stargateWidgetName": "Виджет Stargate Bridge", "liveWidget": "Живой виджет", "getStarted": "Начало работы" };
|
|
59
59
|
const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationTooltip": "Добавляет нативный токен целевой сети для оплаты комиссий за транзакции после бриджа. Увеличивает общую комиссию.", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceTooltip": "Если получаемая сумма окажется ниже этого допуска, транзакция будет отклонена.", "routePriority": "Приоритет маршрута", "routePriorityTooltip": "Выберите маршрут перевода. Рекомендуемый — подбирает самый выгодный вариант по общей стоимости. Быстрый — выбирает маршрут с приоритетом скорости, даже если это дороже.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрый", "cheapest": "Дешевый", "recommended": "Рекомендуемый" } };
|
|
@@ -506,10 +506,7 @@ const ExitIcon = (props) => {
|
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
};
|
|
509
|
-
const SwapButton = ({
|
|
510
|
-
canSwap,
|
|
511
|
-
onSwap
|
|
512
|
-
}) => {
|
|
509
|
+
const SwapButton = ({ canSwap, onSwap }) => {
|
|
513
510
|
const [turns, setTurns] = react.useState(0);
|
|
514
511
|
const [isSwapping, setIsSwapping] = react.useState(false);
|
|
515
512
|
const handleSwap = react.useCallback(() => {
|
|
@@ -2210,7 +2207,8 @@ async function fetchQuotes(req) {
|
|
|
2210
2207
|
).toString()}`;
|
|
2211
2208
|
const res = await fetch(url);
|
|
2212
2209
|
const data = await res.json();
|
|
2213
|
-
|
|
2210
|
+
const quotes = data?.quotes ?? [];
|
|
2211
|
+
return quotes.filter((q3) => !q3.error);
|
|
2214
2212
|
}
|
|
2215
2213
|
function selectQuoteByPriority(routes, priority) {
|
|
2216
2214
|
if (priority === RoutePriority.FASTEST) {
|
|
@@ -2405,7 +2403,7 @@ function calculateMinReceived(quote, slippageBps, dstToken) {
|
|
|
2405
2403
|
}
|
|
2406
2404
|
function getQuoteDetails(quote, srcToken, dstToken, tokens, chains, slippageBps, srcChain, dstChain) {
|
|
2407
2405
|
const amounts = getQuoteAmounts(quote, srcToken, dstToken);
|
|
2408
|
-
const fees = computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstChain);
|
|
2406
|
+
const fees = computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcChain, dstChain);
|
|
2409
2407
|
const minimumReceived = calculateMinReceived(quote, slippageBps, dstToken);
|
|
2410
2408
|
return {
|
|
2411
2409
|
inputAmount: amounts.inputHuman,
|
|
@@ -2425,7 +2423,7 @@ function getRouteDisplayName(route) {
|
|
|
2425
2423
|
if (routeLower.includes("v2")) return "Stargate V2";
|
|
2426
2424
|
return route.split(/[/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
2427
2425
|
}
|
|
2428
|
-
function computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstChain) {
|
|
2426
|
+
function computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcChain, dstChain) {
|
|
2429
2427
|
const defaultMsgSymbol = srcChain?.nativeCurrency?.symbol?.toUpperCase() ?? "";
|
|
2430
2428
|
const defaultBridgeSymbol = srcToken?.symbol?.toUpperCase() ?? "";
|
|
2431
2429
|
const defaultDstGasSymbol = dstChain?.nativeCurrency?.symbol?.toUpperCase() ?? "";
|
|
@@ -2468,7 +2466,7 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstCh
|
|
|
2468
2466
|
let bridgeFeeUsd = 0;
|
|
2469
2467
|
const bridgeFeeSymbol = srcToken.symbol?.toUpperCase() ?? "";
|
|
2470
2468
|
const srcHuman = fromLD(quote.srcAmount, srcToken.decimals);
|
|
2471
|
-
const dstHuman = fromLD(quote.dstAmount,
|
|
2469
|
+
const dstHuman = dstToken ? fromLD(quote.dstAmount, dstToken.decimals) : 0;
|
|
2472
2470
|
const diff = srcHuman - dstHuman;
|
|
2473
2471
|
if (diff > 0) {
|
|
2474
2472
|
bridgeFeeAmount = diff;
|
|
@@ -2668,14 +2666,16 @@ function useBridgeQuote() {
|
|
|
2668
2666
|
slippage: slippageDecimal,
|
|
2669
2667
|
routePriority
|
|
2670
2668
|
});
|
|
2671
|
-
if (quoteRoute
|
|
2672
|
-
|
|
2673
|
-
|
|
2669
|
+
if (!quoteRoute || quoteRoute.route === null) {
|
|
2670
|
+
if (!cancelled) {
|
|
2671
|
+
setNoRoute(true);
|
|
2672
|
+
setLoading(false);
|
|
2673
|
+
}
|
|
2674
2674
|
return;
|
|
2675
2675
|
} else {
|
|
2676
2676
|
setNoRoute(false);
|
|
2677
2677
|
}
|
|
2678
|
-
if (!quoteRoute
|
|
2678
|
+
if (!quoteRoute.dstAmount || BigInt(quoteRoute.dstAmount) === BigInt(0)) {
|
|
2679
2679
|
if (!cancelled) resetUi();
|
|
2680
2680
|
return;
|
|
2681
2681
|
}
|
|
@@ -2979,6 +2979,7 @@ function useSwapModel() {
|
|
|
2979
2979
|
const toChain = chainsStore.toChain;
|
|
2980
2980
|
const sym = (tokensStore.selectedAssetSymbol ?? "").toUpperCase();
|
|
2981
2981
|
if (!fromChain || !toChain || !sym) return;
|
|
2982
|
+
if (!isAllowedFromChain(toChain.chainKey)) return;
|
|
2982
2983
|
chainsStore.setAllowedToChains([]);
|
|
2983
2984
|
chainsStore.setFromChain(toChain);
|
|
2984
2985
|
const tokenOnNewFrom = tokensStore.assetMatrix?.[sym]?.[toChain.chainKey];
|
|
@@ -3051,7 +3052,12 @@ function useFeeBreakdown() {
|
|
|
3051
3052
|
selectedAssetSymbol,
|
|
3052
3053
|
fromChain?.chainKey
|
|
3053
3054
|
);
|
|
3054
|
-
|
|
3055
|
+
const dstToken = resolveTokenOnChainFromMatrix$1(
|
|
3056
|
+
assetMatrix,
|
|
3057
|
+
selectedAssetSymbol,
|
|
3058
|
+
toChain?.chainKey
|
|
3059
|
+
);
|
|
3060
|
+
return computeFeeBreakdownUsd(quote, srcToken, dstToken, allTokens ?? tokens, chains, fromChain, toChain);
|
|
3055
3061
|
}, [quote, allTokens, tokens, chains, selectedAssetSymbol, assetMatrix, fromChain, toChain]);
|
|
3056
3062
|
}
|
|
3057
3063
|
function useBridgeExternalData(options) {
|
|
@@ -4109,30 +4115,6 @@ function useSilentValidations(amountString) {
|
|
|
4109
4115
|
status,
|
|
4110
4116
|
error
|
|
4111
4117
|
]);
|
|
4112
|
-
react.useEffect(() => {
|
|
4113
|
-
if (validationResult.isValidForTransfer) return;
|
|
4114
|
-
console.info("[SilentValidations] invalid", {
|
|
4115
|
-
amountString,
|
|
4116
|
-
hasTooManyDecimals: validationResult.hasTooManyDecimals,
|
|
4117
|
-
hasUnsupportedTokenPair: validationResult.hasUnsupportedTokenPair,
|
|
4118
|
-
hasInsufficientLiquidity: validationResult.hasInsufficientLiquidity,
|
|
4119
|
-
status,
|
|
4120
|
-
hasQuote: Boolean(quote),
|
|
4121
|
-
error,
|
|
4122
|
-
fromChainKey: fromChain?.chainKey,
|
|
4123
|
-
toChainKey: toChain?.chainKey,
|
|
4124
|
-
selectedAssetSymbol
|
|
4125
|
-
});
|
|
4126
|
-
}, [
|
|
4127
|
-
validationResult,
|
|
4128
|
-
amountString,
|
|
4129
|
-
status,
|
|
4130
|
-
quote,
|
|
4131
|
-
error,
|
|
4132
|
-
fromChain?.chainKey,
|
|
4133
|
-
toChain?.chainKey,
|
|
4134
|
-
selectedAssetSymbol
|
|
4135
|
-
]);
|
|
4136
4118
|
return validationResult;
|
|
4137
4119
|
}
|
|
4138
4120
|
function useTelegramRestriction() {
|
|
@@ -4259,7 +4241,6 @@ const MainButton = ({
|
|
|
4259
4241
|
}
|
|
4260
4242
|
};
|
|
4261
4243
|
const disabled = status === "loading" || requiresCustomAddress || !isTelegramRestricted && !missingSrc && !missingDst && (amountNum <= 0 || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer);
|
|
4262
|
-
console.log(gas);
|
|
4263
4244
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-4 space-y-4", children: [
|
|
4264
4245
|
isTelegramRestricted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4265
4246
|
alert.Alert,
|
|
@@ -4269,6 +4250,14 @@ const MainButton = ({
|
|
|
4269
4250
|
children: /* @__PURE__ */ jsxRuntime.jsx(alert.AlertDescription, { className: "leading-snug tracking-wide", children: t2("telegram.restrictionMessage") })
|
|
4270
4251
|
}
|
|
4271
4252
|
),
|
|
4253
|
+
noRoute && !isTelegramRestricted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4254
|
+
alert.Alert,
|
|
4255
|
+
{
|
|
4256
|
+
variant: "warning",
|
|
4257
|
+
className: "mt-2 text-sm font-medium text-center px-2 py-2",
|
|
4258
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(alert.AlertDescription, { className: "leading-snug tracking-wide", children: t2("transaction.noRouteAlert") })
|
|
4259
|
+
}
|
|
4260
|
+
),
|
|
4272
4261
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4273
4262
|
button.Button,
|
|
4274
4263
|
{
|
|
@@ -26098,7 +26087,7 @@ class WalletConnectModal {
|
|
|
26098
26087
|
}
|
|
26099
26088
|
async initUi() {
|
|
26100
26089
|
if (typeof window !== "undefined") {
|
|
26101
|
-
await Promise.resolve().then(() => require("./index-
|
|
26090
|
+
await Promise.resolve().then(() => require("./index-x-S2vNi4.cjs"));
|
|
26102
26091
|
const modal = document.createElement("wcm-modal");
|
|
26103
26092
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
26104
26093
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26806,7 +26795,9 @@ const EvaaBridgeContent = ({
|
|
|
26806
26795
|
const allowedFromChains = swap.allowedFromChains;
|
|
26807
26796
|
const allowedToChains = swap.allowedToChains;
|
|
26808
26797
|
const { chains } = useChainsStore();
|
|
26809
|
-
const canSwap = Boolean(
|
|
26798
|
+
const canSwap = Boolean(
|
|
26799
|
+
fromChain && toChain && selectedAssetSymbol && isAllowedFromChain(toChain.chainKey)
|
|
26800
|
+
);
|
|
26810
26801
|
const outputAmount = react.useMemo(() => {
|
|
26811
26802
|
if (!quote || loading) return "";
|
|
26812
26803
|
const srcToken = resolveTokenOnChainFromMatrix$1(
|
|
@@ -26998,4 +26989,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26998
26989
|
exports.useSwapModel = useSwapModel;
|
|
26999
26990
|
exports.useTokensStore = useTokensStore;
|
|
27000
26991
|
exports.useTransactionStore = useTransactionStore;
|
|
27001
|
-
//# sourceMappingURL=index-
|
|
26992
|
+
//# sourceMappingURL=index-DnrWUlYr.cjs.map
|