@zerodev/sdk 5.2.0-alpha-4 → 5.2.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/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +115 -58
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.js +39 -0
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.js.map +1 -0
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.js +203 -0
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.js.map +1 -0
- package/_cjs/accounts/kernel/createKernelAccount.js +42 -22
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +22 -0
- package/_cjs/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js.map +1 -0
- package/_cjs/accounts/kernel/utils/common/getActionSelector.js +19 -0
- package/_cjs/accounts/kernel/utils/common/getActionSelector.js.map +1 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js +22 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js +39 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +21 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +41 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js +20 -0
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js.map +1 -0
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js +4 -2
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js +9 -4
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js.map +1 -1
- package/_cjs/accounts/utils/getCustomNonceKeyFromString.js +19 -0
- package/_cjs/accounts/utils/getCustomNonceKeyFromString.js.map +1 -0
- package/_cjs/accounts/utils/index.js +3 -1
- package/_cjs/accounts/utils/index.js.map +1 -1
- package/_cjs/accounts/utils/toKernelPluginManager.js +120 -184
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/actions/account-client/getUserOperationGasPrice.js +15 -0
- package/_cjs/actions/account-client/getUserOperationGasPrice.js.map +1 -0
- package/_cjs/actions/index.js +3 -1
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/paymaster/estimateGasInERC20.js +2 -2
- package/_cjs/actions/paymaster/estimateGasInERC20.js.map +1 -1
- package/_cjs/actions/paymaster/sponsorUserOperation.js +1 -2
- package/_cjs/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_cjs/clients/decorators/kernel.js +3 -1
- package/_cjs/clients/decorators/kernel.js.map +1 -1
- package/_cjs/clients/kernelAccountClient.js +29 -3
- package/_cjs/clients/kernelAccountClient.js.map +1 -1
- package/_cjs/clients/paymasterClient.js +18 -1
- package/_cjs/clients/paymasterClient.js.map +1 -1
- package/_cjs/clients/utils.js +31 -0
- package/_cjs/clients/utils.js.map +1 -0
- package/_cjs/constants.js +5 -2
- package/_cjs/constants.js.map +1 -1
- package/_cjs/index.js +6 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/providers/KernelEIP1193Provider.js +37 -0
- package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
- package/_cjs/types/index.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_cjs/utils.js +1 -2
- package/_cjs/utils.js.map +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +115 -58
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.js +36 -0
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.js.map +1 -0
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.js +200 -0
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.js.map +1 -0
- package/_esm/accounts/kernel/createKernelAccount.js +43 -23
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +18 -0
- package/_esm/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js.map +1 -0
- package/_esm/accounts/kernel/utils/common/getActionSelector.js +15 -0
- package/_esm/accounts/kernel/utils/common/getActionSelector.js.map +1 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js +18 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js +35 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +18 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +42 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js +16 -0
- package/_esm/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js.map +1 -0
- package/_esm/accounts/kernel/v1/createKernelV1Account.js +5 -3
- package/_esm/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_esm/accounts/kernel/v2/createKernelV2Account.js +10 -5
- package/_esm/accounts/kernel/v2/createKernelV2Account.js.map +1 -1
- package/_esm/accounts/utils/getCustomNonceKeyFromString.js +15 -0
- package/_esm/accounts/utils/getCustomNonceKeyFromString.js.map +1 -0
- package/_esm/accounts/utils/index.js +1 -0
- package/_esm/accounts/utils/index.js.map +1 -1
- package/_esm/accounts/utils/toKernelPluginManager.js +124 -188
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/actions/account-client/getUserOperationGasPrice.js +11 -0
- package/_esm/actions/account-client/getUserOperationGasPrice.js.map +1 -0
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/paymaster/estimateGasInERC20.js +2 -2
- package/_esm/actions/paymaster/estimateGasInERC20.js.map +1 -1
- package/_esm/actions/paymaster/sponsorUserOperation.js +1 -2
- package/_esm/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_esm/clients/decorators/kernel.js +3 -1
- package/_esm/clients/decorators/kernel.js.map +1 -1
- package/_esm/clients/kernelAccountClient.js +30 -4
- package/_esm/clients/kernelAccountClient.js.map +1 -1
- package/_esm/clients/paymasterClient.js +19 -2
- package/_esm/clients/paymasterClient.js.map +1 -1
- package/_esm/clients/utils.js +26 -0
- package/_esm/clients/utils.js.map +1 -0
- package/_esm/constants.js +4 -1
- package/_esm/constants.js.map +1 -1
- package/_esm/index.js +3 -1
- package/_esm/index.js.map +1 -1
- package/_esm/providers/KernelEIP1193Provider.js +37 -0
- package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
- package/_esm/types/index.js.map +1 -1
- package/_esm/types/kernel.js.map +1 -1
- package/_esm/utils.js +2 -3
- package/_esm/utils.js.map +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts +110 -20
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts.map +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.d.ts +60 -0
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.d.ts +215 -0
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/createKernelAccount.d.ts +7 -4
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.d.ts +3 -0
- package/_types/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/common/getActionSelector.d.ts +4 -0
- package/_types/accounts/kernel/utils/common/getActionSelector.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts +9 -0
- package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts +13 -0
- package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.d.ts +9 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts +10 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.d.ts +3 -0
- package/_types/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.d.ts.map +1 -0
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts +1 -1
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts.map +1 -1
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts +3 -1
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts.map +1 -1
- package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts +3 -0
- package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts.map +1 -0
- package/_types/accounts/utils/index.d.ts +1 -0
- package/_types/accounts/utils/index.d.ts.map +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
- package/_types/actions/account-client/getUserOperationGasPrice.d.ts +9 -0
- package/_types/actions/account-client/getUserOperationGasPrice.d.ts.map +1 -0
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/paymaster/estimateGasInERC20.d.ts.map +1 -1
- package/_types/actions/paymaster/sponsorUserOperation.d.ts.map +1 -1
- package/_types/clients/decorators/kernel.d.ts +8 -1
- package/_types/clients/decorators/kernel.d.ts.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +12 -4
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/_types/clients/paymasterClient.d.ts.map +1 -1
- package/_types/clients/utils.d.ts +3 -0
- package/_types/clients/utils.d.ts.map +1 -0
- package/_types/constants.d.ts +4 -1
- package/_types/constants.d.ts.map +1 -1
- package/_types/index.d.ts +3 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/providers/KernelEIP1193Provider.d.ts +2 -0
- package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -1
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +32 -17
- package/_types/types/kernel.d.ts.map +1 -1
- package/_types/utils.d.ts.map +1 -1
- package/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.ts +115 -58
- package/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.ts +35 -0
- package/accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.ts +199 -0
- package/accounts/kernel/createKernelAccount.ts +57 -26
- package/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.ts +24 -0
- package/accounts/kernel/utils/common/getActionSelector.ts +20 -0
- package/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.ts +39 -0
- package/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.ts +76 -0
- package/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.ts +47 -0
- package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +63 -0
- package/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.ts +23 -0
- package/accounts/kernel/v1/createKernelV1Account.ts +20 -8
- package/accounts/kernel/v2/createKernelV2Account.ts +17 -6
- package/accounts/utils/getCustomNonceKeyFromString.ts +21 -0
- package/accounts/utils/index.ts +2 -0
- package/accounts/utils/toKernelPluginManager.ts +155 -224
- package/actions/account-client/getUserOperationGasPrice.ts +26 -0
- package/actions/index.ts +5 -0
- package/actions/paymaster/estimateGasInERC20.ts +2 -3
- package/actions/paymaster/sponsorUserOperation.ts +1 -3
- package/clients/decorators/kernel.ts +22 -6
- package/clients/kernelAccountClient.ts +36 -3
- package/clients/paymasterClient.ts +24 -1
- package/clients/utils.ts +28 -0
- package/constants.ts +6 -2
- package/index.ts +6 -1
- package/package.json +4 -4
- package/providers/KernelEIP1193Provider.ts +51 -0
- package/types/index.ts +4 -2
- package/types/kernel.ts +52 -38
- package/utils.ts +2 -3
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { concat, concatHex,
|
|
3
|
-
import { getChainId
|
|
1
|
+
import { getEntryPointVersion } from "permissionless";
|
|
2
|
+
import { concat, concatHex, maxUint16, maxUint192, pad, toHex, zeroAddress } from "viem";
|
|
3
|
+
import { getChainId } from "viem/actions";
|
|
4
4
|
import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../../constants.js";
|
|
5
5
|
import { ValidatorMode } from "../../types/kernel.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { getKernelV3Nonce } from "../kernel/utils/account/ep0_7/getKernelV3Nonce.js";
|
|
7
|
+
import { accountMetadata } from "../kernel/utils/common/accountMetadata.js";
|
|
8
|
+
import { getActionSelector } from "../kernel/utils/common/getActionSelector.js";
|
|
9
|
+
import { getEncodedPluginsData as getEncodedPluginsDataV1 } from "../kernel/utils/plugins/ep0_6/getEncodedPluginsData.js";
|
|
10
|
+
import { getPluginsEnableTypedData as getPluginsEnableTypedDataV1 } from "../kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js";
|
|
11
|
+
import { getEncodedPluginsData as getEncodedPluginsDataV2 } from "../kernel/utils/plugins/ep0_7/getEncodedPluginsData.js";
|
|
12
|
+
import { getPluginsEnableTypedData as getPluginsEnableTypedDataV2 } from "../kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js";
|
|
13
|
+
import { isPluginInitialized } from "../kernel/utils/plugins/ep0_7/isPluginInitialized.js";
|
|
10
14
|
export function isKernelPluginManager(
|
|
11
15
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
12
16
|
plugin) {
|
|
13
17
|
return plugin.getPluginEnableSignature !== undefined;
|
|
14
18
|
}
|
|
15
|
-
export async function toKernelPluginManager(client, { sudo, regular, pluginEnableSignature, validatorInitData,
|
|
16
|
-
executor: zeroAddress,
|
|
17
|
-
selector: toFunctionSelector("execute(address, uint256, bytes, uint8)")
|
|
18
|
-
}, validAfter = 0, validUntil = 0, entryPoint: entryPointAddress, kernelVersion }) {
|
|
19
|
+
export async function toKernelPluginManager(client, { sudo, regular, pluginEnableSignature, validatorInitData, action, validAfter = 0, validUntil = 0, entryPoint: entryPointAddress, kernelVersion }) {
|
|
19
20
|
const entryPointVersion = getEntryPointVersion(entryPointAddress);
|
|
20
21
|
const chainId = await getChainId(client);
|
|
21
22
|
const activeValidator = regular || sudo;
|
|
22
23
|
if (!activeValidator) {
|
|
23
24
|
throw new Error("One of `sudo` or `regular` validator must be set");
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
action = {
|
|
27
|
+
selector: action?.selector ?? getActionSelector(entryPointVersion),
|
|
28
|
+
address: action?.address ?? zeroAddress
|
|
29
|
+
};
|
|
30
|
+
if (!action) {
|
|
31
|
+
throw new Error("Action data must be set");
|
|
32
|
+
}
|
|
33
|
+
const getSignatureData = async (accountAddress, selector, userOpSignature = "0x") => {
|
|
34
|
+
if (!action) {
|
|
35
|
+
throw new Error("Action data must be set");
|
|
36
|
+
}
|
|
26
37
|
if (entryPointVersion === "v0.6") {
|
|
27
38
|
if (regular) {
|
|
28
|
-
if (await
|
|
39
|
+
if (await isPluginEnabled(accountAddress, selector)) {
|
|
29
40
|
return ValidatorMode.plugin;
|
|
30
41
|
}
|
|
31
42
|
const enableSignature = await getPluginEnableSignature(accountAddress);
|
|
32
|
-
const enableData = await regular.getEnableData(accountAddress);
|
|
33
|
-
const enableDataLength = enableData.length / 2 - 1;
|
|
34
43
|
if (!enableSignature) {
|
|
35
44
|
throw new Error("Enable signature not set");
|
|
36
45
|
}
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
pad(toHex(enableSignature.length / 2 - 1), { size: 32 }), // 32 bytes 88 + enableData.length - 120 + enableData.length
|
|
46
|
-
enableSignature // 120 + enableData.length - 120 + enableData.length + enableSignature.length
|
|
47
|
-
]);
|
|
46
|
+
return getEncodedPluginsDataV1({
|
|
47
|
+
accountAddress,
|
|
48
|
+
enableSignature,
|
|
49
|
+
action,
|
|
50
|
+
validator: regular,
|
|
51
|
+
validUntil,
|
|
52
|
+
validAfter
|
|
53
|
+
});
|
|
48
54
|
}
|
|
49
55
|
else if (sudo) {
|
|
50
56
|
return ValidatorMode.sudo;
|
|
@@ -54,179 +60,101 @@ export async function toKernelPluginManager(client, { sudo, regular, pluginEnabl
|
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
if (regular) {
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
return sig ?? "0x";
|
|
63
|
+
if (await isPluginEnabled(accountAddress, action.selector)) {
|
|
64
|
+
return userOpSignature;
|
|
60
65
|
}
|
|
61
|
-
const enableData = await regular.getEnableData(accountAddress);
|
|
62
66
|
const enableSignature = await getPluginEnableSignature(accountAddress);
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
executorData.executor,
|
|
71
|
-
zeroAddress,
|
|
72
|
-
"0x"
|
|
73
|
-
]),
|
|
74
|
-
enableSignature,
|
|
75
|
-
sig ?? "0x"
|
|
76
|
-
])
|
|
77
|
-
]);
|
|
67
|
+
return getEncodedPluginsDataV2({
|
|
68
|
+
accountAddress,
|
|
69
|
+
action,
|
|
70
|
+
enableSignature,
|
|
71
|
+
userOpSignature,
|
|
72
|
+
validator: regular
|
|
73
|
+
});
|
|
78
74
|
}
|
|
79
75
|
else if (sudo) {
|
|
80
|
-
return
|
|
76
|
+
return userOpSignature;
|
|
81
77
|
}
|
|
82
78
|
else {
|
|
83
79
|
throw new Error("One of `sudo` or `regular` validator must be set");
|
|
84
80
|
}
|
|
85
81
|
};
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
const isPluginEnabled = async (accountAddress, selector) => {
|
|
83
|
+
if (!action) {
|
|
84
|
+
throw new Error("Action data must be set");
|
|
85
|
+
}
|
|
86
|
+
if (!regular)
|
|
87
|
+
throw new Error("regular validator not set");
|
|
88
|
+
if (entryPointVersion === "v0.6") {
|
|
89
|
+
return regular.isEnabled(accountAddress, selector);
|
|
94
90
|
}
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
return ((await regular.isEnabled(accountAddress, action.selector)) ||
|
|
92
|
+
(await isPluginInitialized(client, accountAddress, regular.address)));
|
|
97
93
|
};
|
|
98
94
|
const getPluginEnableSignature = async (accountAddress) => {
|
|
95
|
+
if (!action) {
|
|
96
|
+
throw new Error("Action data must be set");
|
|
97
|
+
}
|
|
99
98
|
if (pluginEnableSignature)
|
|
100
99
|
return pluginEnableSignature;
|
|
101
100
|
if (!sudo)
|
|
102
101
|
throw new Error("sudo validator not set -- need it to enable the validator");
|
|
103
102
|
if (!regular)
|
|
104
103
|
throw new Error("regular validator not set");
|
|
105
|
-
const
|
|
106
|
-
const _kernelVersion = kernelVersion ?? getKernelVersion(entryPointAddress, kernelImplAddr);
|
|
104
|
+
const { version } = await accountMetadata(client, accountAddress, entryPointAddress);
|
|
107
105
|
let ownerSig;
|
|
108
106
|
if (entryPointVersion === "v0.6") {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
ValidatorApproved: [
|
|
118
|
-
{ name: "sig", type: "bytes4" },
|
|
119
|
-
{ name: "validatorData", type: "uint256" },
|
|
120
|
-
{ name: "executor", type: "address" },
|
|
121
|
-
{ name: "enableData", type: "bytes" }
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
message: {
|
|
125
|
-
sig: executorData.selector,
|
|
126
|
-
validatorData: hexToBigInt(concatHex([
|
|
127
|
-
pad(toHex(validUntil ?? 0), {
|
|
128
|
-
size: 6
|
|
129
|
-
}),
|
|
130
|
-
pad(toHex(validAfter ?? 0), {
|
|
131
|
-
size: 6
|
|
132
|
-
}),
|
|
133
|
-
regular.address
|
|
134
|
-
]), { size: 32 }),
|
|
135
|
-
executor: executorData.executor,
|
|
136
|
-
enableData: await regular.getEnableData(accountAddress)
|
|
137
|
-
},
|
|
138
|
-
primaryType: "ValidatorApproved"
|
|
107
|
+
const typeData = await getPluginsEnableTypedDataV1({
|
|
108
|
+
accountAddress,
|
|
109
|
+
chainId,
|
|
110
|
+
kernelVersion: kernelVersion ?? version,
|
|
111
|
+
action,
|
|
112
|
+
validator: regular,
|
|
113
|
+
validUntil,
|
|
114
|
+
validAfter
|
|
139
115
|
});
|
|
116
|
+
ownerSig = await sudo.signTypedData(typeData);
|
|
140
117
|
pluginEnableSignature = ownerSig;
|
|
141
118
|
return ownerSig;
|
|
142
119
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
Enable: [
|
|
152
|
-
{ name: "validationId", type: "bytes21" },
|
|
153
|
-
{ name: "nonce", type: "uint32" },
|
|
154
|
-
{ name: "hook", type: "address" },
|
|
155
|
-
{ name: "validatorData", type: "bytes" },
|
|
156
|
-
{ name: "hookData", type: "bytes" },
|
|
157
|
-
{ name: "selectorData", type: "bytes" }
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
message: {
|
|
161
|
-
validationId: concat([
|
|
162
|
-
activeValidator.isPermissionValidator
|
|
163
|
-
? VALIDATOR_TYPE.PERMISSION
|
|
164
|
-
: VALIDATOR_TYPE.SECONDARY,
|
|
165
|
-
activeValidator?.isPermissionValidator
|
|
166
|
-
? // @ts-ignore
|
|
167
|
-
pad(regular.getPermissionId(), {
|
|
168
|
-
size: 20,
|
|
169
|
-
dir: "right"
|
|
170
|
-
})
|
|
171
|
-
: activeValidator.address
|
|
172
|
-
]),
|
|
173
|
-
nonce: await getKernelV3Nonce(accountAddress),
|
|
174
|
-
hook: zeroAddress,
|
|
175
|
-
validatorData: await regular.getEnableData(accountAddress),
|
|
176
|
-
hookData: "0x",
|
|
177
|
-
selectorData: concat([
|
|
178
|
-
executorData.selector,
|
|
179
|
-
executorData.executor,
|
|
180
|
-
zeroAddress,
|
|
181
|
-
"0x"
|
|
182
|
-
])
|
|
183
|
-
},
|
|
184
|
-
primaryType: "Enable"
|
|
120
|
+
const validatorNonce = await getKernelV3Nonce(client, accountAddress);
|
|
121
|
+
const typedData = await getPluginsEnableTypedDataV2({
|
|
122
|
+
accountAddress,
|
|
123
|
+
chainId,
|
|
124
|
+
kernelVersion: version,
|
|
125
|
+
action,
|
|
126
|
+
validator: regular,
|
|
127
|
+
validatorNonce
|
|
185
128
|
});
|
|
129
|
+
ownerSig = await sudo.signTypedData(typedData);
|
|
186
130
|
return ownerSig;
|
|
187
131
|
};
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
args: []
|
|
195
|
-
});
|
|
196
|
-
return nonce;
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
return 2;
|
|
200
|
-
}
|
|
132
|
+
const getIdentifier = (isSudo = false) => {
|
|
133
|
+
const validator = (isSudo ? sudo : regular) ?? activeValidator;
|
|
134
|
+
return concat([
|
|
135
|
+
VALIDATOR_TYPE[validator.validatorType],
|
|
136
|
+
validator.getIdentifier()
|
|
137
|
+
]);
|
|
201
138
|
};
|
|
202
139
|
return {
|
|
203
140
|
...activeValidator,
|
|
204
|
-
|
|
205
|
-
const validator = (isSudo ? sudo : regular) ?? activeValidator;
|
|
206
|
-
return concat([
|
|
207
|
-
validator.isPermissionValidator
|
|
208
|
-
? VALIDATOR_TYPE.PERMISSION
|
|
209
|
-
: VALIDATOR_TYPE.SECONDARY,
|
|
210
|
-
validator?.isPermissionValidator
|
|
211
|
-
? // @ts-ignore
|
|
212
|
-
pad(validator.getPermissionId(), {
|
|
213
|
-
size: 20,
|
|
214
|
-
dir: "right"
|
|
215
|
-
})
|
|
216
|
-
: validator.address
|
|
217
|
-
]);
|
|
218
|
-
},
|
|
141
|
+
getIdentifier,
|
|
219
142
|
signUserOperation: async (userOperation) => {
|
|
220
143
|
const userOpSig = await activeValidator.signUserOperation(userOperation);
|
|
221
144
|
if (entryPointVersion === "v0.6") {
|
|
222
145
|
return concatHex([
|
|
223
|
-
await
|
|
146
|
+
await getSignatureData(userOperation.sender, userOperation.callData.toString().slice(0, 10)),
|
|
224
147
|
userOpSig
|
|
225
148
|
]);
|
|
226
149
|
}
|
|
227
|
-
return await
|
|
150
|
+
return await getSignatureData(userOperation.sender, userOperation.callData.toString().slice(0, 10), userOpSig);
|
|
151
|
+
},
|
|
152
|
+
getAction: () => {
|
|
153
|
+
if (!action) {
|
|
154
|
+
throw new Error("Action data must be set");
|
|
155
|
+
}
|
|
156
|
+
return action;
|
|
228
157
|
},
|
|
229
|
-
getExecutorData: () => executorData,
|
|
230
158
|
getValidityData: () => ({
|
|
231
159
|
validAfter,
|
|
232
160
|
validUntil
|
|
@@ -235,37 +163,44 @@ export async function toKernelPluginManager(client, { sudo, regular, pluginEnabl
|
|
|
235
163
|
const userOpSig = await activeValidator.getDummySignature(userOperation);
|
|
236
164
|
if (entryPointVersion === "v0.6") {
|
|
237
165
|
return concatHex([
|
|
238
|
-
await
|
|
166
|
+
await getSignatureData(userOperation.sender, userOperation.callData.toString().slice(0, 10)),
|
|
239
167
|
userOpSig
|
|
240
168
|
]);
|
|
241
169
|
}
|
|
242
|
-
return await
|
|
170
|
+
return await getSignatureData(userOperation.sender, userOperation.callData.toString().slice(0, 10), userOpSig);
|
|
243
171
|
},
|
|
244
|
-
getNonceKey: async (accountAddress = zeroAddress) => {
|
|
245
|
-
if (
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
172
|
+
getNonceKey: async (accountAddress = zeroAddress, customNonceKey = 0n) => {
|
|
173
|
+
if (!action) {
|
|
174
|
+
throw new Error("Action data must be set");
|
|
175
|
+
}
|
|
176
|
+
if (entryPointVersion === "v0.6") {
|
|
177
|
+
if (customNonceKey > maxUint192) {
|
|
178
|
+
throw new Error("Custom nonce key must be equal or less than maxUint192 for v0.6");
|
|
179
|
+
}
|
|
180
|
+
return await activeValidator.getNonceKey(accountAddress, customNonceKey);
|
|
181
|
+
}
|
|
182
|
+
if (customNonceKey > maxUint16)
|
|
183
|
+
throw new Error("Custom nonce key must be equal or less than 2 bytes(maxUint16) for v0.7");
|
|
184
|
+
const validatorMode = !regular ||
|
|
185
|
+
(await isPluginEnabled(accountAddress, action.selector))
|
|
186
|
+
? VALIDATOR_MODE.DEFAULT
|
|
187
|
+
: VALIDATOR_MODE.ENABLE;
|
|
188
|
+
const validatorType = regular
|
|
189
|
+
? VALIDATOR_TYPE[regular.validatorType]
|
|
190
|
+
: VALIDATOR_TYPE.SUDO;
|
|
191
|
+
const encoding = pad(concatHex([
|
|
192
|
+
validatorMode, // 1 byte
|
|
193
|
+
validatorType, // 1 byte
|
|
194
|
+
pad(activeValidator.getIdentifier(), {
|
|
195
|
+
size: 20,
|
|
196
|
+
dir: "right"
|
|
197
|
+
}), // 20 bytes
|
|
198
|
+
pad(toHex(await activeValidator.getNonceKey(accountAddress, customNonceKey)), {
|
|
266
199
|
size: 2
|
|
267
|
-
}) //
|
|
268
|
-
]), { size: 24 })
|
|
200
|
+
}) // 2 byte
|
|
201
|
+
]), { size: 24 });
|
|
202
|
+
const encodedNonceKey = BigInt(encoding);
|
|
203
|
+
return encodedNonceKey;
|
|
269
204
|
},
|
|
270
205
|
getPluginEnableSignature,
|
|
271
206
|
getValidatorInitData: async () => {
|
|
@@ -274,7 +209,8 @@ export async function toKernelPluginManager(client, { sudo, regular, pluginEnabl
|
|
|
274
209
|
return {
|
|
275
210
|
validatorAddress: sudo?.address ?? activeValidator.address,
|
|
276
211
|
enableData: (await sudo?.getEnableData()) ??
|
|
277
|
-
(await activeValidator.getEnableData())
|
|
212
|
+
(await activeValidator.getEnableData()),
|
|
213
|
+
identifier: pad(getIdentifier(true), { size: 21, dir: "right" })
|
|
278
214
|
};
|
|
279
215
|
}
|
|
280
216
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toKernelPluginManager.js","sourceRoot":"","sources":["../../../accounts/utils/toKernelPluginManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"toKernelPluginManager.js","sourceRoot":"","sources":["../../../accounts/utils/toKernelPluginManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAMH,MAAM,EACN,SAAS,EACT,SAAS,EACT,UAAU,EACV,GAAG,EACH,KAAK,EACL,WAAW,EACd,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAGH,aAAa,EAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAA;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAC/E,OAAO,EAAE,qBAAqB,IAAI,uBAAuB,EAAE,MAAM,wDAAwD,CAAA;AACzH,OAAO,EAAE,yBAAyB,IAAI,2BAA2B,EAAE,MAAM,4DAA4D,CAAA;AACrI,OAAO,EAAE,qBAAqB,IAAI,uBAAuB,EAAE,MAAM,wDAAwD,CAAA;AACzH,OAAO,EAAE,yBAAyB,IAAI,2BAA2B,EAAE,MAAM,4DAA4D,CAAA;AACrI,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAA;AAE1F,MAAM,UAAU,qBAAqB;AACjC,4DAA4D;AAC5D,MAAW;IAEX,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serOperationGasPrice = async (client) => {
|
|
2
|
+
const gasPrice = await client.request({
|
|
3
|
+
method: "zd_getUserOperationGasPrice",
|
|
4
|
+
params: []
|
|
5
|
+
});
|
|
6
|
+
return {
|
|
7
|
+
maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
|
|
8
|
+
maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=getUserOperationGasPrice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/account-client/getUserOperationGasPrice.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAA2E,EACtB,EAAE;IACvD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACvE,CAAA;AACL,CAAC,CAAA"}
|
package/_esm/actions/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { sponsorUserOperation } from "./paymaster/sponsorUserOperation.js";
|
|
2
2
|
export { signUserOperation } from "./account-client/signUserOperation.js";
|
|
3
|
+
export { getUserOperationGasPrice } from "./account-client/getUserOperationGasPrice.js";
|
|
3
4
|
export { estimateGasInERC20 } from "./paymaster/estimateGasInERC20.js";
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EAE3B,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ENTRYPOINT_ADDRESS_V06 } from "permissionless";
|
|
1
2
|
import { deepHexlify } from "permissionless/utils";
|
|
2
|
-
import { KERNEL_ADDRESSES } from "../../accounts/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export const estimateGasInERC20 = async (client, args) => {
|
|
|
11
11
|
chainId: client.chain?.id,
|
|
12
12
|
userOp: deepHexlify(args.userOperation),
|
|
13
13
|
tokenAddress: args.gasTokenAddress,
|
|
14
|
-
entryPointAddress: args.entryPoint ??
|
|
14
|
+
entryPointAddress: args.entryPoint ?? ENTRYPOINT_ADDRESS_V06
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAMvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAmBlD;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACnC,MAA0C,EAC1C,IAAkC,EACG,EAAE;IACvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE,WAAW,CACf,IAAI,CAAC,aAAa,CACmB;gBACzC,YAAY,EAAE,IAAI,CAAC,eAAe;gBAClC,iBAAiB,EAAE,IAAI,CAAC,UAAU,IAAI,sBAAsB;aAC/D;SACJ;KACJ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAkC;QAC1C,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,aAAa,EAAE,QAAQ,CAAC,aAAa;KACxC,CAAA;IAED,MAAM,MAAM,GACR,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEvE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrB,CAAC,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ENTRYPOINT_ADDRESS_V06, deepHexlify } from "permissionless/utils";
|
|
2
|
-
import { KERNEL_ADDRESSES } from "../../accounts/index.js";
|
|
3
2
|
/**
|
|
4
3
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
5
4
|
*/
|
|
@@ -10,7 +9,7 @@ export const sponsorUserOperation = async (client, args) => {
|
|
|
10
9
|
{
|
|
11
10
|
chainId: client.chain?.id,
|
|
12
11
|
userOp: deepHexlify(args.userOperation),
|
|
13
|
-
entryPointAddress: args.entryPoint
|
|
12
|
+
entryPointAddress: args.entryPoint,
|
|
14
13
|
gasTokenData: args.gasToken && {
|
|
15
14
|
tokenAddress: args.gasToken
|
|
16
15
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AA6C1E;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACrC,MAA0C,EAC1C,IAAgD,EACG,EAAE;IACrD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE,WAAW,CACf,IAAI,CAAC,aAAa,CAGrB;gBACD,iBAAiB,EAAE,IAAI,CAAC,UAAU;gBAClC,YAAY,EAAE,IAAI,CAAC,QAAQ,IAAI;oBAC3B,YAAY,EAAE,IAAI,CAAC,QAAQ;iBAC9B;gBACD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,KAAK;gBAClD,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI;aAC5C;SACJ;KACJ,CAAC,CAAA;IACF,IAAI,IAAI,CAAC,UAAU,KAAK,sBAAsB,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,QASnB,CAAA;QACD,OAAO;YACH,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;YAC9C,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAC1D,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;YAC9D,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACH,CAAA;IACnD,CAAC;IACD,MAAM,WAAW,GAAG,QASnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;KACG,CAAA;IAC/C,gEAAgE;IAChE,wCAAwC;IACxC,6BAA6B;IAC7B,mDAAmD;IACnD,+DAA+D;IAC/D,mEAAmE;IACnE,kDAAkD;IAClD,IAAI;IACJ,OAAO;IACP,6CAA6C;IAC7C,kDAAkD;IAClD,MAAM;IACN,iBAAiB;IACjB,qBAAqB;IACrB,uDAAuD;IACvD,sEAAsE;IACtE,QAAQ;IACR,IAAI;IAEJ,gBAAgB;AACpB,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { smartAccountActions } from "permissionless";
|
|
2
2
|
import {} from "permissionless/actions/smartAccount";
|
|
3
|
+
import { getUserOperationGasPrice } from "../../actions/account-client/getUserOperationGasPrice.js";
|
|
3
4
|
import { signUserOperation } from "../../actions/index.js";
|
|
4
5
|
import { estimateGasInERC20 } from "../../actions/paymaster/estimateGasInERC20.js";
|
|
5
6
|
import { sponsorUserOperation } from "../../actions/paymaster/sponsorUserOperation.js";
|
|
@@ -15,6 +16,7 @@ export const kernelAccountClientActions = ({ middleware }) => (client) => ({
|
|
|
15
16
|
signUserOperation: (args) => signUserOperation(client, {
|
|
16
17
|
...args,
|
|
17
18
|
middleware
|
|
18
|
-
})
|
|
19
|
+
}),
|
|
20
|
+
getUserOperationGasPrice: async () => getUserOperationGasPrice(client)
|
|
19
21
|
});
|
|
20
22
|
//# sourceMappingURL=kernel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EAAmB,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EAAmB,MAAM,qCAAqC,CAAA;AAGrE,OAAO,EAEH,wBAAwB,EAC3B,MAAM,0DAA0D,CAAA;AAKjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAGH,kBAAkB,EACrB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAGH,oBAAoB,EACvB,MAAM,iDAAiD,CAAA;AAexD,MAAM,CAAC,MAAM,uBAAuB,GAChC,CAAgC,iBAA6B,EAAE,EAAE,CACjE,CAAC,MAAc,EAA6C,EAAE,CAAC,CAAC;IAC5D,oBAAoB,EAAE,KAAK,EACvB,IAAoE,EACtE,EAAE,CACA,oBAAoB,CAChB,MAA4C,EAC5C;QACI,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CACJ;IACL,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,kBAAkB,CACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AAmCN,MAAM,CAAC,MAAM,0BAA0B,GACnC,CAAgC,EAAE,UAAU,EAA0B,EAAE,EAAE,CAC1E,CAOI,MAAiD,EACY,EAAE,CAAC,CAAC;IACjE,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,iBAAiB,CACb,MAAM,EACN;QACI,GAAG,IAAI;QACP,UAAU;KAC6C,CAC9D;IACL,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC;CACzE,CAAC,CAAA"}
|
|
@@ -1,17 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEntryPointVersion } from "permissionless";
|
|
2
|
+
import { http, createClient } from "viem";
|
|
2
3
|
import {} from "../accounts/index.js";
|
|
4
|
+
import { getUserOperationGasPrice } from "../actions/account-client/getUserOperationGasPrice.js";
|
|
3
5
|
import { kernelAccountClientActions } from "./decorators/kernel.js";
|
|
6
|
+
import { hasPimlicoAsProvider, setPimlicoAsProvider } from "./utils.js";
|
|
4
7
|
export const createKernelAccountClient = (parameters) => {
|
|
5
|
-
const { key = "Account", name = "Kernel Account Client", bundlerTransport } = parameters;
|
|
8
|
+
const { key = "Account", name = "Kernel Account Client", bundlerTransport, entryPoint } = parameters;
|
|
9
|
+
const entryPointVersion = getEntryPointVersion(entryPoint);
|
|
10
|
+
const shouldIncludePimlicoProvider = bundlerTransport({}).config.key === "http" &&
|
|
11
|
+
entryPointVersion === "v0.7";
|
|
6
12
|
const client = createClient({
|
|
7
13
|
...parameters,
|
|
8
14
|
key,
|
|
9
15
|
name,
|
|
10
|
-
transport: (opts) =>
|
|
16
|
+
transport: (opts) => {
|
|
17
|
+
let _bundlerTransport = bundlerTransport({
|
|
18
|
+
...opts,
|
|
19
|
+
retryCount: 0
|
|
20
|
+
});
|
|
21
|
+
if (!shouldIncludePimlicoProvider)
|
|
22
|
+
return _bundlerTransport;
|
|
23
|
+
_bundlerTransport = http(setPimlicoAsProvider(_bundlerTransport.value?.url))({ ...opts, retryCount: 0 });
|
|
24
|
+
return _bundlerTransport;
|
|
25
|
+
},
|
|
11
26
|
type: "kernelAccountClient"
|
|
12
27
|
});
|
|
28
|
+
let middleware = parameters.middleware;
|
|
29
|
+
if ((!middleware ||
|
|
30
|
+
(typeof middleware !== "function" && !middleware.gasPrice)) &&
|
|
31
|
+
client.transport?.url &&
|
|
32
|
+
hasPimlicoAsProvider(client.transport.url)) {
|
|
33
|
+
const gasPrice = () => getUserOperationGasPrice(client);
|
|
34
|
+
middleware = {
|
|
35
|
+
...middleware,
|
|
36
|
+
gasPrice
|
|
37
|
+
};
|
|
38
|
+
}
|
|
13
39
|
return client.extend(kernelAccountClientActions({
|
|
14
|
-
middleware
|
|
40
|
+
middleware
|
|
15
41
|
}));
|
|
16
42
|
};
|
|
17
43
|
//# sourceMappingURL=kernelAccountClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAKrD,OAAO,EACH,IAAI,EAKJ,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAA2B,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAA;AAChG,OAAO,EAEH,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAsCvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAQrC,UAKC,EACiE,EAAE;IACpE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,uBAAuB,EAC9B,gBAAgB,EAChB,UAAU,EACb,GAAG,UAAU,CAAA;IACd,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;IAC1D,MAAM,4BAA4B,GAC9B,gBAAgB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,K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