@reef-knot/core-react 5.0.0 → 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.
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { Chain
|
|
2
|
-
import {
|
|
1
|
+
import { Chain } from 'viem';
|
|
2
|
+
import { createConfig } from 'wagmi';
|
|
3
3
|
import type { ReefKnotWalletsModalConfig } from '@reef-knot/types';
|
|
4
4
|
import { GetWalletsDataListArgs } from './getWalletsDataList';
|
|
5
5
|
import type { ReefKnotProviderConfig } from '../context/reefKnotContext';
|
|
6
|
-
type
|
|
7
|
-
type
|
|
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 & {
|
|
6
|
+
type WagmiConfigArgs = Omit<Parameters<typeof createConfig>[0], 'connectors' | 'client'>;
|
|
7
|
+
type DefaultConfigArgs<I extends string = string> = ReefKnotWalletsModalConfig<I> & GetWalletsDataListArgs & WagmiConfigArgs & {
|
|
15
8
|
autoConnect: boolean;
|
|
16
9
|
};
|
|
17
|
-
export declare const getDefaultConfig: <I extends string = string>({ rpc, defaultChain, walletconnectProjectId, walletsList, safeAllowedDomains, chains,
|
|
18
|
-
wagmiConfig: import("wagmi").Config<
|
|
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>>>;
|
|
19
12
|
reefKnotConfig: ReefKnotProviderConfig;
|
|
20
13
|
walletsDataList: import("@reef-knot/types").WalletAdapterData[];
|
|
21
14
|
walletsModalConfig: ReefKnotWalletsModalConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/getDefaultConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,
|
|
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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest } from '../_virtual/_tslib.js';
|
|
1
2
|
import { http } from 'viem';
|
|
2
3
|
import { createConfig } from 'wagmi';
|
|
3
4
|
import { getWalletsDataList } from './getWalletsDataList.js';
|
|
@@ -7,29 +8,29 @@ const getDefaultTransports = (chains, rpc) => chains.reduce((result, chain) => O
|
|
|
7
8
|
batch: true
|
|
8
9
|
})
|
|
9
10
|
}), {});
|
|
10
|
-
const getDefaultConfig =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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"]);
|
|
33
34
|
const {
|
|
34
35
|
walletsDataList
|
|
35
36
|
} = getWalletsDataList({
|
|
@@ -43,13 +44,11 @@ const getDefaultConfig = ({
|
|
|
43
44
|
autoConnect,
|
|
44
45
|
walletDataList: walletsDataList
|
|
45
46
|
};
|
|
46
|
-
const wagmiConfig = createConfig({
|
|
47
|
+
const wagmiConfig = createConfig(Object.assign({
|
|
47
48
|
chains,
|
|
48
|
-
ssr,
|
|
49
49
|
transports: transports || getDefaultTransports(chains, rpc),
|
|
50
|
-
storage,
|
|
51
50
|
multiInjectedProviderDiscovery: false
|
|
52
|
-
});
|
|
51
|
+
}, wagmiArgs));
|
|
53
52
|
// TODO: We could use `getDefaultWalletsModalConfig` here, but it cause package dependency cycle rn
|
|
54
53
|
const walletsModalConfig = {
|
|
55
54
|
buttonComponentsByConnectorId,
|