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