@dynamic-labs/waas-evm 4.9.3 → 4.9.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 +21 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/DynamicWaasEVMConnector.cjs +9 -9
- package/src/DynamicWaasEVMConnector.d.ts +0 -2
- package/src/DynamicWaasEVMConnector.js +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.9.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.4...v4.9.5) (2025-03-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for AA to Global Wallet ([#8294](https://github.com/dynamic-labs/dynamic-auth/issues/8294)) ([173dfb9](https://github.com/dynamic-labs/dynamic-auth/commit/173dfb9c00e4307feec6ab11913f1a80310885eb))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Remove the usage of random uuid in Global Wallet ([#8314](https://github.com/dynamic-labs/dynamic-auth/issues/8314)) ([79a7a64](https://github.com/dynamic-labs/dynamic-auth/commit/79a7a640b9ce470051a3c877ea46e8d4c94ea542))
|
|
13
|
+
* Fix UI when token balance is 0 ([#8299](https://github.com/dynamic-labs/dynamic-auth/issues/8299)) ([e8a2eca](https://github.com/dynamic-labs/dynamic-auth/commit/e8a2eca9876d914db738557a74751537eee2e129))
|
|
14
|
+
|
|
15
|
+
### [4.9.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.3...v4.9.4) (2025-03-17)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **logger:** don't try to store data if localStorage is not available ([#8309](https://github.com/dynamic-labs/dynamic-auth/issues/8309)) ([30164c7](https://github.com/dynamic-labs/dynamic-auth/commit/30164c7de7bbf1463c6f6a7c12c4b60b5cfb6e78))
|
|
21
|
+
* modal corners ([#8308](https://github.com/dynamic-labs/dynamic-auth/issues/8308)) ([2d21d87](https://github.com/dynamic-labs/dynamic-auth/commit/2d21d87466cee4ab3b981b24fa15f5c321b163f5))
|
|
22
|
+
|
|
2
23
|
### [4.9.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.2...v4.9.3) (2025-03-14)
|
|
3
24
|
|
|
4
25
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-evm",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.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",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs-wallet/evm": "0.0.
|
|
21
|
+
"@dynamic-labs-wallet/evm": "0.0.46",
|
|
22
22
|
"viem": "2.21.55",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.9.
|
|
24
|
-
"@dynamic-labs/ethereum-core": "4.9.
|
|
25
|
-
"@dynamic-labs/logger": "4.9.
|
|
26
|
-
"@dynamic-labs/types": "4.9.
|
|
27
|
-
"@dynamic-labs/utils": "4.9.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.9.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.9.5",
|
|
24
|
+
"@dynamic-labs/ethereum-core": "4.9.5",
|
|
25
|
+
"@dynamic-labs/logger": "4.9.5",
|
|
26
|
+
"@dynamic-labs/types": "4.9.5",
|
|
27
|
+
"@dynamic-labs/utils": "4.9.5",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.9.5"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {}
|
|
31
31
|
}
|
|
@@ -104,9 +104,6 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
104
104
|
}
|
|
105
105
|
return ((_a = evmNetwork === null || evmNetwork === void 0 ? void 0 : evmNetwork.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || (evmNetwork === null || evmNetwork === void 0 ? void 0 : evmNetwork.rpcUrls[0]);
|
|
106
106
|
}
|
|
107
|
-
setActiveAccountAddress(accountAddress) {
|
|
108
|
-
this.activeAccountAddress = accountAddress;
|
|
109
|
-
}
|
|
110
107
|
createDynamicWaasClient() {
|
|
111
108
|
var _a;
|
|
112
109
|
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
@@ -131,6 +128,7 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
131
128
|
}
|
|
132
129
|
validateActiveWallet(expectedAddress) {
|
|
133
130
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
var _a;
|
|
134
132
|
const walletClient = this.getWaasWalletClient();
|
|
135
133
|
const targetWallet = yield walletClient.getWallet({
|
|
136
134
|
accountAddress: expectedAddress,
|
|
@@ -138,9 +136,9 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
138
136
|
if (!targetWallet) {
|
|
139
137
|
throw new utils.DynamicError('Account not found');
|
|
140
138
|
}
|
|
141
|
-
const isWalletActive = walletConnectorCore.isSameAddress(targetWallet.accountAddress, this.
|
|
139
|
+
const isWalletActive = walletConnectorCore.isSameAddress(targetWallet.accountAddress, ((_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address) || '', this.connectedChain);
|
|
142
140
|
if (!isWalletActive) {
|
|
143
|
-
this.
|
|
141
|
+
this.setActiveAccount(targetWallet.accountAddress);
|
|
144
142
|
}
|
|
145
143
|
});
|
|
146
144
|
}
|
|
@@ -163,7 +161,8 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
163
161
|
return customViemAccount;
|
|
164
162
|
}
|
|
165
163
|
getWalletClient(chainId) {
|
|
166
|
-
|
|
164
|
+
var _a;
|
|
165
|
+
const targetAccountAddress = (_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address;
|
|
167
166
|
if (!targetAccountAddress) {
|
|
168
167
|
return this.getPublicClient();
|
|
169
168
|
}
|
|
@@ -203,13 +202,14 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
203
202
|
});
|
|
204
203
|
}
|
|
205
204
|
getWalletClientByAddress({ accountAddress, }) {
|
|
206
|
-
this.
|
|
205
|
+
this.setActiveAccount(accountAddress);
|
|
207
206
|
return this.getWalletClient();
|
|
208
207
|
}
|
|
209
208
|
exportPrivateKey() {
|
|
210
209
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, } = {}) {
|
|
210
|
+
var _a;
|
|
211
211
|
const walletClient = this.getWaasWalletClient();
|
|
212
|
-
const targetAccountAddress = accountAddress || this.
|
|
212
|
+
const targetAccountAddress = accountAddress || ((_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address);
|
|
213
213
|
if (!targetAccountAddress) {
|
|
214
214
|
throw new Error('Account address is required');
|
|
215
215
|
}
|
|
@@ -237,7 +237,7 @@ class DynamicWaasEVMConnector extends ethereumCore.EthereumWalletConnector {
|
|
|
237
237
|
if (!accountAddress) {
|
|
238
238
|
throw new Error('Account address is required');
|
|
239
239
|
}
|
|
240
|
-
this.
|
|
240
|
+
this.setActiveAccount(accountAddress);
|
|
241
241
|
const walletClient = this.getWaasWalletClient();
|
|
242
242
|
yield walletClient.exportClientKeyshares({
|
|
243
243
|
accountAddress,
|
|
@@ -12,7 +12,6 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
|
|
|
12
12
|
private environmentId?;
|
|
13
13
|
private getAuthToken?;
|
|
14
14
|
private dynamicWaasClient;
|
|
15
|
-
private activeAccountAddress;
|
|
16
15
|
private baseApiUrl?;
|
|
17
16
|
private relayUrl?;
|
|
18
17
|
constructor(props: EthereumWalletConnectorOpts);
|
|
@@ -28,7 +27,6 @@ export declare class DynamicWaasEVMConnector extends EthereumWalletConnector imp
|
|
|
28
27
|
private currentEvmNetwork;
|
|
29
28
|
switchNetwork({ networkChainId, }: SwitchNetworkOps): Promise<void>;
|
|
30
29
|
private getRpcUrl;
|
|
31
|
-
private setActiveAccountAddress;
|
|
32
30
|
createDynamicWaasClient(): DynamicEvmWalletClient;
|
|
33
31
|
getWaasWalletClient(): DynamicEvmWalletClient;
|
|
34
32
|
validateActiveWallet(expectedAddress: string): Promise<void>;
|
|
@@ -100,9 +100,6 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
100
100
|
}
|
|
101
101
|
return ((_a = evmNetwork === null || evmNetwork === void 0 ? void 0 : evmNetwork.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || (evmNetwork === null || evmNetwork === void 0 ? void 0 : evmNetwork.rpcUrls[0]);
|
|
102
102
|
}
|
|
103
|
-
setActiveAccountAddress(accountAddress) {
|
|
104
|
-
this.activeAccountAddress = accountAddress;
|
|
105
|
-
}
|
|
106
103
|
createDynamicWaasClient() {
|
|
107
104
|
var _a;
|
|
108
105
|
const authToken = (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
@@ -127,6 +124,7 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
127
124
|
}
|
|
128
125
|
validateActiveWallet(expectedAddress) {
|
|
129
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a;
|
|
130
128
|
const walletClient = this.getWaasWalletClient();
|
|
131
129
|
const targetWallet = yield walletClient.getWallet({
|
|
132
130
|
accountAddress: expectedAddress,
|
|
@@ -134,9 +132,9 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
134
132
|
if (!targetWallet) {
|
|
135
133
|
throw new DynamicError('Account not found');
|
|
136
134
|
}
|
|
137
|
-
const isWalletActive = isSameAddress(targetWallet.accountAddress, this.
|
|
135
|
+
const isWalletActive = isSameAddress(targetWallet.accountAddress, ((_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address) || '', this.connectedChain);
|
|
138
136
|
if (!isWalletActive) {
|
|
139
|
-
this.
|
|
137
|
+
this.setActiveAccount(targetWallet.accountAddress);
|
|
140
138
|
}
|
|
141
139
|
});
|
|
142
140
|
}
|
|
@@ -159,7 +157,8 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
159
157
|
return customViemAccount;
|
|
160
158
|
}
|
|
161
159
|
getWalletClient(chainId) {
|
|
162
|
-
|
|
160
|
+
var _a;
|
|
161
|
+
const targetAccountAddress = (_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address;
|
|
163
162
|
if (!targetAccountAddress) {
|
|
164
163
|
return this.getPublicClient();
|
|
165
164
|
}
|
|
@@ -199,13 +198,14 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
getWalletClientByAddress({ accountAddress, }) {
|
|
202
|
-
this.
|
|
201
|
+
this.setActiveAccount(accountAddress);
|
|
203
202
|
return this.getWalletClient();
|
|
204
203
|
}
|
|
205
204
|
exportPrivateKey() {
|
|
206
205
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, } = {}) {
|
|
206
|
+
var _a;
|
|
207
207
|
const walletClient = this.getWaasWalletClient();
|
|
208
|
-
const targetAccountAddress = accountAddress || this.
|
|
208
|
+
const targetAccountAddress = accountAddress || ((_a = this.getActiveAccount()) === null || _a === void 0 ? void 0 : _a.address);
|
|
209
209
|
if (!targetAccountAddress) {
|
|
210
210
|
throw new Error('Account address is required');
|
|
211
211
|
}
|
|
@@ -233,7 +233,7 @@ class DynamicWaasEVMConnector extends EthereumWalletConnector {
|
|
|
233
233
|
if (!accountAddress) {
|
|
234
234
|
throw new Error('Account address is required');
|
|
235
235
|
}
|
|
236
|
-
this.
|
|
236
|
+
this.setActiveAccount(accountAddress);
|
|
237
237
|
const walletClient = this.getWaasWalletClient();
|
|
238
238
|
yield walletClient.exportClientKeyshares({
|
|
239
239
|
accountAddress,
|