@dynamic-labs/ethereum 3.0.3 → 3.1.1
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 +28 -0
- package/package.json +7 -7
- package/src/ethProviderHelper.cjs +33 -22
- package/src/ethProviderHelper.js +33 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.1.1](https://github.com/dynamic-labs/DynamicAuth/compare/v3.1.0...v3.1.1) (2024-09-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* blockaid website scanning for global connectivity ([#6874](https://github.com/dynamic-labs/DynamicAuth/issues/6874)) ([#6960](https://github.com/dynamic-labs/DynamicAuth/issues/6960)) ([67ac487](https://github.com/dynamic-labs/DynamicAuth/commit/67ac487ce4123cd99ce532ca7d238ee8059bcf8b))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* dont verify all signatures for solana embedded ([#6958](https://github.com/dynamic-labs/DynamicAuth/issues/6958)) ([5d8ac6e](https://github.com/dynamic-labs/DynamicAuth/commit/5d8ac6ebb2cbf46dfaef7f2cef9f90f1294fb8e2)), closes [#6953](https://github.com/dynamic-labs/DynamicAuth/issues/6953)
|
|
13
|
+
* magic eden wallet transactions ([#6946](https://github.com/dynamic-labs/DynamicAuth/issues/6946)) ([#6967](https://github.com/dynamic-labs/DynamicAuth/issues/6967)) ([6e474f7](https://github.com/dynamic-labs/DynamicAuth/commit/6e474f76acfea34eb80a97daca06ea5df526797e))
|
|
14
|
+
* populate error variable when user closes oauth window for useSocialAccounts ([#6952](https://github.com/dynamic-labs/DynamicAuth/issues/6952)) ([#6970](https://github.com/dynamic-labs/DynamicAuth/issues/6970)) ([dca6aa5](https://github.com/dynamic-labs/DynamicAuth/commit/dca6aa5c795c62b39c6b78fc6a1515c1bfe1ba07))
|
|
15
|
+
* prevent calling refresh after logout ([#6948](https://github.com/dynamic-labs/DynamicAuth/issues/6948)) ([#6971](https://github.com/dynamic-labs/DynamicAuth/issues/6971)) ([6bd8a03](https://github.com/dynamic-labs/DynamicAuth/commit/6bd8a0359f5207ceabdd29ff21787140d4ca5234))
|
|
16
|
+
* qrcode for mfa in dark mode ([#6961](https://github.com/dynamic-labs/DynamicAuth/issues/6961)) ([#6969](https://github.com/dynamic-labs/DynamicAuth/issues/6969)) ([fb0cdc7](https://github.com/dynamic-labs/DynamicAuth/commit/fb0cdc7c9de225ae5279546f291df9677d7668f7))
|
|
17
|
+
|
|
18
|
+
## [3.1.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.3...v3.1.0) (2024-09-19)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add iconVariant prop to DynamicBridgeWidget ([#6915](https://github.com/dynamic-labs/DynamicAuth/issues/6915)) ([#6935](https://github.com/dynamic-labs/DynamicAuth/issues/6935)) ([e84874b](https://github.com/dynamic-labs/DynamicAuth/commit/e84874bedc965461ce5107e1cf773a55ed130d42))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* don't try to set up event listeners if wallet provider doesn't support it ([#6944](https://github.com/dynamic-labs/DynamicAuth/issues/6944)) ([c043a85](https://github.com/dynamic-labs/DynamicAuth/commit/c043a853623951f2af32eefcd030931ca4c5a8be))
|
|
29
|
+
|
|
2
30
|
### [3.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.2...v3.0.3) (2024-09-16)
|
|
3
31
|
|
|
4
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@walletconnect/ethereum-provider": "2.11.2",
|
|
31
31
|
"eventemitter3": "5.0.1",
|
|
32
32
|
"buffer": "6.0.3",
|
|
33
|
-
"@dynamic-labs/embedded-wallet-evm": "3.
|
|
34
|
-
"@dynamic-labs/ethereum-core": "3.
|
|
35
|
-
"@dynamic-labs/types": "3.
|
|
36
|
-
"@dynamic-labs/utils": "3.
|
|
37
|
-
"@dynamic-labs/wallet-book": "3.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "3.
|
|
33
|
+
"@dynamic-labs/embedded-wallet-evm": "3.1.1",
|
|
34
|
+
"@dynamic-labs/ethereum-core": "3.1.1",
|
|
35
|
+
"@dynamic-labs/types": "3.1.1",
|
|
36
|
+
"@dynamic-labs/utils": "3.1.1",
|
|
37
|
+
"@dynamic-labs/wallet-book": "3.1.1",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "3.1.1",
|
|
39
39
|
"stream": "0.0.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -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
|
}
|