@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
|
@@ -34,7 +34,7 @@ import { FixedSizeList } from "react-window";
|
|
|
34
34
|
const common$1 = { "connecting": "Connecting…", "initializing": "Initializing...", "loading": "Loading...", "paste": "paste", "close": "Close", "zeroPlaceholder": "0", "nativeToken": "Native Token" };
|
|
35
35
|
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" };
|
|
36
36
|
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" };
|
|
37
|
-
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" } };
|
|
37
|
+
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" } };
|
|
38
38
|
const telegram$1 = { "openWebVersion": "Open EVAA Web to Bridge", "restrictionMessage": "You can bridge between the chosen networks on EVAA web version" };
|
|
39
39
|
const app$1 = { "stargateWidgetName": "Stargate Bridge Widget", "liveWidget": "Live Widget", "getStarted": "Get Started" };
|
|
40
40
|
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" } };
|
|
@@ -52,7 +52,7 @@ const en$3 = {
|
|
|
52
52
|
const common = { "connecting": "Подключение…", "initializing": "Инициализация...", "loading": "Загрузка...", "paste": "вставить", "close": "Закрыть", "zeroPlaceholder": "0", "nativeToken": "Нативный токен" };
|
|
53
53
|
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": "Подключить кошелёк" };
|
|
54
54
|
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": "Проверьте корректность перед переводом" };
|
|
55
|
-
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": "Завершено" } };
|
|
55
|
+
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": "Завершено" } };
|
|
56
56
|
const telegram = { "openWebVersion": "Открыть EVAA веб для трансфера", "restrictionMessage": "Трансфер между выбранными сетями доступен только в веб-версии EVAA" };
|
|
57
57
|
const app = { "stargateWidgetName": "Виджет Stargate Bridge", "liveWidget": "Живой виджет", "getStarted": "Начало работы" };
|
|
58
58
|
const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationTooltip": "Добавляет нативный токен целевой сети для оплаты комиссий за транзакции после бриджа. Увеличивает общую комиссию.", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceTooltip": "Если получаемая сумма окажется ниже этого допуска, транзакция будет отклонена.", "routePriority": "Приоритет маршрута", "routePriorityTooltip": "Выберите маршрут перевода. Рекомендуемый — подбирает самый выгодный вариант по общей стоимости. Быстрый — выбирает маршрут с приоритетом скорости, даже если это дороже.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрый", "cheapest": "Дешевый", "recommended": "Рекомендуемый" } };
|
|
@@ -505,10 +505,7 @@ const ExitIcon = (props) => {
|
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
507
|
};
|
|
508
|
-
const SwapButton = ({
|
|
509
|
-
canSwap,
|
|
510
|
-
onSwap
|
|
511
|
-
}) => {
|
|
508
|
+
const SwapButton = ({ canSwap, onSwap }) => {
|
|
512
509
|
const [turns, setTurns] = useState(0);
|
|
513
510
|
const [isSwapping, setIsSwapping] = useState(false);
|
|
514
511
|
const handleSwap = useCallback(() => {
|
|
@@ -2209,7 +2206,8 @@ async function fetchQuotes(req) {
|
|
|
2209
2206
|
).toString()}`;
|
|
2210
2207
|
const res = await fetch(url);
|
|
2211
2208
|
const data = await res.json();
|
|
2212
|
-
|
|
2209
|
+
const quotes = data?.quotes ?? [];
|
|
2210
|
+
return quotes.filter((q3) => !q3.error);
|
|
2213
2211
|
}
|
|
2214
2212
|
function selectQuoteByPriority(routes, priority) {
|
|
2215
2213
|
if (priority === RoutePriority.FASTEST) {
|
|
@@ -2404,7 +2402,7 @@ function calculateMinReceived(quote, slippageBps, dstToken) {
|
|
|
2404
2402
|
}
|
|
2405
2403
|
function getQuoteDetails(quote, srcToken, dstToken, tokens, chains, slippageBps, srcChain, dstChain) {
|
|
2406
2404
|
const amounts = getQuoteAmounts(quote, srcToken, dstToken);
|
|
2407
|
-
const fees = computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstChain);
|
|
2405
|
+
const fees = computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcChain, dstChain);
|
|
2408
2406
|
const minimumReceived = calculateMinReceived(quote, slippageBps, dstToken);
|
|
2409
2407
|
return {
|
|
2410
2408
|
inputAmount: amounts.inputHuman,
|
|
@@ -2424,7 +2422,7 @@ function getRouteDisplayName(route) {
|
|
|
2424
2422
|
if (routeLower.includes("v2")) return "Stargate V2";
|
|
2425
2423
|
return route.split(/[/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
2426
2424
|
}
|
|
2427
|
-
function computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstChain) {
|
|
2425
|
+
function computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcChain, dstChain) {
|
|
2428
2426
|
const defaultMsgSymbol = srcChain?.nativeCurrency?.symbol?.toUpperCase() ?? "";
|
|
2429
2427
|
const defaultBridgeSymbol = srcToken?.symbol?.toUpperCase() ?? "";
|
|
2430
2428
|
const defaultDstGasSymbol = dstChain?.nativeCurrency?.symbol?.toUpperCase() ?? "";
|
|
@@ -2467,7 +2465,7 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains, srcChain, dstCh
|
|
|
2467
2465
|
let bridgeFeeUsd = 0;
|
|
2468
2466
|
const bridgeFeeSymbol = srcToken.symbol?.toUpperCase() ?? "";
|
|
2469
2467
|
const srcHuman = fromLD(quote.srcAmount, srcToken.decimals);
|
|
2470
|
-
const dstHuman = fromLD(quote.dstAmount,
|
|
2468
|
+
const dstHuman = dstToken ? fromLD(quote.dstAmount, dstToken.decimals) : 0;
|
|
2471
2469
|
const diff = srcHuman - dstHuman;
|
|
2472
2470
|
if (diff > 0) {
|
|
2473
2471
|
bridgeFeeAmount = diff;
|
|
@@ -2667,14 +2665,16 @@ function useBridgeQuote() {
|
|
|
2667
2665
|
slippage: slippageDecimal,
|
|
2668
2666
|
routePriority
|
|
2669
2667
|
});
|
|
2670
|
-
if (quoteRoute
|
|
2671
|
-
|
|
2672
|
-
|
|
2668
|
+
if (!quoteRoute || quoteRoute.route === null) {
|
|
2669
|
+
if (!cancelled) {
|
|
2670
|
+
setNoRoute(true);
|
|
2671
|
+
setLoading(false);
|
|
2672
|
+
}
|
|
2673
2673
|
return;
|
|
2674
2674
|
} else {
|
|
2675
2675
|
setNoRoute(false);
|
|
2676
2676
|
}
|
|
2677
|
-
if (!quoteRoute
|
|
2677
|
+
if (!quoteRoute.dstAmount || BigInt(quoteRoute.dstAmount) === BigInt(0)) {
|
|
2678
2678
|
if (!cancelled) resetUi();
|
|
2679
2679
|
return;
|
|
2680
2680
|
}
|
|
@@ -2978,6 +2978,7 @@ function useSwapModel() {
|
|
|
2978
2978
|
const toChain = chainsStore.toChain;
|
|
2979
2979
|
const sym = (tokensStore.selectedAssetSymbol ?? "").toUpperCase();
|
|
2980
2980
|
if (!fromChain || !toChain || !sym) return;
|
|
2981
|
+
if (!isAllowedFromChain(toChain.chainKey)) return;
|
|
2981
2982
|
chainsStore.setAllowedToChains([]);
|
|
2982
2983
|
chainsStore.setFromChain(toChain);
|
|
2983
2984
|
const tokenOnNewFrom = tokensStore.assetMatrix?.[sym]?.[toChain.chainKey];
|
|
@@ -3050,7 +3051,12 @@ function useFeeBreakdown() {
|
|
|
3050
3051
|
selectedAssetSymbol,
|
|
3051
3052
|
fromChain?.chainKey
|
|
3052
3053
|
);
|
|
3053
|
-
|
|
3054
|
+
const dstToken = resolveTokenOnChainFromMatrix$1(
|
|
3055
|
+
assetMatrix,
|
|
3056
|
+
selectedAssetSymbol,
|
|
3057
|
+
toChain?.chainKey
|
|
3058
|
+
);
|
|
3059
|
+
return computeFeeBreakdownUsd(quote, srcToken, dstToken, allTokens ?? tokens, chains, fromChain, toChain);
|
|
3054
3060
|
}, [quote, allTokens, tokens, chains, selectedAssetSymbol, assetMatrix, fromChain, toChain]);
|
|
3055
3061
|
}
|
|
3056
3062
|
function useBridgeExternalData(options) {
|
|
@@ -4108,30 +4114,6 @@ function useSilentValidations(amountString) {
|
|
|
4108
4114
|
status,
|
|
4109
4115
|
error
|
|
4110
4116
|
]);
|
|
4111
|
-
useEffect(() => {
|
|
4112
|
-
if (validationResult.isValidForTransfer) return;
|
|
4113
|
-
console.info("[SilentValidations] invalid", {
|
|
4114
|
-
amountString,
|
|
4115
|
-
hasTooManyDecimals: validationResult.hasTooManyDecimals,
|
|
4116
|
-
hasUnsupportedTokenPair: validationResult.hasUnsupportedTokenPair,
|
|
4117
|
-
hasInsufficientLiquidity: validationResult.hasInsufficientLiquidity,
|
|
4118
|
-
status,
|
|
4119
|
-
hasQuote: Boolean(quote),
|
|
4120
|
-
error,
|
|
4121
|
-
fromChainKey: fromChain?.chainKey,
|
|
4122
|
-
toChainKey: toChain?.chainKey,
|
|
4123
|
-
selectedAssetSymbol
|
|
4124
|
-
});
|
|
4125
|
-
}, [
|
|
4126
|
-
validationResult,
|
|
4127
|
-
amountString,
|
|
4128
|
-
status,
|
|
4129
|
-
quote,
|
|
4130
|
-
error,
|
|
4131
|
-
fromChain?.chainKey,
|
|
4132
|
-
toChain?.chainKey,
|
|
4133
|
-
selectedAssetSymbol
|
|
4134
|
-
]);
|
|
4135
4117
|
return validationResult;
|
|
4136
4118
|
}
|
|
4137
4119
|
function useTelegramRestriction() {
|
|
@@ -4258,7 +4240,6 @@ const MainButton = ({
|
|
|
4258
4240
|
}
|
|
4259
4241
|
};
|
|
4260
4242
|
const disabled = status === "loading" || requiresCustomAddress || !isTelegramRestricted && !missingSrc && !missingDst && (amountNum <= 0 || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer);
|
|
4261
|
-
console.log(gas);
|
|
4262
4243
|
return /* @__PURE__ */ jsxs("div", { className: "pt-4 space-y-4", children: [
|
|
4263
4244
|
isTelegramRestricted && /* @__PURE__ */ jsx(
|
|
4264
4245
|
Alert,
|
|
@@ -4268,6 +4249,14 @@ const MainButton = ({
|
|
|
4268
4249
|
children: /* @__PURE__ */ jsx(AlertDescription, { className: "leading-snug tracking-wide", children: t2("telegram.restrictionMessage") })
|
|
4269
4250
|
}
|
|
4270
4251
|
),
|
|
4252
|
+
noRoute && !isTelegramRestricted && /* @__PURE__ */ jsx(
|
|
4253
|
+
Alert,
|
|
4254
|
+
{
|
|
4255
|
+
variant: "warning",
|
|
4256
|
+
className: "mt-2 text-sm font-medium text-center px-2 py-2",
|
|
4257
|
+
children: /* @__PURE__ */ jsx(AlertDescription, { className: "leading-snug tracking-wide", children: t2("transaction.noRouteAlert") })
|
|
4258
|
+
}
|
|
4259
|
+
),
|
|
4271
4260
|
/* @__PURE__ */ jsx(
|
|
4272
4261
|
Button,
|
|
4273
4262
|
{
|
|
@@ -26097,7 +26086,7 @@ class WalletConnectModal {
|
|
|
26097
26086
|
}
|
|
26098
26087
|
async initUi() {
|
|
26099
26088
|
if (typeof window !== "undefined") {
|
|
26100
|
-
await import("./index-
|
|
26089
|
+
await import("./index-D2IOd6mV.js");
|
|
26101
26090
|
const modal = document.createElement("wcm-modal");
|
|
26102
26091
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
26103
26092
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26805,7 +26794,9 @@ const EvaaBridgeContent = ({
|
|
|
26805
26794
|
const allowedFromChains = swap.allowedFromChains;
|
|
26806
26795
|
const allowedToChains = swap.allowedToChains;
|
|
26807
26796
|
const { chains } = useChainsStore();
|
|
26808
|
-
const canSwap = Boolean(
|
|
26797
|
+
const canSwap = Boolean(
|
|
26798
|
+
fromChain && toChain && selectedAssetSymbol && isAllowedFromChain(toChain.chainKey)
|
|
26799
|
+
);
|
|
26809
26800
|
const outputAmount = useMemo(() => {
|
|
26810
26801
|
if (!quote || loading) return "";
|
|
26811
26802
|
const srcToken = resolveTokenOnChainFromMatrix$1(
|
|
@@ -26999,4 +26990,4 @@ export {
|
|
|
26999
26990
|
calculateMinReceived as y,
|
|
27000
26991
|
getQuoteDetails as z
|
|
27001
26992
|
};
|
|
27002
|
-
//# sourceMappingURL=index-
|
|
26993
|
+
//# sourceMappingURL=index-KQ4SsUup.js.map
|