@rash2x/bridge-widget 0.6.63 → 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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-CpKOf8oF.cjs");
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;
@@ -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-HznPfOtP.js";
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": "Рекомендуемый" } };
@@ -2922,6 +2922,7 @@ function useGasEstimate(amountNum) {
2922
2922
  const isNativeSelected = nativeSym === (selectedAssetSymbol || "").toUpperCase();
2923
2923
  let requiredNative = 0;
2924
2924
  let quoteFeesAvailable = false;
2925
+ console.log(quoteFees);
2925
2926
  if (quoteFees && quoteSrcChainKey === chainKey) {
2926
2927
  const fees = quoteFees;
2927
2928
  const feesInNative = fees.filter(
@@ -2940,6 +2941,9 @@ function useGasEstimate(amountNum) {
2940
2941
  } else {
2941
2942
  hasEnoughGas = nativeBalance >= requiredNative;
2942
2943
  }
2944
+ console.log("nativeBalance", nativeBalance);
2945
+ console.log("requiredNative", requiredNative);
2946
+ console.log("nativeBalance - (amountNum ?? 0)", nativeBalance - (amountNum ?? 0));
2943
2947
  const shouldCheckGas = balancesKnown && quoteFeesAvailable;
2944
2948
  return {
2945
2949
  nativeSym,
@@ -3264,6 +3268,16 @@ const useTransactionStore = create((set2, get2) => ({
3264
3268
  };
3265
3269
  set2({ current: next });
3266
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
+ },
3267
3281
  reset: () => {
3268
3282
  set2({ current: void 0 });
3269
3283
  }
@@ -3527,10 +3541,25 @@ function useBridgeTransaction() {
3527
3541
  srcChainKey: quote.srcChainKey,
3528
3542
  dstChainKey: quote.dstChainKey
3529
3543
  };
3530
- const txResult = await strategy.executeSteps(steps, context, (hash) => {
3531
- txStore.setSrcHash(hash);
3532
- txStore.updateStatus("processing");
3533
- });
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
+ );
3534
3563
  if (txResult?.hash) {
3535
3564
  const trackWithLayerZero = async () => {
3536
3565
  let hashForLayerZero = txResult.hash;
@@ -3671,6 +3700,8 @@ function useBalanceCheck(amountNum, gas) {
3671
3700
  };
3672
3701
  }
3673
3702
  const hasEnoughGasForTx = gas.nativeBalance >= gasReserve;
3703
+ console.log("rawBalance", rawBalance);
3704
+ console.log("amountNum", amountNum);
3674
3705
  return {
3675
3706
  availableBalance: rawBalance,
3676
3707
  hasInsufficientBalance: amountNum > rawBalance || !hasEnoughGasForTx,
@@ -4221,10 +4252,30 @@ const CircleLinedIcon = (props) => {
4221
4252
  );
4222
4253
  };
4223
4254
  const ProgressStep = ({
4224
- 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
4225
4257
  }) => {
4226
4258
  const { t: t2 } = useBridgeTranslation();
4227
- const steps = [
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
+ ] : [
4228
4279
  {
4229
4280
  icon: /* @__PURE__ */ jsx(CheckIcon, { className: "w-5 h-5 " }),
4230
4281
  title: t2("transaction.steps.sent")
@@ -4564,6 +4615,9 @@ const StatusStepsDialog = ({
4564
4615
  if (status === "executing") {
4565
4616
  step = /* @__PURE__ */ jsx(ConfirmStep, { icon: icons?.confirm });
4566
4617
  }
4618
+ if (status === "approving") {
4619
+ step = /* @__PURE__ */ jsx(ProgressStep, { icon: icons?.progress, isApproving: true });
4620
+ }
4567
4621
  if (status === "processing") {
4568
4622
  step = /* @__PURE__ */ jsx(ProgressStep, { icon: icons?.progress });
4569
4623
  }
@@ -5168,35 +5222,34 @@ class EvmChainStrategy {
5168
5222
  }
5169
5223
  return Number(formatUnits(totalFeeWei, 18));
5170
5224
  }
5171
- async executeSteps(steps, _context, onFirstHash) {
5225
+ async executeSteps(steps, _context, onStepComplete) {
5172
5226
  if (!this.isConnected() || !this.walletClient) {
5173
5227
  throw new WalletNotConnectedError("evm");
5174
5228
  }
5175
5229
  this.validateSteps(steps);
5176
5230
  try {
5177
5231
  let firstTxHash;
5178
- for (const step of steps) {
5232
+ const totalSteps = steps.length;
5233
+ for (let i3 = 0; i3 < steps.length; i3++) {
5234
+ const step = steps[i3];
5179
5235
  console.log(
5180
- `Executing ${step.type} transaction on ${step.chainKey}...`
5236
+ `Executing ${step.type} transaction on ${step.chainKey} (${i3 + 1}/${totalSteps})...`
5181
5237
  );
5238
+ let hash;
5182
5239
  if (step.type === "approve") {
5183
- const hash = await this.approveTransaction(step);
5184
- if (!firstTxHash) {
5185
- firstTxHash = hash;
5186
- onFirstHash?.(hash);
5187
- }
5240
+ hash = await this.approveTransaction(step);
5188
5241
  } else if (step.type === "bridge") {
5189
- const hash = await this.executeTransaction(step);
5190
- if (!firstTxHash) {
5191
- firstTxHash = hash;
5192
- onFirstHash?.(hash);
5193
- }
5242
+ hash = await this.executeTransaction(step);
5194
5243
  } else {
5195
5244
  throw new InvalidStepsError(
5196
5245
  "evm",
5197
5246
  `Unsupported step type: ${step.type}`
5198
5247
  );
5199
5248
  }
5249
+ if (!firstTxHash) {
5250
+ firstTxHash = hash;
5251
+ }
5252
+ onStepComplete?.(hash, step.type, i3, totalSteps);
5200
5253
  }
5201
5254
  return {
5202
5255
  hash: firstTxHash,
@@ -5460,7 +5513,7 @@ class TonChainStrategy {
5460
5513
  }
5461
5514
  }
5462
5515
  }
5463
- async executeSteps(steps, _context, onFirstHash) {
5516
+ async executeSteps(steps, _context, onStepComplete) {
5464
5517
  if (!this.isConnected() || !this.config.tonConnectUI) {
5465
5518
  throw new WalletNotConnectedError("ton");
5466
5519
  }
@@ -5489,7 +5542,7 @@ class TonChainStrategy {
5489
5542
  const inMessage = loadMessage(Cell.fromBase64(bocBase64).beginParse());
5490
5543
  const messageHash = this.getNormalizedExtMessageHash(inMessage);
5491
5544
  const hexHash = messageHash.toString("hex");
5492
- onFirstHash?.(hexHash);
5545
+ onStepComplete?.(hexHash, "bridge", 0, steps.length);
5493
5546
  return {
5494
5547
  chainKey: "ton",
5495
5548
  hash: hexHash
@@ -5497,7 +5550,7 @@ class TonChainStrategy {
5497
5550
  };
5498
5551
  } catch (error) {
5499
5552
  console.error("Error parsing BOC to hex hash:", error);
5500
- onFirstHash?.(bocBase64);
5553
+ onStepComplete?.(bocBase64, "bridge", 0, steps.length);
5501
5554
  return {
5502
5555
  chainKey: "ton",
5503
5556
  hash: bocBase64
@@ -5909,7 +5962,7 @@ class TronChainStrategy {
5909
5962
  }
5910
5963
  return fee / 1e6;
5911
5964
  }
5912
- async executeSteps(steps, _context, onFirstHash) {
5965
+ async executeSteps(steps, _context, onStepComplete) {
5913
5966
  const tronWeb = this.getClient();
5914
5967
  if (!tronWeb) {
5915
5968
  throw new ProviderNotAvailableError("tron");
@@ -5922,7 +5975,10 @@ class TronChainStrategy {
5922
5975
  const fromB58 = connector.address;
5923
5976
  this.ensureDefaultAddress(tronWeb, fromB58);
5924
5977
  let lastTxId;
5925
- let isFirstHash = true;
5978
+ let stepIndex = 0;
5979
+ const totalSteps = steps.filter(
5980
+ (s2) => String(s2.chainKey).toLowerCase() === "tron"
5981
+ ).length;
5926
5982
  for (const step of steps) {
5927
5983
  if (String(step.chainKey).toLowerCase() !== "tron") continue;
5928
5984
  const tx = step.transaction;
@@ -5992,10 +6048,8 @@ class TronChainStrategy {
5992
6048
  connector
5993
6049
  );
5994
6050
  lastTxId = txid;
5995
- if (isFirstHash) {
5996
- onFirstHash?.(txid);
5997
- isFirstHash = false;
5998
- }
6051
+ onStepComplete?.(txid, step.type, stepIndex, totalSteps);
6052
+ stepIndex++;
5999
6053
  }
6000
6054
  if (!lastTxId) {
6001
6055
  throw new TransactionFailedError(
@@ -25823,7 +25877,7 @@ class WalletConnectModal {
25823
25877
  }
25824
25878
  async initUi() {
25825
25879
  if (typeof window !== "undefined") {
25826
- await import("./index-DEi2-2_y.js");
25880
+ await import("./index-PB3n7I7m.js");
25827
25881
  const modal = document.createElement("wcm-modal");
25828
25882
  document.body.insertAdjacentElement("beforeend", modal);
25829
25883
  OptionsCtrl.setIsUiLoaded(true);
@@ -26592,4 +26646,4 @@ export {
26592
26646
  getQuoteFees as y,
26593
26647
  calculateMinReceived as z
26594
26648
  };
26595
- //# sourceMappingURL=index-HznPfOtP.js.map
26649
+ //# sourceMappingURL=index-Bf7M_Hjm.js.map