solariskit 1.0.0 → 1.2.0

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,7 +1,6 @@
1
1
 
2
- import { o as WalletInstance } from "./Wallet-B3fOxQx_.js";
2
+ import { o as WalletInstance } from "./Wallet-epUweMuA.js";
3
3
  import React, { JSX, ReactNode } from "react";
4
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
4
  import { Address } from "viem";
6
5
  import { Chain } from "wagmi/chains";
7
6
  import { RequiredConditionalValue } from "@vanilla-extract/sprinkles";
@@ -96,7 +95,7 @@ declare const responsiveProperties: {
96
95
  };
97
96
  display: {
98
97
  values: {
99
- block: {
98
+ flex: {
100
99
  defaultClass: string;
101
100
  conditions: {
102
101
  smallScreen: string;
@@ -110,7 +109,7 @@ declare const responsiveProperties: {
110
109
  largeScreen: string;
111
110
  };
112
111
  };
113
- flex: {
112
+ block: {
114
113
  defaultClass: string;
115
114
  conditions: {
116
115
  smallScreen: string;
@@ -186,7 +185,7 @@ declare function RainbowKitProvider({
186
185
  modalSize,
187
186
  showRecentTransactions,
188
187
  theme
189
- }: RainbowKitProviderProps): _$react_jsx_runtime0.JSX.Element;
188
+ }: RainbowKitProviderProps): React.JSX.Element;
190
189
  //#endregion
191
190
  //#region src/components/RainbowKitProvider/AuthenticationContext.d.ts
192
191
  type AuthenticationStatus = "loading" | "unauthenticated" | "authenticated";
@@ -217,7 +216,7 @@ declare function RainbowKitAuthenticationProvider<Message = unknown>({
217
216
  children,
218
217
  enabled,
219
218
  status
220
- }: RainbowKitAuthenticationProviderProps<Message>): _$react_jsx_runtime0.JSX.Element;
219
+ }: RainbowKitAuthenticationProviderProps<Message>): React.JSX.Element;
221
220
  //#endregion
222
221
  //#region src/components/ConnectButton/ConnectButtonRenderer.d.ts
223
222
  interface ConnectButtonRendererProps {
@@ -253,7 +252,7 @@ interface ConnectButtonRendererProps {
253
252
  }
254
253
  declare function ConnectButtonRenderer({
255
254
  children
256
- }: ConnectButtonRendererProps): _$react_jsx_runtime0.JSX.Element;
255
+ }: ConnectButtonRendererProps): React.JSX.Element;
257
256
  declare namespace ConnectButtonRenderer {
258
257
  var displayName: string;
259
258
  }
@@ -272,7 +271,7 @@ declare function ConnectButton({
272
271
  chainStatus,
273
272
  label,
274
273
  showBalance
275
- }: ConnectButtonProps): _$react_jsx_runtime0.JSX.Element | null;
274
+ }: ConnectButtonProps): React.JSX.Element | null;
276
275
  declare namespace ConnectButton {
277
276
  var __defaultProps: {
278
277
  readonly accountStatus: "full";
@@ -2,9 +2,10 @@
2
2
  import React, { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from "react";
3
3
  import { createMapValueFn, createNormalizeValueFn } from "@vanilla-extract/sprinkles/createUtils";
4
4
  import { createSprinkles } from "@vanilla-extract/sprinkles/createRuntimeSprinkles";
5
- import { useBalance, useConfig, useConnect, useConnection, useConnectionEffect, useConnectors, useDisconnect, useEnsAvatar, useEnsName, usePublicClient, useSignMessage, useSwitchChain } from "wagmi";
5
+ import { useBalance, useChainId, useConfig, useConnect, useConnection, useConnectionEffect, useConnectors, useDisconnect, useEnsAvatar, useEnsName, usePublicClient, useSignMessage, useSwitchChain } from "wagmi";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import clsx from "clsx";
8
+ import { polyconDataUri } from "@akshatmittal/polycons";
8
9
  import { UserRejectedRequestError, formatUnits, isAddress } from "viem";
9
10
  import { normalize } from "viem/ens";
10
11
  import { mainnet } from "wagmi/chains";
@@ -1591,7 +1592,7 @@ function AsyncImage({ alt, background, borderColor, borderRadius, useAsImage, bo
1591
1592
  width: typeof width === "string" ? width : void 0,
1592
1593
  testId,
1593
1594
  children: [/* @__PURE__ */ jsx(Box, {
1594
- ...isRemoteImage ? {
1595
+ ...src ? isRemoteImage ? {
1595
1596
  "aria-hidden": true,
1596
1597
  as: "img",
1597
1598
  onLoad: setRemoteImageLoaded,
@@ -1600,7 +1601,7 @@ function AsyncImage({ alt, background, borderColor, borderRadius, useAsImage, bo
1600
1601
  "aria-hidden": true,
1601
1602
  as: "img",
1602
1603
  src
1603
- },
1604
+ } : { "aria-hidden": true },
1604
1605
  height: "full",
1605
1606
  position: "absolute",
1606
1607
  ...ios ? { WebkitUserSelect: "none" } : {},
@@ -1658,125 +1659,6 @@ const SpinnerIcon = ({ height = 21, width = 21 }) => {
1658
1659
  });
1659
1660
  };
1660
1661
 
1661
- //#endregion
1662
- //#region src/components/Avatar/polyconDataUri.ts
1663
- const neutralPairs = [
1664
- ["#FF5C16", "#FCFCFC"],
1665
- ["#FF5C16", "#131416"],
1666
- ["#D075FF", "#FCFCFC"],
1667
- ["#D075FF", "#131416"],
1668
- ["#BAF24A", "#FCFCFC"],
1669
- ["#BAF24A", "#131416"],
1670
- ["#89B0FF", "#FCFCFC"],
1671
- ["#89B0FF", "#131416"],
1672
- ["#FCFCFC", "#FF5C16"],
1673
- ["#131416", "#FF5C16"],
1674
- ["#FCFCFC", "#D075FF"],
1675
- ["#131416", "#D075FF"],
1676
- ["#FCFCFC", "#BAF24A"],
1677
- ["#131416", "#BAF24A"],
1678
- ["#FCFCFC", "#89B0FF"],
1679
- ["#131416", "#89B0FF"]
1680
- ];
1681
- const tonalPairs = [
1682
- ["#FFA680", "#FF5C16"],
1683
- ["#661800", "#FF5C16"],
1684
- ["#EAC2FF", "#D075FF"],
1685
- ["#3D065F", "#D075FF"],
1686
- ["#E5FFC3", "#BAF24A"],
1687
- ["#013330", "#BAF24A"],
1688
- ["#CCE7FF", "#89B0FF"],
1689
- ["#190066", "#89B0FF"],
1690
- ["#FF5C16", "#FFA680"],
1691
- ["#FF5C16", "#661800"],
1692
- ["#D075FF", "#EAC2FF"],
1693
- ["#D075FF", "#3D065F"],
1694
- ["#BAF24A", "#E5FFC3"],
1695
- ["#BAF24A", "#013330"],
1696
- ["#89B0FF", "#CCE7FF"],
1697
- ["#89B0FF", "#190066"],
1698
- ["#661800", "#FFA680"],
1699
- ["#FFA680", "#661800"],
1700
- ["#3D065F", "#EAC2FF"],
1701
- ["#EAC2FF", "#3D065F"],
1702
- ["#013330", "#E5FFC3"],
1703
- ["#E5FFC3", "#013330"],
1704
- ["#190066", "#CCE7FF"],
1705
- ["#CCE7FF", "#190066"]
1706
- ];
1707
- const complementaryPairs = [
1708
- ["#EAC2FF", "#013330"],
1709
- ["#013330", "#EAC2FF"],
1710
- ["#CCE7FF", "#661800"],
1711
- ["#661800", "#CCE7FF"],
1712
- ["#E5FFC3", "#3D065F"],
1713
- ["#3D065F", "#E5FFC3"],
1714
- ["#FFA680", "#190066"],
1715
- ["#190066", "#FFA680"],
1716
- ["#CCE7FF", "#013330"],
1717
- ["#013330", "#CCE7FF"]
1718
- ];
1719
- const colorPairs = [
1720
- ...neutralPairs,
1721
- ...tonalPairs,
1722
- ...complementaryPairs
1723
- ];
1724
- function hashSeed(seed) {
1725
- let hash = 0;
1726
- for (let i = 0; i < seed.length; i++) hash = seed.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
1727
- return hash;
1728
- }
1729
- function polyconDataUri(seed, size) {
1730
- const hash = hashSeed(seed.length < 6 ? seed.padEnd(6, " ") : seed);
1731
- const [backgroundColor, foregroundColor] = colorPairs[Math.abs(hash) % colorPairs.length] ?? ["#FF5C16", "#FCFCFC"];
1732
- const grid = 2;
1733
- const margin = size * .25;
1734
- const cellSize = (size - 2 * margin) / grid;
1735
- const filledGrid = Array.from({ length: grid }, () => Array.from({ length: grid }, () => false));
1736
- const stack = [[Math.floor(grid / 2), Math.floor(grid / 2)]];
1737
- let pathData = "";
1738
- if (filledGrid[1]) filledGrid[1][1] = true;
1739
- while (stack.length > 0) {
1740
- const currentCell = stack.pop();
1741
- if (!currentCell) continue;
1742
- const [x, y] = currentCell;
1743
- const cellHash = Math.abs(hash >> x * 3 + y * 5) & 15;
1744
- const neighbors = [];
1745
- for (const [dx, dy] of [
1746
- [0, 1],
1747
- [1, 0],
1748
- [0, -1],
1749
- [-1, 0]
1750
- ]) {
1751
- const nextX = x + dx;
1752
- const nextY = y + dy;
1753
- if (nextX >= 0 && nextX < grid && nextY >= 0 && nextY < grid && !filledGrid[nextX]?.[nextY]) neighbors.push([nextX, nextY]);
1754
- }
1755
- while (neighbors.length > 0) {
1756
- const neighborIndex = Math.abs(cellHash + neighbors.length) % neighbors.length;
1757
- const nextCell = neighbors.splice(neighborIndex, 1)[0];
1758
- if (!nextCell) continue;
1759
- const [nextX, nextY] = nextCell;
1760
- stack.push(nextCell);
1761
- if (filledGrid[nextX]) filledGrid[nextX][nextY] = true;
1762
- }
1763
- const rotation = cellHash % 4 * 90;
1764
- const isSquare = cellHash % 5 === 0;
1765
- const cx = margin + x * cellSize;
1766
- const cy = margin + y * cellSize;
1767
- if (isSquare) {
1768
- pathData += `M${cx},${cy} h${cellSize} v${cellSize} h-${cellSize}z `;
1769
- continue;
1770
- }
1771
- if (rotation === 0) pathData += `M${cx},${cy} h${cellSize} v${cellSize}z `;
1772
- else if (rotation === 90) pathData += `M${cx + cellSize},${cy} v${cellSize} h-${cellSize}z `;
1773
- else if (rotation === 180) pathData += `M${cx + cellSize},${cy + cellSize} h-${cellSize} v-${cellSize}z `;
1774
- else pathData += `M${cx},${cy + cellSize} v-${cellSize} h${cellSize}z `;
1775
- }
1776
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${size} ${size}"><rect width="${size}" height="${size}" fill="${backgroundColor}"/><path d="${pathData.trim()}" fill="${foregroundColor}"/></svg>`;
1777
- return `data:image/svg+xml,${encodeURIComponent(svg)}`;
1778
- }
1779
-
1780
1662
  //#endregion
1781
1663
  //#region src/components/Avatar/EmojiAvatar.tsx
1782
1664
  const EmojiAvatar = ({ address, ensImage, size }) => {
@@ -1895,6 +1777,12 @@ const DropdownIcon = () => /* @__PURE__ */ jsxs("svg", {
1895
1777
  })]
1896
1778
  });
1897
1779
 
1780
+ //#endregion
1781
+ //#region src/utils/isChainIdSupported.ts
1782
+ function isChainIdSupported(chains, chainId) {
1783
+ return chainId != null && chains.some((chain) => chain.id === chainId);
1784
+ }
1785
+
1898
1786
  //#endregion
1899
1787
  //#region src/components/RainbowKitProvider/provideRainbowKitChains.ts
1900
1788
  const getChainIconUrl = (chainId) => `https://static.createmytoken.com/images/chains/${chainId}.png`;
@@ -1912,15 +1800,32 @@ const RainbowKitChainContext = createContext({
1912
1800
  });
1913
1801
  function RainbowKitChainProvider({ chainSearchThreshold = 5, children, initialChain }) {
1914
1802
  const { chains } = useConfig();
1803
+ const { status } = useConnection();
1804
+ const wagmiChainId = useChainId();
1805
+ const { mutate: switchChain } = useSwitchChain();
1806
+ const appliedInitialChainIdRef = useRef(void 0);
1807
+ const initialChainId = typeof initialChain === "number" ? initialChain : initialChain?.id;
1808
+ const configuredInitialChainId = isChainIdSupported(chains, initialChainId) ? initialChainId : void 0;
1809
+ useEffect(() => {
1810
+ if (status !== "disconnected" || configuredInitialChainId == null) return;
1811
+ if (appliedInitialChainIdRef.current === configuredInitialChainId) return;
1812
+ appliedInitialChainIdRef.current = configuredInitialChainId;
1813
+ if (wagmiChainId !== configuredInitialChainId) switchChain({ chainId: configuredInitialChainId });
1814
+ }, [
1815
+ configuredInitialChainId,
1816
+ status,
1817
+ switchChain,
1818
+ wagmiChainId
1819
+ ]);
1915
1820
  return /* @__PURE__ */ jsx(RainbowKitChainContext.Provider, {
1916
1821
  value: useMemo(() => ({
1917
1822
  chains: provideRainbowKitChains(chains),
1918
1823
  chainSearchThreshold,
1919
- initialChainId: typeof initialChain === "number" ? initialChain : initialChain?.id
1824
+ initialChainId
1920
1825
  }), [
1921
1826
  chainSearchThreshold,
1922
1827
  chains,
1923
- initialChain
1828
+ initialChainId
1924
1829
  ]),
1925
1830
  children
1926
1831
  });
@@ -2242,9 +2147,16 @@ function useProfile({ address, includeBalance }) {
2242
2147
  };
2243
2148
  }
2244
2149
 
2150
+ //#endregion
2151
+ //#region src/hooks/useSelectedChainId.ts
2152
+ function useSelectedChainId(connectedChainId) {
2153
+ const wagmiChainId = useChainId();
2154
+ return connectedChainId ?? wagmiChainId;
2155
+ }
2156
+
2245
2157
  //#endregion
2246
2158
  //#region src/hooks/useChainId.ts
2247
- function useChainId() {
2159
+ function useChainId$1() {
2248
2160
  const { chain: activeChain } = useConnection();
2249
2161
  return activeChain?.id ?? null;
2250
2162
  }
@@ -2394,7 +2306,7 @@ const TransactionStoreContext = React.createContext(null);
2394
2306
  function TransactionStoreProvider({ children }) {
2395
2307
  const provider = usePublicClient();
2396
2308
  const { address } = useConnection();
2397
- const chainId = useChainId();
2309
+ const chainId = useChainId$1();
2398
2310
  const { refetch } = useBalance({
2399
2311
  address,
2400
2312
  query: { enabled: false }
@@ -2440,7 +2352,7 @@ function useTransactionStore() {
2440
2352
  function useRecentTransactions() {
2441
2353
  const store = useTransactionStore();
2442
2354
  const { address } = useConnection();
2443
- const chainId = useChainId();
2355
+ const chainId = useChainId$1();
2444
2356
  const [transactions, setTransactions] = useState(() => store && address && chainId ? store.getTransactions(address, chainId) : []);
2445
2357
  useEffect(() => {
2446
2358
  if (store && address && chainId) {
@@ -2696,7 +2608,7 @@ function setRainbowKitVersion({ version }) {
2696
2608
  }
2697
2609
  function useFingerprint() {
2698
2610
  const fingerprint = useCallback(() => {
2699
- setRainbowKitVersion({ version: "1.0.0" });
2611
+ setRainbowKitVersion({ version: "1.2.0" });
2700
2612
  }, []);
2701
2613
  useEffect(() => {
2702
2614
  fingerprint();
@@ -2769,7 +2681,8 @@ function addRecentWalletId(walletId) {
2769
2681
  function useWalletConnectors(mergeEIP6963WithRkConnectors = false) {
2770
2682
  const rainbowKitChains = useRainbowKitChains();
2771
2683
  const initialChainId = useInitialChainId();
2772
- const { connectAsync } = useConnect();
2684
+ const selectedChainId = useChainId();
2685
+ const { mutateAsync: connect } = useConnect();
2773
2686
  const defaultCreatedConnectors = useConnectors();
2774
2687
  const { setIsWalletConnectModalOpen } = useWalletConnectOpenState();
2775
2688
  const defaultConnectors = defaultCreatedConnectors.map((connector) => ({
@@ -2778,9 +2691,9 @@ function useWalletConnectors(mergeEIP6963WithRkConnectors = false) {
2778
2691
  }));
2779
2692
  async function connectWallet(connector, parameters) {
2780
2693
  const walletChainId = await connector.getChainId();
2781
- const result = await connectAsync({
2694
+ const result = await connect({
2782
2695
  ...parameters,
2783
- chainId: parameters?.chainId ?? initialChainId ?? rainbowKitChains.find(({ id }) => id === walletChainId)?.id ?? rainbowKitChains[0]?.id,
2696
+ chainId: parameters?.chainId ?? selectedChainId ?? initialChainId ?? (isChainIdSupported(rainbowKitChains, walletChainId) ? walletChainId : void 0) ?? rainbowKitChains[0]?.id,
2784
2697
  connector
2785
2698
  });
2786
2699
  if (result) addRecentWalletId(connector.id);
@@ -2860,7 +2773,7 @@ function useWalletConnectors(mergeEIP6963WithRkConnectors = false) {
2860
2773
 
2861
2774
  //#endregion
2862
2775
  //#region src/components/Icons/Assets.tsx
2863
- const src$1 = async () => (await import("./assets-CTAKUsg7.js")).default;
2776
+ const src$1 = async () => (await import("./assets-DGFjAppz.js")).default;
2864
2777
  const preloadAssetsIcon = () => loadImages(src$1);
2865
2778
  const AssetsIcon = () => /* @__PURE__ */ jsx(AsyncImage, {
2866
2779
  background: "#d0d5de",
@@ -2872,7 +2785,7 @@ const AssetsIcon = () => /* @__PURE__ */ jsx(AsyncImage, {
2872
2785
 
2873
2786
  //#endregion
2874
2787
  //#region src/components/Icons/Login.tsx
2875
- const src = async () => (await import("./login-jACia2OZ.js")).default;
2788
+ const src = async () => (await import("./login-VHg-UliQ.js")).default;
2876
2789
  const preloadLoginIcon = () => loadImages(src);
2877
2790
  const LoginIcon = () => /* @__PURE__ */ jsx(AsyncImage, {
2878
2791
  background: "#d0d5de",
@@ -3030,7 +2943,7 @@ const CloseButton = ({ "aria-label": ariaLabel = "Close", onClose }) => {
3030
2943
 
3031
2944
  //#endregion
3032
2945
  //#region src/components/SignIn/SignIn.tsx
3033
- const signInIcon = async () => (await import("./sign-CzTxopYk.js")).default;
2946
+ const signInIcon = async () => (await import("./sign-DqCbFd_U.js")).default;
3034
2947
  function SignIn({ onClose, onCloseModal }) {
3035
2948
  const [{ status, ...state }, setState] = React.useState({ status: "idle" });
3036
2949
  const authAdapter = useAuthenticationAdapter();
@@ -3057,7 +2970,7 @@ function SignIn({ onClose, onCloseModal }) {
3057
2970
  }, [getNonce]);
3058
2971
  const mobile = isMobile();
3059
2972
  const { address, chain: activeChain } = useConnection();
3060
- const { signMessageAsync } = useSignMessage();
2973
+ const { mutateAsync: signMessage } = useSignMessage();
3061
2974
  const signIn = async () => {
3062
2975
  try {
3063
2976
  const chainId = activeChain?.id;
@@ -3092,7 +3005,7 @@ function SignIn({ onClose, onCloseModal }) {
3092
3005
  ...x,
3093
3006
  status: "signing"
3094
3007
  }));
3095
- signature = await signMessageAsync({ message });
3008
+ signature = await signMessage({ message });
3096
3009
  } catch (error) {
3097
3010
  if (error instanceof UserRejectedRequestError) return setState((x) => ({
3098
3011
  ...x,
@@ -3481,9 +3394,7 @@ function abbreviateETHBalance(number) {
3481
3394
  //#endregion
3482
3395
  //#region src/components/ConnectButton/formatAddress.ts
3483
3396
  function formatAddress(address) {
3484
- const leadingChars = 4;
3485
- const trailingChars = 4;
3486
- return address.length < leadingChars + trailingChars ? address : `${address.substring(0, leadingChars)}\u2026${address.substring(address.length - trailingChars)}`;
3397
+ return address.length < 8 ? address : `${address.substring(0, 4)}\u2026${address.substring(address.length - 4)}`;
3487
3398
  }
3488
3399
 
3489
3400
  //#endregion
@@ -3543,7 +3454,7 @@ const DisconnectIcon = () => /* @__PURE__ */ jsxs("svg", {
3543
3454
  function useClearRecentTransactions() {
3544
3455
  const store = useTransactionStore();
3545
3456
  const { address } = useConnection();
3546
- const chainId = useChainId();
3457
+ const chainId = useChainId$1();
3547
3458
  return useCallback(() => {
3548
3459
  if (!address || !chainId) throw new Error("No address or chain ID found");
3549
3460
  store.clearTransactions(address, chainId);
@@ -3954,7 +3865,7 @@ function AccountModal({ onClose, open }) {
3954
3865
  address,
3955
3866
  includeBalance: open
3956
3867
  });
3957
- const { disconnect } = useDisconnect();
3868
+ const { mutate: disconnect } = useDisconnect();
3958
3869
  if (!address) return null;
3959
3870
  return /* @__PURE__ */ jsx(Fragment$1, { children: address && /* @__PURE__ */ jsx(Dialog, {
3960
3871
  onClose,
@@ -4128,28 +4039,24 @@ var SearchInputClassName = "_5a0qia2";
4128
4039
  //#endregion
4129
4040
  //#region src/components/ChainModal/ChainModal.tsx
4130
4041
  function ChainModal({ onClose, open }) {
4131
- const { chainId } = useConnection();
4042
+ const { chainId: connectedChainId, isConnected } = useConnection();
4043
+ const currentChainId = useSelectedChainId(connectedChainId);
4132
4044
  const { chains } = useConfig();
4133
4045
  const [pendingChainId, setPendingChainId] = useState(null);
4134
4046
  const [searchQuery, setSearchQuery] = useState("");
4135
- const { switchChain } = useSwitchChain({ mutation: {
4047
+ const { mutate: switchChain } = useSwitchChain({ mutation: {
4136
4048
  onMutate: ({ chainId: _chainId }) => {
4137
4049
  setPendingChainId(_chainId);
4138
4050
  },
4139
- onSuccess: () => {
4140
- if (pendingChainId) setPendingChainId(null);
4141
- },
4142
- onError: () => {
4143
- if (pendingChainId) setPendingChainId(null);
4144
- },
4145
4051
  onSettled: () => {
4052
+ setPendingChainId(null);
4146
4053
  onClose();
4147
4054
  }
4148
4055
  } });
4149
- const { disconnect } = useDisconnect();
4056
+ const { mutate: disconnect } = useDisconnect();
4150
4057
  const titleId = "rk_chain_modal_title";
4151
4058
  const mobile = isMobile();
4152
- const isCurrentChainSupported = chains.some((chain) => chain.id === chainId);
4059
+ const isConnectedToUnsupportedChain = isConnected && !isChainIdSupported(chains, connectedChainId);
4153
4060
  const chainIconSize = mobile ? "36" : "28";
4154
4061
  const rainbowkitChains = useRainbowKitChains();
4155
4062
  const chainSearchThreshold = useChainSearchThreshold();
@@ -4162,7 +4069,6 @@ function ChainModal({ onClose, open }) {
4162
4069
  useEffect(() => {
4163
4070
  if (!open) setSearchQuery("");
4164
4071
  }, [open]);
4165
- if (!chainId) return null;
4166
4072
  return /* @__PURE__ */ jsx(Dialog, {
4167
4073
  onClose,
4168
4074
  open,
@@ -4197,7 +4103,7 @@ function ChainModal({ onClose, open }) {
4197
4103
  /* @__PURE__ */ jsx(CloseButton, { onClose })
4198
4104
  ]
4199
4105
  }),
4200
- !isCurrentChainSupported && /* @__PURE__ */ jsx(Box, {
4106
+ isConnectedToUnsupportedChain && /* @__PURE__ */ jsx(Box, {
4201
4107
  marginX: "8",
4202
4108
  textAlign: mobile ? "center" : "left",
4203
4109
  children: /* @__PURE__ */ jsx(Text, {
@@ -4230,7 +4136,7 @@ function ChainModal({ onClose, open }) {
4230
4136
  filteredChains.map(({ iconBackground, iconUrl, id, name }, idx) => {
4231
4137
  return /* @__PURE__ */ jsx(Chain$1, {
4232
4138
  chainId: id,
4233
- currentChainId: chainId,
4139
+ currentChainId,
4234
4140
  switchChain,
4235
4141
  chainIconSize,
4236
4142
  isLoading: pendingChainId === id,
@@ -4251,7 +4157,7 @@ function ChainModal({ onClose, open }) {
4251
4157
  children: t("chains.search.no_results")
4252
4158
  })
4253
4159
  }),
4254
- !isCurrentChainSupported && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
4160
+ isConnectedToUnsupportedChain && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
4255
4161
  background: "generalBorderDim",
4256
4162
  height: "1",
4257
4163
  marginX: "8"
@@ -4808,12 +4714,6 @@ function ConnectDetail({ compactModeEnabled, connectionError, onClose, qrCodeUri
4808
4714
 
4809
4715
  //#endregion
4810
4716
  //#region src/components/ConnectOptions/DesktopOptions.tsx
4811
- let WalletStep = /* @__PURE__ */ function(WalletStep) {
4812
- WalletStep["None"] = "NONE";
4813
- WalletStep["LearnCompact"] = "LEARN_COMPACT";
4814
- WalletStep["Connect"] = "CONNECT";
4815
- return WalletStep;
4816
- }({});
4817
4717
  function DesktopOptions({ onClose }) {
4818
4718
  const titleId = "rk_connect_title";
4819
4719
  const [selectedOptionId, setSelectedOptionId] = useState();
@@ -4821,7 +4721,7 @@ function DesktopOptions({ onClose }) {
4821
4721
  const [qrCodeUri, setQrCodeUri] = useState();
4822
4722
  const hasQrCode = !!selectedWallet?.qrCode && qrCodeUri;
4823
4723
  const [connectionError, setConnectionError] = useState(false);
4824
- const [walletStep, setWalletStep] = useState(WalletStep.None);
4724
+ const [walletStep, setWalletStep] = useState("NONE");
4825
4725
  const compactModeEnabled = useContext(ModalSizeContext) === ModalSizeOptions.COMPACT;
4826
4726
  const { disclaimer: Disclaimer } = useContext(AppContext);
4827
4727
  const safari = isSafari();
@@ -4858,7 +4758,7 @@ function DesktopOptions({ onClose }) {
4858
4758
  setQrCodeUri(uri);
4859
4759
  setTimeout(() => {
4860
4760
  setSelectedWallet(sWallet);
4861
- changeWalletStep(WalletStep.Connect);
4761
+ changeWalletStep("CONNECT");
4862
4762
  }, uri ? 0 : 50);
4863
4763
  };
4864
4764
  const selectWallet = async (wallet) => {
@@ -4877,7 +4777,7 @@ function DesktopOptions({ onClose }) {
4877
4777
  selectWalletRef.current = selectWallet;
4878
4778
  useEffect(() => {
4879
4779
  if (connector && !initialized.current) {
4880
- setWalletStep(WalletStep.Connect);
4780
+ setWalletStep("CONNECT");
4881
4781
  selectWalletRef.current?.(connector);
4882
4782
  initialized.current = true;
4883
4783
  }
@@ -4898,18 +4798,18 @@ function DesktopOptions({ onClose }) {
4898
4798
  setConnectionError(false);
4899
4799
  }, [walletStep, selectedWallet]);
4900
4800
  switch (walletStep) {
4901
- case WalletStep.None:
4801
+ case "NONE":
4902
4802
  walletContent = /* @__PURE__ */ jsx(ConnectModalIntro, { getWallet: () => window.open(GET_WALLET_URL, "_blank", "noopener,noreferrer") });
4903
4803
  break;
4904
- case WalletStep.LearnCompact:
4804
+ case "LEARN_COMPACT":
4905
4805
  walletContent = /* @__PURE__ */ jsx(ConnectModalIntro, {
4906
4806
  compactModeEnabled,
4907
4807
  getWallet: () => window.open(GET_WALLET_URL, "_blank", "noopener,noreferrer")
4908
4808
  });
4909
4809
  headerLabel = t("intro.title");
4910
- headerBackButtonLink = WalletStep.None;
4810
+ headerBackButtonLink = "NONE";
4911
4811
  break;
4912
- case WalletStep.Connect:
4812
+ case "CONNECT":
4913
4813
  walletContent = selectedWallet && /* @__PURE__ */ jsx(ConnectDetail, {
4914
4814
  compactModeEnabled,
4915
4815
  connectionError,
@@ -4919,7 +4819,7 @@ function DesktopOptions({ onClose }) {
4919
4819
  wallet: selectedWallet
4920
4820
  });
4921
4821
  headerLabel = hasQrCode && (selectedWallet.name === "WalletConnect" ? t("connect_scan.fallback_title") : t("connect_scan.title", { wallet: selectedWallet.name }));
4922
- headerBackButtonLink = compactModeEnabled ? connector ? null : WalletStep.None : null;
4822
+ headerBackButtonLink = compactModeEnabled ? connector ? null : "NONE" : null;
4923
4823
  headerBackButtonCallback = compactModeEnabled ? !connector ? clearSelectedWallet : () => {} : () => {};
4924
4824
  break;
4925
4825
  default: break;
@@ -4928,7 +4828,7 @@ function DesktopOptions({ onClose }) {
4928
4828
  display: "flex",
4929
4829
  flexDirection: "row",
4930
4830
  style: { maxHeight: compactModeEnabled ? 468 : 504 },
4931
- children: [(compactModeEnabled ? walletStep === WalletStep.None : true) && /* @__PURE__ */ jsxs(Box, {
4831
+ children: [(compactModeEnabled ? walletStep === "NONE" : true) && /* @__PURE__ */ jsxs(Box, {
4932
4832
  className: compactModeEnabled ? "_1c95jmh4" : "_1c95jmh3",
4933
4833
  display: "flex",
4934
4834
  flexDirection: "column",
@@ -4941,7 +4841,7 @@ function DesktopOptions({ onClose }) {
4941
4841
  compactModeEnabled && Disclaimer && /* @__PURE__ */ jsx(Box, {
4942
4842
  marginLeft: "16",
4943
4843
  width: "28",
4944
- children: /* @__PURE__ */ jsx(InfoButton, { onClick: () => changeWalletStep(WalletStep.LearnCompact) })
4844
+ children: /* @__PURE__ */ jsx(InfoButton, { onClick: () => changeWalletStep("LEARN_COMPACT") })
4945
4845
  }),
4946
4846
  compactModeEnabled && !Disclaimer && /* @__PURE__ */ jsx(Box, {
4947
4847
  marginLeft: "16",
@@ -5038,7 +4938,7 @@ function DesktopOptions({ onClose }) {
5038
4938
  hover: "grow"
5039
4939
  }),
5040
4940
  cursor: "pointer",
5041
- onClick: () => changeWalletStep(WalletStep.LearnCompact),
4941
+ onClick: () => changeWalletStep("LEARN_COMPACT"),
5042
4942
  paddingY: "4",
5043
4943
  style: { willChange: "transform" },
5044
4944
  transition: "default",
@@ -5052,7 +4952,7 @@ function DesktopOptions({ onClose }) {
5052
4952
  })]
5053
4953
  })] })
5054
4954
  ]
5055
- }), (compactModeEnabled ? walletStep !== WalletStep.None : true) && /* @__PURE__ */ jsxs(Fragment$1, { children: [!compactModeEnabled && /* @__PURE__ */ jsx(Box, {
4955
+ }), (compactModeEnabled ? walletStep !== "NONE" : true) && /* @__PURE__ */ jsxs(Fragment$1, { children: [!compactModeEnabled && /* @__PURE__ */ jsx(Box, {
5056
4956
  background: "generalBorder",
5057
4957
  minWidth: "1",
5058
4958
  width: "1"
@@ -5137,7 +5037,7 @@ const LoadingSpinner = ({ wallet }) => {
5137
5037
  const width = 80;
5138
5038
  const height = 80;
5139
5039
  const radiusFactor = 20;
5140
- const perimeter = 2 * (width + height - 4 * radiusFactor);
5040
+ const perimeter = 2 * (160 - 4 * radiusFactor);
5141
5041
  return /* @__PURE__ */ jsxs("svg", {
5142
5042
  className: spinner,
5143
5043
  viewBox: "0 0 86 86",
@@ -5458,7 +5358,7 @@ function ConnectOptions({ onClose }) {
5458
5358
  function ConnectModal({ onClose, open }) {
5459
5359
  const titleId = "rk_connect_title";
5460
5360
  const connectionStatus = useConnectionStatus();
5461
- const { disconnect } = useDisconnect();
5361
+ const { mutate: disconnect } = useDisconnect();
5462
5362
  const { isConnecting } = useConnection();
5463
5363
  const onAuthCancel = React.useCallback(() => {
5464
5364
  onClose();
@@ -5524,7 +5424,7 @@ function ModalProvider({ children }) {
5524
5424
  const connectionStatus = useConnectionStatus();
5525
5425
  const { chainId } = useConnection();
5526
5426
  const { chains } = useConfig();
5527
- const isCurrentChainSupported = chains.some((chain) => chain.id === chainId);
5427
+ const isCurrentChainSupported = isChainIdSupported(chains, chainId);
5528
5428
  const closeModals = useCallback(({ keepConnectModalOpen = false } = {}) => {
5529
5429
  if (!keepConnectModalOpen) closeConnectModal();
5530
5430
  closeAccountModal();
@@ -5549,7 +5449,7 @@ function ModalProvider({ children }) {
5549
5449
  connectModalOpen,
5550
5450
  isWalletConnectModalOpen,
5551
5451
  openAccountModal: isCurrentChainSupported && connectionStatus === "connected" ? openAccountModal : void 0,
5552
- openChainModal: connectionStatus === "connected" ? openChainModal : void 0,
5452
+ openChainModal: chains.length > 0 ? openChainModal : void 0,
5553
5453
  openConnectModal: connectionStatus === "disconnected" || connectionStatus === "unauthenticated" ? openConnectModal : void 0,
5554
5454
  setIsWalletConnectModalOpen
5555
5455
  }), [
@@ -5561,6 +5461,7 @@ function ModalProvider({ children }) {
5561
5461
  openChainModal,
5562
5462
  openConnectModal,
5563
5463
  isCurrentChainSupported,
5464
+ chains.length,
5564
5465
  isWalletConnectModalOpen
5565
5466
  ]),
5566
5467
  children: [
@@ -5623,10 +5524,10 @@ function useConnectModal() {
5623
5524
  const noop = () => {};
5624
5525
  function ConnectButtonRenderer({ children }) {
5625
5526
  const isMounted = useIsMounted();
5626
- const { address } = useConnection();
5627
- const { chainId } = useConnection();
5527
+ const { address, chainId: connectedChainId } = useConnection();
5528
+ const chainId = useSelectedChainId(connectedChainId);
5628
5529
  const { chains: wagmiChains } = useConfig();
5629
- const isCurrentChainSupported = wagmiChains.some((chain) => chain.id === chainId);
5530
+ const isConnectedChainSupported = connectedChainId ? isChainIdSupported(wagmiChains, connectedChainId) : true;
5630
5531
  const rainbowkitChainsById = useRainbowKitChainsById();
5631
5532
  const authenticationStatus = useAuthenticationStatus() ?? void 0;
5632
5533
  const rainbowKitChain = chainId ? rainbowkitChainsById[chainId] : void 0;
@@ -5671,7 +5572,7 @@ function ConnectButtonRenderer({ children }) {
5671
5572
  iconUrl: resolvedChainIconUrl,
5672
5573
  id: chainId,
5673
5574
  name: chainName,
5674
- unsupported: !isCurrentChainSupported
5575
+ unsupported: !isConnectedChainSupported
5675
5576
  } : void 0,
5676
5577
  chainModalOpen,
5677
5578
  connectModalOpen,
@@ -5713,6 +5614,59 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5713
5614
  return ready ? /* @__PURE__ */ jsx(ConnectButtonRenderer, { children: ({ account, chain, mounted, openAccountModal, openChainModal, openConnectModal }) => {
5714
5615
  const ready = mounted && connectionStatus !== "loading";
5715
5616
  const unsupportedChain = chain?.unsupported ?? false;
5617
+ const chainButton = chain && (chains.length > 1 || unsupportedChain) ? /* @__PURE__ */ jsxs(Box, {
5618
+ alignItems: "center",
5619
+ "aria-label": "Chain Selector",
5620
+ as: "button",
5621
+ background: unsupportedChain ? "connectButtonBackgroundError" : "connectButtonBackground",
5622
+ borderRadius: "connectButton",
5623
+ boxShadow: "connectButton",
5624
+ className: touchableStyles({
5625
+ active: "shrink",
5626
+ hover: "grow"
5627
+ }),
5628
+ color: unsupportedChain ? "connectButtonTextError" : "connectButtonText",
5629
+ display: mapResponsiveValue(chainStatus, (value) => value === "none" ? "none" : "flex"),
5630
+ fontFamily: "body",
5631
+ fontWeight: "bold",
5632
+ gap: "6",
5633
+ onClick: openChainModal,
5634
+ paddingX: "10",
5635
+ paddingY: "8",
5636
+ testId: unsupportedChain ? "wrong-network-button" : "chain-button",
5637
+ transition: "default",
5638
+ type: "button",
5639
+ children: [unsupportedChain ? /* @__PURE__ */ jsx(Box, {
5640
+ alignItems: "center",
5641
+ display: "flex",
5642
+ height: "24",
5643
+ paddingX: "4",
5644
+ children: t("connect_wallet.wrong_network.label")
5645
+ }) : /* @__PURE__ */ jsxs(Box, {
5646
+ alignItems: "center",
5647
+ display: "flex",
5648
+ gap: "6",
5649
+ children: [chain.hasIcon ? /* @__PURE__ */ jsx(Box, {
5650
+ display: mapResponsiveValue(chainStatus, (value) => value === "full" || value === "icon" ? "block" : "none"),
5651
+ height: "24",
5652
+ width: "24",
5653
+ children: /* @__PURE__ */ jsx(AsyncImage, {
5654
+ alt: chain.name ?? "Chain icon",
5655
+ background: chain.iconBackground,
5656
+ borderRadius: "full",
5657
+ height: "24",
5658
+ src: chain.iconUrl,
5659
+ width: "24"
5660
+ })
5661
+ }) : null, /* @__PURE__ */ jsx(Box, {
5662
+ display: mapResponsiveValue(chainStatus, (value) => {
5663
+ if (value === "icon" && !chain.iconUrl) return "block";
5664
+ return value === "full" || value === "name" ? "block" : "none";
5665
+ }),
5666
+ children: chain.name ?? chain.id
5667
+ })]
5668
+ }), /* @__PURE__ */ jsx(DropdownIcon, {})]
5669
+ }, unsupportedChain ? "unsupported" : "supported") : null;
5716
5670
  return /* @__PURE__ */ jsx(Box, {
5717
5671
  display: "flex",
5718
5672
  gap: "12",
@@ -5724,59 +5678,7 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5724
5678
  userSelect: "none"
5725
5679
  }
5726
5680
  },
5727
- children: ready && account && connectionStatus === "connected" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [chain && (chains.length > 1 || unsupportedChain) && /* @__PURE__ */ jsxs(Box, {
5728
- alignItems: "center",
5729
- "aria-label": "Chain Selector",
5730
- as: "button",
5731
- background: unsupportedChain ? "connectButtonBackgroundError" : "connectButtonBackground",
5732
- borderRadius: "connectButton",
5733
- boxShadow: "connectButton",
5734
- className: touchableStyles({
5735
- active: "shrink",
5736
- hover: "grow"
5737
- }),
5738
- color: unsupportedChain ? "connectButtonTextError" : "connectButtonText",
5739
- display: mapResponsiveValue(chainStatus, (value) => value === "none" ? "none" : "flex"),
5740
- fontFamily: "body",
5741
- fontWeight: "bold",
5742
- gap: "6",
5743
- onClick: openChainModal,
5744
- paddingX: "10",
5745
- paddingY: "8",
5746
- testId: unsupportedChain ? "wrong-network-button" : "chain-button",
5747
- transition: "default",
5748
- type: "button",
5749
- children: [unsupportedChain ? /* @__PURE__ */ jsx(Box, {
5750
- alignItems: "center",
5751
- display: "flex",
5752
- height: "24",
5753
- paddingX: "4",
5754
- children: t("connect_wallet.wrong_network.label")
5755
- }) : /* @__PURE__ */ jsxs(Box, {
5756
- alignItems: "center",
5757
- display: "flex",
5758
- gap: "6",
5759
- children: [chain.hasIcon ? /* @__PURE__ */ jsx(Box, {
5760
- display: mapResponsiveValue(chainStatus, (value) => value === "full" || value === "icon" ? "block" : "none"),
5761
- height: "24",
5762
- width: "24",
5763
- children: /* @__PURE__ */ jsx(AsyncImage, {
5764
- alt: chain.name ?? "Chain icon",
5765
- background: chain.iconBackground,
5766
- borderRadius: "full",
5767
- height: "24",
5768
- src: chain.iconUrl,
5769
- width: "24"
5770
- })
5771
- }) : null, /* @__PURE__ */ jsx(Box, {
5772
- display: mapResponsiveValue(chainStatus, (value) => {
5773
- if (value === "icon" && !chain.iconUrl) return "block";
5774
- return value === "full" || value === "name" ? "block" : "none";
5775
- }),
5776
- children: chain.name ?? chain.id
5777
- })]
5778
- }), /* @__PURE__ */ jsx(DropdownIcon, {})]
5779
- }, unsupportedChain ? "unsupported" : "supported"), !unsupportedChain && /* @__PURE__ */ jsxs(Box, {
5681
+ children: ready && account && connectionStatus === "connected" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [chainButton, !unsupportedChain && /* @__PURE__ */ jsxs(Box, {
5780
5682
  alignItems: "center",
5781
5683
  as: "button",
5782
5684
  background: "connectButtonBackground",
@@ -5835,7 +5737,7 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5835
5737
  })]
5836
5738
  })
5837
5739
  })]
5838
- })] }) : /* @__PURE__ */ jsx(Box, {
5740
+ })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [chainButton, /* @__PURE__ */ jsx(Box, {
5839
5741
  as: "button",
5840
5742
  background: "accentColor",
5841
5743
  borderRadius: "connectButton",
@@ -5854,7 +5756,7 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5854
5756
  transition: "default",
5855
5757
  type: "button",
5856
5758
  children: mounted && label === "Connect Wallet" ? t("connect_wallet.label") : label
5857
- }, "connect")
5759
+ }, "connect")] })
5858
5760
  });
5859
5761
  } }) : null;
5860
5762
  }
@@ -6020,4 +5922,4 @@ const WalletButton = ({ wallet }) => {
6020
5922
  WalletButton.Custom = WalletButtonRenderer;
6021
5923
 
6022
5924
  //#endregion
6023
- export { createAuthenticationAdapter as S, useTransactionStore as _, useConnectModal as a, EmojiAvatar as b, ChainModal as c, dialogContentMobile as d, RainbowKitProvider as f, cssObjectFromTheme as g, cssStringFromTheme as h, useChainModal as i, AccountModal as l, baseTheme as m, ConnectButton as n, MobileOptions as o, lightTheme as p, useAccountModal as r, DesktopOptions as s, WalletButton as t, dialogContent as u, useChainId as v, RainbowKitAuthenticationProvider as x, Avatar as y };
5925
+ export { createAuthenticationAdapter as S, useTransactionStore as _, useConnectModal as a, EmojiAvatar as b, ChainModal as c, dialogContentMobile as d, RainbowKitProvider as f, cssObjectFromTheme as g, cssStringFromTheme as h, useChainModal as i, AccountModal as l, baseTheme as m, ConnectButton as n, MobileOptions as o, lightTheme as p, useAccountModal as r, DesktopOptions as s, WalletButton as t, dialogContent as u, useChainId$1 as v, RainbowKitAuthenticationProvider as x, Avatar as y };
@@ -1,6 +1,6 @@
1
1
 
2
- import { a as ConnectButtonProps, d as RainbowKitProviderProps, i as ConnectButton, m as AvatarComponentProps, n as WalletButtonProps, p as AvatarComponent, t as WalletButton, u as RainbowKitProvider } from "../WalletButton-DkkREZEg.js";
3
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { a as ConnectButtonProps, d as RainbowKitProviderProps, i as ConnectButton, m as AvatarComponentProps, n as WalletButtonProps, p as AvatarComponent, t as WalletButton, u as RainbowKitProvider } from "../WalletButton-B-bj9FNL.js";
3
+ import React from "react";
4
4
 
5
5
  //#region src/components/Avatar/Avatar.d.ts
6
6
  interface AvatarProps {
@@ -14,7 +14,7 @@ declare function Avatar({
14
14
  imageUrl,
15
15
  loading,
16
16
  size
17
- }: AvatarProps): _$react_jsx_runtime0.JSX.Element;
17
+ }: AvatarProps): React.JSX.Element;
18
18
  //#endregion
19
19
  //#region src/components/Avatar/EmojiAvatar.d.ts
20
20
  declare const EmojiAvatar: AvatarComponent;
@@ -136,7 +136,7 @@ interface AccountModalProps {
136
136
  declare function AccountModal({
137
137
  onClose,
138
138
  open
139
- }: AccountModalProps): _$react_jsx_runtime0.JSX.Element | null;
139
+ }: AccountModalProps): React.JSX.Element | null;
140
140
  //#endregion
141
141
  //#region src/components/ChainModal/ChainModal.d.ts
142
142
  interface ChainModalProps {
@@ -146,6 +146,6 @@ interface ChainModalProps {
146
146
  declare function ChainModal({
147
147
  onClose,
148
148
  open
149
- }: ChainModalProps): _$react_jsx_runtime0.JSX.Element | null;
149
+ }: ChainModalProps): React.JSX.Element;
150
150
  //#endregion
151
151
  export { AccountModal, type AccountModalProps, Avatar, type AvatarProps, ChainModal, type ChainModalProps, ConnectButton, type ConnectButtonProps, EmojiAvatar, type AvatarComponentProps as EmojiAvatarProps, RainbowKitProvider, type RainbowKitProviderProps, WalletButton, type WalletButtonProps, emojiAvatarForAddress };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { b as EmojiAvatar, c as ChainModal, f as RainbowKitProvider, l as AccountModal, n as ConnectButton, t as WalletButton, y as Avatar } from "../WalletButton-DiROWLU6.js";
2
+ import { b as EmojiAvatar, c as ChainModal, f as RainbowKitProvider, l as AccountModal, n as ConnectButton, t as WalletButton, y as Avatar } from "../WalletButton-CsbqNc5l.js";
3
3
 
4
4
  //#region src/components/Avatar/emojiAvatarForAddress.ts
5
5
  const colors = [
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
 
2
- import { c as RainbowKitAuthenticationProvider, d as RainbowKitProviderProps, f as Theme, g as ThemeVars, h as DisclaimerComponent, i as ConnectButton, l as createAuthenticationAdapter, o as AuthenticationConfig, p as AvatarComponent, r as WalletButtonRendererProps, s as AuthenticationStatus, t as WalletButton, u as RainbowKitProvider } from "./WalletButton-DkkREZEg.js";
3
- import { a as WalletDetailsParams, i as Wallet, r as RainbowKitWalletConnectParameters, s as WalletList, t as CreateConnector } from "./Wallet-B3fOxQx_.js";
4
- import { ReactNode } from "react";
5
- import * as _$wagmi from "wagmi";
2
+ import { c as RainbowKitAuthenticationProvider, d as RainbowKitProviderProps, f as Theme, g as ThemeVars, h as DisclaimerComponent, i as ConnectButton, l as createAuthenticationAdapter, o as AuthenticationConfig, p as AvatarComponent, r as WalletButtonRendererProps, s as AuthenticationStatus, t as WalletButton, u as RainbowKitProvider } from "./WalletButton-B-bj9FNL.js";
3
+ import { a as WalletDetailsParams, i as Wallet, r as RainbowKitWalletConnectParameters, s as WalletList, t as CreateConnector } from "./Wallet-epUweMuA.js";
4
+ import React, { ReactNode } from "react";
6
5
  import { CreateConfigParameters, CreateConnectorFn } from "wagmi";
7
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
8
6
  import { Transport } from "viem";
9
7
  import { Chain } from "wagmi/chains";
10
8
 
@@ -35,7 +33,7 @@ declare const getDefaultConfig: <chains extends _chains, transports extends _tra
35
33
  projectId,
36
34
  walletConnectParameters,
37
35
  ...wagmiParameters
38
- }: GetDefaultConfigParameters<chains, transports>) => _$wagmi.Config<chains, transports, _$wagmi.CreateConnectorFn[]>;
36
+ }: GetDefaultConfigParameters<chains, transports>) => import("wagmi").Config<chains, transports, import("wagmi").CreateConnectorFn[]>;
39
37
  //#endregion
40
38
  //#region src/wallets/connectorsForWallets.d.ts
41
39
  interface ConnectorsForWalletsParameters {
@@ -171,6 +169,9 @@ declare const lightTheme: {
171
169
  selectedWallet: string;
172
170
  walletLogo: string;
173
171
  };
172
+ fonts: {
173
+ body: string;
174
+ };
174
175
  radii: {
175
176
  actionButton: string;
176
177
  connectButton: string;
@@ -178,9 +179,6 @@ declare const lightTheme: {
178
179
  modal: string;
179
180
  modalMobile: string;
180
181
  };
181
- fonts: {
182
- body: string;
183
- };
184
182
  blurs: {
185
183
  modalOverlay: string;
186
184
  };
@@ -235,6 +233,9 @@ declare const darkTheme: {
235
233
  selectedWallet: string;
236
234
  walletLogo: string;
237
235
  };
236
+ fonts: {
237
+ body: string;
238
+ };
238
239
  radii: {
239
240
  actionButton: string;
240
241
  connectButton: string;
@@ -242,9 +243,6 @@ declare const darkTheme: {
242
243
  modal: string;
243
244
  modalMobile: string;
244
245
  };
245
- fonts: {
246
- body: string;
247
- };
248
246
  blurs: {
249
247
  modalOverlay: string;
250
248
  };
@@ -299,6 +297,9 @@ declare const midnightTheme: {
299
297
  selectedWallet: string;
300
298
  walletLogo: string;
301
299
  };
300
+ fonts: {
301
+ body: string;
302
+ };
302
303
  radii: {
303
304
  actionButton: string;
304
305
  connectButton: string;
@@ -306,9 +307,6 @@ declare const midnightTheme: {
306
307
  modal: string;
307
308
  modalMobile: string;
308
309
  };
309
- fonts: {
310
- body: string;
311
- };
312
310
  blurs: {
313
311
  modalOverlay: string;
314
312
  };
@@ -335,14 +333,14 @@ declare function DesktopOptions({
335
333
  onClose
336
334
  }: {
337
335
  onClose: () => void;
338
- }): _$react_jsx_runtime0.JSX.Element;
336
+ }): React.JSX.Element;
339
337
  //#endregion
340
338
  //#region src/components/ConnectOptions/MobileOptions.d.ts
341
339
  declare function MobileOptions({
342
340
  onClose
343
341
  }: {
344
342
  onClose: () => void;
345
- }): _$react_jsx_runtime0.JSX.Element;
343
+ }): React.JSX.Element;
346
344
  //#endregion
347
345
  //#region src/__private__/index.d.ts
348
346
  declare const __private__: {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { S as createAuthenticationAdapter, _ as useTransactionStore, a as useConnectModal, d as dialogContentMobile, f as RainbowKitProvider, g as cssObjectFromTheme, h as cssStringFromTheme, i as useChainModal, m as baseTheme, n as ConnectButton, o as MobileOptions, p as lightTheme, r as useAccountModal, s as DesktopOptions, t as WalletButton, u as dialogContent, v as useChainId, x as RainbowKitAuthenticationProvider } from "./WalletButton-DiROWLU6.js";
3
- import { a as injectedWallet, i as getWalletConnectConnector, n as safeWallet, o as base, r as metaMaskWallet, t as walletConnectWallet } from "./walletConnectors-CvfKowGR.js";
2
+ import { S as createAuthenticationAdapter, _ as useTransactionStore, a as useConnectModal, d as dialogContentMobile, f as RainbowKitProvider, g as cssObjectFromTheme, h as cssStringFromTheme, i as useChainModal, m as baseTheme, n as ConnectButton, o as MobileOptions, p as lightTheme, r as useAccountModal, s as DesktopOptions, t as WalletButton, u as dialogContent, v as useChainId$1, x as RainbowKitAuthenticationProvider } from "./WalletButton-CsbqNc5l.js";
3
+ import { a as injectedWallet, i as getWalletConnectConnector, n as safeWallet, o as base, r as metaMaskWallet, t as walletConnectWallet } from "./walletConnectors-C02JPPxf.js";
4
4
  import { useCallback } from "react";
5
5
  import { createConfig, http, useConnection } from "wagmi";
6
6
 
@@ -167,7 +167,7 @@ function getDefaultWallets(parameters) {
167
167
  function useAddRecentTransaction() {
168
168
  const store = useTransactionStore();
169
169
  const { address } = useConnection();
170
- const chainId = useChainId();
170
+ const chainId = useChainId$1();
171
171
  return useCallback((transaction) => {
172
172
  if (!address || !chainId) throw new Error("No address or chain ID found");
173
173
  store.addTransaction(address, chainId, transaction);
@@ -11,7 +11,7 @@ const base = ({ appName, appIcon }) => {
11
11
  name: "Base",
12
12
  shortName: "Base",
13
13
  rdns: "app.base.account",
14
- iconUrl: async () => (await import("./base-BLNzR5ZY.js")).default,
14
+ iconUrl: async () => (await import("./base-CioEwoIx.js")).default,
15
15
  iconAccent: "#0000FF",
16
16
  iconBackground: "#0000FF",
17
17
  installed: true,
@@ -98,7 +98,7 @@ function getInjectedConnector({ flag, namespace, target }) {
98
98
  const injectedWallet = () => ({
99
99
  id: "injected",
100
100
  name: "Browser Wallet",
101
- iconUrl: async () => (await import("./injectedWallet-Dg7isXIs.js")).default,
101
+ iconUrl: async () => (await import("./injectedWallet-Bq0gF2WF.js")).default,
102
102
  iconBackground: "#fff",
103
103
  createConnector: getInjectedConnector({})
104
104
  });
@@ -159,7 +159,7 @@ const metaMaskWallet = ({ projectId, walletConnectParameters }) => ({
159
159
  name: "MetaMask Mobile",
160
160
  shortName: "MetaMask",
161
161
  rdns: "io.metamask.mobile",
162
- iconUrl: async () => (await import("./metaMaskWallet-r9D3peIN.js")).default,
162
+ iconUrl: async () => (await import("./metaMaskWallet-Rs3AEK6Y.js")).default,
163
163
  iconAccent: "#f6851a",
164
164
  iconBackground: "#fff",
165
165
  mobile: { getUri: (uri) => `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}` },
@@ -177,7 +177,7 @@ const safeWallet = () => ({
177
177
  name: "Safe",
178
178
  iconAccent: "#12ff80",
179
179
  iconBackground: "#fff",
180
- iconUrl: async () => (await import("./safeWallet-B3H2_qec.js")).default,
180
+ iconUrl: async () => (await import("./safeWallet-DTOh4YIR.js")).default,
181
181
  installed: !(typeof window === "undefined") && window?.parent !== window,
182
182
  createConnector: (walletDetails) => {
183
183
  return createConnector((config) => ({
@@ -195,7 +195,7 @@ const walletConnectWallet = ({ projectId, options }) => {
195
195
  id: "walletConnect",
196
196
  name: "WalletConnect",
197
197
  installed: void 0,
198
- iconUrl: async () => (await import("./walletConnectWallet-CMhOxkhx.js")).default,
198
+ iconUrl: async () => (await import("./walletConnectWallet-Bk6DMfRO.js")).default,
199
199
  iconBackground: "#3b99fc",
200
200
  qrCode: { getUri },
201
201
  createConnector: getWalletConnectConnector({
@@ -1,5 +1,5 @@
1
1
 
2
- import { c as walletConnectWallet, i as Wallet, n as DefaultWalletOptions } from "../../Wallet-B3fOxQx_.js";
2
+ import { c as walletConnectWallet, i as Wallet, n as DefaultWalletOptions } from "../../Wallet-epUweMuA.js";
3
3
  import { BaseAccountParameters } from "wagmi/connectors";
4
4
 
5
5
  //#region src/wallets/walletConnectors/base/base.d.ts
@@ -30,4 +30,4 @@ declare const metaMaskWallet: ({
30
30
  //#region src/wallets/walletConnectors/safeWallet/safeWallet.d.ts
31
31
  declare const safeWallet: () => Wallet;
32
32
  //#endregion
33
- export { base, baseAccount, injectedWallet, metaMaskWallet, safeWallet, walletConnectWallet };
33
+ export { BaseOptions, base, baseAccount, injectedWallet, metaMaskWallet, safeWallet, walletConnectWallet };
@@ -1,4 +1,4 @@
1
1
  "use client";
2
- import { a as injectedWallet, n as safeWallet, o as base, r as metaMaskWallet, s as baseAccount, t as walletConnectWallet } from "../../walletConnectors-CvfKowGR.js";
2
+ import { a as injectedWallet, n as safeWallet, o as base, r as metaMaskWallet, s as baseAccount, t as walletConnectWallet } from "../../walletConnectors-C02JPPxf.js";
3
3
 
4
4
  export { base, baseAccount, injectedWallet, metaMaskWallet, safeWallet, walletConnectWallet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solariskit",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "The best way to connect a wallet",
5
5
  "keywords": [
6
6
  "blockchain",
@@ -33,58 +33,77 @@
33
33
  "./components": "./dist/components/index.js"
34
34
  },
35
35
  "dependencies": {
36
- "@base-org/account": "^2.5.3",
37
- "@coinbase/wallet-sdk": "^4.3.7",
38
- "@safe-global/safe-apps-provider": "^0.18.6",
39
- "@safe-global/safe-apps-sdk": "^9.1.0",
40
36
  "@vanilla-extract/css": "1.20.1",
41
37
  "@vanilla-extract/dynamic": "2.1.5",
42
38
  "@vanilla-extract/sprinkles": "1.6.5",
43
- "@walletconnect/ethereum-provider": "^2.23.9",
44
39
  "clsx": "2.1.1",
45
40
  "cuer": "0.0.3",
46
- "react-remove-scroll": "2.7.2"
41
+ "qr": "0.5.5",
42
+ "react-remove-scroll": "2.7.2",
43
+ "@akshatmittal/polycons": "1.1.0"
47
44
  },
48
45
  "devDependencies": {
46
+ "@base-org/account": "^2.5.6",
49
47
  "@rollup/plugin-replace": "^6.0.3",
50
- "@tanstack/react-query": "^5.97.0",
48
+ "@safe-global/safe-apps-provider": "^0.18.6",
49
+ "@safe-global/safe-apps-sdk": "^9.1.0",
50
+ "@tanstack/react-query": "^5.100.14",
51
51
  "@testing-library/dom": "^10.4.1",
52
52
  "@testing-library/jest-dom": "^6.9.1",
53
53
  "@testing-library/react": "^16.3.2",
54
54
  "@testing-library/user-event": "^14.6.1",
55
55
  "@types/node": "^24.12.2",
56
56
  "@types/postcss-prefix-selector": "^1.16.3",
57
- "@types/react": "^19.2.14",
57
+ "@types/react": "^19.2.16",
58
58
  "@types/react-dom": "^19.2.3",
59
59
  "@vanilla-extract/css-utils": "0.1.6",
60
60
  "@vanilla-extract/private": "1.0.9",
61
61
  "@vanilla-extract/rollup-plugin": "^1.5.3",
62
62
  "@vanilla-extract/vite-plugin": "^5.2.2",
63
- "autoprefixer": "^10.4.27",
64
- "jsdom": "^29.0.2",
65
- "msw": "^2.14.3",
66
- "nock": "^14.0.14",
67
- "postcss": "^8.5.9",
63
+ "@walletconnect/ethereum-provider": "^2.23.9",
64
+ "autoprefixer": "^10.5.0",
65
+ "jsdom": "^29.1.1",
66
+ "msw": "^2.14.6",
67
+ "nock": "^14.0.15",
68
+ "postcss": "^8.5.15",
68
69
  "postcss-prefix-selector": "^2.1.1",
69
- "react": "^19.2.5",
70
- "react-dom": "^19.2.5",
71
- "tsdown": "^0.21.7",
72
- "typescript": "^6.0.2",
73
- "viem": "^2.47.12",
74
- "vite": "^8.0.8",
75
- "vitest": "^4.1.4",
76
- "wagmi": "^3.6.1",
70
+ "react": "^19.2.7",
71
+ "react-dom": "^19.2.7",
72
+ "tsdown": "^0.22.1",
73
+ "typescript": "^6.0.3",
74
+ "viem": "^2.52.0",
75
+ "vite": "^8.0.16",
76
+ "vitest": "^4.1.8",
77
+ "wagmi": "^3.6.16",
77
78
  "@workspace/typescript-config": "0.0.0"
78
79
  },
79
80
  "peerDependencies": {
81
+ "@base-org/account": "^2.5.1",
82
+ "@safe-global/safe-apps-provider": "^0.18.6",
83
+ "@safe-global/safe-apps-sdk": "^9.1.0",
80
84
  "@tanstack/react-query": ">=5.0.0",
81
- "react": ">=18",
82
- "react-dom": ">=18",
83
- "viem": "2.x",
85
+ "@walletconnect/ethereum-provider": "^2.21.1",
86
+ "react": "^18 || ^19",
87
+ "react-dom": "^18 || ^19",
88
+ "viem": "^2.0.0",
84
89
  "wagmi": "^3.0.0"
85
90
  },
91
+ "peerDependenciesMeta": {
92
+ "@base-org/account": {
93
+ "optional": true
94
+ },
95
+ "@safe-global/safe-apps-provider": {
96
+ "optional": true
97
+ },
98
+ "@safe-global/safe-apps-sdk": {
99
+ "optional": true
100
+ },
101
+ "@walletconnect/ethereum-provider": {
102
+ "optional": true
103
+ }
104
+ },
86
105
  "engines": {
87
- "node": ">=12.4"
106
+ "node": ">=24"
88
107
  },
89
108
  "scripts": {
90
109
  "build": "tsdown",
File without changes
File without changes
File without changes
File without changes