@dynamic-labs/zerodev-extension 4.20.11 → 4.20.13
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,25 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.20.13](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.12...v4.20.13) (2025-07-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* 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))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* 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))
|
|
13
|
+
|
|
14
|
+
### [4.20.12](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.11...v4.20.12) (2025-07-01)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* bring back braavos mobile deeplink support ([#9041](https://github.com/dynamic-labs/dynamic-auth/issues/9041)) ([90a7eb6](https://github.com/dynamic-labs/dynamic-auth/commit/90a7eb620f6bd27d4560e88fe5542a121e586bed))
|
|
20
|
+
* start exchange funding errors should be logged as error ([#9056](https://github.com/dynamic-labs/dynamic-auth/issues/9056)) ([ba122af](https://github.com/dynamic-labs/dynamic-auth/commit/ba122afb68c462fe8627828bd20f9cc5f92803ff))
|
|
21
|
+
* WC redirect on mobile ([#9063](https://github.com/dynamic-labs/dynamic-auth/issues/9063)) ([f43aa4a](https://github.com/dynamic-labs/dynamic-auth/commit/f43aa4aedea20e3baf012f4778f5e6a47c27515c))
|
|
22
|
+
|
|
2
23
|
### [4.20.11](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.10...v4.20.11) (2025-07-01)
|
|
3
24
|
|
|
4
25
|
|
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.20.
|
|
3
|
+
"version": "4.20.13",
|
|
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.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.
|
|
22
|
-
"@dynamic-labs/client": "4.20.
|
|
23
|
-
"@dynamic-labs/ethereum-aa": "4.20.
|
|
24
|
-
"@dynamic-labs/logger": "4.20.
|
|
25
|
-
"@dynamic-labs/message-transport": "4.20.
|
|
26
|
-
"@dynamic-labs/viem-extension": "4.20.
|
|
21
|
+
"@dynamic-labs/assert-package-version": "4.20.13",
|
|
22
|
+
"@dynamic-labs/client": "4.20.13",
|
|
23
|
+
"@dynamic-labs/ethereum-aa": "4.20.13",
|
|
24
|
+
"@dynamic-labs/logger": "4.20.13",
|
|
25
|
+
"@dynamic-labs/message-transport": "4.20.13",
|
|
26
|
+
"@dynamic-labs/viem-extension": "4.20.13"
|
|
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: (
|
|
29
|
-
var
|
|
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
|
|
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 = (
|
|
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((
|
|
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: (
|
|
25
|
-
var
|
|
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
|
|
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 = (
|
|
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((
|
|
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);
|