@rash2x/bridge-widget 0.6.30 → 0.6.32

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.
@@ -5,7 +5,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import { useEffect, useMemo, createContext, useContext, useState, useCallback, forwardRef, useRef } from "react";
6
6
  import { initReactI18next, I18nextProvider, useTranslation } from "react-i18next";
7
7
  import i18n from "i18next";
8
- import { Button, buttonVariants } from "@/components/ui/button";
8
+ import { Button } from "@/components/ui/button";
9
9
  import { create } from "zustand";
10
10
  import { useAccount, usePublicClient, useConnect, useDisconnect, useWalletClient } from "wagmi";
11
11
  import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks";
@@ -4134,8 +4134,8 @@ const WalletModalButton = (props) => {
4134
4134
  "div",
4135
4135
  {
4136
4136
  className: cn$2(
4137
- buttonVariants({ variant: "ghost", size: "default" }),
4138
- "rounded-xs w-full !hover:scale-100 !px-3 !gap-3 flex items-center justify-start"
4137
+ "whitespace-nowrap text-sm font-medium transition-all h-13 rounded-xs w-full px-3 gap-3 flex items-center justify-start hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 cursor-default",
4138
+ ""
4139
4139
  ),
4140
4140
  children: [
4141
4141
  /* @__PURE__ */ jsx(IconComponent, { className: "min-w-8 min-h-8" }),
@@ -4144,7 +4144,14 @@ const WalletModalButton = (props) => {
4144
4144
  /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-medium text-muted-foreground", children: name })
4145
4145
  ] }),
4146
4146
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 ml-auto", children: [
4147
- /* @__PURE__ */ jsx(Badge, { variant: "default", className: "bg-success/10 text-success h-7 px-2", children: t2("wallets.connectedStatus") }),
4147
+ /* @__PURE__ */ jsx(
4148
+ Badge,
4149
+ {
4150
+ variant: "default",
4151
+ className: "bg-success/10 text-success h-7 px-2",
4152
+ children: t2("wallets.connectedStatus")
4153
+ }
4154
+ ),
4148
4155
  /* @__PURE__ */ jsx(
4149
4156
  "button",
4150
4157
  {
@@ -6573,10 +6580,22 @@ const useConnectedWalletsStore = create((set2, get2) => ({
6573
6580
  hasAnyWallet: () => {
6574
6581
  const state2 = get2();
6575
6582
  return state2.tonConnected || state2.metaMaskConnected || state2.tronConnected;
6583
+ },
6584
+ hasWalletForChain: (chainKey) => {
6585
+ if (!chainKey) return false;
6586
+ const state2 = get2();
6587
+ const key = chainKey.toLowerCase();
6588
+ if (key === "ton") {
6589
+ return state2.tonConnected;
6590
+ }
6591
+ if (key === "tron") {
6592
+ return state2.tronConnected;
6593
+ }
6594
+ return state2.metaMaskConnected;
6576
6595
  }
6577
6596
  }));
6578
6597
  const gasPresets = ["auto", "none", "medium", "max"];
6579
- const slippagePresets = ["0.5%", "1.0%", "5.0%"];
6598
+ const slippagePresets = ["0.5%", "1%", "5%"];
6580
6599
  const routePresets = [
6581
6600
  RoutePriority.FASTEST,
6582
6601
  RoutePriority.CHEAPEST,
@@ -6777,7 +6796,6 @@ const TokenSelectModal = ({
6777
6796
  fromChain?.chainKey,
6778
6797
  srcAddress
6779
6798
  );
6780
- const effectiveTab = hasAnyWallet() ? tab : "all";
6781
6799
  useEffect(() => {
6782
6800
  if (!hasAnyWallet()) setTab("all");
6783
6801
  }, [hasAnyWallet]);
@@ -6846,10 +6864,8 @@ const TokenSelectModal = ({
6846
6864
  findFirstAvailableChain,
6847
6865
  getTokenUsdValue
6848
6866
  ]);
6849
- const myTokens = useMemo(
6850
- () => groupedTokens.withBalance,
6851
- [groupedTokens.withBalance]
6852
- );
6867
+ const myTokens = groupedTokens.withBalance;
6868
+ const effectiveTab = hasAnyWallet() ? tab : "all";
6853
6869
  useEffect(() => {
6854
6870
  if (query.trim() !== "" && tab === "my" && myTokens.length === 0 && !manualTabSwitch) {
6855
6871
  setTab("all");
@@ -6922,7 +6938,7 @@ const TokenSelectModal = ({
6922
6938
  }
6923
6939
  ),
6924
6940
  hasAnyWallet() && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
6925
- /* @__PURE__ */ jsx(
6941
+ myTokens.length !== 0 && /* @__PURE__ */ jsx(
6926
6942
  Button,
6927
6943
  {
6928
6944
  variant: tab === "my" ? "default" : "ghost",
@@ -26137,7 +26153,7 @@ class WalletConnectModal {
26137
26153
  }
26138
26154
  async initUi() {
26139
26155
  if (typeof window !== "undefined") {
26140
- await import("./index-C7MvldxR.js");
26156
+ await import("./index-BbLtc5UN.js");
26141
26157
  const modal = document.createElement("wcm-modal");
26142
26158
  document.body.insertAdjacentElement("beforeend", modal);
26143
26159
  OptionsCtrl.setIsUiLoaded(true);
@@ -26889,4 +26905,4 @@ export {
26889
26905
  getQuoteFees as y,
26890
26906
  calculateMinReceived as z
26891
26907
  };
26892
- //# sourceMappingURL=index-CqfwMxF8.js.map
26908
+ //# sourceMappingURL=index-D0iCKCsz.js.map