@reef-knot/core-react 6.2.4 → 7.0.0-alpha.1

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,63 +1,35 @@
1
- import { __awaiter } from '../_virtual/_tslib.js';
2
- import { useEffect } from 'react';
3
- import { useConfig, useReconnect, useAccount } from 'wagmi';
4
- import { useEagerConnect } from './useEagerConnect.js';
5
- import { checkTermsAccepted } from '../helpers/checkTermsAccepted.js';
6
- import { useReefKnotContext } from './useReefKnotContext.js';
7
- import { LS_KEY_RECONNECT_WALLET_ID } from '../constants/localStorage.js';
8
- import { withCallback } from '../helpers/withCallback.js';
1
+ import { useReefKnotContext } from "./useReefKnotContext.js";
2
+ import { LS_KEY_RECONNECT_WALLET_ID } from "../constants/localStorage.js";
3
+ import { checkTermsAccepted } from "../helpers/checkTermsAccepted.js";
4
+ import { useEagerConnect } from "./useEagerConnect.js";
5
+ import { withCallback } from "../helpers/withCallback.js";
6
+ import { useEffect } from "react";
7
+ import { useConfig, useConnection, useReconnect } from "wagmi";
9
8
 
10
- const useAutoConnect = autoConnectEnabled => {
11
- const {
12
- storage
13
- } = useConfig();
14
- const {
15
- reconnectAsync
16
- } = useReconnect();
17
- const {
18
- isConnected
19
- } = useAccount();
20
- const {
21
- eagerConnect
22
- } = useEagerConnect();
23
- const {
24
- walletDataList,
25
- onReconnect
26
- } = useReefKnotContext();
27
- useEffect(() => {
28
- const tryReconnect = () => __awaiter(void 0, void 0, void 0, function* () {
29
- var _a, _b;
30
- // Don't auto-connect if already connected or if the auto-connect feature is disabled
31
- if (isConnected || !autoConnectEnabled) return;
32
- // Try to eagerly connect wallets that are meant to be used only with auto-connection.
33
- // For example, wallets with dApp browsers, or using iframes to open dApps.
34
- const connectResult = yield eagerConnect();
35
- // If still not connected and there were no errors and the terms of service are accepted,
36
- // call the default wagmi autoConnect method, which attempts to connect to the last used connector.
37
- if (!connectResult && checkTermsAccepted() && (
38
- // We do not want to reconnect if the `recentConnectorId` item was deleted during disconnect
39
- yield storage === null || storage === void 0 ? void 0 : storage.getItem('recentConnectorId'))) {
40
- const savedReconnectWalletId = yield storage === null || storage === void 0 ? void 0 : storage.getItem(LS_KEY_RECONNECT_WALLET_ID);
41
- const walletData = walletDataList.find(data => data.walletId === savedReconnectWalletId);
42
- if (walletData) {
43
- let createConnectorFn = walletData.createConnectorFn;
44
- if ((_b = (_a = walletData === null || walletData === void 0 ? void 0 : walletData.walletconnectExtras) === null || _a === void 0 ? void 0 : _a.connectionViaURI) === null || _b === void 0 ? void 0 : _b.condition) {
45
- createConnectorFn = walletData.walletconnectExtras.connectionViaURI.createConnectorFn;
46
- }
47
- // Wait for all EIP-6963 wallets to load their code and fire "eip6963:announceProvider" event
48
- // Without the delay, this code can be called from a browser's cache faster than wallet extension code
49
- yield new Promise(resolve => setTimeout(resolve, 100));
50
- const reconnectWithCallback = withCallback(reconnectAsync, onReconnect);
51
- yield reconnectWithCallback({
52
- connectors: [createConnectorFn]
53
- });
54
- }
55
- }
56
- });
57
- void tryReconnect();
58
- // No hook deps: do not retry the auto-connect attemption.
59
- // eslint-disable-next-line react-hooks/exhaustive-deps
60
- }, []);
9
+ //#region src/hooks/useAutoConnect.ts
10
+ const useAutoConnect = (autoConnectEnabled) => {
11
+ const { storage } = useConfig();
12
+ const { mutateAsync: reconnectAsync } = useReconnect();
13
+ const { isConnected } = useConnection();
14
+ const { eagerConnect } = useEagerConnect();
15
+ const { walletDataList, onReconnect } = useReefKnotContext();
16
+ useEffect(() => {
17
+ const tryReconnect = async () => {
18
+ if (isConnected || !autoConnectEnabled) return;
19
+ if (!await eagerConnect() && checkTermsAccepted() && await storage?.getItem("recentConnectorId")) {
20
+ const savedReconnectWalletId = await storage?.getItem(LS_KEY_RECONNECT_WALLET_ID);
21
+ const walletData = walletDataList.find((data) => data.walletId === savedReconnectWalletId);
22
+ if (walletData) {
23
+ let createConnectorFn = walletData.createConnectorFn;
24
+ if (walletData?.walletconnectExtras?.connectionViaURI?.condition) createConnectorFn = walletData.walletconnectExtras.connectionViaURI.createConnectorFn;
25
+ await new Promise((resolve) => setTimeout(resolve, 100));
26
+ await withCallback(reconnectAsync, onReconnect)({ connectors: [createConnectorFn] });
27
+ }
28
+ }
29
+ };
30
+ tryReconnect();
31
+ }, []);
61
32
  };
62
33
 
63
- export { useAutoConnect };
34
+ //#endregion
35
+ export { useAutoConnect };
@@ -1,23 +1,17 @@
1
- import { __awaiter } from '../_virtual/_tslib.js';
2
- import { useCallback } from 'react';
3
- import { useReefKnotContext } from './useReefKnotContext.js';
1
+ import { useReefKnotContext } from "./useReefKnotContext.js";
2
+ import { useCallback } from "react";
4
3
 
4
+ //#region src/hooks/useAutoConnectCheck.ts
5
5
  const useAutoConnectCheck = () => {
6
- const {
7
- walletDataList
8
- } = useReefKnotContext();
9
- const checkIfShouldAutoConnect = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
10
- var _a;
11
- for (const adapter of walletDataList) {
12
- if (!adapter.autoConnectOnly) continue;
13
- // Try to detect at least one wallet, marked as for auto connection only
14
- if (yield (_a = adapter.detector) === null || _a === void 0 ? void 0 : _a.call(adapter)) return true;
15
- }
16
- return false;
17
- }), [walletDataList]);
18
- return {
19
- checkIfShouldAutoConnect
20
- };
6
+ const { walletDataList } = useReefKnotContext();
7
+ return { checkIfShouldAutoConnect: useCallback(async () => {
8
+ for (const adapter of walletDataList) {
9
+ if (!adapter.autoConnectOnly) continue;
10
+ if (await adapter.detector?.()) return true;
11
+ }
12
+ return false;
13
+ }, [walletDataList]) };
21
14
  };
22
15
 
23
- export { useAutoConnectCheck };
16
+ //#endregion
17
+ export { useAutoConnectCheck };
@@ -1,34 +1,22 @@
1
- import { __awaiter } from '../_virtual/_tslib.js';
2
- import { useCallback } from 'react';
3
- import { useAutoConnectCheck } from './useAutoConnectCheck.js';
4
- import { useEagerConnect } from './useEagerConnect.js';
5
- import { useReefKnotModal } from './useReefKnotModal.js';
1
+ import { useReefKnotModal } from "./useReefKnotModal.js";
2
+ import { useEagerConnect } from "./useEagerConnect.js";
3
+ import { useAutoConnectCheck } from "./useAutoConnectCheck.js";
4
+ import { useCallback } from "react";
6
5
 
6
+ //#region src/hooks/useConnect.ts
7
7
  const useConnect = () => {
8
- const {
9
- openModalAsync
10
- } = useReefKnotModal();
11
- const {
12
- checkIfShouldAutoConnect
13
- } = useAutoConnectCheck();
14
- const {
15
- eagerConnect
16
- } = useEagerConnect();
17
- const connect = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
18
- if (yield checkIfShouldAutoConnect()) {
19
- const result = yield eagerConnect();
20
- return {
21
- success: !!result
22
- };
23
- } else {
24
- return openModalAsync({
25
- type: 'wallet'
26
- });
27
- }
28
- }), [checkIfShouldAutoConnect, eagerConnect, openModalAsync]);
29
- return {
30
- connect
31
- };
8
+ const { openModalAsync } = useReefKnotModal();
9
+ const { checkIfShouldAutoConnect } = useAutoConnectCheck();
10
+ const { eagerConnect } = useEagerConnect();
11
+ return { connect: useCallback(async () => {
12
+ if (await checkIfShouldAutoConnect()) return { success: !!await eagerConnect() };
13
+ else return openModalAsync({ type: "wallet" });
14
+ }, [
15
+ checkIfShouldAutoConnect,
16
+ eagerConnect,
17
+ openModalAsync
18
+ ]) };
32
19
  };
33
20
 
34
- export { useConnect };
21
+ //#endregion
22
+ export { useConnect };
@@ -1,29 +1,24 @@
1
- import { useAccount } from 'wagmi';
2
- import { idLedgerHid, idLedgerLive } from '@reef-knot/ledger-connector';
3
- import { hasInjected, isDappBrowserProvider } from '../helpers/providerDetectors.js';
1
+ import { hasInjected, isDappBrowserProvider } from "../helpers/providerDetectors.js";
2
+ import { useConnection } from "wagmi";
3
+ import { idLedgerHid, idLedgerLive } from "@reef-knot/ledger-connector";
4
4
 
5
+ //#region src/hooks/useConnectorInfo.ts
5
6
  const useConnectorInfo = () => {
6
- const {
7
- connector
8
- } = useAccount();
9
- // These checks are working only for connected wallets! There is no connector if a wallet is not connected yet.
10
- const isLedger = Boolean((connector === null || connector === void 0 ? void 0 : connector.id) === idLedgerHid);
11
- const isLedgerLive = Boolean((connector === null || connector === void 0 ? void 0 : connector.id) === idLedgerLive);
12
- const isGnosis = Boolean((connector === null || connector === void 0 ? void 0 : connector.id) === 'safe');
13
- const isInjected = hasInjected();
14
- const isDappBrowser = isDappBrowserProvider();
15
- // Do not set connector's name if the app is opened in a mobile wallet dapp browser,
16
- // because we use a generic injected connector for this case and proper detection is hard.
17
- // Also, it will be easy for a user to understand which wallet app is being used for connection.
18
- const connectorName = isDappBrowser ? undefined : connector === null || connector === void 0 ? void 0 : connector.name;
19
- return {
20
- connectorName,
21
- isGnosis,
22
- isLedger,
23
- isLedgerLive,
24
- isDappBrowser,
25
- isInjected
26
- };
7
+ const { connector } = useConnection();
8
+ const isLedger = Boolean(connector?.id === idLedgerHid);
9
+ const isLedgerLive = Boolean(connector?.id === idLedgerLive);
10
+ const isGnosis = Boolean(connector?.id === "safe");
11
+ const isInjected = hasInjected();
12
+ const isDappBrowser = isDappBrowserProvider();
13
+ return {
14
+ connectorName: isDappBrowser ? void 0 : connector?.name,
15
+ isGnosis,
16
+ isLedger,
17
+ isLedgerLive,
18
+ isDappBrowser,
19
+ isInjected
20
+ };
27
21
  };
28
22
 
29
- export { useConnectorInfo };
23
+ //#endregion
24
+ export { useConnectorInfo };
@@ -1,54 +1,44 @@
1
- import { useCallback, useMemo } from 'react';
2
- import { useAccount, useConfig, useDisconnect as useDisconnect$1 } from 'wagmi';
3
- import { useReefKnotContext } from './useReefKnotContext.js';
4
- import { useReefKnotModal } from './useReefKnotModal.js';
5
- import { LS_KEY_RECONNECT_WALLET_ID } from '../constants/localStorage.js';
1
+ import { useReefKnotContext } from "./useReefKnotContext.js";
2
+ import { LS_KEY_RECONNECT_WALLET_ID } from "../constants/localStorage.js";
3
+ import { useReefKnotModal } from "./useReefKnotModal.js";
4
+ import { useCallback, useMemo } from "react";
5
+ import { useConfig, useConnection, useDisconnect } from "wagmi";
6
6
 
7
+ //#region src/hooks/useDisconnect.ts
7
8
  const useDisconnectCleaningStorage = () => {
8
- const {
9
- storage
10
- } = useConfig();
11
- const {
12
- disconnect
13
- } = useDisconnect$1();
14
- return useCallback((...args) => {
15
- disconnect(...args);
16
- void (storage === null || storage === void 0 ? void 0 : storage.removeItem('recentConnectorId'));
17
- void (storage === null || storage === void 0 ? void 0 : storage.removeItem(LS_KEY_RECONNECT_WALLET_ID));
18
- }, [disconnect, storage]);
9
+ const { storage } = useConfig();
10
+ const { mutate: disconnect } = useDisconnect();
11
+ return useCallback((...args) => {
12
+ disconnect(...args);
13
+ storage?.removeItem("recentConnectorId");
14
+ storage?.removeItem(LS_KEY_RECONNECT_WALLET_ID);
15
+ }, [disconnect, storage]);
19
16
  };
20
17
  const useForceDisconnect = () => {
21
- const disconnect = useDisconnectCleaningStorage();
22
- const {
23
- forceCloseAllModals
24
- } = useReefKnotModal();
25
- const forceDisconnect = useCallback(() => {
26
- forceCloseAllModals();
27
- disconnect();
28
- }, [disconnect, forceCloseAllModals]);
29
- return {
30
- forceDisconnect
31
- };
18
+ const disconnect = useDisconnectCleaningStorage();
19
+ const { forceCloseAllModals } = useReefKnotModal();
20
+ return { forceDisconnect: useCallback(() => {
21
+ forceCloseAllModals();
22
+ disconnect();
23
+ }, [disconnect, forceCloseAllModals]) };
32
24
  };
33
- const useDisconnect = () => {
34
- const {
35
- isConnected,
36
- connector
37
- } = useAccount();
38
- const disconnect = useDisconnectCleaningStorage();
39
- const {
40
- walletDataList
41
- } = useReefKnotContext();
42
- const isDisconnectMakesSense = useMemo(() => {
43
- // It doesn't make sense to offer a user the ability to disconnect if the user is not connected yet,
44
- // or if the user was connected automatically
45
- const connectorData = walletDataList.find(c => c.walletId === (connector === null || connector === void 0 ? void 0 : connector.id));
46
- return isConnected && !(connectorData === null || connectorData === void 0 ? void 0 : connectorData.autoConnectOnly);
47
- }, [isConnected, connector, walletDataList]);
48
- return {
49
- disconnect: isDisconnectMakesSense ? disconnect : undefined,
50
- isDisconnectMakesSense
51
- };
25
+ const useDisconnect$1 = () => {
26
+ const { isConnected, connector } = useConnection();
27
+ const disconnect = useDisconnectCleaningStorage();
28
+ const { walletDataList } = useReefKnotContext();
29
+ const isDisconnectMakesSense = useMemo(() => {
30
+ const connectorData = walletDataList.find((c) => c.walletId === connector?.id);
31
+ return isConnected && !connectorData?.autoConnectOnly;
32
+ }, [
33
+ isConnected,
34
+ connector,
35
+ walletDataList
36
+ ]);
37
+ return {
38
+ disconnect: isDisconnectMakesSense ? disconnect : void 0,
39
+ isDisconnectMakesSense
40
+ };
52
41
  };
53
42
 
54
- export { useDisconnect, useForceDisconnect };
43
+ //#endregion
44
+ export { useDisconnect$1 as useDisconnect, useForceDisconnect };
@@ -1,77 +1,54 @@
1
- import { __awaiter } from '../_virtual/_tslib.js';
2
- import { useCallback } from 'react';
3
- import { useConfig } from 'wagmi';
4
- import { useReefKnotContext } from './useReefKnotContext.js';
5
- import { useReefKnotModal } from './useReefKnotModal.js';
6
- import { connect } from 'wagmi/actions';
7
- import { checkTermsAccepted } from '../helpers/checkTermsAccepted.js';
1
+ import { useReefKnotContext } from "./useReefKnotContext.js";
2
+ import { useReefKnotModal } from "./useReefKnotModal.js";
3
+ import { checkTermsAccepted } from "../helpers/checkTermsAccepted.js";
4
+ import { useCallback } from "react";
5
+ import { useConfig } from "wagmi";
6
+ import { connect } from "wagmi/actions";
8
7
 
9
- const connectEagerly = (config, adapters, openModalAsync) => __awaiter(void 0, void 0, void 0, function* () {
10
- var _a;
11
- const isTermsAccepted = checkTermsAccepted();
12
- for (const adapter of adapters) {
13
- if (yield (_a = adapter.detector) === null || _a === void 0 ? void 0 : _a.call(adapter)) {
14
- // wallet is detected
15
- let connectionResult = null;
16
- const tryConnection = () => __awaiter(void 0, void 0, void 0, function* () {
17
- const result = yield connect(config, {
18
- connector: adapter.createConnectorFn
19
- });
20
- connectionResult = result;
21
- return result;
22
- });
23
- // if terms are not accepted, show modal and wait for user to try to connect from it
24
- if (!isTermsAccepted) {
25
- // Terms of service were not accepted previously.
26
- // So, for legal reasons, we must ask a user to accept the terms before connecting.
27
- yield openModalAsync({
28
- type: 'eager',
29
- props: {
30
- tryConnection
31
- }
32
- });
33
- } else {
34
- // happy path - try connection
35
- try {
36
- yield tryConnection();
37
- } catch (e) {
38
- // when failed, open the terms modal, allow user to see the error and retry the connection
39
- yield openModalAsync({
40
- type: 'eager',
41
- props: {
42
- tryConnection,
43
- initialError: e
44
- }
45
- });
46
- }
47
- }
48
- return connectionResult;
49
- }
50
- }
51
- return null;
52
- });
8
+ //#region src/hooks/useEagerConnect.ts
9
+ const connectEagerly = async (config, adapters, openModalAsync) => {
10
+ const isTermsAccepted = checkTermsAccepted();
11
+ for (const adapter of adapters) if (await adapter.detector?.()) {
12
+ let connectionResult = null;
13
+ const tryConnection = async () => {
14
+ const result = await connect(config, { connector: adapter.createConnectorFn });
15
+ connectionResult = result;
16
+ return result;
17
+ };
18
+ if (!isTermsAccepted) await openModalAsync({
19
+ type: "eager",
20
+ props: { tryConnection }
21
+ });
22
+ else try {
23
+ await tryConnection();
24
+ } catch (e) {
25
+ await openModalAsync({
26
+ type: "eager",
27
+ props: {
28
+ tryConnection,
29
+ initialError: e
30
+ }
31
+ });
32
+ }
33
+ return connectionResult;
34
+ }
35
+ return null;
36
+ };
53
37
  const useEagerConnect = () => {
54
- const config = useConfig();
55
- const {
56
- openModalAsync
57
- } = useReefKnotModal();
58
- const {
59
- walletDataList,
60
- onAutoConnect
61
- } = useReefKnotContext();
62
- const eagerConnect = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
63
- const autoConnectOnlyAdapters = walletDataList.filter(({
64
- autoConnectOnly
65
- }) => autoConnectOnly);
66
- const connectionResult = yield connectEagerly(config, autoConnectOnlyAdapters, openModalAsync);
67
- if (connectionResult && onAutoConnect) {
68
- onAutoConnect();
69
- }
70
- return connectionResult;
71
- }), [openModalAsync, walletDataList, config, onAutoConnect]);
72
- return {
73
- eagerConnect
74
- };
38
+ const config = useConfig();
39
+ const { openModalAsync } = useReefKnotModal();
40
+ const { walletDataList, onAutoConnect } = useReefKnotContext();
41
+ return { eagerConnect: useCallback(async () => {
42
+ const connectionResult = await connectEagerly(config, walletDataList.filter(({ autoConnectOnly }) => autoConnectOnly), openModalAsync);
43
+ if (connectionResult && onAutoConnect) onAutoConnect();
44
+ return connectionResult;
45
+ }, [
46
+ openModalAsync,
47
+ walletDataList,
48
+ config,
49
+ onAutoConnect
50
+ ]) };
75
51
  };
76
52
 
77
- export { connectEagerly, useEagerConnect };
53
+ //#endregion
54
+ export { connectEagerly, useEagerConnect };
@@ -1,6 +1,8 @@
1
- import { useContext } from 'react';
2
- import { ReefKnotContext } from '../context/reefKnotContext.js';
1
+ import { ReefKnotContext } from "../context/reefKnotContext.js";
2
+ import { useContext } from "react";
3
3
 
4
+ //#region src/hooks/useReefKnotContext.ts
4
5
  const useReefKnotContext = () => useContext(ReefKnotContext);
5
6
 
6
- export { useReefKnotContext };
7
+ //#endregion
8
+ export { useReefKnotContext };
@@ -1,10 +1,12 @@
1
- import { useContext } from 'react';
2
- import { ReefKnotModalContext } from '../context/reefKnotModalContext.js';
1
+ import { ReefKnotModalContext } from "../context/reefKnotModalContext.js";
2
+ import { useContext } from "react";
3
3
 
4
+ //#region src/hooks/useReefKnotModal.ts
4
5
  const useReefKnotModal = () => {
5
- const value = useContext(ReefKnotModalContext);
6
- if (!value) throw new Error('useReefKnotModal was called outside of the ReefKnotModalContext');
7
- return value;
6
+ const value = useContext(ReefKnotModalContext);
7
+ if (!value) throw new Error("useReefKnotModal was called outside of the ReefKnotModalContext");
8
+ return value;
8
9
  };
9
10
 
10
- export { useReefKnotModal };
11
+ //#endregion
12
+ export { useReefKnotModal };
package/dist/index.js CHANGED
@@ -1,18 +1,22 @@
1
- export { useReefKnotContext } from './hooks/useReefKnotContext.js';
2
- export { useAutoConnect } from './hooks/useAutoConnect.js';
3
- export { useAutoConnectCheck } from './hooks/useAutoConnectCheck.js';
4
- export { connectEagerly, useEagerConnect } from './hooks/useEagerConnect.js';
5
- export { useDisconnect, useForceDisconnect } from './hooks/useDisconnect.js';
6
- export { useConnectorInfo } from './hooks/useConnectorInfo.js';
7
- export { useConnect } from './hooks/useConnect.js';
8
- export { useReefKnotModal } from './hooks/useReefKnotModal.js';
9
- export { LS_KEY_RECONNECT_WALLET_ID, LS_KEY_TERMS_ACCEPTANCE } from './constants/localStorage.js';
10
- export { getUnsupportedChainError } from './helpers/getUnsupportedChainError.js';
11
- export { getDefaultConfig } from './helpers/getDefaultConfig.js';
12
- export { getWalletsDataList } from './helpers/getWalletsDataList.js';
13
- export { checkTermsAccepted } from './helpers/checkTermsAccepted.js';
14
- export { hasInjected, isDappBrowserProvider } from './helpers/providerDetectors.js';
15
- export { useLocalStorage } from './helpers/useLocalStorage.js';
16
- export { ReefKnotContext } from './context/reefKnotContext.js';
17
- export { ReefKnotProvider } from './context/reefKnotProvider.js';
18
- export { ReefKnotModalContextProvider } from './context/reefKnotModalContext.js';
1
+ import { ReefKnotContext } from "./context/reefKnotContext.js";
2
+ import { useReefKnotContext } from "./hooks/useReefKnotContext.js";
3
+ import { useLocalStorage } from "./helpers/useLocalStorage.js";
4
+ import { LS_KEY_RECONNECT_WALLET_ID, LS_KEY_TERMS_ACCEPTANCE } from "./constants/localStorage.js";
5
+ import { ReefKnotModalContextProvider } from "./context/reefKnotModalContext.js";
6
+ import { useReefKnotModal } from "./hooks/useReefKnotModal.js";
7
+ import { checkTermsAccepted } from "./helpers/checkTermsAccepted.js";
8
+ import { connectEagerly, useEagerConnect } from "./hooks/useEagerConnect.js";
9
+ import { useAutoConnect } from "./hooks/useAutoConnect.js";
10
+ import { useAutoConnectCheck } from "./hooks/useAutoConnectCheck.js";
11
+ import { useDisconnect, useForceDisconnect } from "./hooks/useDisconnect.js";
12
+ import { hasInjected, isDappBrowserProvider } from "./helpers/providerDetectors.js";
13
+ import { useConnectorInfo } from "./hooks/useConnectorInfo.js";
14
+ import { useConnect } from "./hooks/useConnect.js";
15
+ import "./hooks/index.js";
16
+ import { getUnsupportedChainError } from "./helpers/getUnsupportedChainError.js";
17
+ import { getWalletsDataList } from "./helpers/getWalletsDataList.js";
18
+ import { getDefaultConfig } from "./helpers/getDefaultConfig.js";
19
+ import "./helpers/index.js";
20
+ import { ReefKnotProvider } from "./context/reefKnotProvider.js";
21
+
22
+ export { LS_KEY_RECONNECT_WALLET_ID, LS_KEY_TERMS_ACCEPTANCE, ReefKnotContext, ReefKnotModalContextProvider, ReefKnotProvider, checkTermsAccepted, connectEagerly, getDefaultConfig, getUnsupportedChainError, getWalletsDataList, hasInjected, isDappBrowserProvider, useAutoConnect, useAutoConnectCheck, useConnect, useConnectorInfo, useDisconnect, useEagerConnect, useForceDisconnect, useLocalStorage, useReefKnotContext, useReefKnotModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/core-react",
3
- "version": "6.2.4",
3
+ "version": "7.0.0-alpha.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -32,31 +32,33 @@
32
32
  "access": "public"
33
33
  },
34
34
  "scripts": {
35
- "build": "rollup -c",
36
- "dev": "dev=on rollup -c -w",
37
- "lint": "eslint --ext ts,tsx,js,mjs ."
35
+ "build": "yarn run -T tsdown",
36
+ "dev": "yarn run -T tsdown --watch",
37
+ "lint": "eslint --ext ts,tsx,js,mjs .",
38
+ "typecheck": "tsc --noEmit"
38
39
  },
39
40
  "devDependencies": {
40
- "@reef-knot/ledger-connector": "4.5.0",
41
- "@reef-knot/types": "4.2.0",
42
- "@reef-knot/ui-react": "2.3.0",
43
- "@reef-knot/wallets-helpers": "2.3.0",
44
- "@reef-knot/wallets-list": "4.2.4",
41
+ "@reef-knot/ledger-connector": "4.4.0-alpha.5",
42
+ "@reef-knot/types": "4.2.0-alpha.3",
43
+ "@reef-knot/ui-react": "2.3.0-alpha.3",
44
+ "@reef-knot/wallets-helpers": "2.3.0-alpha.3",
45
+ "@reef-knot/wallets-list": "4.2.0-alpha.6",
46
+ "build-config": "*",
45
47
  "eslint-config-custom": "*",
46
48
  "mipd": "0.0.7",
47
49
  "react": "18.2.0",
48
- "viem": ">=2.23",
49
- "wagmi": ">=2.14"
50
+ "viem": ">=2.44",
51
+ "wagmi": ">=3.3"
50
52
  },
51
53
  "peerDependencies": {
52
- "@reef-knot/ledger-connector": "4.5.0",
53
- "@reef-knot/types": "4.2.0",
54
- "@reef-knot/ui-react": "2.3.0",
55
- "@reef-knot/wallets-helpers": "2.3.0",
56
- "@reef-knot/wallets-list": "4.2.4",
54
+ "@reef-knot/ledger-connector": "4.4.0-alpha.5",
55
+ "@reef-knot/types": "4.2.0-alpha.3",
56
+ "@reef-knot/ui-react": "2.3.0-alpha.3",
57
+ "@reef-knot/wallets-helpers": "2.3.0-alpha.3",
58
+ "@reef-knot/wallets-list": "4.2.0-alpha.6",
57
59
  "@tanstack/react-query": "^5.29.0",
58
60
  "react": ">=18",
59
- "viem": ">=2.23",
60
- "wagmi": ">=2.14"
61
+ "viem": ">=2.44",
62
+ "wagmi": ">=3.3"
61
63
  }
62
64
  }