@spicenet-io/spiceflow-ui 1.2.2-0 → 1.2.3
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.
- package/dist/auth-dynamic.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/SpiceDeposit/SpiceDeposit.d.ts +2 -0
- package/dist/components/SpiceDeposit/index.d.ts +2 -2
- package/dist/index.cjs.js +11 -9
- package/dist/index.js +13 -11
- package/package.json +11 -11
- /package/dist/{Button-aWXByNBC.js → Button-RifBkofT.js} +0 -0
package/dist/auth-dynamic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React, { useEffect, useState, useCallback } from 'react';
|
|
4
|
-
import { c as createTheme, B as Button } from './Button-
|
|
4
|
+
import { c as createTheme, B as Button } from './Button-RifBkofT.js';
|
|
5
5
|
import { useDynamicContext, useConnectWithOtp } from '@dynamic-labs/sdk-react-core';
|
|
6
6
|
|
|
7
7
|
const Input = ({
|
package/dist/auth-privy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
|
-
import { B as Button, c as createTheme } from './Button-
|
|
4
|
+
import { B as Button, c as createTheme } from './Button-RifBkofT.js';
|
|
5
5
|
import { usePrivy, useLogin, useLogout } from '@privy-io/react-auth';
|
|
6
6
|
|
|
7
7
|
const PrivyLogin = ({
|
|
@@ -15,5 +15,7 @@ export interface SpiceDepositProps {
|
|
|
15
15
|
destinationTokenAddress?: string;
|
|
16
16
|
postDepositInstruction?: (bridgedAmount: string) => Promise<void> | void;
|
|
17
17
|
postDepositInstructionLabel?: string;
|
|
18
|
+
useInternalWagmi?: boolean;
|
|
18
19
|
}
|
|
20
|
+
export declare const SpiceDepositFlow: React.FC<SpiceDepositProps>;
|
|
19
21
|
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 } from "./SpiceDeposit";
|
|
5
|
-
export { SelectChainModal, ConnectWalletModal, DepositModal, SpiceDeposit };
|
|
4
|
+
import { SpiceDeposit, SpiceDepositFlow } from "./SpiceDeposit";
|
|
5
|
+
export { SelectChainModal, ConnectWalletModal, DepositModal, SpiceDeposit, SpiceDepositFlow, };
|
package/dist/index.cjs.js
CHANGED
|
@@ -2645,7 +2645,7 @@ const useWallet = () => {
|
|
|
2645
2645
|
};
|
|
2646
2646
|
};
|
|
2647
2647
|
|
|
2648
|
-
const RELAYER_API_URL = process.env.NEXT_PUBLIC_RELAYER_API_URL || "
|
|
2648
|
+
const RELAYER_API_URL = process.env.NEXT_PUBLIC_RELAYER_API_URL || "https://tx-api.spicenet.io";
|
|
2649
2649
|
class RelayerService {
|
|
2650
2650
|
constructor() {
|
|
2651
2651
|
this.baseUrl = RELAYER_API_URL;
|
|
@@ -6528,6 +6528,8 @@ const DepositModal = React.memo(
|
|
|
6528
6528
|
errorMessage = "Transaction rejected by user";
|
|
6529
6529
|
} else if (error2?.message?.includes("user rejected")) {
|
|
6530
6530
|
errorMessage = "Transaction rejected by user";
|
|
6531
|
+
} else if (error2?.message?.includes("does not match the target chain") || error2?.message?.includes("Current Chain ID")) {
|
|
6532
|
+
errorMessage = "Network mismatch detected. Please click the button again to proceed.";
|
|
6531
6533
|
} else if (error2 instanceof Error) {
|
|
6532
6534
|
errorMessage = error2.message;
|
|
6533
6535
|
} else if (typeof error2 === "string") {
|
|
@@ -7038,11 +7040,12 @@ const SpiceDepositFlow = ({
|
|
|
7038
7040
|
};
|
|
7039
7041
|
const SpiceDeposit = (props) => {
|
|
7040
7042
|
const context = React.useContext(SpiceFlowProviderContext);
|
|
7041
|
-
const { walletConnectProjectId } = props;
|
|
7043
|
+
const { walletConnectProjectId, useInternalWagmi = true } = props;
|
|
7042
7044
|
if (!context) {
|
|
7043
7045
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Error: SpiceDeposit must be used within SpiceFlowProvider" });
|
|
7044
7046
|
}
|
|
7045
7047
|
const wagmiConfig = React.useMemo(() => {
|
|
7048
|
+
if (!useInternalWagmi) return null;
|
|
7046
7049
|
const chains = [];
|
|
7047
7050
|
context.supportedChainIds.forEach((chainId) => {
|
|
7048
7051
|
const config = getChainConfig(chainId);
|
|
@@ -7070,13 +7073,9 @@ const SpiceDeposit = (props) => {
|
|
|
7070
7073
|
chains,
|
|
7071
7074
|
connectors: connectorsList,
|
|
7072
7075
|
transports,
|
|
7073
|
-
ssr: false
|
|
7074
|
-
storage: wagmi.createStorage({
|
|
7075
|
-
storage: typeof window !== "undefined" ? window.localStorage : void 0,
|
|
7076
|
-
key: "spiceflow.wagmi"
|
|
7077
|
-
})
|
|
7076
|
+
ssr: false
|
|
7078
7077
|
});
|
|
7079
|
-
}, [context.supportedChainIds, walletConnectProjectId]);
|
|
7078
|
+
}, [context.supportedChainIds, walletConnectProjectId, useInternalWagmi]);
|
|
7080
7079
|
const queryClient = React.useMemo(
|
|
7081
7080
|
() => new reactQuery.QueryClient({
|
|
7082
7081
|
defaultOptions: {
|
|
@@ -7088,7 +7087,10 @@ const SpiceDeposit = (props) => {
|
|
|
7088
7087
|
}),
|
|
7089
7088
|
[]
|
|
7090
7089
|
);
|
|
7091
|
-
|
|
7090
|
+
if (useInternalWagmi && wagmiConfig) {
|
|
7091
|
+
return /* @__PURE__ */ jsxRuntime.jsx(wagmi.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(SpiceDepositFlow, { ...props }) }) });
|
|
7092
|
+
}
|
|
7093
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SpiceDepositFlow, { ...props });
|
|
7092
7094
|
};
|
|
7093
7095
|
|
|
7094
7096
|
const BalanceSection = ({
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React, { useState, useRef, useEffect, useCallback, createContext, useContext, useTransition, forwardRef, createElement, useMemo } from 'react';
|
|
4
4
|
import { defineChain, createPublicClient, http, parseEther, parseUnits, encodeFunctionData } from 'viem';
|
|
5
|
-
import { c as createTheme, B as Button, d as defaultTheme } from './Button-
|
|
5
|
+
import { c as createTheme, B as Button, d as defaultTheme } from './Button-RifBkofT.js';
|
|
6
6
|
import { getBalance } from 'viem/actions';
|
|
7
7
|
import { basecampTestnet, citreaTestnet, baseSepolia, arbitrumSepolia, sepolia } from 'viem/chains';
|
|
8
8
|
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,
|
|
12
|
+
import { useAccount, useConnect, useDisconnect, useSwitchChain, useWalletClient, http as http$1, createConfig, 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';
|
|
@@ -2643,7 +2643,7 @@ const useWallet = () => {
|
|
|
2643
2643
|
};
|
|
2644
2644
|
};
|
|
2645
2645
|
|
|
2646
|
-
const RELAYER_API_URL = process.env.NEXT_PUBLIC_RELAYER_API_URL || "
|
|
2646
|
+
const RELAYER_API_URL = process.env.NEXT_PUBLIC_RELAYER_API_URL || "https://tx-api.spicenet.io";
|
|
2647
2647
|
class RelayerService {
|
|
2648
2648
|
constructor() {
|
|
2649
2649
|
this.baseUrl = RELAYER_API_URL;
|
|
@@ -6526,6 +6526,8 @@ const DepositModal = React.memo(
|
|
|
6526
6526
|
errorMessage = "Transaction rejected by user";
|
|
6527
6527
|
} else if (error2?.message?.includes("user rejected")) {
|
|
6528
6528
|
errorMessage = "Transaction rejected by user";
|
|
6529
|
+
} else if (error2?.message?.includes("does not match the target chain") || error2?.message?.includes("Current Chain ID")) {
|
|
6530
|
+
errorMessage = "Network mismatch detected. Please click the button again to proceed.";
|
|
6529
6531
|
} else if (error2 instanceof Error) {
|
|
6530
6532
|
errorMessage = error2.message;
|
|
6531
6533
|
} else if (typeof error2 === "string") {
|
|
@@ -7036,11 +7038,12 @@ const SpiceDepositFlow = ({
|
|
|
7036
7038
|
};
|
|
7037
7039
|
const SpiceDeposit = (props) => {
|
|
7038
7040
|
const context = useContext(SpiceFlowProviderContext);
|
|
7039
|
-
const { walletConnectProjectId } = props;
|
|
7041
|
+
const { walletConnectProjectId, useInternalWagmi = true } = props;
|
|
7040
7042
|
if (!context) {
|
|
7041
7043
|
return /* @__PURE__ */ jsx("div", { children: "Error: SpiceDeposit must be used within SpiceFlowProvider" });
|
|
7042
7044
|
}
|
|
7043
7045
|
const wagmiConfig = useMemo(() => {
|
|
7046
|
+
if (!useInternalWagmi) return null;
|
|
7044
7047
|
const chains = [];
|
|
7045
7048
|
context.supportedChainIds.forEach((chainId) => {
|
|
7046
7049
|
const config = getChainConfig(chainId);
|
|
@@ -7068,13 +7071,9 @@ const SpiceDeposit = (props) => {
|
|
|
7068
7071
|
chains,
|
|
7069
7072
|
connectors: connectorsList,
|
|
7070
7073
|
transports,
|
|
7071
|
-
ssr: false
|
|
7072
|
-
storage: createStorage({
|
|
7073
|
-
storage: typeof window !== "undefined" ? window.localStorage : void 0,
|
|
7074
|
-
key: "spiceflow.wagmi"
|
|
7075
|
-
})
|
|
7074
|
+
ssr: false
|
|
7076
7075
|
});
|
|
7077
|
-
}, [context.supportedChainIds, walletConnectProjectId]);
|
|
7076
|
+
}, [context.supportedChainIds, walletConnectProjectId, useInternalWagmi]);
|
|
7078
7077
|
const queryClient = useMemo(
|
|
7079
7078
|
() => new QueryClient({
|
|
7080
7079
|
defaultOptions: {
|
|
@@ -7086,7 +7085,10 @@ const SpiceDeposit = (props) => {
|
|
|
7086
7085
|
}),
|
|
7087
7086
|
[]
|
|
7088
7087
|
);
|
|
7089
|
-
|
|
7088
|
+
if (useInternalWagmi && wagmiConfig) {
|
|
7089
|
+
return /* @__PURE__ */ jsx(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(SpiceDepositFlow, { ...props }) }) });
|
|
7090
|
+
}
|
|
7091
|
+
return /* @__PURE__ */ jsx(SpiceDepositFlow, { ...props });
|
|
7090
7092
|
};
|
|
7091
7093
|
|
|
7092
7094
|
const BalanceSection = ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spicenet-io/spiceflow-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Spiceflow UI SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"tslib": "^2.8.1"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@dynamic-labs/ethereum": ">=3.9.13",
|
|
75
|
-
"@dynamic-labs/sdk-react-core": ">=3.9.13",
|
|
76
|
-
"@dynamic-labs/wallet-connector-core": ">=3.9.13",
|
|
77
|
-
"@privy-io/react-auth": ">=2.24.0",
|
|
74
|
+
"@dynamic-labs/ethereum": ">=3.9.13 <5.0.0",
|
|
75
|
+
"@dynamic-labs/sdk-react-core": ">=3.9.13 <5.0.0",
|
|
76
|
+
"@dynamic-labs/wallet-connector-core": ">=3.9.13 <5.0.0",
|
|
77
|
+
"@privy-io/react-auth": ">=2.24.0 <4.0.0",
|
|
78
78
|
"@tanstack/react-query": ">=5.0.0",
|
|
79
79
|
"axios": ">=1.0.0",
|
|
80
|
-
"react": "
|
|
81
|
-
"react-dom": "
|
|
80
|
+
"react": "^18.0.0",
|
|
81
|
+
"react-dom": "^18.0.0",
|
|
82
82
|
"spiceflow-core-test": ">=0.1.0",
|
|
83
83
|
"viem": ">=2.21.0",
|
|
84
84
|
"wagmi": ">=2.12.0"
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
114
114
|
"@tanstack/react-query": "^5.90.5",
|
|
115
115
|
"@types/node": "^24.3.0",
|
|
116
|
-
"@types/react": "^
|
|
117
|
-
"@types/react-dom": "^
|
|
116
|
+
"@types/react": "^18.3.3",
|
|
117
|
+
"@types/react-dom": "^18.3.0",
|
|
118
118
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
119
119
|
"@typescript-eslint/parser": "^6.0.0",
|
|
120
120
|
"eslint": "^8.45.0",
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
"postcss-import": "^16.1.1",
|
|
128
128
|
"prettier": "3.6.2",
|
|
129
129
|
"jest": "^29.6.0",
|
|
130
|
-
"react": "^
|
|
131
|
-
"react-dom": "^
|
|
130
|
+
"react": "^18.3.1",
|
|
131
|
+
"react-dom": "^18.3.1",
|
|
132
132
|
"rollup": "^4.50.0",
|
|
133
133
|
"rollup-plugin-copy": "^3.5.0",
|
|
134
134
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
File without changes
|