@rash2x/bridge-widget 0.6.58 → 0.6.62

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-DiF0Z4eu.cjs");
3
+ const index = require("./index-CAc7tJ3r.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 { K, d, f, e, P, G, z, V, S, w, s, v, r, p, q, F, Y, a4, _, a1, x, A, y, $, B, Z, a2, a3, Q, a0, N, H, U, X, a5, I, J, W, D, L, t, o, i, u, l, m, j, n, h, k } from "./index-CDUxAooI.js";
1
+ import { K, d, f, e, P, G, z, V, S, w, s, v, r, p, q, F, Y, a4, _, a1, x, A, y, $, B, Z, a2, a3, Q, a0, N, H, U, X, a5, I, J, W, D, L, t, o, i, u, l, m, j, n, h, k } from "./index-C0BTirT_.js";
2
2
  export {
3
3
  K as DEFAULT_SLIPPAGE_BPS,
4
4
  d as EvaaBridge,
@@ -16,8 +16,8 @@ import { cn as cn$2 } from "@/lib/utils";
16
16
  import { Skeleton } from "@/components/ui/skeleton";
17
17
  import { Input } from "@/components/ui/input";
18
18
  import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "@/components/ui/dialog";
19
+ import { XIcon, X as X$3, Loader2, AlertCircleIcon, ArrowRight, CheckCircle2, Clock } from "lucide-react";
19
20
  import { Switch } from "@/components/ui/switch";
20
- import { X as X$3, Loader2, AlertCircleIcon, ArrowRight, CheckCircle2, Clock } from "lucide-react";
21
21
  import { AnimatePresence, motion } from "framer-motion";
22
22
  import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/components/ui/accordion";
23
23
  import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
@@ -2028,22 +2028,31 @@ const SearchInput = ({
2028
2028
  placeholder,
2029
2029
  value,
2030
2030
  onChange,
2031
- className
2031
+ className,
2032
+ rootClassName
2032
2033
  }) => {
2033
- return /* @__PURE__ */ jsxs("div", { className: cn$2("rounded-xs relative"), children: [
2034
+ return /* @__PURE__ */ jsxs("div", { className: cn$2("rounded-xs relative", rootClassName), children: [
2034
2035
  /* @__PURE__ */ jsx(SearchIcon, { className: "w-6 h-6 absolute z-10 left-5 top-0 bottom-0 my-auto text-foreground" }),
2035
2036
  /* @__PURE__ */ jsx(
2036
2037
  Input,
2037
2038
  {
2038
2039
  placeholder,
2039
2040
  className: cn$2(
2040
- "w-full outline-none px-5 py-4 relative pl-16 bg-input border transition-all border-transparent rounded-xs ring-0 leading-0 h-13 text-base focus-visible:border focus-visible:border-ring",
2041
+ "w-full outline-none px-5 py-4 relative pl-16 bg-input border transition-all border-transparent rounded-xs ring-0 leading-0 h-13 text-base",
2042
+ value && "pr-16",
2041
2043
  className
2042
2044
  ),
2043
2045
  value,
2044
2046
  onChange: (e2) => onChange(e2.target.value)
2045
2047
  }
2046
- )
2048
+ ),
2049
+ value && /* @__PURE__ */ jsx("div", { className: "absolute z-10 right-4 top-0 bottom-0 my-auto h-5 w-5 bg-accent flex items-center justify-center rounded-full", children: /* @__PURE__ */ jsx(
2050
+ XIcon,
2051
+ {
2052
+ className: "w-4 h-4 text-foreground cursor-pointer hover:opacity-70 transition-opacity",
2053
+ onClick: () => onChange("")
2054
+ }
2055
+ ) })
2047
2056
  ] });
2048
2057
  };
2049
2058
  const ChainSelectModal = ({
@@ -2193,49 +2202,58 @@ const ChainSelectModal = ({
2193
2202
  chain2.chainKey
2194
2203
  );
2195
2204
  };
2196
- return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "md:max-h-[90dvh] md:h-[90dvh] 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%] overflow-hidden flex flex-col p-10 pt-7 rounded-none md:rounded-lg", children: [
2197
- /* @__PURE__ */ jsx(DialogHeader, { className: "text-left pb-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl leading-8", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0", children: [
2198
- /* @__PURE__ */ jsx("div", { children: t2("bridge.select") }),
2199
- /* @__PURE__ */ jsx("div", { children: t2(isSource ? "bridge.sourceNetwork" : "bridge.destinationNetwork") })
2200
- ] }) }) }),
2201
- /* @__PURE__ */ jsx(
2202
- SearchInput,
2203
- {
2204
- placeholder: t2("bridge.search"),
2205
- value: query,
2206
- onChange: setQuery,
2207
- className: "text-foreground placeholder:text-muted-foreground"
2208
- }
2209
- ),
2210
- /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30", children: [
2211
- groupedChains.available.length > 0 && groupedChains.available.map((c2) => renderChainItem(c2, false)),
2212
- groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
2213
- /* @__PURE__ */ jsx(
2214
- "p",
2215
- {
2216
- className: `px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase ${groupedChains.available.length > 0 ? "mt-10" : ""}`,
2217
- children: t2("bridge.willChangeSourceChain")
2218
- }
2219
- ),
2220
- groupedChains.willChangeSrc.map(
2221
- (c2) => renderChainItem(c2, true, false)
2222
- )
2223
- ] }),
2224
- groupedChains.willChangeTokenAndSrc.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
2205
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(
2206
+ DialogContent,
2207
+ {
2208
+ className: "md:max-h-[90dvh] md:h-[90dvh] 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%] overflow-hidden flex flex-col p-6 md:p-10 md:pt-8 rounded-none md:rounded-lg",
2209
+ closeButtonClassName: "right-6 md:right-10",
2210
+ children: [
2211
+ /* @__PURE__ */ jsx(DialogHeader, { className: "text-left pb-2", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl leading-8", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0", children: [
2212
+ /* @__PURE__ */ jsx("div", { children: t2("bridge.select") }),
2213
+ /* @__PURE__ */ jsx("div", { children: t2(
2214
+ isSource ? "bridge.sourceNetwork" : "bridge.destinationNetwork"
2215
+ ) })
2216
+ ] }) }) }),
2225
2217
  /* @__PURE__ */ jsx(
2226
- "p",
2218
+ SearchInput,
2227
2219
  {
2228
- className: `px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase ${groupedChains.available.length > 0 || groupedChains.willChangeSrc.length > 0 ? "mt-10" : ""}`,
2229
- children: t2("bridge.willChangeSourceNetworkAndToken")
2220
+ placeholder: t2("bridge.search"),
2221
+ value: query,
2222
+ onChange: setQuery,
2223
+ className: "text-foreground placeholder:text-muted-foreground"
2230
2224
  }
2231
2225
  ),
2232
- groupedChains.willChangeTokenAndSrc.map(
2233
- (c2) => renderChainItem(c2, false, true)
2234
- )
2235
- ] }),
2236
- groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && groupedChains.willChangeTokenAndSrc.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground px-12 py-2 h-28 flex items-center justify-center text-center", children: t2("bridge.chainNotFound") })
2237
- ] })
2238
- ] }) });
2226
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30", children: [
2227
+ groupedChains.available.length > 0 && groupedChains.available.map((c2) => renderChainItem(c2, false)),
2228
+ groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
2229
+ /* @__PURE__ */ jsx(
2230
+ "p",
2231
+ {
2232
+ className: `px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase ${groupedChains.available.length > 0 ? "mt-10" : ""}`,
2233
+ children: t2("bridge.willChangeSourceChain")
2234
+ }
2235
+ ),
2236
+ groupedChains.willChangeSrc.map(
2237
+ (c2) => renderChainItem(c2, true, false)
2238
+ )
2239
+ ] }),
2240
+ groupedChains.willChangeTokenAndSrc.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
2241
+ /* @__PURE__ */ jsx(
2242
+ "p",
2243
+ {
2244
+ className: `px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase ${groupedChains.available.length > 0 || groupedChains.willChangeSrc.length > 0 ? "mt-10" : ""}`,
2245
+ children: t2("bridge.willChangeSourceNetworkAndToken")
2246
+ }
2247
+ ),
2248
+ groupedChains.willChangeTokenAndSrc.map(
2249
+ (c2) => renderChainItem(c2, false, true)
2250
+ )
2251
+ ] }),
2252
+ groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && groupedChains.willChangeTokenAndSrc.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground px-12 py-2 h-28 flex items-center justify-center text-center", children: t2("bridge.chainNotFound") })
2253
+ ] })
2254
+ ]
2255
+ }
2256
+ ) });
2239
2257
  };
2240
2258
  const useWalletSelectModal = create((set2) => ({
2241
2259
  isOpen: false,
@@ -2865,7 +2883,9 @@ function useGasEstimate(amountNum) {
2865
2883
  try {
2866
2884
  const estimateValue = await strategy.estimateNetworkFee(steps);
2867
2885
  if (cancelled) return;
2868
- setNetworkFeeEstimate(Number.isFinite(estimateValue) ? estimateValue : 0);
2886
+ setNetworkFeeEstimate(
2887
+ Number.isFinite(estimateValue) ? estimateValue : 0
2888
+ );
2869
2889
  } catch {
2870
2890
  if (cancelled) return;
2871
2891
  setNetworkFeeEstimate(0);
@@ -6623,6 +6643,7 @@ const SettingsModal = ({ isOpen, onClose }) => {
6623
6643
  const TOKEN_ROW_HEIGHT = 52;
6624
6644
  const TokenRow = ({
6625
6645
  symbol,
6646
+ willChangeSrc,
6626
6647
  name,
6627
6648
  isSelected,
6628
6649
  hasAnyWallet,
@@ -6635,7 +6656,7 @@ const TokenRow = ({
6635
6656
  Button,
6636
6657
  {
6637
6658
  onClick: onPick,
6638
- className: `w-full px-5 rounded-xs bg-transparent flex items-center justify-between gap-3 hover:bg-accent hover:scale-100 ${isSelected ? "border border-primary" : ""}`,
6659
+ className: `w-full px-5 rounded-xs bg-transparent flex items-center justify-between gap-3 hover:bg-accent hover:scale-100 ${isSelected ? "border border-primary" : ""} ${willChangeSrc ? "opacity-50 hover:opacity-100" : ""}`,
6639
6660
  children: [
6640
6661
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
6641
6662
  /* @__PURE__ */ jsx(
@@ -6871,7 +6892,7 @@ const TokenSelectModal = ({
6871
6892
  "div",
6872
6893
  {
6873
6894
  style: { ...style, height: TOKEN_ROW_HEIGHT },
6874
- className: "px-5 flex leading-4 text-base py-2 text-muted-foreground uppercase mt-8",
6895
+ className: "px-5 flex leading-4 text-base py-2 text-muted-foreground uppercase mt-3",
6875
6896
  children: /* @__PURE__ */ jsx("p", { children: item.text })
6876
6897
  }
6877
6898
  );
@@ -6890,6 +6911,7 @@ const TokenSelectModal = ({
6890
6911
  balance: bal,
6891
6912
  usdValue: usd,
6892
6913
  isBalanceLoading: balancesQuery.isLoading || balancesQuery.isFetching,
6914
+ willChangeSrc,
6893
6915
  onPick: () => onPick(token.symbol, willChangeSrc)
6894
6916
  }
6895
6917
  ) });
@@ -6914,67 +6936,74 @@ const TokenSelectModal = ({
6914
6936
  },
6915
6937
  [effectiveTab, virtualItems]
6916
6938
  );
6917
- return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "md:max-h-[90dvh] md:h-[90dvh] overflow-hidden flex flex-col 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%] p-10 pt-7 rounded-none md:rounded-lg", children: [
6918
- /* @__PURE__ */ jsx(DialogHeader, { className: "text-left", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-2xl leading-8", children: t2("bridge.selectToken") }) }),
6919
- /* @__PURE__ */ jsx(
6920
- SearchInput,
6921
- {
6922
- placeholder: t2("bridge.searchToken"),
6923
- value: query,
6924
- onChange: setQuery
6925
- }
6926
- ),
6927
- hasSourceWallet() && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
6928
- /* @__PURE__ */ jsx(
6929
- Button,
6930
- {
6931
- variant: effectiveTab === "my" ? "default" : "ghost",
6932
- onClick: () => {
6933
- setTab("my");
6934
- setManualTabSwitch(true);
6935
- },
6936
- size: "sm",
6937
- className: cn$2(
6938
- "px-4 cursor-pointer",
6939
- effectiveTab !== "my" && "bg-muted hover:bg-accent"
6940
- ),
6941
- children: t2("bridge.myTokens")
6942
- }
6943
- ),
6944
- /* @__PURE__ */ jsx(
6945
- Button,
6946
- {
6947
- variant: effectiveTab === "all" ? "default" : "ghost",
6948
- onClick: () => {
6949
- setTab("all");
6950
- setManualTabSwitch(true);
6951
- },
6952
- size: "sm",
6953
- className: cn$2(
6954
- "px-4 cursor-pointer",
6955
- effectiveTab !== "all" && "bg-muted hover:bg-accent"
6939
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(
6940
+ DialogContent,
6941
+ {
6942
+ className: "md:max-h-[90dvh] md:h-[90dvh] overflow-hidden flex flex-col 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%] p-6 md:p-10 md:pt-8 rounded-none md:rounded-lg",
6943
+ closeButtonClassName: "right-6 md:right-10",
6944
+ children: [
6945
+ /* @__PURE__ */ jsx(DialogHeader, { className: "text-left pb-2", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-2xl leading-8", children: t2("bridge.selectToken") }) }),
6946
+ /* @__PURE__ */ jsx(
6947
+ SearchInput,
6948
+ {
6949
+ placeholder: t2("bridge.searchToken"),
6950
+ value: query,
6951
+ onChange: setQuery
6952
+ }
6953
+ ),
6954
+ hasSourceWallet() && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
6955
+ /* @__PURE__ */ jsx(
6956
+ Button,
6957
+ {
6958
+ variant: effectiveTab === "my" ? "default" : "ghost",
6959
+ onClick: () => {
6960
+ setTab("my");
6961
+ setManualTabSwitch(true);
6962
+ },
6963
+ size: "sm",
6964
+ className: cn$2(
6965
+ "px-4 h-9 cursor-pointer",
6966
+ effectiveTab !== "my" && "bg-muted hover:bg-accent"
6967
+ ),
6968
+ children: t2("bridge.myTokens")
6969
+ }
6956
6970
  ),
6957
- children: t2("bridge.allTokens")
6958
- }
6959
- )
6960
- ] }),
6961
- /* @__PURE__ */ jsx("div", { id: "token-select-list", className: "flex-1 -mx-5 min-h-0", children: hasNoResults ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-12 py-2 h-28 flex items-center justify-center text-center", children: t2("bridge.tokenNotFound") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6962
- effectiveTab === "my" && myTokens.length === 0 && /* @__PURE__ */ jsx("p", { className: "leading-4 px-5 text-base text-muted-foreground uppercase py-2", children: t2("bridge.noBalancesFound") }),
6963
- /* @__PURE__ */ jsx(
6964
- FixedSizeList,
6965
- {
6966
- height: listHeight,
6967
- itemCount: virtualItems.length,
6968
- itemSize: TOKEN_ROW_HEIGHT,
6969
- width: "100%",
6970
- itemKey,
6971
- className: "[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30",
6972
- overscanCount: 5,
6973
- children: VirtualRow
6974
- }
6975
- )
6976
- ] }) })
6977
- ] }) });
6971
+ /* @__PURE__ */ jsx(
6972
+ Button,
6973
+ {
6974
+ variant: effectiveTab === "all" ? "default" : "ghost",
6975
+ onClick: () => {
6976
+ setTab("all");
6977
+ setManualTabSwitch(true);
6978
+ },
6979
+ size: "sm",
6980
+ className: cn$2(
6981
+ "px-4 h-9 cursor-pointer",
6982
+ effectiveTab !== "all" && "bg-muted hover:bg-accent"
6983
+ ),
6984
+ children: t2("bridge.allTokens")
6985
+ }
6986
+ )
6987
+ ] }),
6988
+ /* @__PURE__ */ jsx("div", { id: "token-select-list", className: "flex-1 -mx-5 min-h-0", children: hasNoResults ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-12 py-2 h-28 flex items-center justify-center text-center", children: t2("bridge.tokenNotFound") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6989
+ effectiveTab === "my" && myTokens.length === 0 && /* @__PURE__ */ jsx("p", { className: "leading-4 px-5 text-base text-muted-foreground uppercase py-2", children: t2("bridge.noBalancesFound") }),
6990
+ /* @__PURE__ */ jsx(
6991
+ FixedSizeList,
6992
+ {
6993
+ height: listHeight,
6994
+ itemCount: virtualItems.length,
6995
+ itemSize: TOKEN_ROW_HEIGHT,
6996
+ width: "100%",
6997
+ itemKey,
6998
+ className: "[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30",
6999
+ overscanCount: 5,
7000
+ children: VirtualRow
7001
+ }
7002
+ )
7003
+ ] }) })
7004
+ ]
7005
+ }
7006
+ ) });
6978
7007
  };
6979
7008
  function useBridgeRefresh() {
6980
7009
  const qc = useQueryClient();
@@ -25793,7 +25822,7 @@ class WalletConnectModal {
25793
25822
  }
25794
25823
  async initUi() {
25795
25824
  if (typeof window !== "undefined") {
25796
- await import("./index-D8sxoZ5P.js");
25825
+ await import("./index-CcNV1b5l.js");
25797
25826
  const modal = document.createElement("wcm-modal");
25798
25827
  document.body.insertAdjacentElement("beforeend", modal);
25799
25828
  OptionsCtrl.setIsUiLoaded(true);
@@ -26561,4 +26590,4 @@ export {
26561
26590
  getQuoteFees as y,
26562
26591
  calculateMinReceived as z
26563
26592
  };
26564
- //# sourceMappingURL=index-CDUxAooI.js.map
26593
+ //# sourceMappingURL=index-C0BTirT_.js.map