@rash2x/bridge-widget 0.6.43 → 0.6.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-Cqs3pq51.cjs");
3
+ const index = require("./index-dS_Zjwua.cjs");
4
4
  exports.DEFAULT_SLIPPAGE_BPS = index.DEFAULT_SLIPPAGE_BPS;
5
5
  exports.EvaaBridge = index.EvaaBridge;
6
6
  exports.RoutePriority = index.RoutePriority;
@@ -1,4 +1,4 @@
1
- import { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, aa, a4, a7, x, I, y, a5, J, a3, a8, a9, Y, a6, W, P, _, a1, ab, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-B6AZb_BQ.js";
1
+ import { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, aa, a4, a7, x, I, y, a5, J, a3, a8, a9, Y, a6, W, P, _, a1, ab, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-C-Rv5dlA.js";
2
2
  export {
3
3
  U as DEFAULT_SLIPPAGE_BPS,
4
4
  d as EvaaBridge,
@@ -18,13 +18,14 @@ import { Skeleton } from "@/components/ui/skeleton";
18
18
  import { Input } from "@/components/ui/input";
19
19
  import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "@/components/ui/dialog";
20
20
  import { Switch } from "@/components/ui/switch";
21
- import { X as X$3, Loader2, ArrowRight, CheckCircle2, Clock } from "lucide-react";
21
+ import { X as X$3, Loader2, AlertCircleIcon, ArrowRight, CheckCircle2, Clock } from "lucide-react";
22
22
  import { AnimatePresence, motion } from "framer-motion";
23
23
  import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/components/ui/accordion";
24
24
  import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
25
25
  import { Alert, AlertDescription } from "@/components/ui/alert";
26
26
  import { toast, Toaster } from "sonner";
27
27
  import { Badge } from "@/components/ui/badge";
28
+ import { DialogDescription as DialogDescription$1 } from "@radix-ui/react-dialog";
28
29
  import { isAddress, formatUnits, parseUnits } from "viem";
29
30
  import { TronLinkAdapterName } from "@tronweb3/tronwallet-adapters";
30
31
  import { TronWeb } from "tronweb";
@@ -4417,9 +4418,9 @@ const ProgressStep = ({
4417
4418
  title: t2("transaction.steps.completed")
4418
4419
  }
4419
4420
  ];
4420
- return /* @__PURE__ */ jsx(DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px]", children: /* @__PURE__ */ jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background noise p-10 pb-0", children: [
4421
+ return /* @__PURE__ */ jsx(DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background noise p-10", children: [
4421
4422
  icon,
4422
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pb-2 text-center", children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.inProgress") }) }),
4423
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.inProgress") }) }),
4423
4424
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
4424
4425
  /* @__PURE__ */ jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground/50" }),
4425
4426
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxs(
@@ -4439,6 +4440,25 @@ const ProgressStep = ({
4439
4440
  ] })
4440
4441
  ] }) });
4441
4442
  };
4443
+ const FailedStep = ({
4444
+ icon = /* @__PURE__ */ jsx(AlertCircleIcon, { className: "w-16 h-16" })
4445
+ }) => {
4446
+ const { current, reset } = useTransactionStore();
4447
+ const { t: t2 } = useBridgeTranslation();
4448
+ return /* @__PURE__ */ jsxs(DialogContent, { showCloseButton: true, className: "overflow-hidden md:max-w-[420px] p-0", children: [
4449
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10 pb-0", children: [
4450
+ icon,
4451
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4452
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.failed") }),
4453
+ current?.errorCode && /* @__PURE__ */ jsx(DialogDescription$1, { children: t2(
4454
+ `errors.${current.errorCode}`,
4455
+ current.errorParams || {}
4456
+ ) })
4457
+ ] })
4458
+ ] }),
4459
+ /* @__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") }) })
4460
+ ] });
4461
+ };
4442
4462
  const EXPLORER_CONFIGS = {
4443
4463
  // TON
4444
4464
  ton: {
@@ -4576,7 +4596,7 @@ const SuccessStep = ({
4576
4596
  children: [
4577
4597
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 flex-1 justify-start items-center text-center bg-background noise p-10 pb-0", children: [
4578
4598
  icon,
4579
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 text-center", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-[28px]", children: t2("transaction.success") }) }),
4599
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pt-4 text-center", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-[28px]", children: t2("transaction.success") }) }),
4580
4600
  /* @__PURE__ */ jsxs("div", { className: "w-full space-y-2 mt-3 relative z-10 pb-14", children: [
4581
4601
  metadata?.srcAmountHuman && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
4582
4602
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t2("transaction.bridged") }),
@@ -4636,7 +4656,7 @@ const SuccessStep = ({
4636
4656
  ] })
4637
4657
  ] })
4638
4658
  ] }),
4639
- /* @__PURE__ */ jsx(DialogFooter, { className: "px-10 pb-10", children: /* @__PURE__ */ jsx(Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
4659
+ /* @__PURE__ */ jsx(DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsx(Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
4640
4660
  ]
4641
4661
  }
4642
4662
  );
@@ -4663,9 +4683,9 @@ const ConfirmStep = ({
4663
4683
  }) => {
4664
4684
  const { t: t2 } = useBridgeTranslation();
4665
4685
  const { formatTime } = useCountdown(90);
4666
- return /* @__PURE__ */ jsx(DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10 pb-0", children: [
4686
+ return /* @__PURE__ */ jsx(DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10", children: [
4667
4687
  icon,
4668
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pb-2 text-center", children: [
4688
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4669
4689
  /* @__PURE__ */ jsx(DialogTitle, { children: t2("transaction.confirm") }),
4670
4690
  /* @__PURE__ */ jsx(DialogDescription, { children: t2("transaction.signTransaction") })
4671
4691
  ] }),
@@ -4689,7 +4709,7 @@ const StatusStepsDialog = ({
4689
4709
  step = /* @__PURE__ */ jsx(SuccessStep, { icon: icons?.success });
4690
4710
  }
4691
4711
  if (status === "failed") {
4692
- step = /* @__PURE__ */ jsx(SuccessStep, { icon: icons?.failed });
4712
+ step = /* @__PURE__ */ jsx(FailedStep, { icon: icons?.failed });
4693
4713
  }
4694
4714
  return /* @__PURE__ */ jsx(Dialog, { open: true, onOpenChange: () => reset(), children: step });
4695
4715
  };
@@ -25945,7 +25965,7 @@ class WalletConnectModal {
25945
25965
  }
25946
25966
  async initUi() {
25947
25967
  if (typeof window !== "undefined") {
25948
- await import("./index-DnmdzSj9.js");
25968
+ await import("./index-DlXh95vJ.js");
25949
25969
  const modal = document.createElement("wcm-modal");
25950
25970
  document.body.insertAdjacentElement("beforeend", modal);
25951
25971
  OptionsCtrl.setIsUiLoaded(true);
@@ -26704,4 +26724,4 @@ export {
26704
26724
  getQuoteFees as y,
26705
26725
  calculateMinReceived as z
26706
26726
  };
26707
- //# sourceMappingURL=index-B6AZb_BQ.js.map
26727
+ //# sourceMappingURL=index-C-Rv5dlA.js.map