@zerodev/sdk 5.2.1-alpha-9 → 5.2.1
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 +17 -5
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_cjs/accounts/kernel/createKernelAccount.js +14 -7
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +27 -0
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -0
- package/_cjs/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +2 -2
- package/_cjs/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js +2 -2
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js.map +1 -1
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js +3 -0
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js +3 -0
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js.map +1 -1
- package/_cjs/accounts/utils/6492.js +2 -2
- package/_cjs/accounts/utils/6492.js.map +1 -1
- package/_cjs/accounts/utils/toKernelPluginManager.js +20 -0
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/actions/account-client/signUserOperation.js +2 -1
- package/_cjs/actions/account-client/signUserOperation.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_cjs/utils.js +1 -1
- package/_cjs/utils.js.map +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +17 -5
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +14 -7
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +23 -0
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -0
- package/_esm/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +2 -2
- package/_esm/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js +2 -2
- package/_esm/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js.map +1 -1
- package/_esm/accounts/kernel/v1/createKernelV1Account.js +3 -0
- package/_esm/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_esm/accounts/kernel/v2/createKernelV2Account.js +4 -0
- package/_esm/accounts/kernel/v2/createKernelV2Account.js.map +1 -1
- package/_esm/accounts/utils/6492.js +2 -2
- package/_esm/accounts/utils/6492.js.map +1 -1
- package/_esm/accounts/utils/toKernelPluginManager.js +20 -0
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/actions/account-client/signUserOperation.js +3 -2
- package/_esm/actions/account-client/signUserOperation.js.map +1 -1
- package/_esm/types/kernel.js.map +1 -1
- package/_esm/utils.js +2 -1
- package/_esm/utils.js.map +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts +19 -5
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts.map +1 -1
- package/_types/accounts/kernel/createKernelAccount.d.ts +1 -0
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts +14 -0
- package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts.map +1 -0
- package/_types/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.d.ts.map +1 -1
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts.map +1 -1
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts +3 -9
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts.map +1 -1
- package/_types/accounts/utils/6492.d.ts.map +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
- package/_types/actions/account-client/signUserOperation.d.ts.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +14 -10
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/_types/clients/paymasterClient.d.ts +4 -0
- package/_types/clients/paymasterClient.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +10 -1
- 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 +17 -5
- package/accounts/kernel/createKernelAccount.ts +16 -6
- package/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.ts +35 -0
- package/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.ts +3 -2
- package/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.ts +0 -1
- package/accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.ts +3 -2
- package/accounts/kernel/v1/createKernelV1Account.ts +3 -0
- package/accounts/kernel/v2/createKernelV2Account.ts +7 -15
- package/accounts/utils/6492.ts +3 -2
- package/accounts/utils/toKernelPluginManager.ts +19 -0
- package/actions/account-client/signUserOperation.ts +3 -2
- package/package.json +3 -3
- package/types/kernel.ts +18 -1
- package/utils.ts +2 -1
|
@@ -13,10 +13,10 @@ import type {
|
|
|
13
13
|
} from "permissionless/types"
|
|
14
14
|
import {
|
|
15
15
|
AccountOrClientNotFoundError,
|
|
16
|
-
getAction,
|
|
17
16
|
parseAccount
|
|
18
17
|
} from "permissionless/utils"
|
|
19
18
|
import type { Chain, Client, Transport } from "viem"
|
|
19
|
+
import { getAction } from "viem/utils"
|
|
20
20
|
|
|
21
21
|
export type SignUserOperationParameters<
|
|
22
22
|
entryPoint extends EntryPoint,
|
|
@@ -60,7 +60,8 @@ export async function signUserOperation<
|
|
|
60
60
|
|
|
61
61
|
const userOperation = await getAction(
|
|
62
62
|
client,
|
|
63
|
-
prepareUserOperationRequest<entryPoint, TTransport, TChain, TAccount
|
|
63
|
+
prepareUserOperationRequest<entryPoint, TTransport, TChain, TAccount>,
|
|
64
|
+
"prepareUserOperationRequest"
|
|
64
65
|
)(args)
|
|
65
66
|
|
|
66
67
|
userOperation.signature = await account.signUserOperation(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerodev/sdk",
|
|
3
|
-
"version": "5.2.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"author": "ZeroDev",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"viem": "^2.
|
|
94
|
-
"permissionless": "^0.1.
|
|
93
|
+
"viem": "^2.9.17",
|
|
94
|
+
"permissionless": "^0.1.17"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"semver": "^7.6.0"
|
package/types/kernel.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ENTRYPOINT_ADDRESS_V06_TYPE,
|
|
3
|
+
EntryPoint
|
|
4
|
+
} from "permissionless/types"
|
|
2
5
|
import type { GetEntryPointVersion } from "permissionless/types/entrypoint"
|
|
3
6
|
import type {
|
|
4
7
|
UserOperation,
|
|
@@ -151,8 +154,22 @@ export type KernelPluginManager<entryPoint extends EntryPoint> =
|
|
|
151
154
|
getAction(): Action
|
|
152
155
|
getValidityData(): PluginValidityData
|
|
153
156
|
getIdentifier(isSudo?: boolean): Hex
|
|
157
|
+
encodeModuleInstallCallData: (accountAddress: Address) => Promise<Hex>
|
|
154
158
|
}
|
|
155
159
|
|
|
160
|
+
export type PluginInstallData<entryPoint extends EntryPoint> =
|
|
161
|
+
entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
|
|
162
|
+
? {
|
|
163
|
+
selector: Hex
|
|
164
|
+
executor: Address
|
|
165
|
+
validator: Address
|
|
166
|
+
validUntil: number
|
|
167
|
+
validAfter: number
|
|
168
|
+
enableData: Hex
|
|
169
|
+
}
|
|
170
|
+
: // TODO: Add support for EP v0.7
|
|
171
|
+
never
|
|
172
|
+
|
|
156
173
|
export type KernelPluginManagerParams<entryPoint extends EntryPoint> = {
|
|
157
174
|
sudo?: KernelValidator<entryPoint>
|
|
158
175
|
regular?: KernelValidator<entryPoint>
|
package/utils.ts
CHANGED
|
@@ -98,7 +98,8 @@ export const fixSignedData = (sig: Hex): Hex => {
|
|
|
98
98
|
|
|
99
99
|
let { r, s, v } = hexToSignature(signature)
|
|
100
100
|
if (v === 0n || v === 1n) v += 27n
|
|
101
|
-
|
|
101
|
+
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
102
|
+
const joined = signatureToHex({ r, s, v: v! })
|
|
102
103
|
return joined
|
|
103
104
|
}
|
|
104
105
|
|