@reef-knot/web3-react 6.2.0-alpha.4 → 6.2.0-alpha.5
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,16 +1,16 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { getNetwork } from '@ethersproject/providers';
|
|
3
|
-
import {
|
|
3
|
+
import { useConnection, useConfig } from 'wagmi';
|
|
4
4
|
|
|
5
5
|
var useSupportedChains = () => {
|
|
6
6
|
var {
|
|
7
7
|
chainId
|
|
8
|
-
} =
|
|
8
|
+
} = useConnection();
|
|
9
9
|
var {
|
|
10
10
|
chains
|
|
11
11
|
} = useConfig();
|
|
12
12
|
var isUnsupported = useMemo(() => {
|
|
13
|
-
return !chainId || !(chains
|
|
13
|
+
return !chainId || !(chains !== null && chains !== void 0 && chains.find(c => c.id === chainId));
|
|
14
14
|
}, [chainId, chains]);
|
|
15
15
|
var supportedChains = useMemo(() => {
|
|
16
16
|
return chains.map(c => getNetwork(c.id));
|
package/dist/hooks/useWeb3.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useConnection, useConnect } from 'wagmi';
|
|
2
2
|
import { useSupportedChains } from './useSupportedChains.js';
|
|
3
3
|
|
|
4
4
|
// This is a legacy hook for getting data and methods from web3-react library.
|
|
5
5
|
// Because of migration to wagmi library, this method now returns values from wagmi and is left here for backwards compatibility.
|
|
6
6
|
function useWeb3(_key) {
|
|
7
|
-
var wagmiAccount =
|
|
7
|
+
var wagmiAccount = useConnection();
|
|
8
8
|
var {
|
|
9
9
|
error: wagmiError
|
|
10
10
|
} = useConnect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reef-knot/web3-react",
|
|
3
|
-
"version": "6.2.0-alpha.
|
|
3
|
+
"version": "6.2.0-alpha.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@babel/preset-react": "7.18.6",
|
|
47
47
|
"@babel/preset-typescript": "7.18.6",
|
|
48
48
|
"@ethersproject/providers": "^5.7.2",
|
|
49
|
-
"@reef-knot/core-react": "6.2.0-alpha.
|
|
50
|
-
"@reef-knot/ledger-connector": "4.4.0-alpha.
|
|
51
|
-
"@reef-knot/wallets-helpers": "2.3.0-alpha.
|
|
49
|
+
"@reef-knot/core-react": "6.2.0-alpha.5",
|
|
50
|
+
"@reef-knot/ledger-connector": "4.4.0-alpha.4",
|
|
51
|
+
"@reef-knot/wallets-helpers": "2.3.0-alpha.2",
|
|
52
52
|
"@testing-library/react": "^12.1.5",
|
|
53
53
|
"@testing-library/react-hooks": "^7.0.2",
|
|
54
54
|
"@types/react": "18.2.45",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@ethersproject/providers": "5",
|
|
65
|
-
"@reef-knot/core-react": "6.2.0-alpha.
|
|
66
|
-
"@reef-knot/ledger-connector": "4.4.0-alpha.
|
|
67
|
-
"@reef-knot/wallets-helpers": "2.3.0-alpha.
|
|
65
|
+
"@reef-knot/core-react": "6.2.0-alpha.5",
|
|
66
|
+
"@reef-knot/ledger-connector": "4.4.0-alpha.4",
|
|
67
|
+
"@reef-knot/wallets-helpers": "2.3.0-alpha.2",
|
|
68
68
|
"@tanstack/react-query": "^5.29.0",
|
|
69
69
|
"react": ">=18",
|
|
70
|
-
"wagmi": ">=
|
|
70
|
+
"wagmi": ">=3.3"
|
|
71
71
|
}
|
|
72
72
|
}
|