@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.
@@ -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, isProcessing: isTxProcessing } = useBridgeTransaction();
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 = isBusy || status === "loading" || requiresCustomAddress || !isTelegramRestricted && !missingSrc && !missingDst && (amountNum <= 0 || isBalanceLoading || hasInsufficientBalance || hasAmountTooLarge || !gas.hasEnoughGas || noRoute || !isValidForTransfer);
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(Alert, { variant: "warning", className: "mt-2 text-sm font-medium text-center px-2 py-2", children: /* @__PURE__ */ jsx(AlertDescription, { className: "leading-snug tracking-wide", children: t2("telegram.restrictionMessage") }) }),
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,40 @@ 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
+ const statuses = [
4248
+ "executing",
4249
+ "approving",
4250
+ "processing",
4251
+ "completed",
4252
+ "failed"
4253
+ ];
4254
+ const handleStatusChange = (status) => {
4255
+ if (status === "failed") {
4256
+ setError("UNKNOWN_ERROR", { message: "Test error message" });
4257
+ } else {
4258
+ updateStatus(status);
4259
+ }
4260
+ if ((status === "processing" || status === "completed" || status === "failed") && !current.srcTxHash) {
4261
+ setSrcHash(
4262
+ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
4263
+ );
4264
+ }
4265
+ };
4266
+ return /* @__PURE__ */ jsx("div", { className: "fixed bottom-0 left-4 z-100", children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: statuses.map((status) => /* @__PURE__ */ jsx(
4267
+ Button,
4268
+ {
4269
+ size: "sm",
4270
+ variant: current.status === status ? "default" : "outline",
4271
+ onClick: () => handleStatusChange(status),
4272
+ className: "text-xs h-7 px-2",
4273
+ children: status
4274
+ },
4275
+ status
4276
+ )) }) });
4277
+ };
4254
4278
  const ProgressStep = ({
4255
4279
  icon = /* @__PURE__ */ jsx(Loader2, { className: "w-16 h-16 animate-spin" }),
4256
4280
  isApproving = false
@@ -4258,6 +4282,7 @@ const ProgressStep = ({
4258
4282
  const { t: t2 } = useBridgeTranslation();
4259
4283
  const { current } = useTransactionStore();
4260
4284
  const currentStep = current?.currentStep;
4285
+ const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
4261
4286
  const steps = isApproving && currentStep ? [
4262
4287
  {
4263
4288
  icon: /* @__PURE__ */ jsx(Loader2, { className: "w-5 h-5 text-primary animate-spin", strokeWidth: 3 }),
@@ -4290,135 +4315,92 @@ const ProgressStep = ({
4290
4315
  title: t2("transaction.steps.completed")
4291
4316
  }
4292
4317
  ];
4293
- return /* @__PURE__ */ jsx(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: /* @__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: [
4294
- icon,
4295
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.inProgress") }) }),
4296
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
4297
- /* @__PURE__ */ jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground opacity-50" }),
4298
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxs(
4299
- "div",
4300
- {
4301
- className: "flex items-center gap-5 text-left",
4302
- children: [
4303
- /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center text-foreground shadow-inner", children: step.icon }),
4304
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
4305
- /* @__PURE__ */ jsx("span", { className: "text-base leading-5", children: step.title }),
4306
- step.description && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground leading-4", children: step.description })
4307
- ] })
4308
- ]
4309
- },
4310
- step.title
4311
- )) })
4312
- ] })
4313
- ] }) });
4318
+ 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: [
4319
+ /* @__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: [
4320
+ icon,
4321
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center relative z-50", children: [
4322
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.inProgress") }),
4323
+ srcTxHash && /* @__PURE__ */ jsxs(
4324
+ "a",
4325
+ {
4326
+ href: `https://layerzeroscan.com/tx/${srcTxHash}`,
4327
+ target: "_blank",
4328
+ rel: "noopener noreferrer",
4329
+ className: "text-xs text-muted-foreground hover:text-foreground cursor-pointer underline hover:no-underline px-4 mt-1",
4330
+ children: [
4331
+ t2("transaction.hash"),
4332
+ ": ",
4333
+ formatHash(srcTxHash)
4334
+ ]
4335
+ }
4336
+ )
4337
+ ] }),
4338
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
4339
+ /* @__PURE__ */ jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground opacity-50" }),
4340
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxs(
4341
+ "div",
4342
+ {
4343
+ className: "flex items-center gap-5 text-left",
4344
+ children: [
4345
+ /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center text-foreground shadow-inner", children: step.icon }),
4346
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
4347
+ /* @__PURE__ */ jsx("span", { className: "text-base leading-5", children: step.title }),
4348
+ step.description && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground leading-4", children: step.description })
4349
+ ] })
4350
+ ]
4351
+ },
4352
+ step.title
4353
+ )) })
4354
+ ] })
4355
+ ] }),
4356
+ /* @__PURE__ */ jsx(DevStatusControls, {})
4357
+ ] });
4358
+ };
4359
+ const getLayerZeroScanUrl = (txHash) => {
4360
+ return `https://layerzeroscan.com/tx/${txHash}`;
4314
4361
  };
4315
4362
  const FailedStep = ({
4316
4363
  icon = /* @__PURE__ */ jsx(AlertCircleIcon, { className: "w-16 h-16" })
4317
4364
  }) => {
4318
4365
  const { current, reset } = useTransactionStore();
4319
4366
  const { t: t2 } = useBridgeTranslation();
4320
- return /* @__PURE__ */ jsxs(DialogContent, { showCloseButton: true, 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: [
4321
- /* @__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: [
4322
- icon,
4323
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4324
- /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.failed") }),
4325
- current?.errorCode && /* @__PURE__ */ jsx(DialogDescription$1, { children: t2(
4326
- `errors.${current.errorCode}`,
4327
- current.errorParams || {}
4328
- ) })
4329
- ] })
4330
- ] }),
4331
- /* @__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") }) })
4332
- ] });
4333
- };
4334
- const EXPLORER_CONFIGS = {
4335
- // TON
4336
- ton: {
4337
- baseUrl: "https://tonscan.org",
4338
- txPath: "/tx/"
4339
- },
4340
- // TRON
4341
- tron: {
4342
- baseUrl: "https://tronscan.org",
4343
- txPath: "/#/transaction/"
4344
- },
4345
- // Ethereum & EVM chains
4346
- ethereum: {
4347
- baseUrl: "https://etherscan.io",
4348
- txPath: "/tx/"
4349
- },
4350
- eth: {
4351
- baseUrl: "https://etherscan.io",
4352
- txPath: "/tx/"
4353
- },
4354
- // BSC (Binance Smart Chain)
4355
- bsc: {
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
- }
4367
+ const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
4368
+ return /* @__PURE__ */ jsxs(
4369
+ DialogContent,
4370
+ {
4371
+ showCloseButton: true,
4372
+ 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",
4373
+ children: [
4374
+ /* @__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: [
4375
+ icon,
4376
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4377
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.failed") }),
4378
+ current?.errorCode && /* @__PURE__ */ jsx(DialogDescription$1, { children: t2(
4379
+ `errors.${current.errorCode}`,
4380
+ current.errorParams || {}
4381
+ ) }),
4382
+ srcTxHash && /* @__PURE__ */ jsxs(
4383
+ "a",
4384
+ {
4385
+ href: getLayerZeroScanUrl(srcTxHash),
4386
+ target: "_blank",
4387
+ rel: "noopener noreferrer",
4388
+ className: "text-xs text-muted-foreground hover:text-foreground cursor-pointer underline hover:no-underline px-4 mt-2",
4389
+ children: [
4390
+ t2("transaction.hash"),
4391
+ ": ",
4392
+ formatHash(srcTxHash)
4393
+ ]
4394
+ }
4395
+ )
4396
+ ] })
4397
+ ] }),
4398
+ /* @__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") }) }),
4399
+ /* @__PURE__ */ jsx(DevStatusControls, {})
4400
+ ]
4401
+ }
4402
+ );
4401
4403
  };
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
4404
  const SuccessStep = ({
4423
4405
  icon = /* @__PURE__ */ jsx(CheckCircle2, { className: "w-16 h-16" })
4424
4406
  }) => {
@@ -4426,8 +4408,7 @@ const SuccessStep = ({
4426
4408
  const { t: t2 } = useBridgeTranslation();
4427
4409
  const { chains } = useChainsStore();
4428
4410
  const metadata = current?.metadata;
4429
- const srcTxHash = current?.srcTxHash;
4430
- const tonTransactionHash = current?.tonTransactionHash;
4411
+ const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
4431
4412
  const srcChainKey = current?.quote?.srcChainKey;
4432
4413
  const quote = current?.quote;
4433
4414
  const layerZeroTotalFeeValue = metadata?.layerZeroTotalFeeValue;
@@ -4484,27 +4465,6 @@ const SuccessStep = ({
4484
4465
  finalFee,
4485
4466
  t2
4486
4467
  ]);
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
4468
  return /* @__PURE__ */ jsxs(
4509
4469
  DialogContent,
4510
4470
  {
@@ -4521,14 +4481,20 @@ const SuccessStep = ({
4521
4481
  formatBalance(metadata.srcAmountHuman, 2),
4522
4482
  " ",
4523
4483
  metadata?.srcTokenSymbol,
4524
- /* @__PURE__ */ jsx(TokenSymbol, { className: "w-[18px] h-[18px]", symbol: metadata?.srcTokenSymbol })
4484
+ /* @__PURE__ */ jsx(
4485
+ TokenSymbol,
4486
+ {
4487
+ className: "w-[18px] h-[18px]",
4488
+ symbol: metadata?.srcTokenSymbol
4489
+ }
4490
+ )
4525
4491
  ] })
4526
4492
  ] }),
4527
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
4493
+ metadata?.srcChainName && metadata?.dstChainName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
4528
4494
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t2("transaction.transferTitle") }),
4529
4495
  /* @__PURE__ */ jsxs("span", { className: "font-medium flex gap-1 items-center", children: [
4530
4496
  /* @__PURE__ */ jsxs("span", { className: "inline-flex gap-1 items-center", children: [
4531
- metadata?.srcChainName,
4497
+ metadata.srcChainName,
4532
4498
  " ",
4533
4499
  /* @__PURE__ */ jsx(
4534
4500
  NetworkSymbol,
@@ -4540,7 +4506,7 @@ const SuccessStep = ({
4540
4506
  ] }),
4541
4507
  /* @__PURE__ */ jsx(ArrowRight, { className: "text-muted-foreground/50 size-4" }),
4542
4508
  /* @__PURE__ */ jsxs("span", { className: "inline-flex gap-1 items-center", children: [
4543
- metadata?.dstChainName,
4509
+ metadata.dstChainName,
4544
4510
  " ",
4545
4511
  /* @__PURE__ */ jsx(
4546
4512
  NetworkSymbol,
@@ -4553,11 +4519,13 @@ const SuccessStep = ({
4553
4519
  ] })
4554
4520
  ] }),
4555
4521
  srcTxHash && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
4556
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: srcChainKey !== "ton" || tonTransactionHash ? t2("transaction.layerzeroScan") : t2("transaction.hash") }),
4522
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t2("transaction.hash") }),
4557
4523
  /* @__PURE__ */ jsx(
4558
- "button",
4524
+ "a",
4559
4525
  {
4560
- onClick: handleOpenExplorer,
4526
+ href: `https://layerzeroscan.com/tx/${srcTxHash}`,
4527
+ target: "_blank",
4528
+ rel: "noopener noreferrer",
4561
4529
  className: "font-medium cursor-pointer inline-flex items-center gap-1 underline hover:no-underline",
4562
4530
  children: formatHash(srcTxHash)
4563
4531
  }
@@ -4569,7 +4537,8 @@ const SuccessStep = ({
4569
4537
  ] })
4570
4538
  ] })
4571
4539
  ] }),
4572
- /* @__PURE__ */ jsx(DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsx(Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
4540
+ /* @__PURE__ */ jsx(DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsx(Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) }),
4541
+ /* @__PURE__ */ jsx(DevStatusControls, {})
4573
4542
  ]
4574
4543
  }
4575
4544
  );
@@ -4596,20 +4565,28 @@ const ConfirmStep = ({
4596
4565
  }) => {
4597
4566
  const { t: t2 } = useBridgeTranslation();
4598
4567
  const { formatTime } = useCountdown(90);
4599
- return /* @__PURE__ */ jsx(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: /* @__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: [
4600
- icon,
4601
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4602
- /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.confirm") }),
4603
- /* @__PURE__ */ jsx(DialogDescription, { children: t2("transaction.signTransaction") })
4568
+ 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: [
4569
+ /* @__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: [
4570
+ icon,
4571
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4572
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.confirm") }),
4573
+ /* @__PURE__ */ jsx(DialogDescription, { children: t2("transaction.signTransaction") })
4574
+ ] }),
4575
+ /* @__PURE__ */ jsx("div", { className: "text-3xl font-black relative z-10", children: formatTime })
4604
4576
  ] }),
4605
- /* @__PURE__ */ jsx("div", { className: "text-3xl font-black relative z-10", children: formatTime })
4606
- ] }) });
4577
+ /* @__PURE__ */ jsx(DevStatusControls, {})
4578
+ ] });
4607
4579
  };
4608
4580
  const StatusStepsDialog = ({
4609
4581
  icons
4610
4582
  }) => {
4611
4583
  const { current, reset } = useTransactionStore();
4612
4584
  const status = current?.status;
4585
+ const handleClose = () => {
4586
+ if (status === "completed" || status === "failed" || status === "executing") {
4587
+ reset();
4588
+ }
4589
+ };
4613
4590
  if (!status || status === "idle") return null;
4614
4591
  let step = null;
4615
4592
  if (status === "executing") {
@@ -4627,7 +4604,8 @@ const StatusStepsDialog = ({
4627
4604
  if (status === "failed") {
4628
4605
  step = /* @__PURE__ */ jsx(FailedStep, { icon: icons?.failed });
4629
4606
  }
4630
- return /* @__PURE__ */ jsx(Dialog, { open: true, onOpenChange: () => reset(), children: step });
4607
+ if (!step) return null;
4608
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Dialog, { open: true, onOpenChange: handleClose, children: step }) });
4631
4609
  };
4632
4610
  const useTokens = () => {
4633
4611
  const { setTokens, setAllTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
@@ -25877,7 +25855,7 @@ class WalletConnectModal {
25877
25855
  }
25878
25856
  async initUi() {
25879
25857
  if (typeof window !== "undefined") {
25880
- await import("./index-PB3n7I7m.js");
25858
+ await import("./index-CkDt6lc8.js");
25881
25859
  const modal = document.createElement("wcm-modal");
25882
25860
  document.body.insertAdjacentElement("beforeend", modal);
25883
25861
  OptionsCtrl.setIsUiLoaded(true);
@@ -26646,4 +26624,4 @@ export {
26646
26624
  getQuoteFees as y,
26647
26625
  calculateMinReceived as z
26648
26626
  };
26649
- //# sourceMappingURL=index-Bf7M_Hjm.js.map
26627
+ //# sourceMappingURL=index-DV105AWa.js.map