@dynamic-labs/wagmi-connector 2.6.1 → 2.6.2
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
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [2.6.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.1...v2.6.2) (2024-09-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* add missing bitcoin wallets to wallet-book fallback ([#6872](https://github.com/dynamic-labs/DynamicAuth/issues/6872)) ([4dec35c](https://github.com/dynamic-labs/DynamicAuth/commit/4dec35c9a457081944231c64432b1966bc7f938b))
|
|
8
|
+
* stop infinite rerendering when wagmi config error is thrown ([#6862](https://github.com/dynamic-labs/DynamicAuth/issues/6862)) ([#6864](https://github.com/dynamic-labs/DynamicAuth/issues/6864)) ([8fe2cf0](https://github.com/dynamic-labs/DynamicAuth/commit/8fe2cf0d592c3067af6edfe8aa4ea8d3fc8278a7))
|
|
9
|
+
|
|
2
10
|
### [2.6.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.0...v2.6.1) (2024-09-11)
|
|
3
11
|
|
|
4
12
|
## [2.6.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.5.3...v2.6.0) (2024-09-03)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wagmi-connector",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"react": "^18.0.0",
|
|
12
12
|
"viem": "^2.7.6",
|
|
13
13
|
"wagmi": "2.8.8",
|
|
14
|
-
"@dynamic-labs/logger": "2.6.
|
|
15
|
-
"@dynamic-labs/rpc-providers": "2.6.
|
|
16
|
-
"@dynamic-labs/sdk-react-core": "2.6.
|
|
17
|
-
"@dynamic-labs/types": "2.6.
|
|
18
|
-
"@dynamic-labs/wallet-connector-core": "2.6.
|
|
14
|
+
"@dynamic-labs/logger": "2.6.2",
|
|
15
|
+
"@dynamic-labs/rpc-providers": "2.6.2",
|
|
16
|
+
"@dynamic-labs/sdk-react-core": "2.6.2",
|
|
17
|
+
"@dynamic-labs/types": "2.6.2",
|
|
18
|
+
"@dynamic-labs/wallet-connector-core": "2.6.2",
|
|
19
19
|
"eventemitter3": "5.0.1"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
@@ -14,8 +14,8 @@ const DynamicWagmiConnectorInner = ({ suppressChainMismatchError = false, childr
|
|
|
14
14
|
const config = useConfig();
|
|
15
15
|
const { handleLogOut, primaryWallet } = useDynamicContext();
|
|
16
16
|
const wallets = useUserWallets();
|
|
17
|
-
useChainMismatchLogger({ throwOnMismatch: !suppressChainMismatchError });
|
|
18
17
|
const evmWallet = useFindEvmWallet(primaryWallet, wallets);
|
|
18
|
+
useChainMismatchLogger({ suppress: suppressChainMismatchError });
|
|
19
19
|
const getConnectorId = useConnectorId();
|
|
20
20
|
/**
|
|
21
21
|
* This will prevent the wagmi Connector from calling handleLogOut when we are the ones calling disconnect
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const useChainMismatchLogger: ({
|
|
2
|
-
|
|
1
|
+
export declare const useChainMismatchLogger: ({ suppress, }?: {
|
|
2
|
+
suppress: boolean;
|
|
3
3
|
}) => void;
|
|
@@ -5,11 +5,11 @@ import { Logger } from '@dynamic-labs/logger';
|
|
|
5
5
|
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
|
|
6
6
|
|
|
7
7
|
const logger = new Logger('DynamicWagmiConnector');
|
|
8
|
-
const useChainMismatchLogger = ({
|
|
8
|
+
const useChainMismatchLogger = ({ suppress, } = { suppress: false }) => {
|
|
9
9
|
const config = useConfig();
|
|
10
10
|
const { networkConfigurations } = useDynamicContext();
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
if (!(networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm))
|
|
12
|
+
if (!(networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || suppress)
|
|
13
13
|
return;
|
|
14
14
|
const wagmiChains = config.chains;
|
|
15
15
|
const wagmiChainIds = wagmiChains.map((chain) => chain.id);
|
|
@@ -20,10 +20,6 @@ const useChainMismatchLogger = ({ throwOnMismatch, } = { throwOnMismatch: true }
|
|
|
20
20
|
const message = `Chain (id: ${chain.id} name: ${chain.name}) is present in the Wagmi config, but is not present in the Dynamic configuration.` +
|
|
21
21
|
' Please make sure to enable the chain in your Dynamic Dashboard, or add it to the evmNetworks prop on DynamicContextProvider.' +
|
|
22
22
|
' For more information, see: https://docs.dynamic.xyz/guides/frameworks/wagmi-v2#chain-configuration';
|
|
23
|
-
if (throwOnMismatch) {
|
|
24
|
-
throw new Error(message +
|
|
25
|
-
' \n\nTo suppress this error, pass `suppressChainMismatchError` to `DynamicWagmiConnector`: `<DynamicWagmiConnector suppressChainMismatchError>`');
|
|
26
|
-
}
|
|
27
23
|
logger.warn(message);
|
|
28
24
|
}
|
|
29
25
|
});
|
|
@@ -32,14 +28,10 @@ const useChainMismatchLogger = ({ throwOnMismatch, } = { throwOnMismatch: true }
|
|
|
32
28
|
const message = `Chain (id: ${chain.chainId} name: ${chain.name}) is present in the Dynamic config, but is not present in the Wagmi configuration.` +
|
|
33
29
|
' Please make sure to add the chain to the chains prop on the Wagmi createConfig function.' +
|
|
34
30
|
' For more information, see: https://docs.dynamic.xyz/guides/frameworks/wagmi-v2#chain-configuration';
|
|
35
|
-
if (throwOnMismatch) {
|
|
36
|
-
throw new Error(message +
|
|
37
|
-
' \n\nTo suppress this error, pass `suppressChainMismatchError` to `DynamicWagmiConnector`: `<DynamicWagmiConnector suppressChainMismatchError>`');
|
|
38
|
-
}
|
|
39
31
|
logger.warn(message);
|
|
40
32
|
}
|
|
41
33
|
});
|
|
42
|
-
}, [config.chains, networkConfigurations,
|
|
34
|
+
}, [config.chains, networkConfigurations, suppress]);
|
|
43
35
|
};
|
|
44
36
|
|
|
45
37
|
export { useChainMismatchLogger };
|