@dynamic-labs/zerodev-extension 4.20.12 → 4.20.14

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,24 @@
1
1
 
2
+ ### [4.20.14](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.13...v4.20.14) (2025-07-03)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * refresh function user state for sessionId ([#9073](https://github.com/dynamic-labs/dynamic-auth/issues/9073)) ([080e923](https://github.com/dynamic-labs/dynamic-auth/commit/080e92356e3920f1d240b5025db9c831aa2abc5a))
8
+ * remove default commonjs setups for @dynamic-labs-wallet/browser-wallet-client ([#9079](https://github.com/dynamic-labs/dynamic-auth/issues/9079)) ([27507ab](https://github.com/dynamic-labs/dynamic-auth/commit/27507abedfd223209cad15d5c1e12b37fa421071))
9
+
10
+ ### [4.20.13](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.12...v4.20.13) (2025-07-02)
11
+
12
+
13
+ ### Features
14
+
15
+ * add createWalletClient method to ZeroDevExtension ([#9036](https://github.com/dynamic-labs/dynamic-auth/issues/9036)) ([674df45](https://github.com/dynamic-labs/dynamic-auth/commit/674df45f21e76070594963c2e3b7c19ba94e3004))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * allow to retry metamask deeplink ([#9066](https://github.com/dynamic-labs/dynamic-auth/issues/9066)) ([308c0d2](https://github.com/dynamic-labs/dynamic-auth/commit/308c0d2ddd7a5c7460f31d25365687b315b0a0f4))
21
+
2
22
  ### [4.20.12](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.11...v4.20.12) (2025-07-01)
3
23
 
4
24
 
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.12";
6
+ var version = "4.20.14";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.20.12";
2
+ var version = "4.20.14";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/zerodev-extension",
3
- "version": "4.20.12",
3
+ "version": "4.20.14",
4
4
  "main": "./src/index.cjs",
5
5
  "module": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -14,16 +14,16 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "dependencies": {
17
- "@dynamic-labs/sdk-api-core": "0.0.699",
17
+ "@dynamic-labs/sdk-api-core": "0.0.704",
18
18
  "@zerodev/sdk": "5.4.36",
19
19
  "@zerodev/multi-chain-ecdsa-validator": "5.4.5",
20
20
  "@zerodev/ecdsa-validator": "5.4.9",
21
- "@dynamic-labs/assert-package-version": "4.20.12",
22
- "@dynamic-labs/client": "4.20.12",
23
- "@dynamic-labs/ethereum-aa": "4.20.12",
24
- "@dynamic-labs/logger": "4.20.12",
25
- "@dynamic-labs/message-transport": "4.20.12",
26
- "@dynamic-labs/viem-extension": "4.20.12"
21
+ "@dynamic-labs/assert-package-version": "4.20.14",
22
+ "@dynamic-labs/client": "4.20.14",
23
+ "@dynamic-labs/ethereum-aa": "4.20.14",
24
+ "@dynamic-labs/logger": "4.20.14",
25
+ "@dynamic-labs/message-transport": "4.20.14",
26
+ "@dynamic-labs/viem-extension": "4.20.14"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "viem": "^2.28.4"
@@ -23,40 +23,43 @@ const ZeroDevExtension = () => (client$1, core) => {
23
23
  }
24
24
  const zeroDevRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
25
25
  const viemRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
26
+ const createWalletClientHelper = (wallet, chainId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
27
+ const eoaWallet = yield client$1.wallets.accountAbstraction.getEOAWallet({
28
+ wallet,
29
+ });
30
+ if (!eoaWallet) {
31
+ throw new Error('EOA wallet not found');
32
+ }
33
+ return client$1.viem.createWalletClient({
34
+ account: accounts.toAccount({
35
+ address: eoaWallet.address,
36
+ signAuthorization: (parameters) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
37
+ var _a;
38
+ const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
39
+ return Object.assign(Object.assign({}, result), { yParity: (_a = result.yParity) !== null && _a !== void 0 ? _a : 0 });
40
+ }),
41
+ signMessage: (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ message }) {
42
+ return viemRequestChannel.request('viem_signMessage', eoaWallet.id, message);
43
+ }),
44
+ signTransaction: (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
45
+ return viemRequestChannel.request('viem_signTransaction', eoaWallet.id, transaction);
46
+ }),
47
+ signTypedData: (typedData) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
48
+ return viemRequestChannel.request('viem_signTypedData', eoaWallet.id, typedData);
49
+ }),
50
+ }),
51
+ chain: chainId ? getChainById.getChainById(chainId) : undefined,
52
+ wallet: eoaWallet,
53
+ });
54
+ });
26
55
  return {
27
56
  zeroDev: {
28
- createKernelClient: (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
29
- var _b, _c, _d;
57
+ createKernelClient: (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
58
+ var _d, _e, _f;
30
59
  try {
31
- const eoaWallet = yield client$1.wallets.accountAbstraction.getEOAWallet({
32
- wallet,
33
- });
34
- if (!eoaWallet) {
35
- throw new Error('EOA wallet not found');
36
- }
37
- const walletClient = yield client$1.viem.createWalletClient({
38
- account: accounts.toAccount({
39
- address: eoaWallet.address,
40
- signAuthorization: (parameters) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
41
- var _e;
42
- const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
43
- return Object.assign(Object.assign({}, result), { yParity: (_e = result.yParity) !== null && _e !== void 0 ? _e : 0 });
44
- }),
45
- signMessage: (_f) => _tslib.__awaiter(void 0, [_f], void 0, function* ({ message }) {
46
- return viemRequestChannel.request('viem_signMessage', eoaWallet.id, message);
47
- }),
48
- signTransaction: (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
49
- return viemRequestChannel.request('viem_signTransaction', eoaWallet.id, transaction);
50
- }),
51
- signTypedData: (typedData) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
52
- return viemRequestChannel.request('viem_signTypedData', eoaWallet.id, typedData);
53
- }),
54
- }),
55
- chain: chainId ? getChainById.getChainById(chainId) : undefined,
56
- wallet: eoaWallet,
57
- });
60
+ const walletClient = yield createWalletClientHelper(wallet, chainId);
58
61
  const accountSettings = yield zeroDevRequestChannel.request('getKernelAccountSettings', { chainId, wallet });
59
- const zerodevWalletProperties = (_c = (_b = client$1.auth.authenticatedUser) === null || _b === void 0 ? void 0 : _b.verifiedCredentials.find((credential) => credential.id === wallet.id)) === null || _c === void 0 ? void 0 : _c.walletProperties;
62
+ const zerodevWalletProperties = (_e = (_d = client$1.auth.authenticatedUser) === null || _d === void 0 ? void 0 : _d.verifiedCredentials.find((credential) => credential.id === wallet.id)) === null || _e === void 0 ? void 0 : _e.walletProperties;
60
63
  const walletEntryPoint = (zerodevWalletProperties === null || zerodevWalletProperties === void 0 ? void 0 : zerodevWalletProperties.entryPointVersion)
61
64
  ? ethereumAa.getEntryPoint(zerodevWalletProperties.entryPointVersion)
62
65
  : undefined;
@@ -84,7 +87,16 @@ const ZeroDevExtension = () => (client$1, core) => {
84
87
  if (accountSettings.enableEIP7702) {
85
88
  return ethereumAa.createEcdsaKernelAccountClientWith7702(Object.assign(Object.assign({}, params), { kernelVersion: constants.KERNEL_V3_3 }));
86
89
  }
87
- return ethereumAa.createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: ethereumAa.getEcdsaValidator((_d = accountSettings.ecdsaProviderType) !== null && _d !== void 0 ? _d : undefined) }));
90
+ return ethereumAa.createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: ethereumAa.getEcdsaValidator((_f = accountSettings.ecdsaProviderType) !== null && _f !== void 0 ? _f : undefined) }));
91
+ }
92
+ catch (error) {
93
+ logger.logger.error(error);
94
+ throw error;
95
+ }
96
+ }),
97
+ createWalletClient: (_g) => _tslib.__awaiter(void 0, [_g], void 0, function* ({ wallet, chainId }) {
98
+ try {
99
+ return yield createWalletClientHelper(wallet, chainId);
88
100
  }
89
101
  catch (error) {
90
102
  logger.logger.error(error);
@@ -4,6 +4,7 @@ import { SmartAccount } from 'viem/account-abstraction';
4
4
  import { Extension, Wallet } from '@dynamic-labs/client';
5
5
  import { PaymasterType } from '@dynamic-labs/ethereum-aa';
6
6
  import { ZerodevBundlerProvider } from '@dynamic-labs/sdk-api-core';
7
+ import { type IViemExtension } from '@dynamic-labs/viem-extension';
7
8
  type CreateKernelAccountClientArgs = {
8
9
  wallet: Wallet;
9
10
  chainId?: number;
@@ -15,6 +16,7 @@ type CreateKernelAccountClientArgs = {
15
16
  type IZeroDevExtension = {
16
17
  zeroDev: {
17
18
  createKernelClient: (args: CreateKernelAccountClientArgs) => Promise<KernelAccountClient<Transport, ViemChain, SmartAccount, Client, RpcSchema>>;
19
+ createWalletClient: (args: CreateKernelAccountClientArgs) => Promise<Awaited<ReturnType<IViemExtension['viem']['createWalletClient']>>>;
18
20
  };
19
21
  };
20
22
  export declare const ZeroDevExtension: () => Extension<IZeroDevExtension>;
@@ -19,40 +19,43 @@ const ZeroDevExtension = () => (client, core) => {
19
19
  }
20
20
  const zeroDevRequestChannel = createRequestChannel(core.messageTransport);
21
21
  const viemRequestChannel = createRequestChannel(core.messageTransport);
22
+ const createWalletClientHelper = (wallet, chainId) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const eoaWallet = yield client.wallets.accountAbstraction.getEOAWallet({
24
+ wallet,
25
+ });
26
+ if (!eoaWallet) {
27
+ throw new Error('EOA wallet not found');
28
+ }
29
+ return client.viem.createWalletClient({
30
+ account: toAccount({
31
+ address: eoaWallet.address,
32
+ signAuthorization: (parameters) => __awaiter(void 0, void 0, void 0, function* () {
33
+ var _a;
34
+ const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
35
+ return Object.assign(Object.assign({}, result), { yParity: (_a = result.yParity) !== null && _a !== void 0 ? _a : 0 });
36
+ }),
37
+ signMessage: (_b) => __awaiter(void 0, [_b], void 0, function* ({ message }) {
38
+ return viemRequestChannel.request('viem_signMessage', eoaWallet.id, message);
39
+ }),
40
+ signTransaction: (transaction) => __awaiter(void 0, void 0, void 0, function* () {
41
+ return viemRequestChannel.request('viem_signTransaction', eoaWallet.id, transaction);
42
+ }),
43
+ signTypedData: (typedData) => __awaiter(void 0, void 0, void 0, function* () {
44
+ return viemRequestChannel.request('viem_signTypedData', eoaWallet.id, typedData);
45
+ }),
46
+ }),
47
+ chain: chainId ? getChainById(chainId) : undefined,
48
+ wallet: eoaWallet,
49
+ });
50
+ });
22
51
  return {
23
52
  zeroDev: {
24
- createKernelClient: (_a) => __awaiter(void 0, [_a], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
25
- var _b, _c, _d;
53
+ createKernelClient: (_c) => __awaiter(void 0, [_c], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
54
+ var _d, _e, _f;
26
55
  try {
27
- const eoaWallet = yield client.wallets.accountAbstraction.getEOAWallet({
28
- wallet,
29
- });
30
- if (!eoaWallet) {
31
- throw new Error('EOA wallet not found');
32
- }
33
- const walletClient = yield client.viem.createWalletClient({
34
- account: toAccount({
35
- address: eoaWallet.address,
36
- signAuthorization: (parameters) => __awaiter(void 0, void 0, void 0, function* () {
37
- var _e;
38
- const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
39
- return Object.assign(Object.assign({}, result), { yParity: (_e = result.yParity) !== null && _e !== void 0 ? _e : 0 });
40
- }),
41
- signMessage: (_f) => __awaiter(void 0, [_f], void 0, function* ({ message }) {
42
- return viemRequestChannel.request('viem_signMessage', eoaWallet.id, message);
43
- }),
44
- signTransaction: (transaction) => __awaiter(void 0, void 0, void 0, function* () {
45
- return viemRequestChannel.request('viem_signTransaction', eoaWallet.id, transaction);
46
- }),
47
- signTypedData: (typedData) => __awaiter(void 0, void 0, void 0, function* () {
48
- return viemRequestChannel.request('viem_signTypedData', eoaWallet.id, typedData);
49
- }),
50
- }),
51
- chain: chainId ? getChainById(chainId) : undefined,
52
- wallet: eoaWallet,
53
- });
56
+ const walletClient = yield createWalletClientHelper(wallet, chainId);
54
57
  const accountSettings = yield zeroDevRequestChannel.request('getKernelAccountSettings', { chainId, wallet });
55
- const zerodevWalletProperties = (_c = (_b = client.auth.authenticatedUser) === null || _b === void 0 ? void 0 : _b.verifiedCredentials.find((credential) => credential.id === wallet.id)) === null || _c === void 0 ? void 0 : _c.walletProperties;
58
+ const zerodevWalletProperties = (_e = (_d = client.auth.authenticatedUser) === null || _d === void 0 ? void 0 : _d.verifiedCredentials.find((credential) => credential.id === wallet.id)) === null || _e === void 0 ? void 0 : _e.walletProperties;
56
59
  const walletEntryPoint = (zerodevWalletProperties === null || zerodevWalletProperties === void 0 ? void 0 : zerodevWalletProperties.entryPointVersion)
57
60
  ? getEntryPoint(zerodevWalletProperties.entryPointVersion)
58
61
  : undefined;
@@ -80,7 +83,16 @@ const ZeroDevExtension = () => (client, core) => {
80
83
  if (accountSettings.enableEIP7702) {
81
84
  return createEcdsaKernelAccountClientWith7702(Object.assign(Object.assign({}, params), { kernelVersion: KERNEL_V3_3 }));
82
85
  }
83
- return createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: getEcdsaValidator((_d = accountSettings.ecdsaProviderType) !== null && _d !== void 0 ? _d : undefined) }));
86
+ return createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: getEcdsaValidator((_f = accountSettings.ecdsaProviderType) !== null && _f !== void 0 ? _f : undefined) }));
87
+ }
88
+ catch (error) {
89
+ logger.error(error);
90
+ throw error;
91
+ }
92
+ }),
93
+ createWalletClient: (_g) => __awaiter(void 0, [_g], void 0, function* ({ wallet, chainId }) {
94
+ try {
95
+ return yield createWalletClientHelper(wallet, chainId);
84
96
  }
85
97
  catch (error) {
86
98
  logger.error(error);