@dynamic-labs/ethereum-aa 4.3.0 → 4.3.2

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,15 @@
1
1
 
2
+ ### [4.3.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.3.1...v4.3.2) (2025-01-24)
3
+
4
+ ### [4.3.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.3.0...v4.3.1) (2025-01-23)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * correctly parse message to sign when it has unscaped new line character ([#7850](https://github.com/dynamic-labs/dynamic-auth/issues/7850)) ([156c144](https://github.com/dynamic-labs/dynamic-auth/commit/156c1440989ef7cb9a9066491e8670bc1737eb68))
10
+ * ensure user wallets state has been updated before emitting walletAdded/walletRemoved events ([#7863](https://github.com/dynamic-labs/dynamic-auth/issues/7863)) ([2bf61db](https://github.com/dynamic-labs/dynamic-auth/commit/2bf61dbace85d93c8fb684a9c7304fe562a85395))
11
+ * ensure zerodev simulation has correct gas limit and initCode data ([#7861](https://github.com/dynamic-labs/dynamic-auth/issues/7861)) ([88c2588](https://github.com/dynamic-labs/dynamic-auth/commit/88c2588256a2421907c0d9f0f724a8708cf9a54a))
12
+
2
13
  ## [4.3.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.2.3...v4.3.0) (2025-01-21)
3
14
 
4
15
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.3.0";
6
+ var version = "4.3.2";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.3.0";
2
+ var version = "4.3.2";
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.3.0",
3
+ "version": "4.3.2",
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,17 +18,17 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.586",
22
- "@zerodev/ecdsa-validator": "5.4.0",
21
+ "@dynamic-labs/sdk-api-core": "0.0.599",
22
+ "@zerodev/ecdsa-validator": "5.4.3",
23
23
  "@zerodev/multi-chain-ecdsa-validator": "5.4.2",
24
- "@zerodev/sdk": "5.4.5",
25
- "@dynamic-labs/assert-package-version": "4.3.0",
26
- "@dynamic-labs/ethereum-core": "4.3.0",
27
- "@dynamic-labs/logger": "4.3.0",
28
- "@dynamic-labs/types": "4.3.0",
29
- "@dynamic-labs/utils": "4.3.0",
30
- "@dynamic-labs/wallet-book": "4.3.0",
31
- "@dynamic-labs/wallet-connector-core": "4.3.0"
24
+ "@zerodev/sdk": "5.4.17",
25
+ "@dynamic-labs/assert-package-version": "4.3.2",
26
+ "@dynamic-labs/ethereum-core": "4.3.2",
27
+ "@dynamic-labs/logger": "4.3.2",
28
+ "@dynamic-labs/types": "4.3.2",
29
+ "@dynamic-labs/utils": "4.3.2",
30
+ "@dynamic-labs/wallet-book": "4.3.2",
31
+ "@dynamic-labs/wallet-connector-core": "4.3.2"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "viem": "^2.21.55"
@@ -371,12 +371,19 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
371
371
  const entryPoint = kernelAccount === null || kernelAccount === void 0 ? void 0 : kernelAccount.entryPoint;
372
372
  const isV6 = (entryPoint === null || entryPoint === void 0 ? void 0 : entryPoint.address.toLowerCase()) ===
373
373
  constants$1.getEntryPoint('0.6').address.toLowerCase();
374
+ const factoryArgs = yield (kernelAccount === null || kernelAccount === void 0 ? void 0 : kernelAccount.getFactoryArgs());
375
+ // we need the initCode in order to simulate the transaction
376
+ // when the contract is not yet deployed
377
+ const initCode = (factoryArgs === null || factoryArgs === void 0 ? void 0 : factoryArgs.factory) && (factoryArgs === null || factoryArgs === void 0 ? void 0 : factoryArgs.factoryData)
378
+ ? '0x' +
379
+ factoryArgs.factory.slice(2).toLowerCase() +
380
+ factoryArgs.factoryData.slice(2).toLowerCase()
381
+ : '0x';
374
382
  if (isV6) {
375
383
  return {
376
384
  callData: params.callData,
377
385
  callGasLimit: viem.toHex(params.callGasLimit),
378
- // setting initCode to 0x since it is only used for transaction simulation
379
- initCode: '0x',
386
+ initCode,
380
387
  maxFeePerGas: viem.toHex(params.maxFeePerGas),
381
388
  maxPriorityFeePerGas: viem.toHex(params.maxPriorityFeePerGas),
382
389
  nonce: viem.toHex(params.nonce),
@@ -388,16 +395,12 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
388
395
  };
389
396
  }
390
397
  const accountGasLimits = '0x' +
391
- '000000000000000000000000000' + // 27 zeros
392
- viem.toHex(params.verificationGasLimit).slice(2) +
393
- '000000000000000000000000000' + // 27 zeros
394
- viem.toHex(params.callGasLimit).slice(2);
398
+ viem.toHex(params.verificationGasLimit).slice(2).padStart(32, '0') +
399
+ viem.toHex(params.callGasLimit).slice(2).padStart(32, '0');
395
400
  const preVerificationGas = viem.toHex(params.preVerificationGas);
396
401
  const gasFees = '0x' +
397
- '00000000000000000000000000' + // 26 zeros
398
- viem.toHex(params.maxPriorityFeePerGas).slice(2).padStart(6, '0') +
399
- '0000000000000000000000' + // 22 zeros
400
- viem.toHex(params.maxFeePerGas).slice(2).padStart(10, '0');
402
+ viem.toHex(params.maxPriorityFeePerGas).slice(2).padStart(32, '0') +
403
+ viem.toHex(params.maxFeePerGas).slice(2).padStart(32, '0');
401
404
  const paymasterAndData = params.paymaster
402
405
  ? '0x' +
403
406
  params.paymaster.slice(2).toLowerCase() +
@@ -409,8 +412,7 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
409
412
  accountGasLimits: accountGasLimits,
410
413
  callData: params.callData,
411
414
  gasFees: gasFees,
412
- // setting initCode to 0x since it is only used for transaction simulation
413
- initCode: '0x',
415
+ initCode,
414
416
  nonce: viem.toHex(params.nonce),
415
417
  paymasterAndData: paymasterAndData.toLowerCase(),
416
418
  preVerificationGas: preVerificationGas,
@@ -367,12 +367,19 @@ class ZeroDevConnector extends WalletConnectorBase {
367
367
  const entryPoint = kernelAccount === null || kernelAccount === void 0 ? void 0 : kernelAccount.entryPoint;
368
368
  const isV6 = (entryPoint === null || entryPoint === void 0 ? void 0 : entryPoint.address.toLowerCase()) ===
369
369
  getEntryPoint$1('0.6').address.toLowerCase();
370
+ const factoryArgs = yield (kernelAccount === null || kernelAccount === void 0 ? void 0 : kernelAccount.getFactoryArgs());
371
+ // we need the initCode in order to simulate the transaction
372
+ // when the contract is not yet deployed
373
+ const initCode = (factoryArgs === null || factoryArgs === void 0 ? void 0 : factoryArgs.factory) && (factoryArgs === null || factoryArgs === void 0 ? void 0 : factoryArgs.factoryData)
374
+ ? '0x' +
375
+ factoryArgs.factory.slice(2).toLowerCase() +
376
+ factoryArgs.factoryData.slice(2).toLowerCase()
377
+ : '0x';
370
378
  if (isV6) {
371
379
  return {
372
380
  callData: params.callData,
373
381
  callGasLimit: toHex(params.callGasLimit),
374
- // setting initCode to 0x since it is only used for transaction simulation
375
- initCode: '0x',
382
+ initCode,
376
383
  maxFeePerGas: toHex(params.maxFeePerGas),
377
384
  maxPriorityFeePerGas: toHex(params.maxPriorityFeePerGas),
378
385
  nonce: toHex(params.nonce),
@@ -384,16 +391,12 @@ class ZeroDevConnector extends WalletConnectorBase {
384
391
  };
385
392
  }
386
393
  const accountGasLimits = '0x' +
387
- '000000000000000000000000000' + // 27 zeros
388
- toHex(params.verificationGasLimit).slice(2) +
389
- '000000000000000000000000000' + // 27 zeros
390
- toHex(params.callGasLimit).slice(2);
394
+ toHex(params.verificationGasLimit).slice(2).padStart(32, '0') +
395
+ toHex(params.callGasLimit).slice(2).padStart(32, '0');
391
396
  const preVerificationGas = toHex(params.preVerificationGas);
392
397
  const gasFees = '0x' +
393
- '00000000000000000000000000' + // 26 zeros
394
- toHex(params.maxPriorityFeePerGas).slice(2).padStart(6, '0') +
395
- '0000000000000000000000' + // 22 zeros
396
- toHex(params.maxFeePerGas).slice(2).padStart(10, '0');
398
+ toHex(params.maxPriorityFeePerGas).slice(2).padStart(32, '0') +
399
+ toHex(params.maxFeePerGas).slice(2).padStart(32, '0');
397
400
  const paymasterAndData = params.paymaster
398
401
  ? '0x' +
399
402
  params.paymaster.slice(2).toLowerCase() +
@@ -405,8 +408,7 @@ class ZeroDevConnector extends WalletConnectorBase {
405
408
  accountGasLimits: accountGasLimits,
406
409
  callData: params.callData,
407
410
  gasFees: gasFees,
408
- // setting initCode to 0x since it is only used for transaction simulation
409
- initCode: '0x',
411
+ initCode,
410
412
  nonce: toHex(params.nonce),
411
413
  paymasterAndData: paymasterAndData.toLowerCase(),
412
414
  preVerificationGas: preVerificationGas,