@dynamic-labs/ethereum 3.9.6 → 3.9.8
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 +16 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/walletConnect/walletConnect.cjs +33 -33
- package/src/walletConnect/walletConnect.d.ts +3039 -3
- package/src/walletConnect/walletConnect.js +33 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.9.8](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.7...v3.9.8) (2025-01-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* allow confirmed commitment transactions for solana ([#7735](https://github.com/dynamic-labs/DynamicAuth/issues/7735)) ([7a43b79](https://github.com/dynamic-labs/DynamicAuth/commit/7a43b792ba615e277573b5540801a8b3e0c68155))
|
|
8
|
+
* allow selecting wallet directly without showing group view if wallet key is the same as group key ([#7748](https://github.com/dynamic-labs/DynamicAuth/issues/7748)) ([b335cbd](https://github.com/dynamic-labs/DynamicAuth/commit/b335cbdafc22d757c84995bd276c55681e6b2de5))
|
|
9
|
+
* make transaction destination parsing for regular EVM transactions ([#7719](https://github.com/dynamic-labs/DynamicAuth/issues/7719)) ([890bc0f](https://github.com/dynamic-labs/DynamicAuth/commit/890bc0f32a79fe3670d9dc4474b34c85854c0e70))
|
|
10
|
+
|
|
11
|
+
### [3.9.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.6...v3.9.7) (2025-01-02)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* wc wallet client interactions on some wallets ([#7728](https://github.com/dynamic-labs/DynamicAuth/issues/7728)) ([f1190d9](https://github.com/dynamic-labs/DynamicAuth/commit/f1190d9bd119f00787b61009d28c2d0f564f1ed8))
|
|
17
|
+
|
|
2
18
|
### [3.9.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.9.5...v3.9.6) (2024-12-28)
|
|
3
19
|
|
|
4
20
|
|
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": "3.9.
|
|
3
|
+
"version": "3.9.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@walletconnect/types": "2.10.6",
|
|
32
32
|
"eventemitter3": "5.0.1",
|
|
33
33
|
"buffer": "6.0.3",
|
|
34
|
-
"@dynamic-labs/assert-package-version": "3.9.
|
|
35
|
-
"@dynamic-labs/embedded-wallet-evm": "3.9.
|
|
36
|
-
"@dynamic-labs/ethereum-core": "3.9.
|
|
37
|
-
"@dynamic-labs/types": "3.9.
|
|
38
|
-
"@dynamic-labs/utils": "3.9.
|
|
39
|
-
"@dynamic-labs/wallet-book": "3.9.
|
|
40
|
-
"@dynamic-labs/wallet-connector-core": "3.9.
|
|
34
|
+
"@dynamic-labs/assert-package-version": "3.9.8",
|
|
35
|
+
"@dynamic-labs/embedded-wallet-evm": "3.9.8",
|
|
36
|
+
"@dynamic-labs/ethereum-core": "3.9.8",
|
|
37
|
+
"@dynamic-labs/types": "3.9.8",
|
|
38
|
+
"@dynamic-labs/utils": "3.9.8",
|
|
39
|
+
"@dynamic-labs/wallet-book": "3.9.8",
|
|
40
|
+
"@dynamic-labs/wallet-connector-core": "3.9.8"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"viem": "^2.7.12"
|
|
@@ -50,10 +50,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
50
50
|
: undefined;
|
|
51
51
|
}
|
|
52
52
|
getMappedChains() {
|
|
53
|
-
return
|
|
54
|
-
// Filters out palm that crashes Trust Wallet
|
|
55
|
-
.filter((network) => network.chainId !== 11297108109)
|
|
56
|
-
.map((network) => `eip155:${network.chainId}`));
|
|
53
|
+
return this.evmNetworks.map((network) => `eip155:${network.chainId}`);
|
|
57
54
|
}
|
|
58
55
|
getMappedChainsByPreferredOrder() {
|
|
59
56
|
const allChains = this.getMappedChains();
|
|
@@ -100,15 +97,19 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
100
97
|
});
|
|
101
98
|
});
|
|
102
99
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
getWalletClient(chainId) {
|
|
101
|
+
const walletConnect = this.createProvider();
|
|
102
|
+
const walletClient = viem.createWalletClient({
|
|
103
|
+
account: this.getActiveAccount(),
|
|
104
|
+
chain: ethereumCore.chainsMap[chainId !== null && chainId !== void 0 ? chainId : String(this.currentChainId)],
|
|
105
|
+
transport: viem.custom({
|
|
106
|
+
request: (args) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const provider = yield walletConnect;
|
|
108
|
+
return provider.request(args);
|
|
109
|
+
}),
|
|
110
|
+
}),
|
|
111
111
|
});
|
|
112
|
+
return walletClient;
|
|
112
113
|
}
|
|
113
114
|
createInitProviderPromise() {
|
|
114
115
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -132,14 +133,23 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
135
|
refreshSession() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
var _a, _b, _c, _d, _e;
|
|
138
|
+
if ((_b = (_a = WalletConnect.provider) === null || _a === void 0 ? void 0 : _a.session) === null || _b === void 0 ? void 0 : _b.topic) {
|
|
139
|
+
if (localStorage.getItem(this.sessionTopicKey) ===
|
|
140
|
+
((_d = (_c = WalletConnect.provider) === null || _c === void 0 ? void 0 : _c.session) === null || _d === void 0 ? void 0 : _d.topic)) {
|
|
141
|
+
this.session = WalletConnect.provider.session;
|
|
142
|
+
this.setActiveAccount(((_e = localStorage.getItem(this.activeAccountKey)) !== null && _e !== void 0 ? _e : undefined));
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
|
-
|
|
145
|
+
const walletClient = this.getWalletClient();
|
|
146
|
+
const walletChainId = yield walletClient.getChainId();
|
|
147
|
+
walletConnectorCore.logger.debug('checking selected chain in refreshSession', this.name, walletChainId, this.currentChainId);
|
|
148
|
+
if (this.currentChainId && this.currentChainId !== walletChainId) {
|
|
149
|
+
walletConnectorCore.logger.debug('switching to selected chain', this.currentChainId);
|
|
150
|
+
yield walletClient.switchChain({ id: this.currentChainId });
|
|
151
|
+
}
|
|
152
|
+
});
|
|
143
153
|
}
|
|
144
154
|
init() {
|
|
145
155
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -239,16 +249,6 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
239
249
|
WalletConnect.provider.off('session_event', this.sessionEventHandler);
|
|
240
250
|
WalletConnect.provider.off('session_delete', this.sessionDeleteHandler);
|
|
241
251
|
}
|
|
242
|
-
getWalletClient(chainId) {
|
|
243
|
-
if (!WalletConnect.provider) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
return viem.createWalletClient({
|
|
247
|
-
account: this.getActiveAccount(),
|
|
248
|
-
chain: ethereumCore.chainsMap[chainId !== null && chainId !== void 0 ? chainId : String(this.currentChainId)],
|
|
249
|
-
transport: viem.custom(WalletConnect.provider),
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
252
|
getAddress(opts) {
|
|
253
253
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
254
254
|
var _a, _b;
|
|
@@ -385,7 +385,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
385
385
|
if (!activeAccount) {
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
const walletClient = yield this.
|
|
388
|
+
const walletClient = yield this.getWalletClient();
|
|
389
389
|
return walletClient.signMessage({
|
|
390
390
|
account: activeAccount,
|
|
391
391
|
message: messageToSign,
|
|
@@ -466,7 +466,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
466
466
|
if (!this.supportsNetworkSwitching()) {
|
|
467
467
|
throw new utils.DynamicError('Network switching not supported');
|
|
468
468
|
}
|
|
469
|
-
const walletClient = yield this.
|
|
469
|
+
const walletClient = yield this.getWalletClient();
|
|
470
470
|
if (this.isMetaMask()) {
|
|
471
471
|
const deepLink = this.getDeepLink();
|
|
472
472
|
if (deepLink) {
|
|
@@ -483,7 +483,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
483
483
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
484
484
|
if (this.isInitialized === false) {
|
|
485
485
|
yield this.initProvider();
|
|
486
|
-
this.refreshSession();
|
|
486
|
+
yield this.refreshSession();
|
|
487
487
|
this.isInitialized = true;
|
|
488
488
|
}
|
|
489
489
|
const activeAccount = this.getActiveAccount();
|
|
@@ -501,7 +501,7 @@ class WalletConnect extends ethereumCore.EthereumWalletConnector {
|
|
|
501
501
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
502
502
|
var _a;
|
|
503
503
|
yield this.initProvider();
|
|
504
|
-
this.refreshSession();
|
|
504
|
+
yield this.refreshSession();
|
|
505
505
|
if (this.isMetaMask()) {
|
|
506
506
|
if (this.hasSwitchedNetwork) {
|
|
507
507
|
return [String(this.currentChainId)];
|