@dynamic-labs/ethereum 4.0.0-alpha.2 → 4.0.0-alpha.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 +21 -0
- package/package.json +8 -8
- package/src/ethProviderHelper.cjs +33 -22
- package/src/ethProviderHelper.js +33 -22
- package/src/types.d.ts +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.3...v4.0.0-alpha.4) (2024-09-23)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* issue where builtin stream module was a dependency ([#6968](https://github.com/dynamic-labs/DynamicAuth/issues/6968)) ([0661129](https://github.com/dynamic-labs/DynamicAuth/commit/0661129920ba70ebbcd4d17ee5aa988c51d1b477))
|
|
8
|
+
* update in memory secure storage ([#6955](https://github.com/dynamic-labs/DynamicAuth/issues/6955)) ([697fc20](https://github.com/dynamic-labs/DynamicAuth/commit/697fc20740b243fa31ecf06e8b2ed9d09932a544))
|
|
9
|
+
|
|
10
|
+
## [4.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.2...v4.0.0-alpha.3) (2024-09-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* developers provide global connectivity appkit project id ([#6941](https://github.com/dynamic-labs/DynamicAuth/issues/6941)) ([83760ea](https://github.com/dynamic-labs/DynamicAuth/commit/83760ea57591685b12caee945f173f6a7f9312d1))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* don't try to set up event listeners if wallet provider doesn't support it ([#6943](https://github.com/dynamic-labs/DynamicAuth/issues/6943)) ([439f1bb](https://github.com/dynamic-labs/DynamicAuth/commit/439f1bbb3c765959756cfc6eeb8429e4018e0379))
|
|
21
|
+
* dont verify all signatures for solana embedded multisig tx ([#6953](https://github.com/dynamic-labs/DynamicAuth/issues/6953)) ([7a7973e](https://github.com/dynamic-labs/DynamicAuth/commit/7a7973e05f0960421b348a55c6a00c9fd873b0b7))
|
|
22
|
+
|
|
2
23
|
## [4.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2024-09-18)
|
|
3
24
|
|
|
4
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@coinbase/wallet-sdk": "4.0.4",
|
|
30
30
|
"@walletconnect/ethereum-provider": "2.11.2",
|
|
31
|
+
"@walletconnect/types": "2.10.6",
|
|
31
32
|
"eventemitter3": "5.0.1",
|
|
32
33
|
"buffer": "6.0.3",
|
|
33
|
-
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/ethereum-core": "4.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
39
|
-
"stream": "0.0.2"
|
|
34
|
+
"@dynamic-labs/embedded-wallet-evm": "4.0.0-alpha.4",
|
|
35
|
+
"@dynamic-labs/ethereum-core": "4.0.0-alpha.4",
|
|
36
|
+
"@dynamic-labs/types": "4.0.0-alpha.4",
|
|
37
|
+
"@dynamic-labs/utils": "4.0.0-alpha.4",
|
|
38
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.4",
|
|
39
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"viem": "^2.7.6"
|
|
@@ -130,32 +130,43 @@ class EthProviderHelper {
|
|
|
130
130
|
}
|
|
131
131
|
_setupEventListeners(walletConnector) {
|
|
132
132
|
const web3Provider = this.findProvider();
|
|
133
|
-
if (
|
|
133
|
+
if (web3Provider && 'on' in web3Provider) {
|
|
134
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
|
|
135
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
136
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
137
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
138
|
+
const tearDownEventListeners = () => {
|
|
139
|
+
const web3Provider = this.findProvider();
|
|
140
|
+
if (!web3Provider) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (handleAccountChange) {
|
|
144
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
145
|
+
}
|
|
146
|
+
if (handleChainChange) {
|
|
147
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
148
|
+
}
|
|
149
|
+
if (handleDisconnect) {
|
|
150
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
134
153
|
return {
|
|
135
|
-
tearDownEventListeners
|
|
154
|
+
tearDownEventListeners,
|
|
136
155
|
};
|
|
137
156
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
if (handleChainChange) {
|
|
151
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
152
|
-
}
|
|
153
|
-
if (handleDisconnect) {
|
|
154
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
+
if (!web3Provider) {
|
|
158
|
+
walletConnectorCore.logger.warn('Provider not found', {
|
|
159
|
+
connector: walletConnector,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
else if (!('on' in web3Provider)) {
|
|
163
|
+
walletConnectorCore.logger.warn('Provider does not support event listeners', {
|
|
164
|
+
connector: walletConnector,
|
|
165
|
+
provider: web3Provider,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
157
168
|
return {
|
|
158
|
-
tearDownEventListeners,
|
|
169
|
+
tearDownEventListeners: () => { },
|
|
159
170
|
};
|
|
160
171
|
}
|
|
161
172
|
}
|
package/src/ethProviderHelper.js
CHANGED
|
@@ -126,32 +126,43 @@ class EthProviderHelper {
|
|
|
126
126
|
}
|
|
127
127
|
_setupEventListeners(walletConnector) {
|
|
128
128
|
const web3Provider = this.findProvider();
|
|
129
|
-
if (
|
|
129
|
+
if (web3Provider && 'on' in web3Provider) {
|
|
130
|
+
const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
|
|
131
|
+
web3Provider.on('accountsChanged', handleAccountChange);
|
|
132
|
+
web3Provider.on('chainChanged', handleChainChange);
|
|
133
|
+
web3Provider.on('disconnect', handleDisconnect);
|
|
134
|
+
const tearDownEventListeners = () => {
|
|
135
|
+
const web3Provider = this.findProvider();
|
|
136
|
+
if (!web3Provider) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (handleAccountChange) {
|
|
140
|
+
web3Provider.removeListener('accountsChanged', handleAccountChange);
|
|
141
|
+
}
|
|
142
|
+
if (handleChainChange) {
|
|
143
|
+
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
144
|
+
}
|
|
145
|
+
if (handleDisconnect) {
|
|
146
|
+
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
130
149
|
return {
|
|
131
|
-
tearDownEventListeners
|
|
150
|
+
tearDownEventListeners,
|
|
132
151
|
};
|
|
133
152
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
if (handleChainChange) {
|
|
147
|
-
web3Provider.removeListener('chainChanged', handleChainChange);
|
|
148
|
-
}
|
|
149
|
-
if (handleDisconnect) {
|
|
150
|
-
web3Provider.removeListener('disconnect', handleDisconnect);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
+
if (!web3Provider) {
|
|
154
|
+
logger.warn('Provider not found', {
|
|
155
|
+
connector: walletConnector,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
else if (!('on' in web3Provider)) {
|
|
159
|
+
logger.warn('Provider does not support event listeners', {
|
|
160
|
+
connector: walletConnector,
|
|
161
|
+
provider: web3Provider,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
153
164
|
return {
|
|
154
|
-
tearDownEventListeners,
|
|
165
|
+
tearDownEventListeners: () => { },
|
|
155
166
|
};
|
|
156
167
|
}
|
|
157
168
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { EventEmitter } from 'stream';
|
|
1
|
+
import { type EventEmitter } from 'eventemitter3';
|
|
4
2
|
import { PublicClient } from 'viem';
|
|
5
3
|
import { ProviderCondition } from '@dynamic-labs/wallet-connector-core';
|
|
6
4
|
declare global {
|