@reef-knot/core-react 4.3.0 → 5.0.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.
@@ -12,6 +12,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
+
15
17
 
16
18
  function __rest(s, e) {
17
19
  var t = {};
@@ -0,0 +1,14 @@
1
+ import type { WalletAdapterData } from '@reef-knot/types';
2
+ /**
3
+ * Context definition is in separated file to avoid circular dependencies
4
+ */
5
+ export type ReefKnotProviderConfig = {
6
+ autoConnect: boolean;
7
+ walletDataList: WalletAdapterData[];
8
+ };
9
+ export type ReefKnotContextValue = ReefKnotProviderConfig & {
10
+ loadingWalletId: string | null;
11
+ setLoadingWalletId: React.Dispatch<React.SetStateAction<string | null>>;
12
+ };
13
+ export declare const ReefKnotContext: import("react").Context<ReefKnotContextValue>;
14
+ //# sourceMappingURL=reefKnotContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reefKnotContext.d.ts","sourceRoot":"","sources":["../../src/context/reefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AAEH,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GAAG;IAC1D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CACzE,CAAC;AAEF,eAAO,MAAM,eAAe,+CAA4C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+
3
+ const ReefKnotContext = createContext({});
4
+
5
+ export { ReefKnotContext };
@@ -0,0 +1,8 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ReefKnotProviderConfig } from './reefKnotContext';
3
+ export interface ReefKnotProviderProps {
4
+ config: ReefKnotProviderConfig;
5
+ children?: ReactNode;
6
+ }
7
+ export declare const ReefKnotProvider: ({ config, children, }: ReefKnotProviderProps) => React.JSX.Element;
8
+ //# sourceMappingURL=reefKnotProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reefKnotProvider.d.ts","sourceRoot":"","sources":["../../src/context/reefKnotProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAmB,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAG5E,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,0BAG1B,qBAAqB,sBAqBvB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import React, { useState, useMemo } from 'react';
2
+ import { ReefKnotModalContextProvider } from './reefKnotModalContext.js';
3
+ import { ReefKnotContext } from './reefKnotContext.js';
4
+ import { AutoConnect } from '../components/AutoConnect.js';
5
+
6
+ const ReefKnotProvider = ({
7
+ config,
8
+ children
9
+ }) => {
10
+ const [loadingWalletId, setLoadingWalletId] = useState(null);
11
+ const {
12
+ autoConnect
13
+ } = config;
14
+ const contextValue = useMemo(() => Object.assign(Object.assign({}, config), {
15
+ loadingWalletId,
16
+ setLoadingWalletId
17
+ }), [config, loadingWalletId]);
18
+ return React.createElement(ReefKnotContext.Provider, {
19
+ value: contextValue
20
+ }, React.createElement(ReefKnotModalContextProvider, null, autoConnect && React.createElement(AutoConnect, {
21
+ autoConnect: true
22
+ }), children));
23
+ };
24
+
25
+ export { ReefKnotProvider };
@@ -0,0 +1,24 @@
1
+ import { Chain, Transport } from 'viem';
2
+ import { Storage } from 'wagmi';
3
+ import type { ReefKnotWalletsModalConfig } from '@reef-knot/types';
4
+ import { GetWalletsDataListArgs } from './getWalletsDataList';
5
+ import type { ReefKnotProviderConfig } from '../context/reefKnotContext';
6
+ type Transports = Record<number, Transport>;
7
+ type Chains = readonly [Chain, ...Chain[]];
8
+ type WagmiAllowedArgs = {
9
+ chains: Chains;
10
+ ssr?: boolean;
11
+ transports?: Transports;
12
+ storage?: Storage | null;
13
+ };
14
+ type DefaultConfigArgs<I extends string = string> = ReefKnotWalletsModalConfig<I> & GetWalletsDataListArgs & WagmiAllowedArgs & {
15
+ autoConnect: boolean;
16
+ };
17
+ export declare const getDefaultConfig: <I extends string = string>({ rpc, defaultChain, walletconnectProjectId, walletsList, safeAllowedDomains, chains, ssr, transports, storage, autoConnect, buttonComponentsByConnectorId, metrics, walletsShown, walletsPinned, walletsDisplayInitialCount, linkTerms, linkPrivacyNotice, linkDontHaveWallet, }: DefaultConfigArgs<I>) => {
18
+ wagmiConfig: import("wagmi").Config<Chains, Transports>;
19
+ reefKnotConfig: ReefKnotProviderConfig;
20
+ walletsDataList: import("@reef-knot/types").WalletAdapterData[];
21
+ walletsModalConfig: ReefKnotWalletsModalConfig;
22
+ };
23
+ export {};
24
+ //# sourceMappingURL=getDefaultConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/getDefaultConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAgB,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAEL,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGzE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC5C,KAAK,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAE3C,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC9C,0BAA0B,CAAC,CAAC,CAAC,GAC3B,sBAAsB,GACtB,gBAAgB,GAAG;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAWN,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,8RAwB9C,iBAAiB,CAAC,CAAC,CAAC;;;;;CAwCtB,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { http } from 'viem';
2
+ import { createConfig } from 'wagmi';
3
+ import { getWalletsDataList } from './getWalletsDataList.js';
4
+
5
+ const getDefaultTransports = (chains, rpc) => chains.reduce((result, chain) => Object.assign(Object.assign({}, result), {
6
+ [chain.id]: http(rpc[chain.id], {
7
+ batch: true
8
+ })
9
+ }), {});
10
+ const getDefaultConfig = ({
11
+ // Reef-Knot config args
12
+ rpc,
13
+ defaultChain,
14
+ walletconnectProjectId,
15
+ walletsList,
16
+ safeAllowedDomains,
17
+ // Wagmi config args
18
+ chains,
19
+ ssr,
20
+ transports,
21
+ storage,
22
+ autoConnect,
23
+ // Wallets config args
24
+ buttonComponentsByConnectorId,
25
+ metrics,
26
+ walletsShown,
27
+ walletsPinned,
28
+ walletsDisplayInitialCount,
29
+ linkTerms,
30
+ linkPrivacyNotice,
31
+ linkDontHaveWallet
32
+ }) => {
33
+ const {
34
+ walletsDataList
35
+ } = getWalletsDataList({
36
+ rpc,
37
+ defaultChain,
38
+ walletsList,
39
+ walletconnectProjectId,
40
+ safeAllowedDomains
41
+ });
42
+ const reefKnotConfig = {
43
+ autoConnect,
44
+ walletDataList: walletsDataList
45
+ };
46
+ const wagmiConfig = createConfig({
47
+ chains,
48
+ ssr,
49
+ transports: transports || getDefaultTransports(chains, rpc),
50
+ storage,
51
+ multiInjectedProviderDiscovery: false
52
+ });
53
+ // TODO: We could use `getDefaultWalletsModalConfig` here, but it cause package dependency cycle rn
54
+ const walletsModalConfig = {
55
+ buttonComponentsByConnectorId,
56
+ metrics,
57
+ walletsShown,
58
+ walletsPinned,
59
+ walletsDisplayInitialCount,
60
+ linkTerms,
61
+ linkPrivacyNotice,
62
+ linkDontHaveWallet
63
+ };
64
+ return {
65
+ wagmiConfig,
66
+ reefKnotConfig,
67
+ walletsDataList,
68
+ walletsModalConfig
69
+ };
70
+ };
71
+
72
+ export { getDefaultConfig };
@@ -10,4 +10,4 @@ export interface GetWalletsDataListArgs {
10
10
  export declare const getWalletsDataList: ({ walletsList, rpc, defaultChain, walletconnectProjectId, safeAllowedDomains, }: GetWalletsDataListArgs) => {
11
11
  walletsDataList: import("@reef-knot/types").WalletAdapterData[];
12
12
  };
13
- //# sourceMappingURL=index.d.ts.map
13
+ //# sourceMappingURL=getWalletsDataList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWalletsDataList.d.ts","sourceRoot":"","sources":["../../src/helpers/getWalletsDataList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,YAAY,EAAE,KAAK,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,kBAAkB,oFAM5B,sBAAsB;;CAoBxB,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export * from './getUnsupportedChainError';
2
+ export * from './getDefaultConfig';
3
+ export * from './getWalletsDataList';
2
4
  export * from './checkTermsAccepted';
3
5
  export * from './providerDetectors';
4
6
  export * from './useLocalStorage';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { WalletAdapterData } from '@reef-knot/types';
2
2
  import type { Config, ConnectReturnType } from '@wagmi/core';
3
- import type { ReefKnotModalContextValue } from '../context';
3
+ import type { ReefKnotModalContextValue } from '../context/reefKnotModalContext';
4
4
  type ConnectResult = ConnectReturnType;
5
5
  export declare const connectEagerly: (config: Config, adapters: WalletAdapterData[], openModalAsync: ReefKnotModalContextValue["openModalAsync"]) => Promise<ConnectResult | null>;
6
6
  export declare const useEagerConnect: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"useEagerConnect.d.ts","sourceRoot":"","sources":["../../src/hooks/useEagerConnect.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,aAAa,GAAG,iBAAiB,CAAC;AAEvC,eAAO,MAAM,cAAc,WACjB,MAAM,YACJ,iBAAiB,EAAE,kBACb,yBAAyB,CAAC,gBAAgB,CAAC,KAC1D,OAAO,CAAC,aAAa,GAAG,IAAI,CA4C9B,CAAC;AAEF,eAAO,MAAM,eAAe;;CAc3B,CAAC"}
1
+ {"version":3,"file":"useEagerConnect.d.ts","sourceRoot":"","sources":["../../src/hooks/useEagerConnect.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,KAAK,aAAa,GAAG,iBAAiB,CAAC;AAEvC,eAAO,MAAM,cAAc,WACjB,MAAM,YACJ,iBAAiB,EAAE,kBACb,yBAAyB,CAAC,gBAAgB,CAAC,KAC1D,OAAO,CAAC,aAAa,GAAG,IAAI,CA4C9B,CAAC;AAEF,eAAO,MAAM,eAAe;;CAc3B,CAAC"}
@@ -1,3 +1,3 @@
1
- import { ReefKnotContextValue } from '../context/reefKnot';
1
+ import { ReefKnotContextValue } from '../context/reefKnotContext';
2
2
  export declare const useReefKnotContext: () => ReefKnotContextValue;
3
3
  //# sourceMappingURL=useReefKnotContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReefKnotContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useReefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,kBAAkB,QAAO,oBACT,CAAC"}
1
+ {"version":3,"file":"useReefKnotContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useReefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,kBAAkB,QAAO,oBACT,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ReefKnotContext } from '../context/reefKnot.js';
2
+ import { ReefKnotContext } from '../context/reefKnotContext.js';
3
3
 
4
4
  const useReefKnotContext = () => useContext(ReefKnotContext);
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export * from './components/AutoConnect';
2
- export * from './walletData';
3
1
  export * from './hooks';
4
- export * from './context';
5
2
  export * from './constants';
6
3
  export * from './helpers';
4
+ export * from './context/reefKnotContext';
5
+ export * from './context/reefKnotProvider';
6
+ export { ReefKnotModalContextProvider } from './context/reefKnotModalContext';
7
+ export type { ReefKnotModalContextValue } from './context/reefKnotModalContext';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,3 @@
1
- export { AutoConnect } from './components/AutoConnect.js';
2
- export { getWalletsDataList } from './walletData/index.js';
3
1
  export { useReefKnotContext } from './hooks/useReefKnotContext.js';
4
2
  export { useAutoConnect } from './hooks/useAutoConnect.js';
5
3
  export { useAutoConnectCheck } from './hooks/useAutoConnectCheck.js';
@@ -8,10 +6,13 @@ export { useDisconnect, useForceDisconnect } from './hooks/useDisconnect.js';
8
6
  export { useConnectorInfo } from './hooks/useConnectorInfo.js';
9
7
  export { useConnect } from './hooks/useConnect.js';
10
8
  export { useReefKnotModal } from './hooks/useReefKnotModal.js';
11
- export { ReefKnot, ReefKnotContext } from './context/reefKnot.js';
12
- export { ReefKnotModalContextProvider } from './context/reefKnotModalContext.js';
13
9
  export { LS_KEY_RECONNECT_WALLET_ID, LS_KEY_TERMS_ACCEPTANCE } from './constants/localStorage.js';
14
10
  export { getUnsupportedChainError } from './helpers/getUnsupportedChainError.js';
11
+ export { getDefaultConfig } from './helpers/getDefaultConfig.js';
12
+ export { getWalletsDataList } from './helpers/getWalletsDataList.js';
15
13
  export { checkTermsAccepted } from './helpers/checkTermsAccepted.js';
16
14
  export { hasInjected, isDappBrowserProvider } from './helpers/providerDetectors.js';
17
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/core-react",
3
- "version": "4.3.0",
3
+ "version": "5.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -37,26 +37,26 @@
37
37
  "lint": "eslint --ext ts,tsx,js,mjs ."
38
38
  },
39
39
  "devDependencies": {
40
- "@reef-knot/ledger-connector": "^4.1.0",
41
- "@reef-knot/wallets-list": "^2.1.0",
42
- "@reef-knot/types": "^2.1.0",
43
- "@reef-knot/ui-react": "^2.1.3",
44
- "@reef-knot/wallets-helpers": "^2.1.0",
40
+ "@reef-knot/ledger-connector": "^4.1.4",
41
+ "@reef-knot/wallets-list": "^3.0.0",
42
+ "@reef-knot/types": "^3.0.0",
43
+ "@reef-knot/ui-react": "^2.1.5",
44
+ "@reef-knot/wallets-helpers": "^2.1.1",
45
45
  "eslint-config-custom": "*",
46
46
  "react": "18.2.0",
47
- "viem": "2.13.3",
48
- "wagmi": "2.11.2",
47
+ "viem": ">=2.21",
48
+ "wagmi": ">=2.12",
49
49
  "mipd": "0.0.7"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@reef-knot/ledger-connector": "^4.1.0",
53
- "@reef-knot/wallets-list": "^2.1.0",
54
- "@reef-knot/types": "^2.0.1",
53
+ "@reef-knot/wallets-list": "^3.0.0",
54
+ "@reef-knot/types": "^3.0.0",
55
55
  "@reef-knot/ui-react": "^2.1.3",
56
56
  "@reef-knot/wallets-helpers": "^2.0.2",
57
57
  "react": ">=18",
58
- "viem": "2.13.3",
59
- "wagmi": "2.11.2",
58
+ "viem": ">=2.21",
59
+ "wagmi": ">=2.12",
60
60
  "@tanstack/react-query": "^5.29.0"
61
61
  }
62
62
  }
@@ -1,4 +0,0 @@
1
- export * from './reefKnot';
2
- export { ReefKnotModalContextProvider } from './reefKnotModalContext';
3
- export type { ReefKnotModalContextValue } from './reefKnotModalContext';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,19 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import type { Chain } from 'wagmi/chains';
3
- import type { WalletAdapterData } from '@reef-knot/types';
4
- export interface ReefKnotContextProps {
5
- walletDataList: WalletAdapterData[];
6
- rpc: Record<number, string>;
7
- chains: readonly [Chain, ...Chain[]];
8
- children?: ReactNode;
9
- }
10
- export type ReefKnotContextValue = {
11
- rpc: Record<number, string>;
12
- walletDataList: WalletAdapterData[];
13
- loadingWalletId: string | null;
14
- setLoadingWalletId: React.Dispatch<React.SetStateAction<string | null>>;
15
- chains: readonly [Chain, ...Chain[]];
16
- };
17
- export declare const ReefKnotContext: React.Context<ReefKnotContextValue>;
18
- export declare const ReefKnot: ({ rpc, chains, walletDataList, children, }: ReefKnotContextProps) => React.JSX.Element;
19
- //# sourceMappingURL=reefKnot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reefKnot.d.ts","sourceRoot":"","sources":["../../src/context/reefKnot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACxE,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,eAAe,qCAA4C,CAAC;AAEzE,eAAO,MAAM,QAAQ,+CAKlB,oBAAoB,sBAmBtB,CAAC"}
@@ -1,24 +0,0 @@
1
- import React, { createContext, useState, useMemo } from 'react';
2
- import { ReefKnotModalContextProvider } from './reefKnotModalContext.js';
3
-
4
- const ReefKnotContext = createContext({});
5
- const ReefKnot = ({
6
- rpc,
7
- chains,
8
- walletDataList,
9
- children
10
- }) => {
11
- const [loadingWalletId, setLoadingWalletId] = useState(null);
12
- const contextValue = useMemo(() => ({
13
- rpc,
14
- walletDataList,
15
- chains,
16
- loadingWalletId,
17
- setLoadingWalletId
18
- }), [rpc, walletDataList, chains, loadingWalletId]);
19
- return React.createElement(ReefKnotContext.Provider, {
20
- value: contextValue
21
- }, React.createElement(ReefKnotModalContextProvider, null, children));
22
- };
23
-
24
- export { ReefKnot, ReefKnotContext };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/walletData/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,YAAY,EAAE,KAAK,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,kBAAkB,oFAM5B,sBAAsB;;CAoBxB,CAAC"}