@reef-knot/web3-react 1.1.0 → 1.2.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/web3.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface ProviderWeb3Props extends ConnectorsContextProps {
|
|
|
7
7
|
supportedChainIds: CHAINS[];
|
|
8
8
|
swrConfig?: SWRConfiguration;
|
|
9
9
|
pollingInterval?: number;
|
|
10
|
+
walletconnectProjectId?: string;
|
|
10
11
|
onError?: (error: unknown) => void;
|
|
11
12
|
}
|
|
12
13
|
declare const _default: React.MemoExoticComponent<React.FC<ProviderWeb3Props>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../src/context/web3.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../src/context/web3.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAGvC,OAA2B,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;;AA4HD,wBAAyD"}
|
package/dist/context/web3.js
CHANGED
|
@@ -8,6 +8,7 @@ import { ProviderSDK as ProviderSDK$1 } from '@lido-sdk/react';
|
|
|
8
8
|
import { Web3ReactProvider, useWeb3React } from '@web3-react/core';
|
|
9
9
|
import { ReefKnot } from '@reef-knot/core-react';
|
|
10
10
|
import { useAccount } from 'wagmi';
|
|
11
|
+
import * as wagmiChains from 'wagmi/chains';
|
|
11
12
|
import 'tiny-warning';
|
|
12
13
|
import { useWeb3 } from '../hooks/useWeb3.js';
|
|
13
14
|
import { POLLING_INTERVAL } from '../constants/web3.js';
|
|
@@ -88,12 +89,14 @@ var ProviderWeb3 = props => {
|
|
|
88
89
|
var {
|
|
89
90
|
children,
|
|
90
91
|
rpc,
|
|
92
|
+
walletconnectProjectId,
|
|
91
93
|
appName,
|
|
92
94
|
appLogoUrl
|
|
93
95
|
} = props,
|
|
94
|
-
sdkProps = __rest(props, ["children", "rpc", "appName", "appLogoUrl"]);
|
|
96
|
+
sdkProps = __rest(props, ["children", "rpc", "walletconnectProjectId", "appName", "appLogoUrl"]);
|
|
95
97
|
var {
|
|
96
|
-
defaultChainId
|
|
98
|
+
defaultChainId,
|
|
99
|
+
supportedChainIds
|
|
97
100
|
} = props;
|
|
98
101
|
var connectorsProps = {
|
|
99
102
|
rpc,
|
|
@@ -101,12 +104,18 @@ var ProviderWeb3 = props => {
|
|
|
101
104
|
appLogoUrl,
|
|
102
105
|
defaultChainId
|
|
103
106
|
};
|
|
107
|
+
var wagmiChainsArray = Object.values(wagmiChains);
|
|
108
|
+
var supportedWagmiChains = wagmiChainsArray.filter(chain => supportedChainIds.includes(chain.id));
|
|
109
|
+
var defaultWagmiChain = wagmiChainsArray.find(chain => chain.id === defaultChainId);
|
|
104
110
|
return /*#__PURE__*/React.createElement(Web3ReactProvider, {
|
|
105
111
|
getLibrary: getLibrary
|
|
106
112
|
}, /*#__PURE__*/React.createElement(ProviderSDK, Object.assign({
|
|
107
113
|
rpc: rpc
|
|
108
114
|
}, sdkProps), /*#__PURE__*/React.createElement(ProviderConnectors, Object.assign({}, connectorsProps), /*#__PURE__*/React.createElement(ReefKnot, {
|
|
109
|
-
rpc: rpc
|
|
115
|
+
rpc: rpc,
|
|
116
|
+
walletconnectProjectId: walletconnectProjectId,
|
|
117
|
+
chains: supportedWagmiChains,
|
|
118
|
+
defaultChain: defaultWagmiChain
|
|
110
119
|
}, children))));
|
|
111
120
|
};
|
|
112
121
|
const web3 = /*#__PURE__*/memo(ProviderWeb3);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectors.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnectors.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useConnectors.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnectors.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,aAAa,QAAO,sBAEhC,CAAC"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import 'tiny-invariant';
|
|
3
|
-
import '@ethersproject/providers';
|
|
4
|
-
import '@lido-sdk/constants';
|
|
5
|
-
import '@lido-sdk/providers';
|
|
6
|
-
import '@lido-sdk/react';
|
|
7
|
-
import '@web3-react/core';
|
|
8
|
-
import '@reef-knot/core-react';
|
|
9
|
-
import 'wagmi';
|
|
10
|
-
import 'tiny-warning';
|
|
11
|
-
import '../constants/connectors.js';
|
|
12
|
-
import '@gnosis.pm/safe-apps-web3-react';
|
|
13
|
-
import '@web3-react/injected-connector';
|
|
14
|
-
import '@web3-react/walletlink-connector';
|
|
15
|
-
import 'web3-ledgerhq-frame-connector';
|
|
16
|
-
import 'web3-ledgerhq-connector';
|
|
17
|
-
import '../helpers/ua.js';
|
|
18
2
|
import { ConnectorsContext } from '../context/connectors.js';
|
|
19
3
|
|
|
20
4
|
var useConnectors = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reef-knot/web3-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/preset-react": "7.18.6",
|
|
48
48
|
"@babel/preset-typescript": "7.18.6",
|
|
49
49
|
"@ethersproject/providers": "^5.7.2",
|
|
50
|
-
"@reef-knot/core-react": "^1.
|
|
50
|
+
"@reef-knot/core-react": "^1.4.0",
|
|
51
51
|
"@testing-library/react": "^12.1.5",
|
|
52
52
|
"@testing-library/react-hooks": "^7.0.2",
|
|
53
53
|
"@types/jest": "^29.4.0",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@ethersproject/providers": "5",
|
|
83
|
-
"@reef-knot/core-react": "^1.
|
|
83
|
+
"@reef-knot/core-react": "^1.4.0",
|
|
84
84
|
"@walletconnect/ethereum-provider": "^1.8.0",
|
|
85
85
|
"react": ">=17",
|
|
86
86
|
"ua-parser-js": "^1.0.33",
|
|
87
|
-
"wagmi": "^0.12.
|
|
87
|
+
"wagmi": "^0.12.16"
|
|
88
88
|
}
|
|
89
89
|
}
|