@rash2x/bridge-widget 0.6.79 → 0.6.81

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.
@@ -34,10 +34,10 @@ 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", "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", "estTime": "Est. Time", "slippage": "Slippage", "minimumReceived": "Minimum received", "totalFee": "Total Fee", "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", "totalFee": "Total Fee", "totalFeeTooltip": "Total fee is the estimated total cost of the transfer. It includes network gas and bridge/route fees. The final fee may vary slightly.", "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
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
- const settings$1 = { "title": "Settings", "gasOnDestination": "Gas on destination", "gasOnDestinationDescription": "The default amount allows you to perform a couple of transactions (e.g. Approve and Swap).", "slippageTolerance": "Slippage tolerance", "slippageToleranceDescription": "Your transaction will revert if the amount you're receiving is outside of this tolerance", "routePriority": "Route Priority", "routePriorityDescription": "Choose how your transfer is routed. Recommended picks the best overall path for cost. Fastest prioritizes speed above all else.", "highSlippageWarning": "High slippage warning", "gasPresets": { "auto": "Auto", "none": "None", "medium": "Medium", "max": "Max" }, "routePresets": { "fastest": "Fastest", "cheapest": "Cheapest", "recommended": "Recommended" } };
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" } };
41
41
  const errors$1 = { "WALLET_NOT_CONNECTED": "{{chainKey}} wallet not connected", "WALLET_CONNECTION_FAILED": "Failed to connect {{chainKey}} wallet", "WALLET_NOT_FOUND": "No {{chainKey}} wallet found. Please install a wallet extension.", "INVALID_ADDRESS": "Invalid {{chainKey}} address format", "INVALID_STEPS": "Invalid transaction steps for {{chainKey}}", "INVALID_TRANSACTION_DATA": "Invalid transaction data for {{chainKey}}", "TRANSACTION_REJECTED": "Transaction rejected by user", "TRANSACTION_FAILED": "Transaction failed", "TRANSACTION_TIMEOUT": "Transaction confirmation timeout", "TRANSACTION_REVERTED": "Transaction reverted on-chain", "INSUFFICIENT_GAS": "Insufficient {{chainKey}} gas", "PROVIDER_NOT_AVAILABLE": "{{chainKey}} provider not available", "NETWORK_REQUEST_FAILED": "Network request failed", "TRANSACTION_FAILED_TO_COMPLETE": "Transaction failed to complete", "COMPLETION_TRACKING_FAILED": "Completion tracking failed", "UNKNOWN_ERROR": "An unknown error occurred" };
42
42
  const en$3 = {
43
43
  common: common$1,
@@ -52,10 +52,10 @@ 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": "Сменит исходную сеть", "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": "Маршрут", "estTime": "Время", "slippage": "Проскальзывание", "minimumReceived": "Минимум к получению", "totalFee": "Общая комиссия", "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": "Минимум к получению", "totalFee": "Общая комиссия", "totalFeeTooltip": "Общая комиссия за перевод. Включает оценку комиссии сети (газ) и комиссии моста/маршрута. Фактическая сумма может немного измениться.", "noRouteFound": "Маршрут не найден", "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
- const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationDescription": "Значение по умолчанию позволяет выполнить пару транзакций (например, Approve и Swap).", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceDescription": "Ваша транзакция будет отклонена, если получаемая сумма выйдет за пределы этой допустимой погрешности.", "routePriority": "Приоритет маршрута", "routePriorityDescription": "Выберите, как будет выполняться ваш трансфер. Recommended выбирает оптимальный маршрут с учётом общей стоимости. Fastestотдаёт приоритет максимальной скорости.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрейший", "cheapest": "Дешевейший", "recommended": "Рекомендуемый" } };
58
+ const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationTooltip": "Добавляет нативный токен целевой сети для оплаты комиссий за транзакции после бриджа. Увеличивает общую комиссию.", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceTooltip": "Если получаемая сумма окажется ниже этого допуска, транзакция будет отклонена.", "routePriority": "Приоритет маршрута", "routePriorityTooltip": "Выберите маршрут перевода. Рекомендуемыйподбирает самый выгодный вариант по общей стоимости. Быстрыйвыбирает маршрут с приоритетом скорости, даже если это дороже.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрый", "cheapest": "Дешевый", "recommended": "Рекомендуемый" } };
59
59
  const errors = { "WALLET_NOT_CONNECTED": "{{chainKey}} кошелёк не подключен", "WALLET_CONNECTION_FAILED": "Не удалось подключить {{chainKey}} кошелёк", "WALLET_NOT_FOUND": "{{chainKey}} кошелёк не найден. Пожалуйста, установите расширение кошелька.", "INVALID_ADDRESS": "Неверный формат {{chainKey}} адреса", "INVALID_STEPS": "Недопустимые шаги транзакции для {{chainKey}}", "INVALID_TRANSACTION_DATA": "Недопустимые данные транзакции для {{chainKey}}", "TRANSACTION_REJECTED": "Транзакция отклонена пользователем", "TRANSACTION_FAILED": "Транзакция не удалась", "TRANSACTION_TIMEOUT": "Время ожидания подтверждения транзакции истекло", "TRANSACTION_REVERTED": "Транзакция отменена в блокчейне", "INSUFFICIENT_GAS": "Недостаточно {{chainKey}} газа", "PROVIDER_NOT_AVAILABLE": "{{chainKey}} провайдер недоступен", "NETWORK_REQUEST_FAILED": "Сетевой запрос не удался", "TRANSACTION_FAILED_TO_COMPLETE": "Транзакция не завершилась", "COMPLETION_TRACKING_FAILED": "Отслеживание завершения не удалось", "UNKNOWN_ERROR": "Произошла неизвестная ошибка" };
60
60
  const ru$1 = {
61
61
  common,
@@ -3102,6 +3102,7 @@ const Details = () => {
3102
3102
  DetailsRow,
3103
3103
  {
3104
3104
  label: t2("transaction.route"),
3105
+ tooltip: t2("transaction.routeTooltip"),
3105
3106
  value: /* @__PURE__ */ jsx("span", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx("p", { className: "", children: routeText }) })
3106
3107
  }
3107
3108
  ),
@@ -3109,6 +3110,7 @@ const Details = () => {
3109
3110
  DetailsRow,
3110
3111
  {
3111
3112
  label: t2("transaction.estTime"),
3113
+ tooltip: t2("transaction.estTimeTooltip"),
3112
3114
  value: etaText,
3113
3115
  isLoading
3114
3116
  }
@@ -3117,6 +3119,7 @@ const Details = () => {
3117
3119
  DetailsRow,
3118
3120
  {
3119
3121
  label: t2("transaction.slippage"),
3122
+ tooltip: t2("transaction.slippageTooltip"),
3120
3123
  value: currentSlippageText
3121
3124
  }
3122
3125
  ),
@@ -3124,6 +3127,7 @@ const Details = () => {
3124
3127
  DetailsRow,
3125
3128
  {
3126
3129
  label: t2("transaction.totalFee"),
3130
+ tooltip: t2("transaction.totalFeeTooltip"),
3127
3131
  value: /* @__PURE__ */ jsxs("strong", { className: "inline-flex items-center gap-1", children: [
3128
3132
  /* @__PURE__ */ jsx("span", { children: totalFeeDisplay }),
3129
3133
  /* @__PURE__ */ jsx(
@@ -3143,12 +3147,13 @@ const Details = () => {
3143
3147
  };
3144
3148
  const DetailsRow = ({
3145
3149
  label,
3150
+ tooltip,
3146
3151
  value,
3147
3152
  isLoading = false
3148
3153
  }) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
3149
3154
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3150
3155
  /* @__PURE__ */ jsx("p", { className: "text-sm text-priority font-normal", children: label }),
3151
- /* @__PURE__ */ jsx(Tip, { text: label, children: /* @__PURE__ */ jsx(InfoIcon, {}) })
3156
+ /* @__PURE__ */ jsx(Tip, { text: tooltip, children: /* @__PURE__ */ jsx(InfoIcon, {}) })
3152
3157
  ] }),
3153
3158
  isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
3154
3159
  ] });
@@ -3438,6 +3443,115 @@ async function waitForLayerZeroCompletion(txHash, timeoutMs = 6e5, pollIntervalM
3438
3443
  status: "TIMEOUT"
3439
3444
  };
3440
3445
  }
3446
+ const useBridgeReportStore = create((set2) => ({
3447
+ config: {
3448
+ enabled: false,
3449
+ authToken: void 0,
3450
+ baseUrl: void 0
3451
+ },
3452
+ setConfig: (config) => {
3453
+ set2({ config });
3454
+ },
3455
+ setAuthToken: (token) => {
3456
+ set2((state2) => ({
3457
+ config: { ...state2.config, authToken: token }
3458
+ }));
3459
+ },
3460
+ setEnabled: (enabled) => {
3461
+ set2((state2) => ({
3462
+ config: { ...state2.config, enabled }
3463
+ }));
3464
+ }
3465
+ }));
3466
+ async function tryFetch(url) {
3467
+ try {
3468
+ const res = await fetch(url);
3469
+ if (!res.ok) return null;
3470
+ return await res.json();
3471
+ } catch {
3472
+ return null;
3473
+ }
3474
+ }
3475
+ function interpretStatus(data) {
3476
+ if (!data) return null;
3477
+ const d3 = Array.isArray(data) ? data[0] : data;
3478
+ const lower2 = JSON.stringify(d3).toLowerCase();
3479
+ const hasDst = d3?.dstTxHash || d3?.dstTx || d3?.destinationTxHash || d3?.dstHash;
3480
+ const delivered = d3?.delivered === true || d3?.status === "delivered" || d3?.status === "completed" || typeof hasDst === "string" && hasDst.length > 0;
3481
+ const failed = d3?.status === "failed" || lower2.includes("failed") || lower2.includes("reverted");
3482
+ if (delivered) return { status: "delivered", srcTxHash: d3?.srcTxHash || d3?.srcTx, dstTxHash: hasDst || void 0, raw: d3 };
3483
+ if (failed) return { status: "failed", srcTxHash: d3?.srcTxHash || d3?.srcTx, raw: d3 };
3484
+ return { status: "pending", srcTxHash: d3?.srcTxHash || d3?.srcTx, raw: d3 };
3485
+ }
3486
+ async function getDeliveryStatus(params) {
3487
+ const query = new URLSearchParams();
3488
+ query.set("srcChainKey", params.srcChainKey);
3489
+ if (params.dstChainKey) query.set("dstChainKey", params.dstChainKey);
3490
+ query.set("srcTxHash", params.srcTxHash);
3491
+ const bases2 = [
3492
+ `https://stargate.finance/api/v1/transactions?${query.toString()}`,
3493
+ `https://stargate.finance/api/v1/txStatus?${query.toString()}`,
3494
+ `https://stargate.finance/api/v1/messageStatus?${query.toString()}`
3495
+ ];
3496
+ for (const url of bases2) {
3497
+ const json = await tryFetch(url);
3498
+ const st2 = interpretStatus(json);
3499
+ if (st2) return st2;
3500
+ }
3501
+ return null;
3502
+ }
3503
+ async function pollUntilDelivered(args) {
3504
+ const { intervalMs = 7e3, timeoutMs = 12 * 60 * 1e3 } = args;
3505
+ const start = Date.now();
3506
+ while (true) {
3507
+ if (args.signal?.aborted) throw new Error("aborted");
3508
+ const st2 = await getDeliveryStatus({
3509
+ srcChainKey: args.srcChainKey,
3510
+ dstChainKey: args.dstChainKey,
3511
+ srcTxHash: args.srcTxHash
3512
+ });
3513
+ if (st2) args.onUpdate?.(st2);
3514
+ if (st2?.status === "delivered") return st2;
3515
+ if (st2?.status === "failed") return st2;
3516
+ if (Date.now() - start > timeoutMs) return { status: "failed", srcTxHash: args.srcTxHash };
3517
+ await new Promise((r2) => setTimeout(r2, intervalMs));
3518
+ }
3519
+ }
3520
+ const DEFAULT_BRIDGE_REPORT_URL = "https://api.evaa.space/query/user/bridge";
3521
+ async function reportBridgeTransaction(params, config) {
3522
+ if (!config.enabled) {
3523
+ return { status: "ok" };
3524
+ }
3525
+ const url = config.baseUrl || DEFAULT_BRIDGE_REPORT_URL;
3526
+ const headers = {
3527
+ "Content-Type": "application/json"
3528
+ };
3529
+ if (config.authToken) {
3530
+ headers["Authorization"] = `Bearer ${config.authToken}`;
3531
+ }
3532
+ try {
3533
+ const res = await fetch(url, {
3534
+ method: "POST",
3535
+ headers,
3536
+ body: JSON.stringify(params)
3537
+ });
3538
+ const data = await res.json();
3539
+ if (!res.ok) {
3540
+ return {
3541
+ status: "error",
3542
+ error: data.error || "Failed to report bridge transaction",
3543
+ messages: data.messages
3544
+ };
3545
+ }
3546
+ return data;
3547
+ } catch (error) {
3548
+ console.error("Failed to report bridge transaction:", error);
3549
+ return {
3550
+ status: "error",
3551
+ error: error instanceof Error ? error.message : "Network error"
3552
+ };
3553
+ }
3554
+ }
3441
3555
  function useBridgeTransaction() {
3442
3556
  const { quote } = useBridgeQuoteStore();
3443
3557
  const { chainRegistry } = useChainStrategies();
@@ -3445,6 +3559,8 @@ function useBridgeTransaction() {
3445
3559
  const { assetMatrix, selectedAssetSymbol, allTokens } = useTokensStore();
3446
3560
  const { chains } = useChainsStore();
3447
3561
  const txStore = useTransactionStore();
3562
+ const { config: bridgeReportConfig } = useBridgeReportStore();
3563
+ const gas = useGasEstimate();
3448
3564
  const srcToken = useMemo(
3449
3565
  () => resolveTokenOnChainFromMatrix$2(
3450
3566
  assetMatrix,
@@ -3542,6 +3658,24 @@ function useBridgeTransaction() {
3542
3658
  console.warn("Failed to convert TON message hash to tx hash");
3543
3659
  }
3544
3660
  }
3661
+ if (bridgeReportConfig.enabled) {
3662
+ reportBridgeTransaction(
3663
+ {
3664
+ lz_tx_hash: hashForLayerZero,
3665
+ from_address: srcAddress,
3666
+ to_address: dstAddress,
3667
+ amount: amounts.inputHuman.toString(),
3668
+ token: srcToken?.symbol || quote.srcToken,
3669
+ from_network: srcChain?.name || quote.srcChainKey,
3670
+ to_network: dstChain?.name || quote.dstChainKey,
3671
+ estimated_fee: gas.requiredNative.toString(),
3672
+ sent_at: (/* @__PURE__ */ new Date()).toISOString()
3673
+ },
3674
+ bridgeReportConfig
3675
+ ).catch((err) => {
3676
+ console.warn("Failed to report bridge transaction:", err);
3677
+ });
3678
+ }
3545
3679
  const lzResult = await waitForLayerZeroCompletion(
3546
3680
  hashForLayerZero,
3547
3681
  6e5,
@@ -6461,7 +6595,7 @@ const SettingsModal = ({ isOpen, onClose }) => {
6461
6595
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
6462
6596
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6463
6597
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.gasOnDestination") }),
6464
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.gasOnDestinationDescription"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6598
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.gasOnDestinationTooltip"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6465
6599
  ] }),
6466
6600
  /* @__PURE__ */ jsx("p", { className: "text-foreground text-sm font-medium leading-4", children: formatUsd(gasUsdValue) })
6467
6601
  ] }),
@@ -6498,7 +6632,7 @@ const SettingsModal = ({ isOpen, onClose }) => {
6498
6632
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
6499
6633
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6500
6634
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.slippageTolerance") }),
6501
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.slippageToleranceDescription"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6635
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.slippageToleranceTooltip"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6502
6636
  ] }),
6503
6637
  slippageBps >= 500 && /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs font-medium", children: t2("settings.highSlippageWarning", {
6504
6638
  defaultValue: "High slippage warning"
@@ -6527,7 +6661,7 @@ const SettingsModal = ({ isOpen, onClose }) => {
6527
6661
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
6528
6662
  /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6529
6663
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.routePriority") }),
6530
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.routePriorityDescription"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6664
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.routePriorityTooltip"), children: /* @__PURE__ */ jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6531
6665
  ] }) }),
6532
6666
  /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r2) => /* @__PURE__ */ jsx(
6533
6667
  Badge,
@@ -25720,7 +25854,7 @@ class WalletConnectModal {
25720
25854
  }
25721
25855
  async initUi() {
25722
25856
  if (typeof window !== "undefined") {
25723
- await import("./index-DGozHzv0.js");
25857
+ await import("./index-88BW4a4g.js");
25724
25858
  const modal = document.createElement("wcm-modal");
25725
25859
  document.body.insertAdjacentElement("beforeend", modal);
25726
25860
  OptionsCtrl.setIsUiLoaded(true);
@@ -26162,6 +26296,14 @@ function useUrlSync(options) {
26162
26296
  const EvaaBridgeWithProviders = (props) => {
26163
26297
  const [tonConnectUI] = useTonConnectUI();
26164
26298
  const tonAddress = useTonAddress();
26299
+ const { setConfig: setBridgeReportConfig } = useBridgeReportStore();
26300
+ useEffect(() => {
26301
+ if (props.bridgeReport) {
26302
+ setBridgeReportConfig(props.bridgeReport);
26303
+ } else {
26304
+ setBridgeReportConfig({ enabled: false });
26305
+ }
26306
+ }, [props.bridgeReport, setBridgeReportConfig]);
26165
26307
  const { address: evmAddress, isConnected: evmIsConnected } = useAccount();
26166
26308
  const { disconnect: evmDisconnect } = useDisconnect();
26167
26309
  const { data: walletClient } = useWalletClient();
@@ -26398,97 +26540,45 @@ const EvaaBridgeContent = ({
26398
26540
  ] });
26399
26541
  };
26400
26542
  const EvaaBridge = EvaaBridgeWithProviders;
26401
- async function tryFetch(url) {
26402
- try {
26403
- const res = await fetch(url);
26404
- if (!res.ok) return null;
26405
- return await res.json();
26406
- } catch {
26407
- return null;
26408
- }
26409
- }
26410
- function interpretStatus(data) {
26411
- if (!data) return null;
26412
- const d3 = Array.isArray(data) ? data[0] : data;
26413
- const lower2 = JSON.stringify(d3).toLowerCase();
26414
- const hasDst = d3?.dstTxHash || d3?.dstTx || d3?.destinationTxHash || d3?.dstHash;
26415
- const delivered = d3?.delivered === true || d3?.status === "delivered" || d3?.status === "completed" || typeof hasDst === "string" && hasDst.length > 0;
26416
- const failed = d3?.status === "failed" || lower2.includes("failed") || lower2.includes("reverted");
26417
- if (delivered) return { status: "delivered", srcTxHash: d3?.srcTxHash || d3?.srcTx, dstTxHash: hasDst || void 0, raw: d3 };
26418
- if (failed) return { status: "failed", srcTxHash: d3?.srcTxHash || d3?.srcTx, raw: d3 };
26419
- return { status: "pending", srcTxHash: d3?.srcTxHash || d3?.srcTx, raw: d3 };
26420
- }
26421
- async function getDeliveryStatus(params) {
26422
- const query = new URLSearchParams();
26423
- query.set("srcChainKey", params.srcChainKey);
26424
- if (params.dstChainKey) query.set("dstChainKey", params.dstChainKey);
26425
- query.set("srcTxHash", params.srcTxHash);
26426
- const bases2 = [
26427
- `https://stargate.finance/api/v1/transactions?${query.toString()}`,
26428
- `https://stargate.finance/api/v1/txStatus?${query.toString()}`,
26429
- `https://stargate.finance/api/v1/messageStatus?${query.toString()}`
26430
- ];
26431
- for (const url of bases2) {
26432
- const json = await tryFetch(url);
26433
- const st2 = interpretStatus(json);
26434
- if (st2) return st2;
26435
- }
26436
- return null;
26437
- }
26438
- async function pollUntilDelivered(args) {
26439
- const { intervalMs = 7e3, timeoutMs = 12 * 60 * 1e3 } = args;
26440
- const start = Date.now();
26441
- while (true) {
26442
- if (args.signal?.aborted) throw new Error("aborted");
26443
- const st2 = await getDeliveryStatus({
26444
- srcChainKey: args.srcChainKey,
26445
- dstChainKey: args.dstChainKey,
26446
- srcTxHash: args.srcTxHash
26447
- });
26448
- if (st2) args.onUpdate?.(st2);
26449
- if (st2?.status === "delivered") return st2;
26450
- if (st2?.status === "failed") return st2;
26451
- if (Date.now() - start > timeoutMs) return { status: "failed", srcTxHash: args.srcTxHash };
26452
- await new Promise((r2) => setTimeout(r2, intervalMs));
26453
- }
26454
- }
26455
26543
  export {
26456
- getDestTokens as $,
26457
- getQuoteDetails as A,
26458
- getRouteDisplayName as B,
26544
+ getTokens as $,
26545
+ calculateMinReceived as A,
26546
+ getQuoteDetails as B,
26459
26547
  ConfigCtrl as C,
26460
- addNetworkFeesToQuote as D,
26548
+ getRouteDisplayName as D,
26461
26549
  EventsCtrl as E,
26462
- toLD as F,
26463
- fromLD as G,
26464
- buildAssetMatrix as H,
26465
- listAssetsForSelect as I,
26466
- resolveTokenOnChain as J,
26467
- resolveTokenOnChainFromMatrix$2 as K,
26468
- DEFAULT_SLIPPAGE_BPS as L,
26550
+ addNetworkFeesToQuote as F,
26551
+ toLD as G,
26552
+ fromLD as H,
26553
+ buildAssetMatrix as I,
26554
+ listAssetsForSelect as J,
26555
+ resolveTokenOnChain as K,
26556
+ resolveTokenOnChainFromMatrix$2 as L,
26469
26557
  ModalCtrl as M,
26470
- tonNorm as N,
26558
+ DEFAULT_SLIPPAGE_BPS as N,
26471
26559
  OptionsCtrl as O,
26472
- isZeroAddr as P,
26473
- addrForApi as Q,
26560
+ tonNorm as P,
26561
+ isZeroAddr as Q,
26474
26562
  RouterCtrl as R,
26475
- isNativeAddrEqual as S,
26563
+ addrForApi as S,
26476
26564
  ToastCtrl as T,
26477
- findNativeMeta as U,
26478
- lookupTokenMeta as V,
26479
- computeFeesUsdFromArray as W,
26480
- sumFeeByTokenLD as X,
26481
- normalizeTickerSymbol$1 as Y,
26482
- getChains as Z,
26483
- getTokens as _,
26565
+ isNativeAddrEqual as U,
26566
+ findNativeMeta as V,
26567
+ lookupTokenMeta as W,
26568
+ computeFeesUsdFromArray as X,
26569
+ sumFeeByTokenLD as Y,
26570
+ normalizeTickerSymbol$1 as Z,
26571
+ getChains as _,
26484
26572
  ThemeCtrl as a,
26485
- getQuotesByPriority as a0,
26486
- isNativeAddress as a1,
26487
- getEvmBalances as a2,
26488
- getTonBalances as a3,
26489
- getTronBalances as a4,
26490
- getDeliveryStatus as a5,
26491
- pollUntilDelivered as a6,
26573
+ getDestTokens as a0,
26574
+ getQuotesByPriority as a1,
26575
+ isNativeAddress as a2,
26576
+ getEvmBalances as a3,
26577
+ getTonBalances as a4,
26578
+ getTronBalances as a5,
26579
+ getDeliveryStatus as a6,
26580
+ pollUntilDelivered as a7,
26581
+ reportBridgeTransaction as a8,
26492
26582
  ExplorerCtrl as b,
26493
26583
  CoreUtil as c,
26494
26584
  EvaaBridge as d,
@@ -26501,18 +26591,18 @@ export {
26501
26591
  useTransactionStore as k,
26502
26592
  useConnectedWalletsStore as l,
26503
26593
  useCustomAddressStore as m,
26504
- useSwapModel as n,
26505
- useBridgeExternalData as o,
26506
- formatTokenAmount as p,
26507
- formatUsd as q,
26508
- formatPercentage as r,
26509
- formatBalance as s,
26594
+ useBridgeReportStore as n,
26595
+ useSwapModel as o,
26596
+ useBridgeExternalData as p,
26597
+ formatTokenAmount as q,
26598
+ formatUsd as r,
26599
+ formatPercentage as s,
26510
26600
  truncateToDecimals as t,
26511
26601
  useChainsStore as u,
26512
- formatHash as v,
26513
- formatAddress as w,
26514
- getQuoteAmounts as x,
26515
- getQuoteFees as y,
26516
- calculateMinReceived as z
26602
+ formatBalance as v,
26603
+ formatHash as w,
26604
+ formatAddress as x,
26605
+ getQuoteAmounts as y,
26606
+ getQuoteFees as z
26517
26607
  };
26518
- //# sourceMappingURL=index-DtUNq3cs.js.map
26608
+ //# sourceMappingURL=index-DJSauetI.js.map