@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.
- package/dist/evaa-bridge.cjs +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-HznPfOtP.js → index-Bf7M_Hjm.js} +86 -32
- package/dist/index-Bf7M_Hjm.js.map +1 -0
- package/dist/{index-CSE-oDw8.cjs → index-DJrg5YQY.cjs} +2 -2
- package/dist/{index-CSE-oDw8.cjs.map → index-DJrg5YQY.cjs.map} +1 -1
- package/dist/{index-DEi2-2_y.js → index-PB3n7I7m.js} +2 -2
- package/dist/{index-DEi2-2_y.js.map → index-PB3n7I7m.js.map} +1 -1
- package/dist/{index-CpKOf8oF.cjs → index-XPQb2NSf.cjs} +86 -32
- package/dist/index-XPQb2NSf.cjs.map +1 -0
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
- package/dist/index-CpKOf8oF.cjs.map +0 -1
- package/dist/index-HznPfOtP.js.map +0 -1
|
@@ -35,7 +35,7 @@ const reactWindow = require("react-window");
|
|
|
35
35
|
const common$1 = { "connecting": "Connecting…", "initializing": "Initializing...", "loading": "Loading...", "paste": "paste", "close": "Close", "zeroPlaceholder": "0", "nativeToken": "Native Token" };
|
|
36
36
|
const wallets$1 = { "addTonWallet": "Add TON wallet", "addEvmWallet": "Add EVM wallet", "connectTonWallet": "Connect TON wallet", "connectEvmWallet": "Connect EVM wallet", "initializingMetamask": "Initializing MetaMask SDK...", "initializingTronlink": "Initializing TronLink...", "failedToConnectTon": "Failed to connect to TON wallet", "failedToDisconnect": "Failed to disconnect", "metamaskConnectionError": "MetaMask connection error", "failedToConnectMetamask": "Failed to connect to MetaMask", "failedToDisconnectMetamask": "Failed to disconnect from MetaMask", "selectWallet": "Select Wallet", "tonWallets": "TON", "evmWallets": "EVM", "tronWallets": "TRON", "tonconnect": "TonConnect", "metaMask": "WalletConnect", "walletConnect": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Add Tron wallet", "comingSoon": "Coming Soon", "connected": "CONNECTED", "connectedStatus": "Connected", "disconnect": "Disconnect", "chooseWallet": "Connect wallet", "oneWalletPerEnv": "You can only connect one wallet per environment.", "connect": "Connect", "connectTronWallet": "Connect Tron wallet", "connectWallet": "Connect wallet" };
|
|
37
37
|
const bridge$1 = { "max": "Max", "sourceNetwork": "Source network", "destinationNetwork": "Destination network", "selectToken": "Select token", "selectNetwork": "Select network", "selectSourceNetwork": "Select source network", "selectDestinationNetwork": "Select destination network", "searchToken": "Search token", "myTokens": "My tokens", "allTokens": "All tokens", "search": "Search", "select": "Select", "willChangeSourceChain": "Will change source network", "willChangeSourceNetworkAndToken": "Will change source token", "noBalancesFound": "No balances found.", "noResults": "No results", "tokenNotFound": "We couldn't find a token with that name or symbol. Please try again.", "chainNotFound": "We couldn't find a chain with that name. Please try again.", "sendToAnotherAddress": "Send to another address", "youWillReceive": "You will receive", "anotherAddressPlaceholder": "Address", "addressDoesntMatch": "Address doesn't match the {{network}} network", "checkBeforeTransfer": "Check correctness before transfer" };
|
|
38
|
-
const transaction$1 = { "enterAmount": "Enter amount", "transfer": "Transfer", "getQuote": "Get quote", "failed": "Transaction Failed", "confirm": "Confirm transaction", "signTransaction": "Sign in transaction in wallet", "quoting": "Quoting...", "inProgress": "Transaction in progress...", "checkingBalance": "Checking balance...", "insufficientBalance": "Insufficient balance", "amountTooSmall": "Min {{min}}", "amountTooLarge": "Max {{max}}", "success": "Success", "successTitle": "Success", "done": "Done", "hashCopied": "Hash copied to clipboard", "bridged": "Bridged", "transferTitle": "Transfer", "hash": "Hash", "layerzeroScan": "TxHash", "finalFee": "Final Fee", "route": "Route", "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" } };
|
|
38
|
+
const transaction$1 = { "enterAmount": "Enter amount", "transfer": "Transfer", "getQuote": "Get quote", "failed": "Transaction Failed", "confirm": "Confirm transaction", "signTransaction": "Sign in transaction in wallet", "quoting": "Quoting...", "inProgress": "Transaction in progress...", "checkingBalance": "Checking balance...", "insufficientBalance": "Insufficient balance", "amountTooSmall": "Min {{min}}", "amountTooLarge": "Max {{max}}", "success": "Success", "successTitle": "Success", "done": "Done", "hashCopied": "Hash copied to clipboard", "bridged": "Bridged", "transferTitle": "Transfer", "hash": "Hash", "layerzeroScan": "TxHash", "finalFee": "Final Fee", "route": "Route", "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" } };
|
|
39
39
|
const telegram$1 = { "openWebVersion": "Open EVAA Web to Bridge", "restrictionMessage": "You can bridge between the chosen networks on EVAA web version" };
|
|
40
40
|
const app$1 = { "stargateWidgetName": "Stargate Bridge Widget", "liveWidget": "Live Widget", "getStarted": "Get Started" };
|
|
41
41
|
const settings$1 = { "title": "Settings", "gasOnDestination": "Gas on destination", "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" } };
|
|
@@ -53,7 +53,7 @@ const en$3 = {
|
|
|
53
53
|
const common = { "connecting": "Подключение…", "initializing": "Инициализация...", "loading": "Загрузка...", "paste": "вставить", "close": "Закрыть", "zeroPlaceholder": "0", "nativeToken": "Нативный токен" };
|
|
54
54
|
const wallets = { "addTonWallet": "Добавить TON кошелёк", "addEvmWallet": "Добавить EVM кошелёк", "connectTonWallet": "Подключить TON кошелёк", "connectEvmWallet": "Подключить EVM кошелёк", "initializingMetamask": "Инициализация MetaMask SDK...", "initializingTronlink": "Инициализация TronLink...", "failedToConnectTon": "Не удалось подключиться к TON кошельку", "failedToDisconnect": "Не удалось отключиться", "metamaskConnectionError": "Ошибка подключения MetaMask", "failedToConnectMetamask": "Не удалось подключиться к MetaMask", "failedToDisconnectMetamask": "Не удалось отключиться от MetaMask", "selectWallet": "Выберите кошелёк", "tonWallets": "TON", "evmWallets": "EVM", "tronWallets": "TRON", "tonconnect": "TonConnect", "metaMask": "WalletConnect", "walletConnect": "WalletConnect", "tronLink": "TronLink", "addTronWallet": "Добавить Tron кошелёк", "comingSoon": "Скоро", "connected": "ПОДКЛЮЧЕНО", "connectedStatus": "Подключён", "disconnect": "Отключить", "chooseWallet": "Подключите кошелек", "oneWalletPerEnv": "Можно подключить только один кошелёк на окружение.", "connect": "Подключить", "connectTronWallet": "Подключить Tron кошелёк", "connectWallet": "Подключить кошелёк" };
|
|
55
55
|
const bridge = { "max": "Макс", "sourceNetwork": "Исходная сеть", "destinationNetwork": "Целевая сеть", "selectToken": "Выбрать токен", "selectNetwork": "Выбрать сеть", "selectSourceNetwork": "Выбрать исходную сеть", "selectDestinationNetwork": "Выбрать целевую сеть", "searchToken": "Поиск токена", "myTokens": "Мои токены", "allTokens": "Все токены", "search": "Поиск", "select": "Выбрать", "willChangeSourceChain": "Сменит исходную сеть", "willChangeSourceNetworkAndToken": "Сменит исходный токен", "noBalancesFound": "Балансы не найдены.", "noResults": "Нет результатов", "tokenNotFound": "Мы не смогли найти токен с таким названием или символом. Пожалуйста, попробуйте снова.", "chainNotFound": "Мы не смогли найти сеть с таким названием. Пожалуйста, попробуйте снова.", "sendToAnotherAddress": "Отправить на другой адрес", "youWillReceive": "Вы получите", "anotherAddressPlaceholder": "Адрес", "addressDoesntMatch": "Адрес не соответствует сети {{network}}", "checkBeforeTransfer": "Проверьте корректность перед переводом" };
|
|
56
|
-
const transaction = { "enterAmount": "Введите сумму", "transfer": "Перевести", "getQuote": "Получить котировку", "quoting": "Расчет котировки...", "failed": "Ошибка транзакции", "confirm": "Подтвердите транзакцию", "signTransaction": "Подпишите транзакцию в кошельке", "inProgress": "Транзакция выполняется...", "checkingBalance": "Проверка баланса...", "insufficientBalance": "Недостаточно средств", "amountTooSmall": "Минимум {{min}}", "amountTooLarge": "Максимум {{max}}", "success": "Успех", "successTitle": "Успех", "done": "Готово", "hashCopied": "Хэш скопирован в буфер обмена", "bridged": "Переведено", "transferTitle": "Перевод", "hash": "Хэш", "layerzeroScan": "TxHash", "finalFee": "Итоговая комиссия", "route": "Маршрут", "estTime": "Время", "slippage": "Проскальзывание", "minimumReceived": "Минимум к получению", "totalFee": "Общая комиссия", "noRouteFound": "Маршрут не найден", "notEnoughGas": "Недостаточно газа", "pasteAddressToTransfer": "Укажите адрес получателя", "noRouteFoundForSettings": "Маршрут не найден для текущих настроек.", "tryAdjustSettings": "Попробуйте отключить Gas on Destination или измените сумму/сети.", "quoteError": "Ошибка котировки", "steps": { "sent": "Отправлено", "processing": "Обработка", "processingNote": "До 2 минут", "completed": "Завершено" } };
|
|
56
|
+
const transaction = { "enterAmount": "Введите сумму", "transfer": "Перевести", "getQuote": "Получить котировку", "quoting": "Расчет котировки...", "failed": "Ошибка транзакции", "confirm": "Подтвердите транзакцию", "signTransaction": "Подпишите транзакцию в кошельке", "inProgress": "Транзакция выполняется...", "checkingBalance": "Проверка баланса...", "insufficientBalance": "Недостаточно средств", "amountTooSmall": "Минимум {{min}}", "amountTooLarge": "Максимум {{max}}", "success": "Успех", "successTitle": "Успех", "done": "Готово", "hashCopied": "Хэш скопирован в буфер обмена", "bridged": "Переведено", "transferTitle": "Перевод", "hash": "Хэш", "layerzeroScan": "TxHash", "finalFee": "Итоговая комиссия", "route": "Маршрут", "estTime": "Время", "slippage": "Проскальзывание", "minimumReceived": "Минимум к получению", "totalFee": "Общая комиссия", "noRouteFound": "Маршрут не найден", "notEnoughGas": "Недостаточно газа", "pasteAddressToTransfer": "Укажите адрес получателя", "noRouteFoundForSettings": "Маршрут не найден для текущих настроек.", "tryAdjustSettings": "Попробуйте отключить Gas on Destination или измените сумму/сети.", "quoteError": "Ошибка котировки", "steps": { "sent": "Отправлено", "approving": "Одобрение токена", "approvingNote": "Шаг {{current}} из {{total}}: Подтвердите одобрение в кошельке", "bridging": "Перевод через мост", "processing": "Обработка", "processingNote": "До 2 минут", "completed": "Завершено" } };
|
|
57
57
|
const telegram = { "openWebVersion": "Открыть EVAA веб для трансфера", "restrictionMessage": "Трансфер между выбранными сетями доступен только в веб-версии EVAA" };
|
|
58
58
|
const app = { "stargateWidgetName": "Виджет Stargate Bridge", "liveWidget": "Живой виджет", "getStarted": "Начало работы" };
|
|
59
59
|
const settings = { "title": "Настройки", "gasOnDestination": "Газ на назначении", "gasOnDestinationDescription": "Значение по умолчанию позволяет выполнить пару транзакций (например, Approve и Swap).", "slippageTolerance": "Толерантность к проскальзыванию", "slippageToleranceDescription": "Ваша транзакция будет отклонена, если получаемая сумма выйдет за пределы этой допустимой погрешности.", "routePriority": "Приоритет маршрута", "routePriorityDescription": "Выберите, как будет выполняться ваш трансфер. Recommended — выбирает оптимальный маршрут с учётом общей стоимости. Fastest — отдаёт приоритет максимальной скорости.", "highSlippageWarning": "Высокое проскальзывание", "gasPresets": { "auto": "Авто", "none": "Нет", "medium": "Средний", "max": "Макс" }, "routePresets": { "fastest": "Быстрейший", "cheapest": "Дешевейший", "recommended": "Рекомендуемый" } };
|
|
@@ -2923,6 +2923,7 @@ function useGasEstimate(amountNum) {
|
|
|
2923
2923
|
const isNativeSelected = nativeSym === (selectedAssetSymbol || "").toUpperCase();
|
|
2924
2924
|
let requiredNative = 0;
|
|
2925
2925
|
let quoteFeesAvailable = false;
|
|
2926
|
+
console.log(quoteFees);
|
|
2926
2927
|
if (quoteFees && quoteSrcChainKey === chainKey) {
|
|
2927
2928
|
const fees = quoteFees;
|
|
2928
2929
|
const feesInNative = fees.filter(
|
|
@@ -2941,6 +2942,9 @@ function useGasEstimate(amountNum) {
|
|
|
2941
2942
|
} else {
|
|
2942
2943
|
hasEnoughGas = nativeBalance >= requiredNative;
|
|
2943
2944
|
}
|
|
2945
|
+
console.log("nativeBalance", nativeBalance);
|
|
2946
|
+
console.log("requiredNative", requiredNative);
|
|
2947
|
+
console.log("nativeBalance - (amountNum ?? 0)", nativeBalance - (amountNum ?? 0));
|
|
2944
2948
|
const shouldCheckGas = balancesKnown && quoteFeesAvailable;
|
|
2945
2949
|
return {
|
|
2946
2950
|
nativeSym,
|
|
@@ -3265,6 +3269,16 @@ const useTransactionStore = zustand.create((set2, get2) => ({
|
|
|
3265
3269
|
};
|
|
3266
3270
|
set2({ current: next });
|
|
3267
3271
|
},
|
|
3272
|
+
updateCurrentStep: (type, index, total) => {
|
|
3273
|
+
const cur = get2().current;
|
|
3274
|
+
if (!cur) return;
|
|
3275
|
+
const next = {
|
|
3276
|
+
...cur,
|
|
3277
|
+
currentStep: { type, index, total },
|
|
3278
|
+
updatedAt: Date.now()
|
|
3279
|
+
};
|
|
3280
|
+
set2({ current: next });
|
|
3281
|
+
},
|
|
3268
3282
|
reset: () => {
|
|
3269
3283
|
set2({ current: void 0 });
|
|
3270
3284
|
}
|
|
@@ -3528,10 +3542,25 @@ function useBridgeTransaction() {
|
|
|
3528
3542
|
srcChainKey: quote.srcChainKey,
|
|
3529
3543
|
dstChainKey: quote.dstChainKey
|
|
3530
3544
|
};
|
|
3531
|
-
const txResult = await strategy.executeSteps(
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3545
|
+
const txResult = await strategy.executeSteps(
|
|
3546
|
+
steps,
|
|
3547
|
+
context,
|
|
3548
|
+
(hash, stepType, stepIndex, totalSteps) => {
|
|
3549
|
+
txStore.updateCurrentStep(
|
|
3550
|
+
stepType,
|
|
3551
|
+
stepIndex,
|
|
3552
|
+
totalSteps
|
|
3553
|
+
);
|
|
3554
|
+
if (stepIndex === 0) {
|
|
3555
|
+
txStore.setSrcHash(hash);
|
|
3556
|
+
}
|
|
3557
|
+
if (stepType === "approve" && stepIndex < totalSteps - 1) {
|
|
3558
|
+
txStore.updateStatus("approving");
|
|
3559
|
+
} else {
|
|
3560
|
+
txStore.updateStatus("processing");
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
);
|
|
3535
3564
|
if (txResult?.hash) {
|
|
3536
3565
|
const trackWithLayerZero = async () => {
|
|
3537
3566
|
let hashForLayerZero = txResult.hash;
|
|
@@ -3672,6 +3701,8 @@ function useBalanceCheck(amountNum, gas) {
|
|
|
3672
3701
|
};
|
|
3673
3702
|
}
|
|
3674
3703
|
const hasEnoughGasForTx = gas.nativeBalance >= gasReserve;
|
|
3704
|
+
console.log("rawBalance", rawBalance);
|
|
3705
|
+
console.log("amountNum", amountNum);
|
|
3675
3706
|
return {
|
|
3676
3707
|
availableBalance: rawBalance,
|
|
3677
3708
|
hasInsufficientBalance: amountNum > rawBalance || !hasEnoughGasForTx,
|
|
@@ -4222,10 +4253,30 @@ const CircleLinedIcon = (props) => {
|
|
|
4222
4253
|
);
|
|
4223
4254
|
};
|
|
4224
4255
|
const ProgressStep = ({
|
|
4225
|
-
icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-16 h-16 animate-spin" })
|
|
4256
|
+
icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-16 h-16 animate-spin" }),
|
|
4257
|
+
isApproving = false
|
|
4226
4258
|
}) => {
|
|
4227
4259
|
const { t: t2 } = useBridgeTranslation();
|
|
4228
|
-
const
|
|
4260
|
+
const { current } = useTransactionStore();
|
|
4261
|
+
const currentStep = current?.currentStep;
|
|
4262
|
+
const steps = isApproving && currentStep ? [
|
|
4263
|
+
{
|
|
4264
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-5 h-5 text-primary animate-spin", strokeWidth: 3 }),
|
|
4265
|
+
title: t2("transaction.steps.approving"),
|
|
4266
|
+
description: t2("transaction.steps.approvingNote", {
|
|
4267
|
+
current: currentStep.index + 1,
|
|
4268
|
+
total: currentStep.total
|
|
4269
|
+
})
|
|
4270
|
+
},
|
|
4271
|
+
{
|
|
4272
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(CircleLinedIcon, { className: "w-5 h-5" }),
|
|
4273
|
+
title: t2("transaction.steps.bridging")
|
|
4274
|
+
},
|
|
4275
|
+
{
|
|
4276
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(CircleLinedIcon, { className: "w-5 h-5" }),
|
|
4277
|
+
title: t2("transaction.steps.completed")
|
|
4278
|
+
}
|
|
4279
|
+
] : [
|
|
4229
4280
|
{
|
|
4230
4281
|
icon: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "w-5 h-5 " }),
|
|
4231
4282
|
title: t2("transaction.steps.sent")
|
|
@@ -4565,6 +4616,9 @@ const StatusStepsDialog = ({
|
|
|
4565
4616
|
if (status === "executing") {
|
|
4566
4617
|
step = /* @__PURE__ */ jsxRuntime.jsx(ConfirmStep, { icon: icons?.confirm });
|
|
4567
4618
|
}
|
|
4619
|
+
if (status === "approving") {
|
|
4620
|
+
step = /* @__PURE__ */ jsxRuntime.jsx(ProgressStep, { icon: icons?.progress, isApproving: true });
|
|
4621
|
+
}
|
|
4568
4622
|
if (status === "processing") {
|
|
4569
4623
|
step = /* @__PURE__ */ jsxRuntime.jsx(ProgressStep, { icon: icons?.progress });
|
|
4570
4624
|
}
|
|
@@ -5169,35 +5223,34 @@ class EvmChainStrategy {
|
|
|
5169
5223
|
}
|
|
5170
5224
|
return Number(viem.formatUnits(totalFeeWei, 18));
|
|
5171
5225
|
}
|
|
5172
|
-
async executeSteps(steps, _context,
|
|
5226
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5173
5227
|
if (!this.isConnected() || !this.walletClient) {
|
|
5174
5228
|
throw new WalletNotConnectedError("evm");
|
|
5175
5229
|
}
|
|
5176
5230
|
this.validateSteps(steps);
|
|
5177
5231
|
try {
|
|
5178
5232
|
let firstTxHash;
|
|
5179
|
-
|
|
5233
|
+
const totalSteps = steps.length;
|
|
5234
|
+
for (let i3 = 0; i3 < steps.length; i3++) {
|
|
5235
|
+
const step = steps[i3];
|
|
5180
5236
|
console.log(
|
|
5181
|
-
`Executing ${step.type} transaction on ${step.chainKey}...`
|
|
5237
|
+
`Executing ${step.type} transaction on ${step.chainKey} (${i3 + 1}/${totalSteps})...`
|
|
5182
5238
|
);
|
|
5239
|
+
let hash;
|
|
5183
5240
|
if (step.type === "approve") {
|
|
5184
|
-
|
|
5185
|
-
if (!firstTxHash) {
|
|
5186
|
-
firstTxHash = hash;
|
|
5187
|
-
onFirstHash?.(hash);
|
|
5188
|
-
}
|
|
5241
|
+
hash = await this.approveTransaction(step);
|
|
5189
5242
|
} else if (step.type === "bridge") {
|
|
5190
|
-
|
|
5191
|
-
if (!firstTxHash) {
|
|
5192
|
-
firstTxHash = hash;
|
|
5193
|
-
onFirstHash?.(hash);
|
|
5194
|
-
}
|
|
5243
|
+
hash = await this.executeTransaction(step);
|
|
5195
5244
|
} else {
|
|
5196
5245
|
throw new InvalidStepsError(
|
|
5197
5246
|
"evm",
|
|
5198
5247
|
`Unsupported step type: ${step.type}`
|
|
5199
5248
|
);
|
|
5200
5249
|
}
|
|
5250
|
+
if (!firstTxHash) {
|
|
5251
|
+
firstTxHash = hash;
|
|
5252
|
+
}
|
|
5253
|
+
onStepComplete?.(hash, step.type, i3, totalSteps);
|
|
5201
5254
|
}
|
|
5202
5255
|
return {
|
|
5203
5256
|
hash: firstTxHash,
|
|
@@ -5461,7 +5514,7 @@ class TonChainStrategy {
|
|
|
5461
5514
|
}
|
|
5462
5515
|
}
|
|
5463
5516
|
}
|
|
5464
|
-
async executeSteps(steps, _context,
|
|
5517
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5465
5518
|
if (!this.isConnected() || !this.config.tonConnectUI) {
|
|
5466
5519
|
throw new WalletNotConnectedError("ton");
|
|
5467
5520
|
}
|
|
@@ -5490,7 +5543,7 @@ class TonChainStrategy {
|
|
|
5490
5543
|
const inMessage = core.loadMessage(core.Cell.fromBase64(bocBase64).beginParse());
|
|
5491
5544
|
const messageHash = this.getNormalizedExtMessageHash(inMessage);
|
|
5492
5545
|
const hexHash = messageHash.toString("hex");
|
|
5493
|
-
|
|
5546
|
+
onStepComplete?.(hexHash, "bridge", 0, steps.length);
|
|
5494
5547
|
return {
|
|
5495
5548
|
chainKey: "ton",
|
|
5496
5549
|
hash: hexHash
|
|
@@ -5498,7 +5551,7 @@ class TonChainStrategy {
|
|
|
5498
5551
|
};
|
|
5499
5552
|
} catch (error) {
|
|
5500
5553
|
console.error("Error parsing BOC to hex hash:", error);
|
|
5501
|
-
|
|
5554
|
+
onStepComplete?.(bocBase64, "bridge", 0, steps.length);
|
|
5502
5555
|
return {
|
|
5503
5556
|
chainKey: "ton",
|
|
5504
5557
|
hash: bocBase64
|
|
@@ -5910,7 +5963,7 @@ class TronChainStrategy {
|
|
|
5910
5963
|
}
|
|
5911
5964
|
return fee / 1e6;
|
|
5912
5965
|
}
|
|
5913
|
-
async executeSteps(steps, _context,
|
|
5966
|
+
async executeSteps(steps, _context, onStepComplete) {
|
|
5914
5967
|
const tronWeb = this.getClient();
|
|
5915
5968
|
if (!tronWeb) {
|
|
5916
5969
|
throw new ProviderNotAvailableError("tron");
|
|
@@ -5923,7 +5976,10 @@ class TronChainStrategy {
|
|
|
5923
5976
|
const fromB58 = connector.address;
|
|
5924
5977
|
this.ensureDefaultAddress(tronWeb, fromB58);
|
|
5925
5978
|
let lastTxId;
|
|
5926
|
-
let
|
|
5979
|
+
let stepIndex = 0;
|
|
5980
|
+
const totalSteps = steps.filter(
|
|
5981
|
+
(s2) => String(s2.chainKey).toLowerCase() === "tron"
|
|
5982
|
+
).length;
|
|
5927
5983
|
for (const step of steps) {
|
|
5928
5984
|
if (String(step.chainKey).toLowerCase() !== "tron") continue;
|
|
5929
5985
|
const tx = step.transaction;
|
|
@@ -5993,10 +6049,8 @@ class TronChainStrategy {
|
|
|
5993
6049
|
connector
|
|
5994
6050
|
);
|
|
5995
6051
|
lastTxId = txid;
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
isFirstHash = false;
|
|
5999
|
-
}
|
|
6052
|
+
onStepComplete?.(txid, step.type, stepIndex, totalSteps);
|
|
6053
|
+
stepIndex++;
|
|
6000
6054
|
}
|
|
6001
6055
|
if (!lastTxId) {
|
|
6002
6056
|
throw new TransactionFailedError(
|
|
@@ -25824,7 +25878,7 @@ class WalletConnectModal {
|
|
|
25824
25878
|
}
|
|
25825
25879
|
async initUi() {
|
|
25826
25880
|
if (typeof window !== "undefined") {
|
|
25827
|
-
await Promise.resolve().then(() => require("./index-
|
|
25881
|
+
await Promise.resolve().then(() => require("./index-DJrg5YQY.cjs"));
|
|
25828
25882
|
const modal = document.createElement("wcm-modal");
|
|
25829
25883
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25830
25884
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26591,4 +26645,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26591
26645
|
exports.useSwapModel = useSwapModel;
|
|
26592
26646
|
exports.useTokensStore = useTokensStore;
|
|
26593
26647
|
exports.useTransactionStore = useTransactionStore;
|
|
26594
|
-
//# sourceMappingURL=index-
|
|
26648
|
+
//# sourceMappingURL=index-XPQb2NSf.cjs.map
|