@dynamic-labs/ethereum-aa 4.8.3 → 4.8.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 CHANGED
@@ -1,4 +1,30 @@
1
1
 
2
+ ### [4.8.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.4...v4.8.5) (2025-03-06)
3
+
4
+
5
+ ### Features
6
+
7
+ * evm connector can sign arbitrary transactions ([#8217](https://github.com/dynamic-labs/dynamic-auth/issues/8217)) ([c5b227c](https://github.com/dynamic-labs/dynamic-auth/commit/c5b227c5a5d527f3fc74b8c1c9d0247eaf35a016))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * optimize shadow dom re-renders ([#8193](https://github.com/dynamic-labs/dynamic-auth/issues/8193)) ([c97310c](https://github.com/dynamic-labs/dynamic-auth/commit/c97310c9f3eb73b9f69b0b48a79e6bbd93d2e94a))
13
+ * show multichain wallets with zerodev ([#8220](https://github.com/dynamic-labs/dynamic-auth/issues/8220)) ([a48689d](https://github.com/dynamic-labs/dynamic-auth/commit/a48689da1303512551bdf8114de45493d33221a3))
14
+
15
+ ### [4.8.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.3...v4.8.4) (2025-03-05)
16
+
17
+
18
+ ### Features
19
+
20
+ * add iframe deeplink support for iOS Safari ([#8168](https://github.com/dynamic-labs/dynamic-auth/issues/8168)) ([cc4a6b9](https://github.com/dynamic-labs/dynamic-auth/commit/cc4a6b94b8e1b36b303ea5bf86734ba2e73bcef9))
21
+ * add binance bitcoin wallet support ([#8089](ttps://github.com/dynamic-labs/dynamic-auth/issues/8089)) ([c8a3a41](https://github.com/dynamic-labs/dynamic-auth/commit/c8a3a418e4f431b3442e5bc7332530b777e223c8))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * mobile wallet iframe redirects ([#8213](https://github.com/dynamic-labs/dynamic-auth/issues/8213)) ([96ea428](https://github.com/dynamic-labs/dynamic-auth/commit/96ea428375232e57379faef6e2a61dd818325777))
27
+
2
28
  ### [4.8.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.2...v4.8.3) (2025-03-04)
3
29
 
4
30
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.8.3";
6
+ var version = "4.8.5";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.8.3";
2
+ var version = "4.8.5";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum-aa",
3
- "version": "4.8.3",
3
+ "version": "4.8.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",
@@ -22,13 +22,13 @@
22
22
  "@zerodev/ecdsa-validator": "5.4.4",
23
23
  "@zerodev/multi-chain-ecdsa-validator": "5.4.3",
24
24
  "@zerodev/sdk": "5.4.21",
25
- "@dynamic-labs/assert-package-version": "4.8.3",
26
- "@dynamic-labs/ethereum-core": "4.8.3",
27
- "@dynamic-labs/logger": "4.8.3",
28
- "@dynamic-labs/types": "4.8.3",
29
- "@dynamic-labs/utils": "4.8.3",
30
- "@dynamic-labs/wallet-book": "4.8.3",
31
- "@dynamic-labs/wallet-connector-core": "4.8.3"
25
+ "@dynamic-labs/assert-package-version": "4.8.5",
26
+ "@dynamic-labs/ethereum-core": "4.8.5",
27
+ "@dynamic-labs/logger": "4.8.5",
28
+ "@dynamic-labs/types": "4.8.5",
29
+ "@dynamic-labs/utils": "4.8.5",
30
+ "@dynamic-labs/wallet-book": "4.8.5",
31
+ "@dynamic-labs/wallet-connector-core": "4.8.5"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "viem": "^2.21.55"
@@ -194,7 +194,9 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
194
194
  logger.logger.error('No EOA connector provided');
195
195
  return;
196
196
  }
197
- this.kernelClientDeferredPromise = new utils.DeferredPromise();
197
+ this.kernelClientDeferredPromise = this.kernelClientDeferredPromise
198
+ ? this.kernelClientDeferredPromise
199
+ : new utils.DeferredPromise();
198
200
  this.eoaConnector = connector;
199
201
  this.eoaAddress = eoaAddress;
200
202
  if (properties) {
@@ -236,39 +238,53 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
236
238
  }
237
239
  });
238
240
  }
241
+ /**
242
+ * Generates a map of kernel clients for each chain in the providers list
243
+ * Each chain gets two clients: one without sponsorship and one with sponsorship
244
+ *
245
+ * @param signer - The wallet client to use for signing transactions
246
+ */
239
247
  generateProviderMap(signer) {
240
248
  return _tslib.__awaiter(this, void 0, void 0, function* () {
241
- // reset the chains provider map when eoa connector changes
242
- this.providerMap = {};
249
+ const providerMap = {};
243
250
  yield Promise.all(this.providersFromApi.map((provider) => _tslib.__awaiter(this, void 0, void 0, function* () {
244
- if (!this.providerMap[provider.chain]) {
245
- const [kernelClient, kernelClientWithSponsorship] = yield Promise.all([
246
- this.createKernelClient({
247
- chainId: provider.chain,
248
- paymaster: 'NONE',
249
- projectId: provider.clientId,
250
- signer,
251
- }),
252
- this.createKernelClient({
253
- chainId: provider.chain,
254
- paymaster: 'SPONSOR',
255
- projectId: provider.clientId,
256
- signer,
257
- }),
258
- ]);
259
- this.providerMap[provider.chain] = {
260
- kernelClient,
261
- kernelClientWithSponsorship,
262
- };
263
- }
264
- yield this.warnIfProjectChainNotEnabled(utils.parseChainId(provider.chain));
251
+ const { chain, clientId } = provider;
252
+ const [kernelClient, kernelClientWithSponsorship] = yield Promise.all([
253
+ this.createKernelClient({
254
+ chainId: chain,
255
+ paymaster: 'NONE',
256
+ projectId: clientId,
257
+ signer,
258
+ }),
259
+ this.createKernelClient({
260
+ chainId: chain,
261
+ paymaster: 'SPONSOR',
262
+ projectId: clientId,
263
+ signer,
264
+ }),
265
+ ]);
266
+ providerMap[chain] = {
267
+ kernelClient,
268
+ kernelClientWithSponsorship,
269
+ };
270
+ yield this.warnIfProjectChainNotEnabled(utils.parseChainId(chain));
265
271
  })));
272
+ // Filter out duplicate chains and store the provider map
273
+ const uniqueChainProviderMap = Object.entries(providerMap).reduce((acc, [chain, providers]) => {
274
+ if (!acc[chain]) {
275
+ acc[chain] = providers;
276
+ }
277
+ return acc;
278
+ }, {});
279
+ this.providerMap = uniqueChainProviderMap;
266
280
  });
267
281
  }
268
282
  createKernelClient(_a) {
269
283
  return _tslib.__awaiter(this, arguments, void 0, function* ({ chainId, projectId, signer, paymaster, }) {
270
284
  if (chainId && this.providerMap[chainId]) {
271
- return this.providerMap[chainId].kernelClient;
285
+ return paymaster === 'SPONSOR'
286
+ ? this.providerMap[chainId].kernelClientWithSponsorship
287
+ : this.providerMap[chainId].kernelClient;
272
288
  }
273
289
  const { eoaConnector } = this;
274
290
  if (!eoaConnector)
@@ -334,6 +350,8 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
334
350
  }
335
351
  getNetwork() {
336
352
  return _tslib.__awaiter(this, void 0, void 0, function* () {
353
+ var _a;
354
+ yield ((_a = this.kernelClientDeferredPromise) === null || _a === void 0 ? void 0 : _a.promise);
337
355
  return Number(this.lastUsedChainId);
338
356
  });
339
357
  }
@@ -95,6 +95,12 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
95
95
  private getOrCreateAuthorization;
96
96
  private setEoaConnector;
97
97
  private warnIfProjectChainNotEnabled;
98
+ /**
99
+ * Generates a map of kernel clients for each chain in the providers list
100
+ * Each chain gets two clients: one without sponsorship and one with sponsorship
101
+ *
102
+ * @param signer - The wallet client to use for signing transactions
103
+ */
98
104
  private generateProviderMap;
99
105
  private createKernelClient;
100
106
  getAddress(): Promise<string | undefined>;
@@ -190,7 +190,9 @@ class ZeroDevConnector extends WalletConnectorBase {
190
190
  logger.error('No EOA connector provided');
191
191
  return;
192
192
  }
193
- this.kernelClientDeferredPromise = new DeferredPromise();
193
+ this.kernelClientDeferredPromise = this.kernelClientDeferredPromise
194
+ ? this.kernelClientDeferredPromise
195
+ : new DeferredPromise();
194
196
  this.eoaConnector = connector;
195
197
  this.eoaAddress = eoaAddress;
196
198
  if (properties) {
@@ -232,39 +234,53 @@ class ZeroDevConnector extends WalletConnectorBase {
232
234
  }
233
235
  });
234
236
  }
237
+ /**
238
+ * Generates a map of kernel clients for each chain in the providers list
239
+ * Each chain gets two clients: one without sponsorship and one with sponsorship
240
+ *
241
+ * @param signer - The wallet client to use for signing transactions
242
+ */
235
243
  generateProviderMap(signer) {
236
244
  return __awaiter(this, void 0, void 0, function* () {
237
- // reset the chains provider map when eoa connector changes
238
- this.providerMap = {};
245
+ const providerMap = {};
239
246
  yield Promise.all(this.providersFromApi.map((provider) => __awaiter(this, void 0, void 0, function* () {
240
- if (!this.providerMap[provider.chain]) {
241
- const [kernelClient, kernelClientWithSponsorship] = yield Promise.all([
242
- this.createKernelClient({
243
- chainId: provider.chain,
244
- paymaster: 'NONE',
245
- projectId: provider.clientId,
246
- signer,
247
- }),
248
- this.createKernelClient({
249
- chainId: provider.chain,
250
- paymaster: 'SPONSOR',
251
- projectId: provider.clientId,
252
- signer,
253
- }),
254
- ]);
255
- this.providerMap[provider.chain] = {
256
- kernelClient,
257
- kernelClientWithSponsorship,
258
- };
259
- }
260
- yield this.warnIfProjectChainNotEnabled(parseChainId(provider.chain));
247
+ const { chain, clientId } = provider;
248
+ const [kernelClient, kernelClientWithSponsorship] = yield Promise.all([
249
+ this.createKernelClient({
250
+ chainId: chain,
251
+ paymaster: 'NONE',
252
+ projectId: clientId,
253
+ signer,
254
+ }),
255
+ this.createKernelClient({
256
+ chainId: chain,
257
+ paymaster: 'SPONSOR',
258
+ projectId: clientId,
259
+ signer,
260
+ }),
261
+ ]);
262
+ providerMap[chain] = {
263
+ kernelClient,
264
+ kernelClientWithSponsorship,
265
+ };
266
+ yield this.warnIfProjectChainNotEnabled(parseChainId(chain));
261
267
  })));
268
+ // Filter out duplicate chains and store the provider map
269
+ const uniqueChainProviderMap = Object.entries(providerMap).reduce((acc, [chain, providers]) => {
270
+ if (!acc[chain]) {
271
+ acc[chain] = providers;
272
+ }
273
+ return acc;
274
+ }, {});
275
+ this.providerMap = uniqueChainProviderMap;
262
276
  });
263
277
  }
264
278
  createKernelClient(_a) {
265
279
  return __awaiter(this, arguments, void 0, function* ({ chainId, projectId, signer, paymaster, }) {
266
280
  if (chainId && this.providerMap[chainId]) {
267
- return this.providerMap[chainId].kernelClient;
281
+ return paymaster === 'SPONSOR'
282
+ ? this.providerMap[chainId].kernelClientWithSponsorship
283
+ : this.providerMap[chainId].kernelClient;
268
284
  }
269
285
  const { eoaConnector } = this;
270
286
  if (!eoaConnector)
@@ -330,6 +346,8 @@ class ZeroDevConnector extends WalletConnectorBase {
330
346
  }
331
347
  getNetwork() {
332
348
  return __awaiter(this, void 0, void 0, function* () {
349
+ var _a;
350
+ yield ((_a = this.kernelClientDeferredPromise) === null || _a === void 0 ? void 0 : _a.promise);
333
351
  return Number(this.lastUsedChainId);
334
352
  });
335
353
  }