@spicenet-io/spiceflow-ui 1.2.0 → 1.2.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.
@@ -16,7 +16,4 @@ export interface SpiceDepositProps {
16
16
  postDepositInstruction?: (bridgedAmount: string) => Promise<void> | void;
17
17
  postDepositInstructionLabel?: string;
18
18
  }
19
- export declare const SpiceDepositFlow: React.FC<SpiceDepositProps>;
20
- export declare const SpiceDeposit: React.FC<SpiceDepositProps & {
21
- useInternalWagmi?: boolean;
22
- }>;
19
+ export declare const SpiceDeposit: React.FC<SpiceDepositProps>;
@@ -1,5 +1,5 @@
1
1
  import { SelectChainModal } from "./SelectChainModal";
2
2
  import { ConnectWalletModal } from "./ConnectWalletModal";
3
3
  import { DepositModal } from "./DepositModal";
4
- import { SpiceDeposit, SpiceDepositFlow } from "./SpiceDeposit";
5
- export { SelectChainModal, ConnectWalletModal, DepositModal, SpiceDeposit, SpiceDepositFlow };
4
+ import { SpiceDeposit } from "./SpiceDeposit";
5
+ export { SelectChainModal, ConnectWalletModal, DepositModal, SpiceDeposit };
package/dist/index.cjs.js CHANGED
@@ -7038,12 +7038,11 @@ const SpiceDepositFlow = ({
7038
7038
  };
7039
7039
  const SpiceDeposit = (props) => {
7040
7040
  const context = React.useContext(SpiceFlowProviderContext);
7041
- const { walletConnectProjectId, useInternalWagmi = true } = props;
7041
+ const { walletConnectProjectId } = props;
7042
7042
  if (!context) {
7043
7043
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Error: SpiceDeposit must be used within SpiceFlowProvider" });
7044
7044
  }
7045
7045
  const wagmiConfig = React.useMemo(() => {
7046
- if (!useInternalWagmi) return null;
7047
7046
  const chains = [];
7048
7047
  context.supportedChainIds.forEach((chainId) => {
7049
7048
  const config = getChainConfig(chainId);
@@ -7071,9 +7070,13 @@ const SpiceDeposit = (props) => {
7071
7070
  chains,
7072
7071
  connectors: connectorsList,
7073
7072
  transports,
7074
- ssr: false
7073
+ ssr: false,
7074
+ storage: wagmi.createStorage({
7075
+ storage: typeof window !== "undefined" ? window.localStorage : void 0,
7076
+ key: "spiceflow.wagmi"
7077
+ })
7075
7078
  });
7076
- }, [context.supportedChainIds, walletConnectProjectId, useInternalWagmi]);
7079
+ }, [context.supportedChainIds, walletConnectProjectId]);
7077
7080
  const queryClient = React.useMemo(
7078
7081
  () => new reactQuery.QueryClient({
7079
7082
  defaultOptions: {
@@ -7085,10 +7088,7 @@ const SpiceDeposit = (props) => {
7085
7088
  }),
7086
7089
  []
7087
7090
  );
7088
- if (useInternalWagmi && wagmiConfig) {
7089
- return /* @__PURE__ */ jsxRuntime.jsx(wagmi.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(SpiceDepositFlow, { ...props }) }) });
7090
- }
7091
- return /* @__PURE__ */ jsxRuntime.jsx(SpiceDepositFlow, { ...props });
7091
+ return /* @__PURE__ */ jsxRuntime.jsx(wagmi.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(SpiceDepositFlow, { ...props }) }) });
7092
7092
  };
7093
7093
 
7094
7094
  const BalanceSection = ({
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { createPortal } from 'react-dom';
9
9
  import { usePrivy, useWallets, useSign7702Authorization, useSignMessage, useSendTransaction } from '@privy-io/react-auth';
10
10
  import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
11
11
  import { getAccountNonce, hashChainBatches, getAuthorizationHash } from 'spiceflow-core-test';
12
- import { useAccount, useConnect, useDisconnect, useSwitchChain, useWalletClient, http as http$1, createConfig, WagmiProvider } from 'wagmi';
12
+ import { useAccount, useConnect, useDisconnect, useSwitchChain, useWalletClient, http as http$1, createConfig, createStorage, WagmiProvider } from 'wagmi';
13
13
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
14
14
  import { sepolia as sepolia$1, arbitrumSepolia as arbitrumSepolia$1 } from 'wagmi/chains';
15
15
  import { metaMask, walletConnect } from 'wagmi/connectors';
@@ -7036,12 +7036,11 @@ const SpiceDepositFlow = ({
7036
7036
  };
7037
7037
  const SpiceDeposit = (props) => {
7038
7038
  const context = useContext(SpiceFlowProviderContext);
7039
- const { walletConnectProjectId, useInternalWagmi = true } = props;
7039
+ const { walletConnectProjectId } = props;
7040
7040
  if (!context) {
7041
7041
  return /* @__PURE__ */ jsx("div", { children: "Error: SpiceDeposit must be used within SpiceFlowProvider" });
7042
7042
  }
7043
7043
  const wagmiConfig = useMemo(() => {
7044
- if (!useInternalWagmi) return null;
7045
7044
  const chains = [];
7046
7045
  context.supportedChainIds.forEach((chainId) => {
7047
7046
  const config = getChainConfig(chainId);
@@ -7069,9 +7068,13 @@ const SpiceDeposit = (props) => {
7069
7068
  chains,
7070
7069
  connectors: connectorsList,
7071
7070
  transports,
7072
- ssr: false
7071
+ ssr: false,
7072
+ storage: createStorage({
7073
+ storage: typeof window !== "undefined" ? window.localStorage : void 0,
7074
+ key: "spiceflow.wagmi"
7075
+ })
7073
7076
  });
7074
- }, [context.supportedChainIds, walletConnectProjectId, useInternalWagmi]);
7077
+ }, [context.supportedChainIds, walletConnectProjectId]);
7075
7078
  const queryClient = useMemo(
7076
7079
  () => new QueryClient({
7077
7080
  defaultOptions: {
@@ -7083,10 +7086,7 @@ const SpiceDeposit = (props) => {
7083
7086
  }),
7084
7087
  []
7085
7088
  );
7086
- if (useInternalWagmi && wagmiConfig) {
7087
- return /* @__PURE__ */ jsx(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(SpiceDepositFlow, { ...props }) }) });
7088
- }
7089
- return /* @__PURE__ */ jsx(SpiceDepositFlow, { ...props });
7089
+ return /* @__PURE__ */ jsx(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(SpiceDepositFlow, { ...props }) }) });
7090
7090
  };
7091
7091
 
7092
7092
  const BalanceSection = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.2-0",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",