@dynamic-labs/ethereum 4.19.3 → 4.19.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.
- package/CHANGELOG.md +9 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/EthereumWalletConnectors.cjs +24 -10
- package/src/EthereumWalletConnectors.js +24 -10
- package/src/injected/fetchInjectedWalletConnectors.cjs +6 -15
- package/src/injected/fetchInjectedWalletConnectors.d.ts +2 -1
- package/src/injected/fetchInjectedWalletConnectors.js +6 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.19.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.4...v4.19.5) (2025-06-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add cleanup for waas connectors ([#8849](https://github.com/dynamic-labs/dynamic-auth/issues/8849)) ([5899169](https://github.com/dynamic-labs/dynamic-auth/commit/5899169abaf7ce86add2b1393cfd9b967da5e388))
|
|
8
|
+
|
|
9
|
+
### [4.19.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.3...v4.19.4) (2025-05-31)
|
|
10
|
+
|
|
2
11
|
### [4.19.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.2...v4.19.3) (2025-05-28)
|
|
3
12
|
|
|
4
13
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.5",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"eventemitter3": "5.0.1",
|
|
24
24
|
"buffer": "6.0.3",
|
|
25
25
|
"@metamask/sdk": "0.33.0",
|
|
26
|
-
"@dynamic-labs/assert-package-version": "4.19.
|
|
27
|
-
"@dynamic-labs/embedded-wallet-evm": "4.19.
|
|
28
|
-
"@dynamic-labs/ethereum-core": "4.19.
|
|
29
|
-
"@dynamic-labs/logger": "4.19.
|
|
30
|
-
"@dynamic-labs/rpc-providers": "4.19.
|
|
31
|
-
"@dynamic-labs/types": "4.19.
|
|
32
|
-
"@dynamic-labs/utils": "4.19.
|
|
33
|
-
"@dynamic-labs/wallet-book": "4.19.
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "4.19.
|
|
26
|
+
"@dynamic-labs/assert-package-version": "4.19.5",
|
|
27
|
+
"@dynamic-labs/embedded-wallet-evm": "4.19.5",
|
|
28
|
+
"@dynamic-labs/ethereum-core": "4.19.5",
|
|
29
|
+
"@dynamic-labs/logger": "4.19.5",
|
|
30
|
+
"@dynamic-labs/rpc-providers": "4.19.5",
|
|
31
|
+
"@dynamic-labs/types": "4.19.5",
|
|
32
|
+
"@dynamic-labs/utils": "4.19.5",
|
|
33
|
+
"@dynamic-labs/wallet-book": "4.19.5",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "4.19.5"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"viem": "^2.28.4"
|
|
@@ -20,15 +20,29 @@ var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConne
|
|
|
20
20
|
var coinbase = require('./coinbase/coinbase.cjs');
|
|
21
21
|
var MetaMaskConnector = require('./metaMask/MetaMaskConnector.cjs');
|
|
22
22
|
|
|
23
|
-
const EthereumWalletConnectors = (props) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
];
|
|
23
|
+
const EthereumWalletConnectors = (props) => {
|
|
24
|
+
const { useMetamaskSdk } = props;
|
|
25
|
+
const walletsWithCustomConnectors = [
|
|
26
|
+
'phantomevm',
|
|
27
|
+
'coinbase',
|
|
28
|
+
'exodusevm',
|
|
29
|
+
'abstract',
|
|
30
|
+
'edenonline',
|
|
31
|
+
'intersend',
|
|
32
|
+
];
|
|
33
|
+
if (useMetamaskSdk) {
|
|
34
|
+
walletsWithCustomConnectors.push('metamask');
|
|
35
|
+
}
|
|
36
|
+
return [
|
|
37
|
+
...fetchInjectedWalletConnectors.injectedWalletOverrides,
|
|
38
|
+
...fetchInjectedWalletConnectors.fetchInjectedWalletConnector(Object.assign(Object.assign({}, props), { walletsWithCustomConnectors })),
|
|
39
|
+
...fetchWalletConnectWallets.fetchWalletConnectWallets(props),
|
|
40
|
+
...embeddedWalletEvm.TurnkeyEVMWalletConnectors(props),
|
|
41
|
+
...(useMetamaskSdk ? [MetaMaskConnector.MetaMaskConnector] : []),
|
|
42
|
+
coinbase.Coinbase,
|
|
43
|
+
FallbackEvmConnector.FallbackEvmConnector,
|
|
44
|
+
getWalletConnectConnector.getWalletConnectConnector(),
|
|
45
|
+
];
|
|
46
|
+
};
|
|
33
47
|
|
|
34
48
|
exports.EthereumWalletConnectors = EthereumWalletConnectors;
|
|
@@ -16,15 +16,29 @@ import { injectedWalletOverrides, fetchInjectedWalletConnector } from './injecte
|
|
|
16
16
|
import { Coinbase } from './coinbase/coinbase.js';
|
|
17
17
|
import { MetaMaskConnector } from './metaMask/MetaMaskConnector.js';
|
|
18
18
|
|
|
19
|
-
const EthereumWalletConnectors = (props) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
];
|
|
19
|
+
const EthereumWalletConnectors = (props) => {
|
|
20
|
+
const { useMetamaskSdk } = props;
|
|
21
|
+
const walletsWithCustomConnectors = [
|
|
22
|
+
'phantomevm',
|
|
23
|
+
'coinbase',
|
|
24
|
+
'exodusevm',
|
|
25
|
+
'abstract',
|
|
26
|
+
'edenonline',
|
|
27
|
+
'intersend',
|
|
28
|
+
];
|
|
29
|
+
if (useMetamaskSdk) {
|
|
30
|
+
walletsWithCustomConnectors.push('metamask');
|
|
31
|
+
}
|
|
32
|
+
return [
|
|
33
|
+
...injectedWalletOverrides,
|
|
34
|
+
...fetchInjectedWalletConnector(Object.assign(Object.assign({}, props), { walletsWithCustomConnectors })),
|
|
35
|
+
...fetchWalletConnectWallets(props),
|
|
36
|
+
...TurnkeyEVMWalletConnectors(props),
|
|
37
|
+
...(useMetamaskSdk ? [MetaMaskConnector] : []),
|
|
38
|
+
Coinbase,
|
|
39
|
+
FallbackEvmConnector,
|
|
40
|
+
getWalletConnectConnector(),
|
|
41
|
+
];
|
|
42
|
+
};
|
|
29
43
|
|
|
30
44
|
export { EthereumWalletConnectors };
|
|
@@ -14,18 +14,9 @@ const injectedWalletOverrides = [
|
|
|
14
14
|
PhantomEvm.PhantomEvm,
|
|
15
15
|
ExodusEvm.ExodusEvm,
|
|
16
16
|
];
|
|
17
|
-
const walletsWithCustomConnectors = [
|
|
18
|
-
'phantomevm',
|
|
19
|
-
'coinbase',
|
|
20
|
-
'exodusevm',
|
|
21
|
-
'abstract',
|
|
22
|
-
'metamask',
|
|
23
|
-
'edenonline',
|
|
24
|
-
'intersend',
|
|
25
|
-
];
|
|
26
17
|
let removeEip6963EventsListener;
|
|
27
18
|
// should add eip6963 connector only if not in wallet-book, to avoid adding duplicate connectors
|
|
28
|
-
const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook) => {
|
|
19
|
+
const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook, walletsWithCustomConnectors) => {
|
|
29
20
|
var _a;
|
|
30
21
|
const { rdns, name } = eip6963ProviderInfo;
|
|
31
22
|
const chain = 'evm';
|
|
@@ -41,10 +32,10 @@ const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook) => {
|
|
|
41
32
|
walletConnectorCore.logger.logVerboseTroubleshootingMessage('[ETH shouldAddEip6963Connector]', existingWallet);
|
|
42
33
|
return !existingWallet;
|
|
43
34
|
};
|
|
44
|
-
const addEip6963Listener = (walletBook) => {
|
|
35
|
+
const addEip6963Listener = (walletBook, walletsWithCustomConnectors) => {
|
|
45
36
|
removeEip6963EventsListener === null || removeEip6963EventsListener === void 0 ? void 0 : removeEip6963EventsListener();
|
|
46
37
|
removeEip6963EventsListener = utils.listenToEip6963Events((event) => {
|
|
47
|
-
if (!shouldAddEip6963Connector(event.detail.info, walletBook)) {
|
|
38
|
+
if (!shouldAddEip6963Connector(event.detail.info, walletBook, walletsWithCustomConnectors)) {
|
|
48
39
|
return;
|
|
49
40
|
}
|
|
50
41
|
walletConnectorCore.logger.logVerboseTroubleshootingMessage('[ETH fetchInjectedWalletConnectors] listenToEip6963Events', event.detail);
|
|
@@ -53,9 +44,9 @@ const addEip6963Listener = (walletBook) => {
|
|
|
53
44
|
});
|
|
54
45
|
});
|
|
55
46
|
};
|
|
56
|
-
const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
47
|
+
const fetchInjectedWalletConnector = ({ walletBook, walletsWithCustomConnectors, }) => {
|
|
57
48
|
var _a;
|
|
58
|
-
addEip6963Listener(walletBook);
|
|
49
|
+
addEip6963Listener(walletBook, walletsWithCustomConnectors);
|
|
59
50
|
const walletBookConnectors = Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
60
51
|
.filter(([key, wallet]) => {
|
|
61
52
|
var _a;
|
|
@@ -65,7 +56,7 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
65
56
|
.map(([key, wallet]) => getConnectorConstructorInjectedWallet.getConnectorConstructorInjectedWallet(key, wallet));
|
|
66
57
|
const { providers } = utils.Eip6963ProviderSingleton.get();
|
|
67
58
|
const eip6963Connectors = providers
|
|
68
|
-
.filter((provider) => shouldAddEip6963Connector(provider.info, walletBook))
|
|
59
|
+
.filter((provider) => shouldAddEip6963Connector(provider.info, walletBook, walletsWithCustomConnectors))
|
|
69
60
|
.map((provider) => getConnectorConstructorForEip6963Wallet.getConnectorConstructorForEip6963Wallet(provider));
|
|
70
61
|
walletConnectorCore.logger.logVerboseTroubleshootingMessage('[ETH fetchInjectedWalletConnectors] eip6963Connectors', eip6963Connectors);
|
|
71
62
|
return [...walletBookConnectors, ...eip6963Connectors];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
3
3
|
export declare const injectedWalletOverrides: WalletConnectorConstructor[];
|
|
4
|
-
export declare const fetchInjectedWalletConnector: ({ walletBook, }: {
|
|
4
|
+
export declare const fetchInjectedWalletConnector: ({ walletBook, walletsWithCustomConnectors, }: {
|
|
5
5
|
walletBook: WalletBookSchema;
|
|
6
|
+
walletsWithCustomConnectors: string[];
|
|
6
7
|
}) => WalletConnectorConstructor[];
|
|
@@ -10,18 +10,9 @@ const injectedWalletOverrides = [
|
|
|
10
10
|
PhantomEvm,
|
|
11
11
|
ExodusEvm,
|
|
12
12
|
];
|
|
13
|
-
const walletsWithCustomConnectors = [
|
|
14
|
-
'phantomevm',
|
|
15
|
-
'coinbase',
|
|
16
|
-
'exodusevm',
|
|
17
|
-
'abstract',
|
|
18
|
-
'metamask',
|
|
19
|
-
'edenonline',
|
|
20
|
-
'intersend',
|
|
21
|
-
];
|
|
22
13
|
let removeEip6963EventsListener;
|
|
23
14
|
// should add eip6963 connector only if not in wallet-book, to avoid adding duplicate connectors
|
|
24
|
-
const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook) => {
|
|
15
|
+
const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook, walletsWithCustomConnectors) => {
|
|
25
16
|
var _a;
|
|
26
17
|
const { rdns, name } = eip6963ProviderInfo;
|
|
27
18
|
const chain = 'evm';
|
|
@@ -37,10 +28,10 @@ const shouldAddEip6963Connector = (eip6963ProviderInfo, walletBook) => {
|
|
|
37
28
|
logger.logVerboseTroubleshootingMessage('[ETH shouldAddEip6963Connector]', existingWallet);
|
|
38
29
|
return !existingWallet;
|
|
39
30
|
};
|
|
40
|
-
const addEip6963Listener = (walletBook) => {
|
|
31
|
+
const addEip6963Listener = (walletBook, walletsWithCustomConnectors) => {
|
|
41
32
|
removeEip6963EventsListener === null || removeEip6963EventsListener === void 0 ? void 0 : removeEip6963EventsListener();
|
|
42
33
|
removeEip6963EventsListener = listenToEip6963Events((event) => {
|
|
43
|
-
if (!shouldAddEip6963Connector(event.detail.info, walletBook)) {
|
|
34
|
+
if (!shouldAddEip6963Connector(event.detail.info, walletBook, walletsWithCustomConnectors)) {
|
|
44
35
|
return;
|
|
45
36
|
}
|
|
46
37
|
logger.logVerboseTroubleshootingMessage('[ETH fetchInjectedWalletConnectors] listenToEip6963Events', event.detail);
|
|
@@ -49,9 +40,9 @@ const addEip6963Listener = (walletBook) => {
|
|
|
49
40
|
});
|
|
50
41
|
});
|
|
51
42
|
};
|
|
52
|
-
const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
43
|
+
const fetchInjectedWalletConnector = ({ walletBook, walletsWithCustomConnectors, }) => {
|
|
53
44
|
var _a;
|
|
54
|
-
addEip6963Listener(walletBook);
|
|
45
|
+
addEip6963Listener(walletBook, walletsWithCustomConnectors);
|
|
55
46
|
const walletBookConnectors = Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
56
47
|
.filter(([key, wallet]) => {
|
|
57
48
|
var _a;
|
|
@@ -61,7 +52,7 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
61
52
|
.map(([key, wallet]) => getConnectorConstructorInjectedWallet(key, wallet));
|
|
62
53
|
const { providers } = Eip6963ProviderSingleton.get();
|
|
63
54
|
const eip6963Connectors = providers
|
|
64
|
-
.filter((provider) => shouldAddEip6963Connector(provider.info, walletBook))
|
|
55
|
+
.filter((provider) => shouldAddEip6963Connector(provider.info, walletBook, walletsWithCustomConnectors))
|
|
65
56
|
.map((provider) => getConnectorConstructorForEip6963Wallet(provider));
|
|
66
57
|
logger.logVerboseTroubleshootingMessage('[ETH fetchInjectedWalletConnectors] eip6963Connectors', eip6963Connectors);
|
|
67
58
|
return [...walletBookConnectors, ...eip6963Connectors];
|