@dynamic-labs/wagmi-connector 2.0.0-alpha.26 → 2.0.0-alpha.28
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,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) (2024-04-10)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* improve bridge connect experience on mobile ([#5283](https://github.com/dynamic-labs/DynamicAuth/issues/5283)) ([155e4a9](https://github.com/dynamic-labs/DynamicAuth/commit/155e4a99e2cf5f78a1a5e91e774acbf170d6b083))
|
|
8
|
+
|
|
9
|
+
## [2.0.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.26...v2.0.0-alpha.27) (2024-04-09)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* coinbase improvements ([#5268](https://github.com/dynamic-labs/DynamicAuth/issues/5268)) ([c10a6de](https://github.com/dynamic-labs/DynamicAuth/commit/c10a6debcacff6cd97f2436fbde387f85faa5682))
|
|
15
|
+
* show qr code for metamask on desktop when not installed ([#5262](https://github.com/dynamic-labs/DynamicAuth/issues/5262)) ([1dcb4d9](https://github.com/dynamic-labs/DynamicAuth/commit/1dcb4d98de8a95f6b11d7bad90b9059110087385))
|
|
16
|
+
* update title of hardware wallet select screen ([#5270](https://github.com/dynamic-labs/DynamicAuth/issues/5270)) ([6e8fe17](https://github.com/dynamic-labs/DynamicAuth/commit/6e8fe17306677786ccf528b97ab673b9ae6b57b9))
|
|
17
|
+
|
|
2
18
|
## [2.0.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.25...v2.0.0-alpha.26) (2024-04-08)
|
|
3
19
|
|
|
4
20
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wagmi-connector",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.28",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
7
7
|
"directory": "packages/wagmi-connector"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@wagmi/core": "2.6.4",
|
|
10
|
+
"@wagmi/core": "^2.6.4",
|
|
11
11
|
"react": "^18.0.0",
|
|
12
|
-
"viem": "2.7.6",
|
|
13
|
-
"wagmi": "2.5.7",
|
|
14
|
-
"@dynamic-labs/logger": "2.0.0-alpha.
|
|
15
|
-
"@dynamic-labs/rpc-providers": "2.0.0-alpha.
|
|
16
|
-
"@dynamic-labs/sdk-react-core": "2.0.0-alpha.
|
|
17
|
-
"@dynamic-labs/types": "2.0.0-alpha.
|
|
18
|
-
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.
|
|
12
|
+
"viem": "^2.7.6",
|
|
13
|
+
"wagmi": "^2.5.7",
|
|
14
|
+
"@dynamic-labs/logger": "2.0.0-alpha.28",
|
|
15
|
+
"@dynamic-labs/rpc-providers": "2.0.0-alpha.28",
|
|
16
|
+
"@dynamic-labs/sdk-react-core": "2.0.0-alpha.28",
|
|
17
|
+
"@dynamic-labs/types": "2.0.0-alpha.28",
|
|
18
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.28",
|
|
19
19
|
"eventemitter3": "5.0.1"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
@@ -8,11 +8,11 @@ import { useChainMismatchLogger } from './useChainMismatchLogger.js';
|
|
|
8
8
|
import { useFindEvmWallet } from './hooks/useFindEvmWallet/useFindEvmWallet.js';
|
|
9
9
|
import { useConnectorId } from './hooks/useConnectorId/useConnectorId.js';
|
|
10
10
|
|
|
11
|
-
const DynamicWagmiConnector = ({ children, }) => {
|
|
11
|
+
const DynamicWagmiConnector = ({ suppressChainMismatchError = false, children, }) => {
|
|
12
12
|
const config = useConfig();
|
|
13
13
|
const { handleLogOut, primaryWallet } = useDynamicContext();
|
|
14
14
|
const wallets = useUserWallets();
|
|
15
|
-
useChainMismatchLogger();
|
|
15
|
+
useChainMismatchLogger({ throwOnMismatch: !suppressChainMismatchError });
|
|
16
16
|
const evmWallet = useFindEvmWallet(primaryWallet, wallets);
|
|
17
17
|
const getConnectorId = useConnectorId();
|
|
18
18
|
/**
|
|
@@ -4,7 +4,7 @@ import { Logger } from '@dynamic-labs/logger';
|
|
|
4
4
|
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
|
|
5
5
|
|
|
6
6
|
const logger = new Logger('DynamicWagmiConnector');
|
|
7
|
-
const useChainMismatchLogger = () => {
|
|
7
|
+
const useChainMismatchLogger = ({ throwOnMismatch, } = { throwOnMismatch: true }) => {
|
|
8
8
|
const config = useConfig();
|
|
9
9
|
const { networkConfigurations } = useDynamicContext();
|
|
10
10
|
useEffect(() => {
|
|
@@ -16,15 +16,29 @@ const useChainMismatchLogger = () => {
|
|
|
16
16
|
const dynamicChainIds = dynamicChains.map((chain) => chain.chainId);
|
|
17
17
|
wagmiChains.forEach((chain) => {
|
|
18
18
|
if (!dynamicChainIds.includes(chain.id)) {
|
|
19
|
-
|
|
19
|
+
const message = `Chain (id: ${chain.id} name: ${chain.name}) is present in the Wagmi config, but is not present in the Dynamic configuration.` +
|
|
20
|
+
' Please make sure to enable the chain in your Dynamic Dashboard, or add it to the evmNetworks prop on DynamicContextProvider.' +
|
|
21
|
+
' For more information, see: https://docs.dynamic.xyz/guides/frameworks/wagmi-v2#chain-configuration';
|
|
22
|
+
if (throwOnMismatch) {
|
|
23
|
+
throw new Error(message +
|
|
24
|
+
' \n\nTo suppress this error, pass `suppressChainMismatchError` to `DynamicWagmiConnector`: `<DynamicWagmiConnector suppressChainMismatchError>`');
|
|
25
|
+
}
|
|
26
|
+
logger.warn(message);
|
|
20
27
|
}
|
|
21
28
|
});
|
|
22
29
|
dynamicChains.forEach((chain) => {
|
|
23
30
|
if (!wagmiChainIds.includes(Number(chain.chainId))) {
|
|
24
|
-
|
|
31
|
+
const message = `Chain (id: ${chain.chainId} name: ${chain.name}) is present in the Dynamic config, but is not present in the Wagmi configuration.` +
|
|
32
|
+
' Please make sure to add the chain to the chains prop on the Wagmi createConfig function.' +
|
|
33
|
+
' For more information, see: https://docs.dynamic.xyz/guides/frameworks/wagmi-v2#chain-configuration';
|
|
34
|
+
if (throwOnMismatch) {
|
|
35
|
+
throw new Error(message +
|
|
36
|
+
' \n\nTo suppress this error, pass `suppressChainMismatchError` to `DynamicWagmiConnector`: `<DynamicWagmiConnector suppressChainMismatchError>`');
|
|
37
|
+
}
|
|
38
|
+
logger.warn(message);
|
|
25
39
|
}
|
|
26
40
|
});
|
|
27
|
-
}, [config.chains, networkConfigurations]);
|
|
41
|
+
}, [config.chains, networkConfigurations, throwOnMismatch]);
|
|
28
42
|
};
|
|
29
43
|
|
|
30
44
|
export { useChainMismatchLogger };
|