@dynamic-labs/zerodev-extension 4.18.8 → 4.19.0
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,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.19.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.8...v4.19.0) (2025-05-23)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* expose 7702 kernel and add viem controller ([#8786](https://github.com/dynamic-labs/dynamic-auth/issues/8786)) ([eea710e](https://github.com/dynamic-labs/dynamic-auth/commit/eea710e238ccbc36e6be37d8f7493954b99858ef))
|
|
8
|
+
* use browser wallet client & iframe for waas operations ([#8697](https://github.com/dynamic-labs/dynamic-auth/issues/8697)) ([13a47b1](https://github.com/dynamic-labs/dynamic-auth/commit/13a47b1c9a2984f08682e833ca8c87605a3a872f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **global-wallet:** close popup when page unloads to prevent orphaned popup windows ([#8787](https://github.com/dynamic-labs/dynamic-auth/issues/8787)) ([441b04c](https://github.com/dynamic-labs/dynamic-auth/commit/441b04ca04a02feb37473e43bca0e66c5d772ce2))
|
|
14
|
+
* override network when requesting BTC networks in useTokenBalances ([#8773](https://github.com/dynamic-labs/dynamic-auth/issues/8773)) ([fd07d09](https://github.com/dynamic-labs/dynamic-auth/commit/fd07d09de970c7e6f85b251a88854e8eca57e249))
|
|
15
|
+
* remove libmpc executor dependency global wallet ([#8792](https://github.com/dynamic-labs/dynamic-auth/issues/8792)) ([7502585](https://github.com/dynamic-labs/dynamic-auth/commit/75025859d2f952915322cf65504117ec2506152b))
|
|
16
|
+
* standardize font on headers ([#8734](https://github.com/dynamic-labs/dynamic-auth/issues/8734)) ([9f0900c](https://github.com/dynamic-labs/dynamic-auth/commit/9f0900cb7c4294201cc952ae7538648bdea83ff5))
|
|
17
|
+
|
|
2
18
|
### [4.18.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.7...v4.18.8) (2025-05-22)
|
|
3
19
|
|
|
4
20
|
### Bug Fixes
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/zerodev-extension",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"main": "./src/index.cjs",
|
|
5
5
|
"module": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@zerodev/sdk": "5.4.34",
|
|
19
19
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.5",
|
|
20
20
|
"@zerodev/ecdsa-validator": "5.4.8",
|
|
21
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
22
|
-
"@dynamic-labs/client": "4.
|
|
23
|
-
"@dynamic-labs/ethereum-aa": "4.
|
|
24
|
-
"@dynamic-labs/logger": "4.
|
|
25
|
-
"@dynamic-labs/message-transport": "4.
|
|
26
|
-
"@dynamic-labs/viem-extension": "4.
|
|
21
|
+
"@dynamic-labs/assert-package-version": "4.19.0",
|
|
22
|
+
"@dynamic-labs/client": "4.19.0",
|
|
23
|
+
"@dynamic-labs/ethereum-aa": "4.19.0",
|
|
24
|
+
"@dynamic-labs/logger": "4.19.0",
|
|
25
|
+
"@dynamic-labs/message-transport": "4.19.0",
|
|
26
|
+
"@dynamic-labs/viem-extension": "4.19.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"viem": "^2.21.60"
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
|
+
var constants = require('@zerodev/sdk/constants');
|
|
8
|
+
var accounts = require('viem/accounts');
|
|
7
9
|
var client = require('@dynamic-labs/client');
|
|
8
10
|
var ethereumAa = require('@dynamic-labs/ethereum-aa');
|
|
9
11
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
@@ -20,6 +22,7 @@ const ZeroDevExtension = () => (client$1, core) => {
|
|
|
20
22
|
throw new Error('ViemExtension is required to use ZeroDevExtension');
|
|
21
23
|
}
|
|
22
24
|
const zeroDevRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
25
|
+
const viemRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
23
26
|
return {
|
|
24
27
|
zeroDev: {
|
|
25
28
|
createKernelClient: (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
|
|
@@ -32,15 +35,31 @@ const ZeroDevExtension = () => (client$1, core) => {
|
|
|
32
35
|
throw new Error('EOA wallet not found');
|
|
33
36
|
}
|
|
34
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 _c;
|
|
42
|
+
const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
|
|
43
|
+
return Object.assign(Object.assign({}, result), { yParity: (_c = result.yParity) !== null && _c !== void 0 ? _c : 0 });
|
|
44
|
+
}),
|
|
45
|
+
signMessage: (_d) => _tslib.__awaiter(void 0, [_d], 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
|
+
}),
|
|
35
55
|
chain: chainId ? getChainById.getChainById(chainId) : undefined,
|
|
36
56
|
wallet: eoaWallet,
|
|
37
57
|
});
|
|
38
58
|
const accountSettings = yield zeroDevRequestChannel.request('getKernelAccountSettings', { chainId, wallet });
|
|
39
|
-
const
|
|
59
|
+
const params = {
|
|
40
60
|
apiKernelVersion: accountSettings.kernelVersion,
|
|
41
61
|
bundlerRpc,
|
|
42
62
|
chain: getChainById.getChainById(accountSettings.chainId),
|
|
43
|
-
ecdsaValidator: ethereumAa.getEcdsaValidator((_b = accountSettings.ecdsaProviderType) !== null && _b !== void 0 ? _b : undefined),
|
|
44
63
|
enableKernelV3Migration: false,
|
|
45
64
|
entryPoint: accountSettings.entryPoint,
|
|
46
65
|
kernelVersion: accountSettings.kernelVersion,
|
|
@@ -49,8 +68,11 @@ const ZeroDevExtension = () => (client$1, core) => {
|
|
|
49
68
|
projectId: accountSettings.projectId,
|
|
50
69
|
provider: bundlerProvider,
|
|
51
70
|
signer: walletClient,
|
|
52
|
-
}
|
|
53
|
-
|
|
71
|
+
};
|
|
72
|
+
if (accountSettings.enableEIP7702) {
|
|
73
|
+
return ethereumAa.createEcdsaKernelAccountClientWith7702(Object.assign(Object.assign({}, params), { kernelVersion: constants.KERNEL_V3_3 }));
|
|
74
|
+
}
|
|
75
|
+
return ethereumAa.createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: ethereumAa.getEcdsaValidator((_b = accountSettings.ecdsaProviderType) !== null && _b !== void 0 ? _b : undefined) }));
|
|
54
76
|
}
|
|
55
77
|
catch (error) {
|
|
56
78
|
logger.logger.error(error);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
|
+
import { KERNEL_V3_3 } from '@zerodev/sdk/constants';
|
|
4
|
+
import { toAccount } from 'viem/accounts';
|
|
3
5
|
import { hasExtension, baseClientExtensionName } from '@dynamic-labs/client';
|
|
4
|
-
import { createEcdsaKernelAccountClient, getEcdsaValidator
|
|
6
|
+
import { PaymasterTypeEnum, createEcdsaKernelAccountClientWith7702, createEcdsaKernelAccountClient, getEcdsaValidator } from '@dynamic-labs/ethereum-aa';
|
|
5
7
|
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
6
8
|
import { viemExtensionName } from '@dynamic-labs/viem-extension';
|
|
7
9
|
import { getChainById } from '../utils/getChainById/getChainById.js';
|
|
@@ -16,6 +18,7 @@ const ZeroDevExtension = () => (client, core) => {
|
|
|
16
18
|
throw new Error('ViemExtension is required to use ZeroDevExtension');
|
|
17
19
|
}
|
|
18
20
|
const zeroDevRequestChannel = createRequestChannel(core.messageTransport);
|
|
21
|
+
const viemRequestChannel = createRequestChannel(core.messageTransport);
|
|
19
22
|
return {
|
|
20
23
|
zeroDev: {
|
|
21
24
|
createKernelClient: (_a) => __awaiter(void 0, [_a], void 0, function* ({ wallet, chainId, bundlerProvider, bundlerRpc, paymasterRpc, paymaster, }) {
|
|
@@ -28,15 +31,31 @@ const ZeroDevExtension = () => (client, core) => {
|
|
|
28
31
|
throw new Error('EOA wallet not found');
|
|
29
32
|
}
|
|
30
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 _c;
|
|
38
|
+
const result = yield viemRequestChannel.request('viem_signAuthorization', eoaWallet.id, parameters);
|
|
39
|
+
return Object.assign(Object.assign({}, result), { yParity: (_c = result.yParity) !== null && _c !== void 0 ? _c : 0 });
|
|
40
|
+
}),
|
|
41
|
+
signMessage: (_d) => __awaiter(void 0, [_d], 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
|
+
}),
|
|
31
51
|
chain: chainId ? getChainById(chainId) : undefined,
|
|
32
52
|
wallet: eoaWallet,
|
|
33
53
|
});
|
|
34
54
|
const accountSettings = yield zeroDevRequestChannel.request('getKernelAccountSettings', { chainId, wallet });
|
|
35
|
-
const
|
|
55
|
+
const params = {
|
|
36
56
|
apiKernelVersion: accountSettings.kernelVersion,
|
|
37
57
|
bundlerRpc,
|
|
38
58
|
chain: getChainById(accountSettings.chainId),
|
|
39
|
-
ecdsaValidator: getEcdsaValidator((_b = accountSettings.ecdsaProviderType) !== null && _b !== void 0 ? _b : undefined),
|
|
40
59
|
enableKernelV3Migration: false,
|
|
41
60
|
entryPoint: accountSettings.entryPoint,
|
|
42
61
|
kernelVersion: accountSettings.kernelVersion,
|
|
@@ -45,8 +64,11 @@ const ZeroDevExtension = () => (client, core) => {
|
|
|
45
64
|
projectId: accountSettings.projectId,
|
|
46
65
|
provider: bundlerProvider,
|
|
47
66
|
signer: walletClient,
|
|
48
|
-
}
|
|
49
|
-
|
|
67
|
+
};
|
|
68
|
+
if (accountSettings.enableEIP7702) {
|
|
69
|
+
return createEcdsaKernelAccountClientWith7702(Object.assign(Object.assign({}, params), { kernelVersion: KERNEL_V3_3 }));
|
|
70
|
+
}
|
|
71
|
+
return createEcdsaKernelAccountClient(Object.assign(Object.assign({}, params), { ecdsaValidator: getEcdsaValidator((_b = accountSettings.ecdsaProviderType) !== null && _b !== void 0 ? _b : undefined) }));
|
|
50
72
|
}
|
|
51
73
|
catch (error) {
|
|
52
74
|
logger.error(error);
|