@dynamic-labs/wagmi-connector 4.10.1 → 4.10.3
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 +23 -0
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/DynamicWagmiConnector.js +6 -0
- package/src/lib/SyncDynamicWagmi.js +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.10.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.2...v4.10.3) (2025-04-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* dark mode vars ([#8456](https://github.com/dynamic-labs/dynamic-auth/issues/8456)) ([26c8a28](https://github.com/dynamic-labs/dynamic-auth/commit/26c8a289d151b79c73726ddf00048d83ff8d5098))
|
|
8
|
+
* onramp options override ([#8335](https://github.com/dynamic-labs/dynamic-auth/issues/8335)) ([731af19](https://github.com/dynamic-labs/dynamic-auth/commit/731af199df5c7743be8d7502dd7c6155a7d68128))
|
|
9
|
+
|
|
10
|
+
### [4.10.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.1...v4.10.2) (2025-04-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add walletTabSelected event ([#8430](https://github.com/dynamic-labs/dynamic-auth/issues/8430)) ([01ef815](https://github.com/dynamic-labs/dynamic-auth/commit/01ef815330e6c5433f7c135f561ed86621cc2bd9))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* disconect wallets on logout ([#8399](https://github.com/dynamic-labs/dynamic-auth/issues/8399)) ([148bc0d](https://github.com/dynamic-labs/dynamic-auth/commit/148bc0dd175048fa8a9a675383e8e6d93c7d16ac))
|
|
21
|
+
* ensure primary wallet is still a valid credential when calling resfreshUser ([#8439](https://github.com/dynamic-labs/dynamic-auth/issues/8439)) ([2e567e5](https://github.com/dynamic-labs/dynamic-auth/commit/2e567e53ea7738d4a42f3d54bb40a294403a1c36))
|
|
22
|
+
* **global-wallet-client:** ensure multiple global wallets can announce in same page ([#8421](https://github.com/dynamic-labs/dynamic-auth/issues/8421)) ([c55044a](https://github.com/dynamic-labs/dynamic-auth/commit/c55044a50f2d1c9417a3a2d85851c5522834a20a))
|
|
23
|
+
* **global-wallet-popup:** ensure popup icon can be viewed ([#8424](https://github.com/dynamic-labs/dynamic-auth/issues/8424)) ([f960eeb](https://github.com/dynamic-labs/dynamic-auth/commit/f960eebcdd875e1ff1779cd7be946d8342bea964))
|
|
24
|
+
|
|
2
25
|
### [4.10.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.0...v4.10.1) (2025-03-31)
|
|
3
26
|
|
|
4
27
|
## [4.10.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.12...v4.10.0) (2025-03-30)
|
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wagmi-connector",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@wagmi/core": "^2.6.4",
|
|
6
6
|
"react": "^18.0.0",
|
|
7
7
|
"viem": "^2.21.55",
|
|
8
8
|
"wagmi": "^2.14.11",
|
|
9
|
-
"@dynamic-labs/assert-package-version": "4.10.
|
|
10
|
-
"@dynamic-labs/ethereum-core": "4.10.
|
|
11
|
-
"@dynamic-labs/logger": "4.10.
|
|
12
|
-
"@dynamic-labs/rpc-providers": "4.10.
|
|
13
|
-
"@dynamic-labs/sdk-react-core": "4.10.
|
|
14
|
-
"@dynamic-labs/types": "4.10.
|
|
15
|
-
"@dynamic-labs/wallet-connector-core": "4.10.
|
|
9
|
+
"@dynamic-labs/assert-package-version": "4.10.3",
|
|
10
|
+
"@dynamic-labs/ethereum-core": "4.10.3",
|
|
11
|
+
"@dynamic-labs/logger": "4.10.3",
|
|
12
|
+
"@dynamic-labs/rpc-providers": "4.10.3",
|
|
13
|
+
"@dynamic-labs/sdk-react-core": "4.10.3",
|
|
14
|
+
"@dynamic-labs/types": "4.10.3",
|
|
15
|
+
"@dynamic-labs/wallet-connector-core": "4.10.3",
|
|
16
16
|
"eventemitter3": "5.0.1"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
@@ -4,6 +4,7 @@ import { useMemo, useEffect } from 'react';
|
|
|
4
4
|
import { useConfig } from 'wagmi';
|
|
5
5
|
import { ErrorBoundaryInclude, useDynamicContext, ErrorBoundaryExclude } from '@dynamic-labs/sdk-react-core';
|
|
6
6
|
import { isEthereumWallet } from '@dynamic-labs/ethereum-core';
|
|
7
|
+
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import { getCreateConnectorFn } from './Connector.js';
|
|
8
9
|
import { SyncDynamicWagmi } from './SyncDynamicWagmi.js';
|
|
9
10
|
import { useChainMismatchLogger } from './useChainMismatchLogger.js';
|
|
@@ -32,6 +33,11 @@ const DynamicWagmiConnectorInner = ({ suppressChainMismatchError = false, childr
|
|
|
32
33
|
wallet: evmWallet,
|
|
33
34
|
}));
|
|
34
35
|
}, [config._internal.connectors, getConnectorId, evmWallet]);
|
|
36
|
+
logger.logVerboseTroubleshootingMessage('[DynamicWagmiConnector] DynamicWagmiConnectorInner', {
|
|
37
|
+
connector,
|
|
38
|
+
evmWallet,
|
|
39
|
+
primaryWallet: primaryWallet,
|
|
40
|
+
});
|
|
35
41
|
/**
|
|
36
42
|
* Updating the wagmi config must be done in a useEffect because
|
|
37
43
|
* when setting the public client and connectors, wagmi will fire
|
|
@@ -13,7 +13,10 @@ const SyncDynamicWagmi = ({ children, connector, wallet, }) => {
|
|
|
13
13
|
const lastConnectedWalletId = useRef(undefined);
|
|
14
14
|
const hasPreviousConnection = Boolean(lastConnectedWalletId.current);
|
|
15
15
|
const disconnectWagmi = useCallback(() => {
|
|
16
|
-
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] disconnecting wagmi - previous status: ',
|
|
16
|
+
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] disconnecting wagmi - previous status: ', {
|
|
17
|
+
clientStatus,
|
|
18
|
+
lastConnectedWalletId: lastConnectedWalletId.current,
|
|
19
|
+
});
|
|
17
20
|
if (clientStatus === 'disconnected') {
|
|
18
21
|
return;
|
|
19
22
|
}
|
|
@@ -21,7 +24,13 @@ const SyncDynamicWagmi = ({ children, connector, wallet, }) => {
|
|
|
21
24
|
lastConnectedWalletId.current = undefined;
|
|
22
25
|
}, [disconnect, clientStatus]);
|
|
23
26
|
const connectWagmi = useCallback((connector, newId, forceConnect) => {
|
|
24
|
-
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] connecting wagmi - previous status: ',
|
|
27
|
+
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] connecting wagmi - previous status: ', {
|
|
28
|
+
clientStatus,
|
|
29
|
+
connectorKey: connector.key,
|
|
30
|
+
forceConnect,
|
|
31
|
+
lastConnectedWalletId: lastConnectedWalletId.current,
|
|
32
|
+
newId,
|
|
33
|
+
});
|
|
25
34
|
if (clientStatus !== 'disconnected' && !forceConnect) {
|
|
26
35
|
return;
|
|
27
36
|
}
|
|
@@ -29,6 +38,12 @@ const SyncDynamicWagmi = ({ children, connector, wallet, }) => {
|
|
|
29
38
|
connect({ connector });
|
|
30
39
|
}, [connect, clientStatus]);
|
|
31
40
|
const sync = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] sync', {
|
|
42
|
+
connectorKey: connector === null || connector === void 0 ? void 0 : connector.key,
|
|
43
|
+
hasPreviousConnection,
|
|
44
|
+
lastConnectedWalletId: lastConnectedWalletId.current,
|
|
45
|
+
wallet: wallet === null || wallet === void 0 ? void 0 : wallet.address,
|
|
46
|
+
});
|
|
32
47
|
// if there's no connector, disconnect wagmi
|
|
33
48
|
if (!connector || !(wallet === null || wallet === void 0 ? void 0 : wallet.address)) {
|
|
34
49
|
disconnectWagmi();
|
|
@@ -57,9 +72,18 @@ const SyncDynamicWagmi = ({ children, connector, wallet, }) => {
|
|
|
57
72
|
// this is for handling the scenario where the user unlocks the wallet,
|
|
58
73
|
// as well as changes to a linked wallet
|
|
59
74
|
useWalletConnectorEvent(wallet === null || wallet === void 0 ? void 0 : wallet.connector, 'accountChange', () => {
|
|
75
|
+
var _a;
|
|
76
|
+
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] accountChange', {
|
|
77
|
+
clientStatus,
|
|
78
|
+
connectorKey: (_a = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _a === void 0 ? void 0 : _a.key,
|
|
79
|
+
lastConnectedWalletId: lastConnectedWalletId.current,
|
|
80
|
+
});
|
|
60
81
|
sync();
|
|
61
82
|
});
|
|
62
83
|
useEffect(() => {
|
|
84
|
+
logger.logVerboseTroubleshootingMessage('[SyncDynamicWagmi] useEffect', {
|
|
85
|
+
clientStatus,
|
|
86
|
+
});
|
|
63
87
|
sync();
|
|
64
88
|
}, [sync, clientStatus]);
|
|
65
89
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|