@ant-design/web3-wagmi 2.7.3 → 2.7.4
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/CHANGELOG.md +9 -0
- package/dist/esm/wagmi-provider/config-provider.d.ts +1 -1
- package/dist/esm/wagmi-provider/config-provider.js +5 -5
- package/dist/esm/wagmi-provider/index.js +1 -1
- package/dist/lib/wagmi-provider/config-provider.d.ts +1 -1
- package/dist/lib/wagmi-provider/config-provider.js +5 -5
- package/dist/lib/wagmi-provider/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ant-design/web3-wagmi
|
|
2
2
|
|
|
3
|
+
## 2.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- efbd948: fix(web3-wagmi): Correct spelling of "Factories"
|
|
8
|
+
- Updated dependencies [9bb1ea1]
|
|
9
|
+
- @ant-design/web3-common@1.13.0
|
|
10
|
+
- @ant-design/web3-assets@1.10.2
|
|
11
|
+
|
|
3
12
|
## 2.7.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ import type { Config as WagmiConfig } from 'wagmi';
|
|
|
4
4
|
import type { EIP6963Config, WalletFactory } from '../interface';
|
|
5
5
|
export interface AntDesignWeb3ConfigProviderProps {
|
|
6
6
|
chainAssets: Chain[];
|
|
7
|
-
|
|
7
|
+
walletFactories: WalletFactory[];
|
|
8
8
|
locale?: Locale;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
ens?: boolean;
|
|
@@ -10,7 +10,7 @@ export const AntDesignWeb3ConfigProvider = props => {
|
|
|
10
10
|
const {
|
|
11
11
|
children,
|
|
12
12
|
chainAssets,
|
|
13
|
-
|
|
13
|
+
walletFactories,
|
|
14
14
|
ens = true,
|
|
15
15
|
balance,
|
|
16
16
|
locale,
|
|
@@ -62,14 +62,14 @@ export const AntDesignWeb3ConfigProvider = props => {
|
|
|
62
62
|
wagimConfig.connectors.forEach(connector => {
|
|
63
63
|
if (isEIP6963Connector(connector)) {
|
|
64
64
|
// check is need auto add eip6963 wallet
|
|
65
|
-
if (typeof eip6963 === 'object' && eip6963?.autoAddInjectedWallets && !
|
|
65
|
+
if (typeof eip6963 === 'object' && eip6963?.autoAddInjectedWallets && !walletFactories.find(item => item.connectors.includes(connector.name))) {
|
|
66
66
|
// not config wallet and find the wallet in connectors, auto add it
|
|
67
67
|
autoAddEIP6963Wallets.push(EIP6963Wallet().create([connector]));
|
|
68
68
|
}
|
|
69
69
|
// Do not need check eip6963 wallet
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
const walletFactory =
|
|
72
|
+
const walletFactory = walletFactories.find(factory => factory.connectors.includes(connector.name));
|
|
73
73
|
if (!walletFactory?.create) {
|
|
74
74
|
// check user wallets config and console.error for alert
|
|
75
75
|
console.error(`Can not find wallet factory for ${connector.name}, you should config it in WagmiWeb3ConfigProvider 'wallets'.`);
|
|
@@ -77,7 +77,7 @@ export const AntDesignWeb3ConfigProvider = props => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
// Generate Wallet for @ant-design/web3
|
|
80
|
-
const supportWallets =
|
|
80
|
+
const supportWallets = walletFactories.map(factory => {
|
|
81
81
|
const connectors = factory.connectors.map(findConnectorByName).filter(item => !!item);
|
|
82
82
|
if (connectors.length === 0 && !eip6963) {
|
|
83
83
|
// Not config connector for this wallet factory and not use eip6963, ignore it.
|
|
@@ -87,7 +87,7 @@ export const AntDesignWeb3ConfigProvider = props => {
|
|
|
87
87
|
return factory.create(connectors);
|
|
88
88
|
}).filter(item => item !== null);
|
|
89
89
|
return [...supportWallets, ...autoAddEIP6963Wallets];
|
|
90
|
-
}, [wagimConfig.connectors,
|
|
90
|
+
}, [wagimConfig.connectors, walletFactories, eip6963]);
|
|
91
91
|
const chainList = React.useMemo(() => {
|
|
92
92
|
return wagimConfig.chains.map(item => {
|
|
93
93
|
const c = chainAssets?.find(asset => {
|
|
@@ -29,7 +29,7 @@ export function WagmiWeb3ConfigProvider({
|
|
|
29
29
|
children: /*#__PURE__*/_jsx(AntDesignWeb3ConfigProvider, {
|
|
30
30
|
locale: locale,
|
|
31
31
|
chainAssets: chainAssets,
|
|
32
|
-
|
|
32
|
+
walletFactories: wallets,
|
|
33
33
|
ens: ens,
|
|
34
34
|
balance: balance,
|
|
35
35
|
eip6963: eip6963,
|
|
@@ -4,7 +4,7 @@ import type { Config as WagmiConfig } from 'wagmi';
|
|
|
4
4
|
import type { EIP6963Config, WalletFactory } from '../interface';
|
|
5
5
|
export interface AntDesignWeb3ConfigProviderProps {
|
|
6
6
|
chainAssets: Chain[];
|
|
7
|
-
|
|
7
|
+
walletFactories: WalletFactory[];
|
|
8
8
|
locale?: Locale;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
ens?: boolean;
|
|
@@ -17,7 +17,7 @@ const AntDesignWeb3ConfigProvider = props => {
|
|
|
17
17
|
const {
|
|
18
18
|
children,
|
|
19
19
|
chainAssets,
|
|
20
|
-
|
|
20
|
+
walletFactories,
|
|
21
21
|
ens = true,
|
|
22
22
|
balance,
|
|
23
23
|
locale,
|
|
@@ -69,14 +69,14 @@ const AntDesignWeb3ConfigProvider = props => {
|
|
|
69
69
|
wagimConfig.connectors.forEach(connector => {
|
|
70
70
|
if ((0, _utils.isEIP6963Connector)(connector)) {
|
|
71
71
|
// check is need auto add eip6963 wallet
|
|
72
|
-
if (typeof eip6963 === 'object' && eip6963?.autoAddInjectedWallets && !
|
|
72
|
+
if (typeof eip6963 === 'object' && eip6963?.autoAddInjectedWallets && !walletFactories.find(item => item.connectors.includes(connector.name))) {
|
|
73
73
|
// not config wallet and find the wallet in connectors, auto add it
|
|
74
74
|
autoAddEIP6963Wallets.push((0, _eip.EIP6963Wallet)().create([connector]));
|
|
75
75
|
}
|
|
76
76
|
// Do not need check eip6963 wallet
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const walletFactory =
|
|
79
|
+
const walletFactory = walletFactories.find(factory => factory.connectors.includes(connector.name));
|
|
80
80
|
if (!walletFactory?.create) {
|
|
81
81
|
// check user wallets config and console.error for alert
|
|
82
82
|
console.error(`Can not find wallet factory for ${connector.name}, you should config it in WagmiWeb3ConfigProvider 'wallets'.`);
|
|
@@ -84,7 +84,7 @@ const AntDesignWeb3ConfigProvider = props => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
// Generate Wallet for @ant-design/web3
|
|
87
|
-
const supportWallets =
|
|
87
|
+
const supportWallets = walletFactories.map(factory => {
|
|
88
88
|
const connectors = factory.connectors.map(findConnectorByName).filter(item => !!item);
|
|
89
89
|
if (connectors.length === 0 && !eip6963) {
|
|
90
90
|
// Not config connector for this wallet factory and not use eip6963, ignore it.
|
|
@@ -94,7 +94,7 @@ const AntDesignWeb3ConfigProvider = props => {
|
|
|
94
94
|
return factory.create(connectors);
|
|
95
95
|
}).filter(item => item !== null);
|
|
96
96
|
return [...supportWallets, ...autoAddEIP6963Wallets];
|
|
97
|
-
}, [wagimConfig.connectors,
|
|
97
|
+
}, [wagimConfig.connectors, walletFactories, eip6963]);
|
|
98
98
|
const chainList = _react.default.useMemo(() => {
|
|
99
99
|
return wagimConfig.chains.map(item => {
|
|
100
100
|
const c = chainAssets?.find(asset => {
|
|
@@ -37,7 +37,7 @@ function WagmiWeb3ConfigProvider({
|
|
|
37
37
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_configProvider.AntDesignWeb3ConfigProvider, {
|
|
38
38
|
locale: locale,
|
|
39
39
|
chainAssets: chainAssets,
|
|
40
|
-
|
|
40
|
+
walletFactories: wallets,
|
|
41
41
|
ens: ens,
|
|
42
42
|
balance: balance,
|
|
43
43
|
eip6963: eip6963,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/web3-wagmi",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"debug": "^4.3.5",
|
|
41
|
-
"@ant-design/web3-assets": "1.10.
|
|
42
|
-
"@ant-design/web3-common": "1.
|
|
41
|
+
"@ant-design/web3-assets": "1.10.2",
|
|
42
|
+
"@ant-design/web3-common": "1.13.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/debug": "^4.1.12",
|