@dynamic-labs/ethereum 3.0.2 → 3.1.0
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,24 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.1.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.3...v3.1.0) (2024-09-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* 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))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* 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))
|
|
13
|
+
|
|
14
|
+
### [3.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.2...v3.0.3) (2024-09-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* deeplinking for magic eden ethereum and btc ([#6919](https://github.com/dynamic-labs/DynamicAuth/issues/6919)) ([822efaa](https://github.com/dynamic-labs/DynamicAuth/commit/822efaabdec4415a031afabeef13b66ae7d3cd7c))
|
|
20
|
+
* sendBitcoin for unisat ([#6903](https://github.com/dynamic-labs/DynamicAuth/issues/6903)) ([71f726d](https://github.com/dynamic-labs/DynamicAuth/commit/71f726df7d8ff8307048ba1390c4847a9b16ce64))
|
|
21
|
+
|
|
2
22
|
### [3.0.2](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.1...v3.0.2) (2024-09-13)
|
|
3
23
|
|
|
4
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
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.0
|
|
34
|
-
"@dynamic-labs/ethereum-core": "3.0
|
|
35
|
-
"@dynamic-labs/types": "3.0
|
|
36
|
-
"@dynamic-labs/utils": "3.0
|
|
37
|
-
"@dynamic-labs/wallet-book": "3.0
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "3.0
|
|
33
|
+
"@dynamic-labs/embedded-wallet-evm": "3.1.0",
|
|
34
|
+
"@dynamic-labs/ethereum-core": "3.1.0",
|
|
35
|
+
"@dynamic-labs/types": "3.1.0",
|
|
36
|
+
"@dynamic-labs/utils": "3.1.0",
|
|
37
|
+
"@dynamic-labs/wallet-book": "3.1.0",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "3.1.0",
|
|
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
|
}
|
|
@@ -54,8 +54,7 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
54
54
|
walletConnectorCore.logger.error(error.message);
|
|
55
55
|
throw error;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
window.location.href = `${inAppBrowserBase}/${cleanedTargetUrl}`;
|
|
57
|
+
window.location.href = `${inAppBrowserBase}/${window.location.href}`;
|
|
59
58
|
return undefined;
|
|
60
59
|
});
|
|
61
60
|
}
|
|
@@ -50,8 +50,7 @@ const fetchInjectedWalletConnector = ({ walletBook, }) => {
|
|
|
50
50
|
logger.error(error.message);
|
|
51
51
|
throw error;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
window.location.href = `${inAppBrowserBase}/${cleanedTargetUrl}`;
|
|
53
|
+
window.location.href = `${inAppBrowserBase}/${window.location.href}`;
|
|
55
54
|
return undefined;
|
|
56
55
|
});
|
|
57
56
|
}
|