@dynamic-labs/ethereum-aa-zksync 4.20.2 → 4.20.3

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,11 @@
1
1
 
2
+ ### [4.20.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.2...v4.20.3) (2025-06-13)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * use minified jwt for waas wallet client auth ([#8938](https://github.com/dynamic-labs/dynamic-auth/issues/8938)) ([f7b9e14](https://github.com/dynamic-labs/dynamic-auth/commit/f7b9e1435e397a64fdf4f42f9b3ad354314e0191))
8
+
2
9
  ### [4.20.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.1...v4.20.2) (2025-06-11)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.20.2";
6
+ var version = "4.20.3";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.20.2";
2
+ var version = "4.20.3";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum-aa-zksync",
3
- "version": "4.20.2",
3
+ "version": "4.20.3",
4
4
  "description": "Core package for Ethereum Account Abstraction utilities and types",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -20,13 +20,13 @@
20
20
  "dependencies": {
21
21
  "@dynamic-labs/sdk-api-core": "0.0.681",
22
22
  "zksync-sso": "0.2.0",
23
- "@dynamic-labs/assert-package-version": "4.20.2",
24
- "@dynamic-labs/ethereum-aa-core": "4.20.2",
25
- "@dynamic-labs/ethereum-core": "4.20.2",
26
- "@dynamic-labs/types": "4.20.2",
27
- "@dynamic-labs/utils": "4.20.2",
28
- "@dynamic-labs/wallet-book": "4.20.2",
29
- "@dynamic-labs/wallet-connector-core": "4.20.2"
23
+ "@dynamic-labs/assert-package-version": "4.20.3",
24
+ "@dynamic-labs/ethereum-aa-core": "4.20.3",
25
+ "@dynamic-labs/ethereum-core": "4.20.3",
26
+ "@dynamic-labs/types": "4.20.3",
27
+ "@dynamic-labs/utils": "4.20.3",
28
+ "@dynamic-labs/wallet-book": "4.20.3",
29
+ "@dynamic-labs/wallet-connector-core": "4.20.3"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "viem": "^2.28.4"
@@ -704,7 +704,15 @@ class ZKsyncConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
704
704
  sessionConfig: serializedSessionConfig,
705
705
  sessionKey: privateKey,
706
706
  });
707
- return { expiresAt: safeSessionConfig.expiresAt, sessionId: sessionHash };
707
+ return {
708
+ expiresAt: safeSessionConfig.expiresAt,
709
+ session: {
710
+ sessionConfiguration: serializedSessionConfig,
711
+ sessionKey: privateKey,
712
+ sessionKeyValidator: this.sessionKeyAddress,
713
+ },
714
+ sessionId: sessionHash,
715
+ };
708
716
  });
709
717
  }
710
718
  validateActiveWallet(expectedAddress) {
@@ -11,7 +11,7 @@ import { WalletBookSchema } from '@dynamic-labs/wallet-book';
11
11
  import { Chain, IAccountAbstractionWalletConnector, InternalWalletConnector, WalletConnector } from '@dynamic-labs/wallet-connector-core';
12
12
  import { AccountAbstractionBaseConnector, AccountAbstractionConnectorProps } from '@dynamic-labs/ethereum-aa-core';
13
13
  import { DeploymentParams } from '../utils';
14
- import { SessionInformation, SessionConfigWithoutSigner } from '../types';
14
+ import { SessionInformation, SessionConfigWithoutSigner, SessionConfigJSON } from '../types';
15
15
  type ZKsyncConnectorProps = AccountAbstractionConnectorProps & {
16
16
  apiProviders: {
17
17
  [key in ProviderEnum]?: Provider;
@@ -17714,6 +17714,11 @@ export declare class ZKsyncConnector extends AccountAbstractionBaseConnector imp
17714
17714
  addModuleWithPaymaster?: boolean;
17715
17715
  }): Promise<{
17716
17716
  expiresAt: bigint;
17717
+ session: {
17718
+ sessionKeyValidator: `0x${string}`;
17719
+ sessionConfiguration: SessionConfigJSON;
17720
+ sessionKey: `0x${string}`;
17721
+ };
17717
17722
  sessionId: `0x${string}`;
17718
17723
  }>;
17719
17724
  validateActiveWallet(expectedAddress: string): Promise<void>;
@@ -700,7 +700,15 @@ class ZKsyncConnector extends AccountAbstractionBaseConnector {
700
700
  sessionConfig: serializedSessionConfig,
701
701
  sessionKey: privateKey,
702
702
  });
703
- return { expiresAt: safeSessionConfig.expiresAt, sessionId: sessionHash };
703
+ return {
704
+ expiresAt: safeSessionConfig.expiresAt,
705
+ session: {
706
+ sessionConfiguration: serializedSessionConfig,
707
+ sessionKey: privateKey,
708
+ sessionKeyValidator: this.sessionKeyAddress,
709
+ },
710
+ sessionId: sessionHash,
711
+ };
704
712
  });
705
713
  }
706
714
  validateActiveWallet(expectedAddress) {
package/src/index.cjs CHANGED
@@ -11,6 +11,7 @@ require('../_virtual/_tslib.cjs');
11
11
  require('zksync-sso/utils');
12
12
  require('@dynamic-labs/utils');
13
13
  var isZKsyncConnector = require('./utils/isZKsyncConnector.cjs');
14
+ var session = require('./utils/session.cjs');
14
15
  require('viem/zksync');
15
16
  require('zksync-sso/abi');
16
17
 
@@ -24,4 +25,7 @@ const ZKsyncSmartWalletConnectors = (props) => {
24
25
  };
25
26
 
26
27
  exports.isZKsyncConnector = isZKsyncConnector.isZKsyncConnector;
28
+ exports.createSessionClient = session.createSessionClient;
29
+ exports.parseSessionConfigJSON = session.parseSessionConfigJSON;
30
+ exports.stringifySessionConfig = session.stringifySessionConfig;
27
31
  exports.ZKsyncSmartWalletConnectors = ZKsyncSmartWalletConnectors;
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
2
- export { isZKsyncConnector } from './utils';
2
+ export { isZKsyncConnector, parseSessionConfigJSON, stringifySessionConfig, createSessionClient, } from './utils';
3
3
  export { type SessionInformation } from './types';
4
4
  export declare const ZKsyncSmartWalletConnectors: (props: any) => WalletConnectorConstructor[];
package/src/index.js CHANGED
@@ -7,6 +7,7 @@ import '../_virtual/_tslib.js';
7
7
  import 'zksync-sso/utils';
8
8
  import '@dynamic-labs/utils';
9
9
  export { isZKsyncConnector } from './utils/isZKsyncConnector.js';
10
+ export { createSessionClient, parseSessionConfigJSON, stringifySessionConfig } from './utils/session.js';
10
11
  import 'viem/zksync';
11
12
  import 'zksync-sso/abi';
12
13
 
@@ -5,6 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var viem = require('viem');
7
7
  var utils = require('zksync-sso/utils');
8
+ var client = require('zksync-sso/client');
9
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
8
10
 
9
11
  const DEFAULT_EXPIRATION_TIME = 86400; // 1 day
10
12
  const enforceSessionConfigRestrictions = (sessionConfig) => {
@@ -35,7 +37,18 @@ const stringifySessionConfig = (sessionConfig) => {
35
37
  });
36
38
  return Object.assign(Object.assign({}, sessionConfig), { callPolicies: sessionConfig.callPolicies.map((policy) => (Object.assign(Object.assign({}, policy), { constraints: policy.constraints.map((constraint) => (Object.assign(Object.assign({}, constraint), { index: constraint.index.toString(), limit: stringifyLimit(constraint.limit) }))), maxValuePerUse: policy.maxValuePerUse.toString(), valueLimit: stringifyLimit(policy.valueLimit) }))), expiresAt: sessionConfig.expiresAt.toString(), feeLimit: stringifyLimit(sessionConfig.feeLimit), transferPolicies: sessionConfig.transferPolicies.map((policy) => (Object.assign(Object.assign({}, policy), { maxValuePerUse: policy.maxValuePerUse.toString(), valueLimit: stringifyLimit(policy.valueLimit) }))) });
37
39
  };
40
+ const createSessionClient = ({ smartAccountAddress, sessionKeyValidator, sessionConfig, sessionKey, chainId, }) => client.createZksyncSessionClient({
41
+ address: smartAccountAddress,
42
+ chain: ethereumCore.getChain(chainId),
43
+ contracts: {
44
+ session: sessionKeyValidator,
45
+ },
46
+ sessionConfig,
47
+ sessionKey,
48
+ transport: viem.http(),
49
+ });
38
50
 
51
+ exports.createSessionClient = createSessionClient;
39
52
  exports.enforceSessionConfigRestrictions = enforceSessionConfigRestrictions;
40
53
  exports.getSessionHash = getSessionHash;
41
54
  exports.parseSessionConfigJSON = parseSessionConfigJSON;