@rash2x/bridge-widget 0.6.67 → 0.6.69
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-XPQb2NSf.cjs → index-BdIFtxSM.cjs} +162 -184
- package/dist/index-BdIFtxSM.cjs.map +1 -0
- package/dist/{index-PB3n7I7m.js → index-CkDt6lc8.js} +2 -2
- package/dist/{index-PB3n7I7m.js.map → index-CkDt6lc8.js.map} +1 -1
- package/dist/{index-Bf7M_Hjm.js → index-DV105AWa.js} +162 -184
- package/dist/index-DV105AWa.js.map +1 -0
- package/dist/{index-DJrg5YQY.cjs → index-Qp6MEGwg.cjs} +2 -2
- package/dist/{index-DJrg5YQY.cjs.map → index-Qp6MEGwg.cjs.map} +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/index-Bf7M_Hjm.js.map +0 -1
- package/dist/index-XPQb2NSf.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-BdIFtxSM.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-DV105AWa.js";
|
|
2
2
|
export {
|
|
3
3
|
L as DEFAULT_SLIPPAGE_BPS,
|
|
4
4
|
d as EvaaBridge,
|
|
@@ -3478,7 +3478,6 @@ function useBridgeTransaction() {
|
|
|
3478
3478
|
const { assetMatrix, selectedAssetSymbol, allTokens } = useTokensStore();
|
|
3479
3479
|
const { chains } = useChainsStore();
|
|
3480
3480
|
const txStore = useTransactionStore();
|
|
3481
|
-
const [isProcessing, setIsProcessing] = react.useState(false);
|
|
3482
3481
|
const srcToken = react.useMemo(
|
|
3483
3482
|
() => resolveTokenOnChainFromMatrix$2(
|
|
3484
3483
|
assetMatrix,
|
|
@@ -3515,7 +3514,6 @@ function useBridgeTransaction() {
|
|
|
3515
3514
|
// Actual fee will be updated when transaction completes
|
|
3516
3515
|
};
|
|
3517
3516
|
txStore.setTransaction(quote, "executing", metadata);
|
|
3518
|
-
setIsProcessing(true);
|
|
3519
3517
|
try {
|
|
3520
3518
|
const steps = quote.steps || [];
|
|
3521
3519
|
if (steps.length === 0) {
|
|
@@ -3595,9 +3593,7 @@ function useBridgeTransaction() {
|
|
|
3595
3593
|
const { priceUsd } = findNativeMeta(allTokens, srcChain2);
|
|
3596
3594
|
const hashForSourceCost = quote.srcChainKey === "ton" ? messageHash : hashForLayerZero;
|
|
3597
3595
|
try {
|
|
3598
|
-
const sourceCost = await strategy.getSourceCost(
|
|
3599
|
-
hashForSourceCost
|
|
3600
|
-
);
|
|
3596
|
+
const sourceCost = await strategy.getSourceCost(hashForSourceCost);
|
|
3601
3597
|
if (sourceCost?.totalNative !== void 0 && isFinite(sourceCost.totalNative)) {
|
|
3602
3598
|
const feeUsd = priceUsd && priceUsd > 0 ? sourceCost.totalNative * priceUsd : void 0;
|
|
3603
3599
|
console.log("Source cost calculated:", {
|
|
@@ -3639,19 +3635,15 @@ function useBridgeTransaction() {
|
|
|
3639
3635
|
txStore.setError("COMPLETION_TRACKING_FAILED");
|
|
3640
3636
|
}
|
|
3641
3637
|
console.error("Error tracking completion:", err);
|
|
3642
|
-
}).finally(() => {
|
|
3643
|
-
setIsProcessing(false);
|
|
3644
3638
|
});
|
|
3645
3639
|
return txResult;
|
|
3646
3640
|
} else {
|
|
3647
|
-
setIsProcessing(false);
|
|
3648
3641
|
throw new TransactionFailedError(
|
|
3649
3642
|
chainKey,
|
|
3650
3643
|
"Transaction hash not received from wallet"
|
|
3651
3644
|
);
|
|
3652
3645
|
}
|
|
3653
3646
|
} catch (err) {
|
|
3654
|
-
setIsProcessing(false);
|
|
3655
3647
|
if (isUserRejection(err)) {
|
|
3656
3648
|
txStore.setError("TRANSACTION_REJECTED");
|
|
3657
3649
|
throw new TransactionFailedError(
|
|
@@ -3671,7 +3663,6 @@ function useBridgeTransaction() {
|
|
|
3671
3663
|
};
|
|
3672
3664
|
return {
|
|
3673
3665
|
executeTransaction,
|
|
3674
|
-
isProcessing,
|
|
3675
3666
|
hasQuote: !!quote
|
|
3676
3667
|
};
|
|
3677
3668
|
}
|
|
@@ -3839,7 +3830,7 @@ const MainButton = () => {
|
|
|
3839
3830
|
const { quote, status, inputAmount, noRoute } = useBridgeQuoteStore();
|
|
3840
3831
|
const { fromChain, toChain } = useChainsStore();
|
|
3841
3832
|
const { onOpen } = useWalletSelectModal();
|
|
3842
|
-
const { executeTransaction
|
|
3833
|
+
const { executeTransaction } = useBridgeTransaction();
|
|
3843
3834
|
const amountNum = Number(inputAmount || 0);
|
|
3844
3835
|
const gas = useGasEstimate(amountNum);
|
|
3845
3836
|
const { hasInsufficientBalance, isBalanceLoading } = useBalanceCheck(
|
|
@@ -3858,7 +3849,6 @@ const MainButton = () => {
|
|
|
3858
3849
|
const missingSrc = !srcConnectedOk || !srcAddressValid;
|
|
3859
3850
|
const missingDst = isCustomAddressEnabled ? !dstAddressValid : !dstConnectedOk || !dstAddressValid;
|
|
3860
3851
|
const requiresCustomAddress = isCustomAddressEnabled && !dstAddressValid;
|
|
3861
|
-
const isBusy = isTxProcessing;
|
|
3862
3852
|
const canTransfer = !missingSrc && !missingDst && amountNum > 0 && !!srcChainKey && !!dstChainKey;
|
|
3863
3853
|
const label = react.useMemo(() => {
|
|
3864
3854
|
switch (true) {
|
|
@@ -3866,10 +3856,6 @@ const MainButton = () => {
|
|
|
3866
3856
|
return t2("telegram.openWebVersion");
|
|
3867
3857
|
case status === "loading":
|
|
3868
3858
|
return t2("transaction.quoting");
|
|
3869
|
-
case isTxProcessing:
|
|
3870
|
-
return t2("transaction.processing");
|
|
3871
|
-
case isBusy:
|
|
3872
|
-
return t2("common.connecting");
|
|
3873
3859
|
case requiresCustomAddress:
|
|
3874
3860
|
return t2("transaction.pasteAddressToTransfer");
|
|
3875
3861
|
case missingSrc:
|
|
@@ -3899,8 +3885,6 @@ const MainButton = () => {
|
|
|
3899
3885
|
t2,
|
|
3900
3886
|
isTelegramRestricted,
|
|
3901
3887
|
status,
|
|
3902
|
-
isTxProcessing,
|
|
3903
|
-
isBusy,
|
|
3904
3888
|
missingSrc,
|
|
3905
3889
|
missingDst,
|
|
3906
3890
|
srcChainKey,
|
|
@@ -3917,7 +3901,6 @@ const MainButton = () => {
|
|
|
3917
3901
|
chainRegistry
|
|
3918
3902
|
]);
|
|
3919
3903
|
const handleClick = async () => {
|
|
3920
|
-
if (isBusy) return;
|
|
3921
3904
|
if (isTelegramRestricted) {
|
|
3922
3905
|
const searchParams = typeof window !== "undefined" ? window.location.search || "" : "";
|
|
3923
3906
|
const targetUrl = `https://app.evaa.finance/bridge${searchParams}`;
|
|
@@ -3944,9 +3927,16 @@ const MainButton = () => {
|
|
|
3944
3927
|
return;
|
|
3945
3928
|
}
|
|
3946
3929
|
};
|
|
3947
|
-
const disabled =
|
|
3930
|
+
const disabled = status === "loading" || requiresCustomAddress || !isTelegramRestricted && !missingSrc && !missingDst && (amountNum <= 0 || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer);
|
|
3948
3931
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-4 space-y-4", children: [
|
|
3949
|
-
isTelegramRestricted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3932
|
+
isTelegramRestricted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3933
|
+
alert.Alert,
|
|
3934
|
+
{
|
|
3935
|
+
variant: "warning",
|
|
3936
|
+
className: "mt-2 text-sm font-medium text-center px-2 py-2",
|
|
3937
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(alert.AlertDescription, { className: "leading-snug tracking-wide", children: t2("telegram.restrictionMessage") })
|
|
3938
|
+
}
|
|
3939
|
+
),
|
|
3950
3940
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3951
3941
|
button.Button,
|
|
3952
3942
|
{
|
|
@@ -4252,6 +4242,40 @@ const CircleLinedIcon = (props) => {
|
|
|
4252
4242
|
}
|
|
4253
4243
|
);
|
|
4254
4244
|
};
|
|
4245
|
+
const DevStatusControls = () => {
|
|
4246
|
+
const { current, updateStatus, setSrcHash, setError } = useTransactionStore();
|
|
4247
|
+
if (!current) return null;
|
|
4248
|
+
const statuses = [
|
|
4249
|
+
"executing",
|
|
4250
|
+
"approving",
|
|
4251
|
+
"processing",
|
|
4252
|
+
"completed",
|
|
4253
|
+
"failed"
|
|
4254
|
+
];
|
|
4255
|
+
const handleStatusChange = (status) => {
|
|
4256
|
+
if (status === "failed") {
|
|
4257
|
+
setError("UNKNOWN_ERROR", { message: "Test error message" });
|
|
4258
|
+
} else {
|
|
4259
|
+
updateStatus(status);
|
|
4260
|
+
}
|
|
4261
|
+
if ((status === "processing" || status === "completed" || status === "failed") && !current.srcTxHash) {
|
|
4262
|
+
setSrcHash(
|
|
4263
|
+
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
|
|
4264
|
+
);
|
|
4265
|
+
}
|
|
4266
|
+
};
|
|
4267
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed bottom-0 left-4 z-100", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: statuses.map((status) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4268
|
+
button.Button,
|
|
4269
|
+
{
|
|
4270
|
+
size: "sm",
|
|
4271
|
+
variant: current.status === status ? "default" : "outline",
|
|
4272
|
+
onClick: () => handleStatusChange(status),
|
|
4273
|
+
className: "text-xs h-7 px-2",
|
|
4274
|
+
children: status
|
|
4275
|
+
},
|
|
4276
|
+
status
|
|
4277
|
+
)) }) });
|
|
4278
|
+
};
|
|
4255
4279
|
const ProgressStep = ({
|
|
4256
4280
|
icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-16 h-16 animate-spin" }),
|
|
4257
4281
|
isApproving = false
|
|
@@ -4259,6 +4283,7 @@ const ProgressStep = ({
|
|
|
4259
4283
|
const { t: t2 } = useBridgeTranslation();
|
|
4260
4284
|
const { current } = useTransactionStore();
|
|
4261
4285
|
const currentStep = current?.currentStep;
|
|
4286
|
+
const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
|
|
4262
4287
|
const steps = isApproving && currentStep ? [
|
|
4263
4288
|
{
|
|
4264
4289
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "w-5 h-5 text-primary animate-spin", strokeWidth: 3 }),
|
|
@@ -4291,135 +4316,92 @@ const ProgressStep = ({
|
|
|
4291
4316
|
title: t2("transaction.steps.completed")
|
|
4292
4317
|
}
|
|
4293
4318
|
];
|
|
4294
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4319
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0 fixed top-0 left-0 right-0 bottom-0 translate-x-0 translate-y-0 md:left-[50%] md:top-[50%] md:translate-x-[-50%] md:translate-y-[-50%] rounded-none md:rounded-lg", children: [
|
|
4320
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-center md:justify-start text-center bg-background noise p-10", children: [
|
|
4321
|
+
icon,
|
|
4322
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center relative z-50", children: [
|
|
4323
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.inProgress") }),
|
|
4324
|
+
srcTxHash && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4325
|
+
"a",
|
|
4326
|
+
{
|
|
4327
|
+
href: `https://layerzeroscan.com/tx/${srcTxHash}`,
|
|
4328
|
+
target: "_blank",
|
|
4329
|
+
rel: "noopener noreferrer",
|
|
4330
|
+
className: "text-xs text-muted-foreground hover:text-foreground cursor-pointer underline hover:no-underline px-4 mt-1",
|
|
4331
|
+
children: [
|
|
4332
|
+
t2("transaction.hash"),
|
|
4333
|
+
": ",
|
|
4334
|
+
formatHash(srcTxHash)
|
|
4335
|
+
]
|
|
4336
|
+
}
|
|
4337
|
+
)
|
|
4338
|
+
] }),
|
|
4339
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4340
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground opacity-50" }),
|
|
4341
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4342
|
+
"div",
|
|
4343
|
+
{
|
|
4344
|
+
className: "flex items-center gap-5 text-left",
|
|
4345
|
+
children: [
|
|
4346
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center text-foreground shadow-inner", children: step.icon }),
|
|
4347
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
4348
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base leading-5", children: step.title }),
|
|
4349
|
+
step.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground leading-4", children: step.description })
|
|
4350
|
+
] })
|
|
4351
|
+
]
|
|
4352
|
+
},
|
|
4353
|
+
step.title
|
|
4354
|
+
)) })
|
|
4355
|
+
] })
|
|
4356
|
+
] }),
|
|
4357
|
+
/* @__PURE__ */ jsxRuntime.jsx(DevStatusControls, {})
|
|
4358
|
+
] });
|
|
4359
|
+
};
|
|
4360
|
+
const getLayerZeroScanUrl = (txHash) => {
|
|
4361
|
+
return `https://layerzeroscan.com/tx/${txHash}`;
|
|
4315
4362
|
};
|
|
4316
4363
|
const FailedStep = ({
|
|
4317
4364
|
icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "w-16 h-16" })
|
|
4318
4365
|
}) => {
|
|
4319
4366
|
const { current, reset } = useTransactionStore();
|
|
4320
4367
|
const { t: t2 } = useBridgeTranslation();
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
}
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
baseUrl: "https://bscscan.com",
|
|
4358
|
-
txPath: "/tx/"
|
|
4359
|
-
},
|
|
4360
|
-
"binance-smart-chain": {
|
|
4361
|
-
baseUrl: "https://bscscan.com",
|
|
4362
|
-
txPath: "/tx/"
|
|
4363
|
-
},
|
|
4364
|
-
// Polygon
|
|
4365
|
-
polygon: {
|
|
4366
|
-
baseUrl: "https://polygonscan.com",
|
|
4367
|
-
txPath: "/tx/"
|
|
4368
|
-
},
|
|
4369
|
-
matic: {
|
|
4370
|
-
baseUrl: "https://polygonscan.com",
|
|
4371
|
-
txPath: "/tx/"
|
|
4372
|
-
},
|
|
4373
|
-
// Avalanche
|
|
4374
|
-
avalanche: {
|
|
4375
|
-
baseUrl: "https://snowtrace.io",
|
|
4376
|
-
txPath: "/tx/"
|
|
4377
|
-
},
|
|
4378
|
-
avax: {
|
|
4379
|
-
baseUrl: "https://snowtrace.io",
|
|
4380
|
-
txPath: "/tx/"
|
|
4381
|
-
},
|
|
4382
|
-
// Arbitrum
|
|
4383
|
-
arbitrum: {
|
|
4384
|
-
baseUrl: "https://arbiscan.io",
|
|
4385
|
-
txPath: "/tx/"
|
|
4386
|
-
},
|
|
4387
|
-
// Optimism
|
|
4388
|
-
optimism: {
|
|
4389
|
-
baseUrl: "https://optimistic.etherscan.io",
|
|
4390
|
-
txPath: "/tx/"
|
|
4391
|
-
},
|
|
4392
|
-
// Base
|
|
4393
|
-
base: {
|
|
4394
|
-
baseUrl: "https://basescan.org",
|
|
4395
|
-
txPath: "/tx/"
|
|
4396
|
-
},
|
|
4397
|
-
// Fantom
|
|
4398
|
-
fantom: {
|
|
4399
|
-
baseUrl: "https://ftmscan.com",
|
|
4400
|
-
txPath: "/tx/"
|
|
4401
|
-
}
|
|
4368
|
+
const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
|
|
4369
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4370
|
+
dialog.DialogContent,
|
|
4371
|
+
{
|
|
4372
|
+
showCloseButton: true,
|
|
4373
|
+
className: "overflow-hidden md:max-w-[420px] p-0 fixed top-0 left-0 right-0 bottom-0 translate-x-0 translate-y-0 md:left-[50%] md:top-[50%] md:translate-x-[-50%] md:translate-y-[-50%] rounded-none md:rounded-lg",
|
|
4374
|
+
children: [
|
|
4375
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-center md:justify-start text-center noise p-10 pb-0", children: [
|
|
4376
|
+
icon,
|
|
4377
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
|
|
4378
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.failed") }),
|
|
4379
|
+
current?.errorCode && /* @__PURE__ */ jsxRuntime.jsx(reactDialog.DialogDescription, { children: t2(
|
|
4380
|
+
`errors.${current.errorCode}`,
|
|
4381
|
+
current.errorParams || {}
|
|
4382
|
+
) }),
|
|
4383
|
+
srcTxHash && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4384
|
+
"a",
|
|
4385
|
+
{
|
|
4386
|
+
href: getLayerZeroScanUrl(srcTxHash),
|
|
4387
|
+
target: "_blank",
|
|
4388
|
+
rel: "noopener noreferrer",
|
|
4389
|
+
className: "text-xs text-muted-foreground hover:text-foreground cursor-pointer underline hover:no-underline px-4 mt-2",
|
|
4390
|
+
children: [
|
|
4391
|
+
t2("transaction.hash"),
|
|
4392
|
+
": ",
|
|
4393
|
+
formatHash(srcTxHash)
|
|
4394
|
+
]
|
|
4395
|
+
}
|
|
4396
|
+
)
|
|
4397
|
+
] })
|
|
4398
|
+
] }),
|
|
4399
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10 ", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", className: "w-full min-w-40", onClick: reset, children: t2("common.close") }) }),
|
|
4400
|
+
/* @__PURE__ */ jsxRuntime.jsx(DevStatusControls, {})
|
|
4401
|
+
]
|
|
4402
|
+
}
|
|
4403
|
+
);
|
|
4402
4404
|
};
|
|
4403
|
-
function getExplorerTxUrl(chainKey, txHash) {
|
|
4404
|
-
if (!txHash) {
|
|
4405
|
-
return null;
|
|
4406
|
-
}
|
|
4407
|
-
const normalizedChainKey = chainKey.toLowerCase();
|
|
4408
|
-
const config = EXPLORER_CONFIGS[normalizedChainKey];
|
|
4409
|
-
if (!config) {
|
|
4410
|
-
console.warn(
|
|
4411
|
-
`No explorer config found for chain: ${chainKey}. Please add it to EXPLORER_CONFIGS.`
|
|
4412
|
-
);
|
|
4413
|
-
return null;
|
|
4414
|
-
}
|
|
4415
|
-
return `${config.baseUrl}${config.txPath}${txHash}`;
|
|
4416
|
-
}
|
|
4417
|
-
function openTransactionInExplorer(chainKey, txHash) {
|
|
4418
|
-
const url = getExplorerTxUrl(chainKey, txHash);
|
|
4419
|
-
if (url && typeof window !== "undefined") {
|
|
4420
|
-
window.open(url, "_blank", "noopener,noreferrer");
|
|
4421
|
-
}
|
|
4422
|
-
}
|
|
4423
4405
|
const SuccessStep = ({
|
|
4424
4406
|
icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "w-16 h-16" })
|
|
4425
4407
|
}) => {
|
|
@@ -4427,8 +4409,7 @@ const SuccessStep = ({
|
|
|
4427
4409
|
const { t: t2 } = useBridgeTranslation();
|
|
4428
4410
|
const { chains } = useChainsStore();
|
|
4429
4411
|
const metadata = current?.metadata;
|
|
4430
|
-
const srcTxHash = current?.srcTxHash;
|
|
4431
|
-
const tonTransactionHash = current?.tonTransactionHash;
|
|
4412
|
+
const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
|
|
4432
4413
|
const srcChainKey = current?.quote?.srcChainKey;
|
|
4433
4414
|
const quote = current?.quote;
|
|
4434
4415
|
const layerZeroTotalFeeValue = metadata?.layerZeroTotalFeeValue;
|
|
@@ -4485,27 +4466,6 @@ const SuccessStep = ({
|
|
|
4485
4466
|
finalFee,
|
|
4486
4467
|
t2
|
|
4487
4468
|
]);
|
|
4488
|
-
const handleOpenExplorer = () => {
|
|
4489
|
-
if (srcChainKey === "ton") {
|
|
4490
|
-
if (tonTransactionHash) {
|
|
4491
|
-
window.open(
|
|
4492
|
-
`https://layerzeroscan.com/tx/${tonTransactionHash}`,
|
|
4493
|
-
"_blank",
|
|
4494
|
-
"noopener,noreferrer"
|
|
4495
|
-
);
|
|
4496
|
-
} else if (srcTxHash) {
|
|
4497
|
-
openTransactionInExplorer("ton", srcTxHash);
|
|
4498
|
-
}
|
|
4499
|
-
return;
|
|
4500
|
-
}
|
|
4501
|
-
if (srcTxHash) {
|
|
4502
|
-
window.open(
|
|
4503
|
-
`https://layerzeroscan.com/tx/${srcTxHash}`,
|
|
4504
|
-
"_blank",
|
|
4505
|
-
"noopener,noreferrer"
|
|
4506
|
-
);
|
|
4507
|
-
}
|
|
4508
|
-
};
|
|
4509
4469
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4510
4470
|
dialog.DialogContent,
|
|
4511
4471
|
{
|
|
@@ -4522,14 +4482,20 @@ const SuccessStep = ({
|
|
|
4522
4482
|
formatBalance(metadata.srcAmountHuman, 2),
|
|
4523
4483
|
" ",
|
|
4524
4484
|
metadata?.srcTokenSymbol,
|
|
4525
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4485
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4486
|
+
TokenSymbol,
|
|
4487
|
+
{
|
|
4488
|
+
className: "w-[18px] h-[18px]",
|
|
4489
|
+
symbol: metadata?.srcTokenSymbol
|
|
4490
|
+
}
|
|
4491
|
+
)
|
|
4526
4492
|
] })
|
|
4527
4493
|
] }),
|
|
4528
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
4494
|
+
metadata?.srcChainName && metadata?.dstChainName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
4529
4495
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: t2("transaction.transferTitle") }),
|
|
4530
4496
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium flex gap-1 items-center", children: [
|
|
4531
4497
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex gap-1 items-center", children: [
|
|
4532
|
-
metadata
|
|
4498
|
+
metadata.srcChainName,
|
|
4533
4499
|
" ",
|
|
4534
4500
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4535
4501
|
NetworkSymbol,
|
|
@@ -4541,7 +4507,7 @@ const SuccessStep = ({
|
|
|
4541
4507
|
] }),
|
|
4542
4508
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "text-muted-foreground/50 size-4" }),
|
|
4543
4509
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex gap-1 items-center", children: [
|
|
4544
|
-
metadata
|
|
4510
|
+
metadata.dstChainName,
|
|
4545
4511
|
" ",
|
|
4546
4512
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4547
4513
|
NetworkSymbol,
|
|
@@ -4554,11 +4520,13 @@ const SuccessStep = ({
|
|
|
4554
4520
|
] })
|
|
4555
4521
|
] }),
|
|
4556
4522
|
srcTxHash && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
4557
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
4523
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: t2("transaction.hash") }),
|
|
4558
4524
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4559
|
-
"
|
|
4525
|
+
"a",
|
|
4560
4526
|
{
|
|
4561
|
-
|
|
4527
|
+
href: `https://layerzeroscan.com/tx/${srcTxHash}`,
|
|
4528
|
+
target: "_blank",
|
|
4529
|
+
rel: "noopener noreferrer",
|
|
4562
4530
|
className: "font-medium cursor-pointer inline-flex items-center gap-1 underline hover:no-underline",
|
|
4563
4531
|
children: formatHash(srcTxHash)
|
|
4564
4532
|
}
|
|
@@ -4570,7 +4538,8 @@ const SuccessStep = ({
|
|
|
4570
4538
|
] })
|
|
4571
4539
|
] })
|
|
4572
4540
|
] }),
|
|
4573
|
-
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
|
|
4541
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) }),
|
|
4542
|
+
/* @__PURE__ */ jsxRuntime.jsx(DevStatusControls, {})
|
|
4574
4543
|
]
|
|
4575
4544
|
}
|
|
4576
4545
|
);
|
|
@@ -4597,20 +4566,28 @@ const ConfirmStep = ({
|
|
|
4597
4566
|
}) => {
|
|
4598
4567
|
const { t: t2 } = useBridgeTranslation();
|
|
4599
4568
|
const { formatTime } = useCountdown(90);
|
|
4600
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4604
|
-
|
|
4569
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { className: "overflow-hidden md:max-w-[420px] p-0 fixed top-0 left-0 right-0 bottom-0 translate-x-0 translate-y-0 md:left-[50%] md:top-[50%] md:translate-x-[-50%] md:translate-y-[-50%] rounded-none md:rounded-lg", children: [
|
|
4570
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-center md:justify-start text-center noise p-10", children: [
|
|
4571
|
+
icon,
|
|
4572
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
|
|
4573
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.confirm") }),
|
|
4574
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: t2("transaction.signTransaction") })
|
|
4575
|
+
] }),
|
|
4576
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-3xl font-black relative z-10", children: formatTime })
|
|
4605
4577
|
] }),
|
|
4606
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4607
|
-
] })
|
|
4578
|
+
/* @__PURE__ */ jsxRuntime.jsx(DevStatusControls, {})
|
|
4579
|
+
] });
|
|
4608
4580
|
};
|
|
4609
4581
|
const StatusStepsDialog = ({
|
|
4610
4582
|
icons
|
|
4611
4583
|
}) => {
|
|
4612
4584
|
const { current, reset } = useTransactionStore();
|
|
4613
4585
|
const status = current?.status;
|
|
4586
|
+
const handleClose = () => {
|
|
4587
|
+
if (status === "completed" || status === "failed" || status === "executing") {
|
|
4588
|
+
reset();
|
|
4589
|
+
}
|
|
4590
|
+
};
|
|
4614
4591
|
if (!status || status === "idle") return null;
|
|
4615
4592
|
let step = null;
|
|
4616
4593
|
if (status === "executing") {
|
|
@@ -4628,7 +4605,8 @@ const StatusStepsDialog = ({
|
|
|
4628
4605
|
if (status === "failed") {
|
|
4629
4606
|
step = /* @__PURE__ */ jsxRuntime.jsx(FailedStep, { icon: icons?.failed });
|
|
4630
4607
|
}
|
|
4631
|
-
|
|
4608
|
+
if (!step) return null;
|
|
4609
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: true, onOpenChange: handleClose, children: step }) });
|
|
4632
4610
|
};
|
|
4633
4611
|
const useTokens = () => {
|
|
4634
4612
|
const { setTokens, setAllTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
|
|
@@ -25878,7 +25856,7 @@ class WalletConnectModal {
|
|
|
25878
25856
|
}
|
|
25879
25857
|
async initUi() {
|
|
25880
25858
|
if (typeof window !== "undefined") {
|
|
25881
|
-
await Promise.resolve().then(() => require("./index-
|
|
25859
|
+
await Promise.resolve().then(() => require("./index-Qp6MEGwg.cjs"));
|
|
25882
25860
|
const modal = document.createElement("wcm-modal");
|
|
25883
25861
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25884
25862
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26645,4 +26623,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26645
26623
|
exports.useSwapModel = useSwapModel;
|
|
26646
26624
|
exports.useTokensStore = useTokensStore;
|
|
26647
26625
|
exports.useTransactionStore = useTransactionStore;
|
|
26648
|
-
//# sourceMappingURL=index-
|
|
26626
|
+
//# sourceMappingURL=index-BdIFtxSM.cjs.map
|