@rash2x/bridge-widget 0.6.64 → 0.6.65
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-BEeiBKNi.js → index-Bf7M_Hjm.js} +80 -32
- package/dist/index-Bf7M_Hjm.js.map +1 -0
- package/dist/{index-BuYPjNSX.cjs → index-DJrg5YQY.cjs} +2 -2
- package/dist/{index-BuYPjNSX.cjs.map → index-DJrg5YQY.cjs.map} +1 -1
- package/dist/{index-7Pgd_WWn.js → index-PB3n7I7m.js} +2 -2
- package/dist/{index-7Pgd_WWn.js.map → index-PB3n7I7m.js.map} +1 -1
- package/dist/{index-DYJQfOaf.cjs → index-XPQb2NSf.cjs} +80 -32
- package/dist/index-XPQb2NSf.cjs.map +1 -0
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
- package/dist/index-BEeiBKNi.js.map +0 -1
- package/dist/index-DYJQfOaf.cjs.map +0 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-XPQb2NSf.cjs");
|
|
4
4
|
exports.DEFAULT_SLIPPAGE_BPS = index.DEFAULT_SLIPPAGE_BPS;
|
|
5
5
|
exports.EvaaBridge = index.EvaaBridge;
|
|
6
6
|
exports.RoutePriority = index.RoutePriority;
|
package/dist/evaa-bridge.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L, d, f, e, D, Q, H, z, W, U, w, s, v, r, p, q, G, Z, a5, $, a2, x, A, y, a0, B, _, a3, a4, S, a1, P, I, V, Y, a6, J, K, X, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-
|
|
1
|
+
import { L, d, f, e, D, Q, H, z, W, U, w, s, v, r, p, q, G, Z, a5, $, a2, x, A, y, a0, B, _, a3, a4, S, a1, P, I, V, Y, a6, J, K, X, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-Bf7M_Hjm.js";
|
|
2
2
|
export {
|
|
3
3
|
L as DEFAULT_SLIPPAGE_BPS,
|
|
4
4
|
d as EvaaBridge,
|
|
@@ -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", "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", "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", "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" } };
|
|
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", "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" } };
|
|
@@ -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": "Сменит исходную сеть", "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": "Отправлено", "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": "Маршрут", "estTime": "Время", "slippage": "Проскальзывание", "minimumReceived": "Минимум к получению", "totalFee": "Общая комиссия", "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
58
|
const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationDescription": "Значение по умолчанию позволяет выполнить пару транзакций (например, Approve и Swap).", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceDescription": "Ваша транзакция будет отклонена, если получаемая сумма выйдет за пределы этой допустимой погрешности.", "routePriority": "Приоритет маршрута", "routePriorityDescription": "Выберите, как будет выполняться ваш трансфер. Recommended — выбирает оптимальный маршрут с учётом общей стоимости. Fastest — отдаёт приоритет максимальной скорости.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрейший", "cheapest": "Дешевейший", "recommended": "Рекомендуемый" } };
|
|
@@ -3268,6 +3268,16 @@ const useTransactionStore = create((set2, get2) => ({
|
|
|
3268
3268
|
};
|
|
3269
3269
|
set2({ current: next });
|
|
3270
3270
|
},
|
|
3271
|
+
updateCurrentStep: (type, index, total) => {
|
|
3272
|
+
const cur = get2().current;
|
|
3273
|
+
if (!cur) return;
|
|
3274
|
+
const next = {
|
|
3275
|
+
...cur,
|
|
3276
|
+
currentStep: { type, index, total },
|
|
3277
|
+
updatedAt: Date.now()
|
|
3278
|
+
};
|
|
3279
|
+
set2({ current: next });
|
|
3280
|
+
},
|
|
3271
3281
|
reset: () => {
|
|
3272
3282
|
set2({ current: void 0 });
|
|
3273
3283
|
}
|
|
@@ -3531,10 +3541,25 @@ function useBridgeTransaction() {
|
|
|
3531
3541
|
srcChainKey: quote.srcChainKey,
|
|
3532
3542
|
dstChainKey: quote.dstChainKey
|
|
3533
3543
|
};
|
|
3534
|
-
const txResult = await strategy.executeSteps(
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3544
|
+
const txResult = await strategy.executeSteps(
|
|
3545
|
+
steps,
|
|
3546
|
+
context,
|
|
3547
|
+
(hash, stepType, stepIndex, totalSteps) => {
|
|
3548
|
+
txStore.updateCurrentStep(
|
|
3549
|
+
stepType,
|
|
3550
|
+
stepIndex,
|
|
3551
|
+
totalSteps
|
|
3552
|
+
);
|
|
3553
|
+
if (stepIndex === 0) {
|
|
3554
|
+
txStore.setSrcHash(hash);
|
|
3555
|
+
}
|
|
3556
|
+
if (stepType === "approve" && stepIndex < totalSteps - 1) {
|
|
3557
|
+
txStore.updateStatus("approving");
|
|
3558
|
+
} else {
|
|
3559
|
+
txStore.updateStatus("processing");
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
);
|
|
3538
3563
|
if (txResult?.hash) {
|
|
3539
3564
|
const trackWithLayerZero = async () => {
|
|
3540
3565
|
let hashForLayerZero = txResult.hash;
|
|
@@ -4227,10 +4252,30 @@ const CircleLinedIcon = (props) => {
|
|
|
4227
4252
|
);
|
|
4228
4253
|
};
|
|
4229
4254
|
const ProgressStep = ({
|
|
4230
|
-
icon = /* @__PURE__ */ jsx(Loader2, { className: "w-16 h-16 animate-spin" })
|
|
4255
|
+
icon = /* @__PURE__ */ jsx(Loader2, { className: "w-16 h-16 animate-spin" }),
|
|
4256
|
+
isApproving = false
|
|
4231
4257
|
}) => {
|
|
4232
4258
|
const { t: t2 } = useBridgeTranslation();
|
|
4233
|
-
const
|
|
4259
|
+
const { current } = useTransactionStore();
|
|
4260
|
+
const currentStep = current?.currentStep;
|
|
4261
|
+
const steps = isApproving && currentStep ? [
|
|
4262
|
+
{
|
|
4263
|
+
icon: /* @__PURE__ */ jsx(Loader2, { className: "w-5 h-5 text-primary animate-spin", strokeWidth: 3 }),
|
|
4264
|
+
title: t2("transaction.steps.approving"),
|
|
4265
|
+
description: t2("transaction.steps.approvingNote", {
|
|
4266
|
+
current: currentStep.index + 1,
|
|
4267
|
+
total: currentStep.total
|
|
4268
|
+
})
|
|
4269
|
+
},
|
|
4270
|
+
{
|
|
4271
|
+
icon: /* @__PURE__ */ jsx(CircleLinedIcon, { className: "w-5 h-5" }),
|
|
4272
|
+
title: t2("transaction.steps.bridging")
|
|
4273
|
+
},
|
|
4274
|
+
{
|
|
4275
|
+
icon: /* @__PURE__ */ jsx(CircleLinedIcon, { className: "w-5 h-5" }),
|
|
4276
|
+
title: t2("transaction.steps.completed")
|
|
4277
|
+
}
|
|
4278
|
+
] : [
|
|
4234
4279
|
{
|
|
4235
4280
|
icon: /* @__PURE__ */ jsx(CheckIcon, { className: "w-5 h-5 " }),
|
|
4236
4281
|
title: t2("transaction.steps.sent")
|
|
@@ -4570,6 +4615,9 @@ const StatusStepsDialog = ({
|
|
|
4570
4615
|
if (status === "executing") {
|
|
4571
4616
|
step = /* @__PURE__ */ jsx(ConfirmStep, { icon: icons?.confirm });
|
|
4572
4617
|
}
|
|
4618
|
+
if (status === "approving") {
|
|
4619
|
+
step = /* @__PURE__ */ jsx(ProgressStep, { icon: icons?.progress, isApproving: true });
|
|
4620
|
+
}
|
|
4573
4621
|
if (status === "processing") {
|
|
4574
4622
|
step = /* @__PURE__ */ jsx(ProgressStep, { icon: icons?.progress });
|
|
4575
4623
|
}
|
|
@@ -5174,35 +5222,34 @@ class EvmChainStrategy {
|
|
|
5174
5222
|
}
|
|
5175
5223
|
return Number(formatUnits(totalFeeWei, 18));
|
|
5176
5224
|
}
|
|
5177
|
-
async executeSteps(steps, _context,
|
|
5225
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5178
5226
|
if (!this.isConnected() || !this.walletClient) {
|
|
5179
5227
|
throw new WalletNotConnectedError("evm");
|
|
5180
5228
|
}
|
|
5181
5229
|
this.validateSteps(steps);
|
|
5182
5230
|
try {
|
|
5183
5231
|
let firstTxHash;
|
|
5184
|
-
|
|
5232
|
+
const totalSteps = steps.length;
|
|
5233
|
+
for (let i3 = 0; i3 < steps.length; i3++) {
|
|
5234
|
+
const step = steps[i3];
|
|
5185
5235
|
console.log(
|
|
5186
|
-
`Executing ${step.type} transaction on ${step.chainKey}...`
|
|
5236
|
+
`Executing ${step.type} transaction on ${step.chainKey} (${i3 + 1}/${totalSteps})...`
|
|
5187
5237
|
);
|
|
5238
|
+
let hash;
|
|
5188
5239
|
if (step.type === "approve") {
|
|
5189
|
-
|
|
5190
|
-
if (!firstTxHash) {
|
|
5191
|
-
firstTxHash = hash;
|
|
5192
|
-
onFirstHash?.(hash);
|
|
5193
|
-
}
|
|
5240
|
+
hash = await this.approveTransaction(step);
|
|
5194
5241
|
} else if (step.type === "bridge") {
|
|
5195
|
-
|
|
5196
|
-
if (!firstTxHash) {
|
|
5197
|
-
firstTxHash = hash;
|
|
5198
|
-
onFirstHash?.(hash);
|
|
5199
|
-
}
|
|
5242
|
+
hash = await this.executeTransaction(step);
|
|
5200
5243
|
} else {
|
|
5201
5244
|
throw new InvalidStepsError(
|
|
5202
5245
|
"evm",
|
|
5203
5246
|
`Unsupported step type: ${step.type}`
|
|
5204
5247
|
);
|
|
5205
5248
|
}
|
|
5249
|
+
if (!firstTxHash) {
|
|
5250
|
+
firstTxHash = hash;
|
|
5251
|
+
}
|
|
5252
|
+
onStepComplete?.(hash, step.type, i3, totalSteps);
|
|
5206
5253
|
}
|
|
5207
5254
|
return {
|
|
5208
5255
|
hash: firstTxHash,
|
|
@@ -5466,7 +5513,7 @@ class TonChainStrategy {
|
|
|
5466
5513
|
}
|
|
5467
5514
|
}
|
|
5468
5515
|
}
|
|
5469
|
-
async executeSteps(steps, _context,
|
|
5516
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5470
5517
|
if (!this.isConnected() || !this.config.tonConnectUI) {
|
|
5471
5518
|
throw new WalletNotConnectedError("ton");
|
|
5472
5519
|
}
|
|
@@ -5495,7 +5542,7 @@ class TonChainStrategy {
|
|
|
5495
5542
|
const inMessage = loadMessage(Cell.fromBase64(bocBase64).beginParse());
|
|
5496
5543
|
const messageHash = this.getNormalizedExtMessageHash(inMessage);
|
|
5497
5544
|
const hexHash = messageHash.toString("hex");
|
|
5498
|
-
|
|
5545
|
+
onStepComplete?.(hexHash, "bridge", 0, steps.length);
|
|
5499
5546
|
return {
|
|
5500
5547
|
chainKey: "ton",
|
|
5501
5548
|
hash: hexHash
|
|
@@ -5503,7 +5550,7 @@ class TonChainStrategy {
|
|
|
5503
5550
|
};
|
|
5504
5551
|
} catch (error) {
|
|
5505
5552
|
console.error("Error parsing BOC to hex hash:", error);
|
|
5506
|
-
|
|
5553
|
+
onStepComplete?.(bocBase64, "bridge", 0, steps.length);
|
|
5507
5554
|
return {
|
|
5508
5555
|
chainKey: "ton",
|
|
5509
5556
|
hash: bocBase64
|
|
@@ -5915,7 +5962,7 @@ class TronChainStrategy {
|
|
|
5915
5962
|
}
|
|
5916
5963
|
return fee / 1e6;
|
|
5917
5964
|
}
|
|
5918
|
-
async executeSteps(steps, _context,
|
|
5965
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5919
5966
|
const tronWeb = this.getClient();
|
|
5920
5967
|
if (!tronWeb) {
|
|
5921
5968
|
throw new ProviderNotAvailableError("tron");
|
|
@@ -5928,7 +5975,10 @@ class TronChainStrategy {
|
|
|
5928
5975
|
const fromB58 = connector.address;
|
|
5929
5976
|
this.ensureDefaultAddress(tronWeb, fromB58);
|
|
5930
5977
|
let lastTxId;
|
|
5931
|
-
let
|
|
5978
|
+
let stepIndex = 0;
|
|
5979
|
+
const totalSteps = steps.filter(
|
|
5980
|
+
(s2) => String(s2.chainKey).toLowerCase() === "tron"
|
|
5981
|
+
).length;
|
|
5932
5982
|
for (const step of steps) {
|
|
5933
5983
|
if (String(step.chainKey).toLowerCase() !== "tron") continue;
|
|
5934
5984
|
const tx = step.transaction;
|
|
@@ -5998,10 +6048,8 @@ class TronChainStrategy {
|
|
|
5998
6048
|
connector
|
|
5999
6049
|
);
|
|
6000
6050
|
lastTxId = txid;
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
isFirstHash = false;
|
|
6004
|
-
}
|
|
6051
|
+
onStepComplete?.(txid, step.type, stepIndex, totalSteps);
|
|
6052
|
+
stepIndex++;
|
|
6005
6053
|
}
|
|
6006
6054
|
if (!lastTxId) {
|
|
6007
6055
|
throw new TransactionFailedError(
|
|
@@ -25829,7 +25877,7 @@ class WalletConnectModal {
|
|
|
25829
25877
|
}
|
|
25830
25878
|
async initUi() {
|
|
25831
25879
|
if (typeof window !== "undefined") {
|
|
25832
|
-
await import("./index-
|
|
25880
|
+
await import("./index-PB3n7I7m.js");
|
|
25833
25881
|
const modal = document.createElement("wcm-modal");
|
|
25834
25882
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25835
25883
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26598,4 +26646,4 @@ export {
|
|
|
26598
26646
|
getQuoteFees as y,
|
|
26599
26647
|
calculateMinReceived as z
|
|
26600
26648
|
};
|
|
26601
|
-
//# sourceMappingURL=index-
|
|
26649
|
+
//# sourceMappingURL=index-Bf7M_Hjm.js.map
|