@reef-knot/core-react 4.3.1 → 5.1.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.
- package/dist/context/reefKnotContext.d.ts +14 -0
- package/dist/context/reefKnotContext.d.ts.map +1 -0
- package/dist/context/reefKnotContext.js +5 -0
- package/dist/context/reefKnotProvider.d.ts +8 -0
- package/dist/context/reefKnotProvider.d.ts.map +1 -0
- package/dist/context/reefKnotProvider.js +25 -0
- package/dist/helpers/getDefaultConfig.d.ts +17 -0
- package/dist/helpers/getDefaultConfig.d.ts.map +1 -0
- package/dist/helpers/getDefaultConfig.js +71 -0
- package/dist/{walletData/index.d.ts → helpers/getWalletsDataList.d.ts} +1 -1
- package/dist/helpers/getWalletsDataList.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useEagerConnect.d.ts +1 -1
- package/dist/hooks/useEagerConnect.d.ts.map +1 -1
- package/dist/hooks/useReefKnotContext.d.ts +1 -1
- package/dist/hooks/useReefKnotContext.d.ts.map +1 -1
- package/dist/hooks/useReefKnotContext.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/package.json +5 -5
- package/dist/context/index.d.ts +0 -4
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/reefKnot.d.ts +0 -19
- package/dist/context/reefKnot.d.ts.map +0 -1
- package/dist/context/reefKnot.js +0 -24
- package/dist/walletData/index.d.ts.map +0 -1
- /package/dist/{walletData/index.js → helpers/getWalletsDataList.js} +0 -0
|
@@ -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,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,17 @@
|
|
|
1
|
+
import { Chain } from 'viem';
|
|
2
|
+
import { createConfig } from 'wagmi';
|
|
3
|
+
import type { ReefKnotWalletsModalConfig } from '@reef-knot/types';
|
|
4
|
+
import { GetWalletsDataListArgs } from './getWalletsDataList';
|
|
5
|
+
import type { ReefKnotProviderConfig } from '../context/reefKnotContext';
|
|
6
|
+
type WagmiConfigArgs = Omit<Parameters<typeof createConfig>[0], 'connectors' | 'client'>;
|
|
7
|
+
type DefaultConfigArgs<I extends string = string> = ReefKnotWalletsModalConfig<I> & GetWalletsDataListArgs & WagmiConfigArgs & {
|
|
8
|
+
autoConnect: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const getDefaultConfig: <I extends string = string>({ rpc, defaultChain, walletconnectProjectId, walletsList, safeAllowedDomains, chains, transports, autoConnect, buttonComponentsByConnectorId, metrics, walletsShown, walletsPinned, walletsDisplayInitialCount, linkTerms, linkPrivacyNotice, linkDontHaveWallet, ...wagmiArgs }: DefaultConfigArgs<I>) => {
|
|
11
|
+
wagmiConfig: import("wagmi").Config<readonly [Chain, ...Chain[]], Record<number, import("wagmi").Transport<string, Record<string, any>, import("viem").EIP1193RequestFn>>>;
|
|
12
|
+
reefKnotConfig: ReefKnotProviderConfig;
|
|
13
|
+
walletsDataList: import("@reef-knot/types").WalletAdapterData[];
|
|
14
|
+
walletsModalConfig: ReefKnotWalletsModalConfig;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# 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,EAAa,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,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;AAMzE,KAAK,eAAe,GAAG,IAAI,CACzB,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,EAKlC,YAAY,GAAG,QAAQ,CACxB,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC9C,0BAA0B,CAAC,CAAC,CAAC,GAC3B,sBAAsB,GACtB,eAAe,GAAG;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAWN,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,6RAuB9C,iBAAiB,CAAC,CAAC,CAAC;;;;;CAuCtB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { __rest } from '../_virtual/_tslib.js';
|
|
2
|
+
import { http } from 'viem';
|
|
3
|
+
import { createConfig } from 'wagmi';
|
|
4
|
+
import { getWalletsDataList } from './getWalletsDataList.js';
|
|
5
|
+
|
|
6
|
+
const getDefaultTransports = (chains, rpc) => chains.reduce((result, chain) => Object.assign(Object.assign({}, result), {
|
|
7
|
+
[chain.id]: http(rpc[chain.id], {
|
|
8
|
+
batch: true
|
|
9
|
+
})
|
|
10
|
+
}), {});
|
|
11
|
+
const getDefaultConfig = _a => {
|
|
12
|
+
var {
|
|
13
|
+
// Reef-Knot config args
|
|
14
|
+
rpc,
|
|
15
|
+
defaultChain,
|
|
16
|
+
walletconnectProjectId,
|
|
17
|
+
walletsList,
|
|
18
|
+
safeAllowedDomains,
|
|
19
|
+
chains,
|
|
20
|
+
transports,
|
|
21
|
+
autoConnect,
|
|
22
|
+
// Wallets config args
|
|
23
|
+
buttonComponentsByConnectorId,
|
|
24
|
+
metrics,
|
|
25
|
+
walletsShown,
|
|
26
|
+
walletsPinned,
|
|
27
|
+
walletsDisplayInitialCount,
|
|
28
|
+
linkTerms,
|
|
29
|
+
linkPrivacyNotice,
|
|
30
|
+
linkDontHaveWallet
|
|
31
|
+
} = _a,
|
|
32
|
+
// Wagmi config args
|
|
33
|
+
wagmiArgs = __rest(_a, ["rpc", "defaultChain", "walletconnectProjectId", "walletsList", "safeAllowedDomains", "chains", "transports", "autoConnect", "buttonComponentsByConnectorId", "metrics", "walletsShown", "walletsPinned", "walletsDisplayInitialCount", "linkTerms", "linkPrivacyNotice", "linkDontHaveWallet"]);
|
|
34
|
+
const {
|
|
35
|
+
walletsDataList
|
|
36
|
+
} = getWalletsDataList({
|
|
37
|
+
rpc,
|
|
38
|
+
defaultChain,
|
|
39
|
+
walletsList,
|
|
40
|
+
walletconnectProjectId,
|
|
41
|
+
safeAllowedDomains
|
|
42
|
+
});
|
|
43
|
+
const reefKnotConfig = {
|
|
44
|
+
autoConnect,
|
|
45
|
+
walletDataList: walletsDataList
|
|
46
|
+
};
|
|
47
|
+
const wagmiConfig = createConfig(Object.assign({
|
|
48
|
+
chains,
|
|
49
|
+
transports: transports || getDefaultTransports(chains, rpc),
|
|
50
|
+
multiInjectedProviderDiscovery: false
|
|
51
|
+
}, wagmiArgs));
|
|
52
|
+
// TODO: We could use `getDefaultWalletsModalConfig` here, but it cause package dependency cycle rn
|
|
53
|
+
const walletsModalConfig = {
|
|
54
|
+
buttonComponentsByConnectorId,
|
|
55
|
+
metrics,
|
|
56
|
+
walletsShown,
|
|
57
|
+
walletsPinned,
|
|
58
|
+
walletsDisplayInitialCount,
|
|
59
|
+
linkTerms,
|
|
60
|
+
linkPrivacyNotice,
|
|
61
|
+
linkDontHaveWallet
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
wagmiConfig,
|
|
65
|
+
reefKnotConfig,
|
|
66
|
+
walletsDataList,
|
|
67
|
+
walletsModalConfig
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
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=
|
|
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"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReefKnotContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useReefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
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"}
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@reef-knot/ledger-connector": "^4.1.4",
|
|
41
|
-
"@reef-knot/wallets-list": "^
|
|
42
|
-
"@reef-knot/types": "^
|
|
41
|
+
"@reef-knot/wallets-list": "^3.0.0",
|
|
42
|
+
"@reef-knot/types": "^3.0.0",
|
|
43
43
|
"@reef-knot/ui-react": "^2.1.5",
|
|
44
44
|
"@reef-knot/wallets-helpers": "^2.1.1",
|
|
45
45
|
"eslint-config-custom": "*",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@reef-knot/ledger-connector": "^4.1.0",
|
|
53
|
-
"@reef-knot/wallets-list": "^
|
|
54
|
-
"@reef-knot/types": "^
|
|
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",
|
package/dist/context/index.d.ts
DELETED
|
@@ -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"}
|
package/dist/context/reefKnot.js
DELETED
|
@@ -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"}
|
|
File without changes
|