@zerodev/sdk 5.1.13 → 5.1.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.
Files changed (64) hide show
  1. package/_cjs/accounts/index.js +7 -1
  2. package/_cjs/accounts/index.js.map +1 -1
  3. package/_cjs/accounts/kernel/v1/createKernelV1Account.js +1 -1
  4. package/_cjs/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
  5. package/_cjs/accounts/kernel/v2/abi/KernelAccountV2Abi.js +377 -0
  6. package/_cjs/accounts/kernel/v2/abi/KernelAccountV2Abi.js.map +1 -0
  7. package/_cjs/accounts/kernel/v2/abi/KernelFactoryV2Abi.js +115 -0
  8. package/_cjs/accounts/kernel/v2/abi/KernelFactoryV2Abi.js.map +1 -0
  9. package/_cjs/accounts/kernel/v2/createKernelV2Account.js +216 -0
  10. package/_cjs/accounts/kernel/v2/createKernelV2Account.js.map +1 -0
  11. package/_cjs/accounts/utils/multisend.js.map +1 -0
  12. package/_cjs/accounts/utils/toKernelPluginManager.js +5 -4
  13. package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
  14. package/_cjs/index.js +2 -1
  15. package/_cjs/index.js.map +1 -1
  16. package/_cjs/types/kernel.js.map +1 -1
  17. package/_esm/accounts/index.js +3 -0
  18. package/_esm/accounts/index.js.map +1 -1
  19. package/_esm/accounts/kernel/v1/createKernelV1Account.js +1 -1
  20. package/_esm/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
  21. package/_esm/accounts/kernel/v2/abi/KernelAccountV2Abi.js +374 -0
  22. package/_esm/accounts/kernel/v2/abi/KernelAccountV2Abi.js.map +1 -0
  23. package/_esm/accounts/kernel/v2/abi/KernelFactoryV2Abi.js +112 -0
  24. package/_esm/accounts/kernel/v2/abi/KernelFactoryV2Abi.js.map +1 -0
  25. package/_esm/accounts/kernel/v2/createKernelV2Account.js +254 -0
  26. package/_esm/accounts/kernel/v2/createKernelV2Account.js.map +1 -0
  27. package/_esm/accounts/{kernel/v1 → utils}/multisend.js +1 -1
  28. package/_esm/accounts/utils/multisend.js.map +1 -0
  29. package/_esm/accounts/utils/toKernelPluginManager.js +5 -4
  30. package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
  31. package/_esm/index.js +1 -1
  32. package/_esm/index.js.map +1 -1
  33. package/_esm/types/kernel.js.map +1 -1
  34. package/_types/accounts/index.d.ts +3 -0
  35. package/_types/accounts/index.d.ts.map +1 -1
  36. package/_types/accounts/kernel/v1/createKernelV1Account.d.ts.map +1 -1
  37. package/_types/accounts/kernel/v2/abi/KernelAccountV2Abi.d.ts +447 -0
  38. package/_types/accounts/kernel/v2/abi/KernelAccountV2Abi.d.ts.map +1 -0
  39. package/_types/accounts/kernel/v2/abi/KernelFactoryV2Abi.d.ts +109 -0
  40. package/_types/accounts/kernel/v2/abi/KernelFactoryV2Abi.d.ts.map +1 -0
  41. package/_types/accounts/kernel/v2/createKernelV2Account.d.ts +33 -0
  42. package/_types/accounts/kernel/v2/createKernelV2Account.d.ts.map +1 -0
  43. package/_types/accounts/{kernel/v1 → utils}/multisend.d.ts +1 -1
  44. package/_types/accounts/utils/multisend.d.ts.map +1 -0
  45. package/_types/accounts/utils/toKernelPluginManager.d.ts +1 -1
  46. package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
  47. package/_types/index.d.ts +1 -1
  48. package/_types/index.d.ts.map +1 -1
  49. package/_types/types/kernel.d.ts +1 -0
  50. package/_types/types/kernel.d.ts.map +1 -1
  51. package/accounts/index.ts +3 -0
  52. package/accounts/kernel/v1/createKernelV1Account.ts +2 -2
  53. package/accounts/kernel/v2/abi/KernelAccountV2Abi.ts +373 -0
  54. package/accounts/kernel/v2/abi/KernelFactoryV2Abi.ts +111 -0
  55. package/accounts/kernel/v2/createKernelV2Account.ts +369 -0
  56. package/accounts/{kernel/v1 → utils}/multisend.ts +1 -1
  57. package/accounts/utils/toKernelPluginManager.ts +7 -4
  58. package/index.ts +1 -0
  59. package/package.json +1 -1
  60. package/types/kernel.ts +1 -0
  61. package/_cjs/accounts/kernel/v1/multisend.js.map +0 -1
  62. package/_esm/accounts/kernel/v1/multisend.js.map +0 -1
  63. package/_types/accounts/kernel/v1/multisend.d.ts.map +0 -1
  64. /package/_cjs/accounts/{kernel/v1 → utils}/multisend.js +0 -0
package/accounts/index.ts CHANGED
@@ -5,5 +5,8 @@ export {
5
5
  EIP1271ABI
6
6
  } from "./kernel/createKernelAccount.js"
7
7
  export { createKernelV1Account } from "./kernel/v1/createKernelV1Account.js"
8
+ export { createKernelV2Account } from "./kernel/v2/createKernelV2Account.js"
9
+ export { KernelAccountV2Abi } from "./kernel/v2/abi/KernelAccountV2Abi.js"
10
+ export { KernelFactoryV2Abi } from "./kernel/v2/abi/KernelFactoryV2Abi.js"
8
11
  export { addressToEmptyAccount } from "./addressToEmptyAccount.js"
9
12
  export * from "./utils/index.js"
@@ -30,12 +30,12 @@ import {
30
30
  import { type KernelEncodeCallDataArgs } from "../../../types/kernel.js"
31
31
  import { wrapSignatureWith6492 } from "../../utils/6492.js"
32
32
  import { parseFactoryAddressAndCallDataFromAccountInitCode } from "../../utils/index.js"
33
- import { type KernelSmartAccount } from "../createKernelAccount.js"
34
33
  import {
35
34
  MULTISEND_ADDRESS,
36
35
  encodeMultiSend,
37
36
  multiSendAbi
38
- } from "./multisend.js"
37
+ } from "../../utils/multisend.js"
38
+ import { type KernelSmartAccount } from "../createKernelAccount.js"
39
39
 
40
40
  export type KernelV1SmartAccount<
41
41
  transport extends Transport = Transport,
@@ -0,0 +1,373 @@
1
+ export const KernelAccountV2Abi = [
2
+ {
3
+ type: "constructor",
4
+ inputs: [
5
+ {
6
+ name: "_entryPoint",
7
+ type: "address",
8
+ internalType: "contract IEntryPoint"
9
+ }
10
+ ],
11
+ stateMutability: "nonpayable"
12
+ },
13
+ { type: "fallback", stateMutability: "payable" },
14
+ { type: "receive", stateMutability: "payable" },
15
+ {
16
+ type: "function",
17
+ name: "disableMode",
18
+ inputs: [
19
+ { name: "_disableFlag", type: "bytes4", internalType: "bytes4" }
20
+ ],
21
+ outputs: [],
22
+ stateMutability: "nonpayable"
23
+ },
24
+ {
25
+ type: "function",
26
+ name: "entryPoint",
27
+ inputs: [],
28
+ outputs: [
29
+ {
30
+ name: "",
31
+ type: "address",
32
+ internalType: "contract IEntryPoint"
33
+ }
34
+ ],
35
+ stateMutability: "view"
36
+ },
37
+ {
38
+ type: "function",
39
+ name: "execute",
40
+ inputs: [
41
+ { name: "to", type: "address", internalType: "address" },
42
+ { name: "value", type: "uint256", internalType: "uint256" },
43
+ { name: "data", type: "bytes", internalType: "bytes" },
44
+ {
45
+ name: "operation",
46
+ type: "uint8",
47
+ internalType: "enum Operation"
48
+ }
49
+ ],
50
+ outputs: [],
51
+ stateMutability: "nonpayable"
52
+ },
53
+ {
54
+ type: "function",
55
+ name: "getDefaultValidator",
56
+ inputs: [],
57
+ outputs: [
58
+ {
59
+ name: "",
60
+ type: "address",
61
+ internalType: "contract IKernelValidator"
62
+ }
63
+ ],
64
+ stateMutability: "view"
65
+ },
66
+ {
67
+ type: "function",
68
+ name: "getDisabledMode",
69
+ inputs: [],
70
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
71
+ stateMutability: "view"
72
+ },
73
+ {
74
+ type: "function",
75
+ name: "getExecution",
76
+ inputs: [{ name: "_selector", type: "bytes4", internalType: "bytes4" }],
77
+ outputs: [
78
+ {
79
+ name: "",
80
+ type: "tuple",
81
+ internalType: "struct ExecutionDetail",
82
+ components: [
83
+ {
84
+ name: "validUntil",
85
+ type: "uint48",
86
+ internalType: "uint48"
87
+ },
88
+ {
89
+ name: "validAfter",
90
+ type: "uint48",
91
+ internalType: "uint48"
92
+ },
93
+ {
94
+ name: "executor",
95
+ type: "address",
96
+ internalType: "address"
97
+ },
98
+ {
99
+ name: "validator",
100
+ type: "address",
101
+ internalType: "contract IKernelValidator"
102
+ }
103
+ ]
104
+ }
105
+ ],
106
+ stateMutability: "view"
107
+ },
108
+ {
109
+ type: "function",
110
+ name: "getLastDisabledTime",
111
+ inputs: [],
112
+ outputs: [{ name: "", type: "uint48", internalType: "uint48" }],
113
+ stateMutability: "view"
114
+ },
115
+ {
116
+ type: "function",
117
+ name: "getNonce",
118
+ inputs: [{ name: "key", type: "uint192", internalType: "uint192" }],
119
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
120
+ stateMutability: "view"
121
+ },
122
+ {
123
+ type: "function",
124
+ name: "getNonce",
125
+ inputs: [],
126
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
127
+ stateMutability: "view"
128
+ },
129
+ {
130
+ type: "function",
131
+ name: "initialize",
132
+ inputs: [
133
+ {
134
+ name: "_defaultValidator",
135
+ type: "address",
136
+ internalType: "contract IKernelValidator"
137
+ },
138
+ { name: "_data", type: "bytes", internalType: "bytes" }
139
+ ],
140
+ outputs: [],
141
+ stateMutability: "nonpayable"
142
+ },
143
+ {
144
+ type: "function",
145
+ name: "isValidSignature",
146
+ inputs: [
147
+ { name: "hash", type: "bytes32", internalType: "bytes32" },
148
+ { name: "signature", type: "bytes", internalType: "bytes" }
149
+ ],
150
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
151
+ stateMutability: "view"
152
+ },
153
+ {
154
+ type: "function",
155
+ name: "name",
156
+ inputs: [],
157
+ outputs: [{ name: "", type: "string", internalType: "string" }],
158
+ stateMutability: "view"
159
+ },
160
+ {
161
+ type: "function",
162
+ name: "onERC1155BatchReceived",
163
+ inputs: [
164
+ { name: "", type: "address", internalType: "address" },
165
+ { name: "", type: "address", internalType: "address" },
166
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
167
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
168
+ { name: "", type: "bytes", internalType: "bytes" }
169
+ ],
170
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
171
+ stateMutability: "pure"
172
+ },
173
+ {
174
+ type: "function",
175
+ name: "onERC1155Received",
176
+ inputs: [
177
+ { name: "", type: "address", internalType: "address" },
178
+ { name: "", type: "address", internalType: "address" },
179
+ { name: "", type: "uint256", internalType: "uint256" },
180
+ { name: "", type: "uint256", internalType: "uint256" },
181
+ { name: "", type: "bytes", internalType: "bytes" }
182
+ ],
183
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
184
+ stateMutability: "pure"
185
+ },
186
+ {
187
+ type: "function",
188
+ name: "onERC721Received",
189
+ inputs: [
190
+ { name: "", type: "address", internalType: "address" },
191
+ { name: "", type: "address", internalType: "address" },
192
+ { name: "", type: "uint256", internalType: "uint256" },
193
+ { name: "", type: "bytes", internalType: "bytes" }
194
+ ],
195
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
196
+ stateMutability: "pure"
197
+ },
198
+ {
199
+ type: "function",
200
+ name: "setDefaultValidator",
201
+ inputs: [
202
+ {
203
+ name: "_defaultValidator",
204
+ type: "address",
205
+ internalType: "contract IKernelValidator"
206
+ },
207
+ { name: "_data", type: "bytes", internalType: "bytes" }
208
+ ],
209
+ outputs: [],
210
+ stateMutability: "nonpayable"
211
+ },
212
+ {
213
+ type: "function",
214
+ name: "setExecution",
215
+ inputs: [
216
+ { name: "_selector", type: "bytes4", internalType: "bytes4" },
217
+ { name: "_executor", type: "address", internalType: "address" },
218
+ {
219
+ name: "_validator",
220
+ type: "address",
221
+ internalType: "contract IKernelValidator"
222
+ },
223
+ { name: "_validUntil", type: "uint48", internalType: "uint48" },
224
+ { name: "_validAfter", type: "uint48", internalType: "uint48" },
225
+ { name: "_enableData", type: "bytes", internalType: "bytes" }
226
+ ],
227
+ outputs: [],
228
+ stateMutability: "nonpayable"
229
+ },
230
+ {
231
+ type: "function",
232
+ name: "upgradeTo",
233
+ inputs: [
234
+ {
235
+ name: "_newImplementation",
236
+ type: "address",
237
+ internalType: "address"
238
+ }
239
+ ],
240
+ outputs: [],
241
+ stateMutability: "nonpayable"
242
+ },
243
+ {
244
+ type: "function",
245
+ name: "validateUserOp",
246
+ inputs: [
247
+ {
248
+ name: "userOp",
249
+ type: "tuple",
250
+ internalType: "struct UserOperation",
251
+ components: [
252
+ {
253
+ name: "sender",
254
+ type: "address",
255
+ internalType: "address"
256
+ },
257
+ { name: "nonce", type: "uint256", internalType: "uint256" },
258
+ { name: "initCode", type: "bytes", internalType: "bytes" },
259
+ { name: "callData", type: "bytes", internalType: "bytes" },
260
+ {
261
+ name: "callGasLimit",
262
+ type: "uint256",
263
+ internalType: "uint256"
264
+ },
265
+ {
266
+ name: "verificationGasLimit",
267
+ type: "uint256",
268
+ internalType: "uint256"
269
+ },
270
+ {
271
+ name: "preVerificationGas",
272
+ type: "uint256",
273
+ internalType: "uint256"
274
+ },
275
+ {
276
+ name: "maxFeePerGas",
277
+ type: "uint256",
278
+ internalType: "uint256"
279
+ },
280
+ {
281
+ name: "maxPriorityFeePerGas",
282
+ type: "uint256",
283
+ internalType: "uint256"
284
+ },
285
+ {
286
+ name: "paymasterAndData",
287
+ type: "bytes",
288
+ internalType: "bytes"
289
+ },
290
+ { name: "signature", type: "bytes", internalType: "bytes" }
291
+ ]
292
+ },
293
+ { name: "userOpHash", type: "bytes32", internalType: "bytes32" },
294
+ {
295
+ name: "missingAccountFunds",
296
+ type: "uint256",
297
+ internalType: "uint256"
298
+ }
299
+ ],
300
+ outputs: [
301
+ {
302
+ name: "validationData",
303
+ type: "uint256",
304
+ internalType: "uint256"
305
+ }
306
+ ],
307
+ stateMutability: "nonpayable"
308
+ },
309
+ {
310
+ type: "function",
311
+ name: "version",
312
+ inputs: [],
313
+ outputs: [{ name: "", type: "string", internalType: "string" }],
314
+ stateMutability: "view"
315
+ },
316
+ {
317
+ type: "event",
318
+ name: "DefaultValidatorChanged",
319
+ inputs: [
320
+ {
321
+ name: "oldValidator",
322
+ type: "address",
323
+ indexed: true,
324
+ internalType: "address"
325
+ },
326
+ {
327
+ name: "newValidator",
328
+ type: "address",
329
+ indexed: true,
330
+ internalType: "address"
331
+ }
332
+ ],
333
+ anonymous: false
334
+ },
335
+ {
336
+ type: "event",
337
+ name: "ExecutionChanged",
338
+ inputs: [
339
+ {
340
+ name: "selector",
341
+ type: "bytes4",
342
+ indexed: true,
343
+ internalType: "bytes4"
344
+ },
345
+ {
346
+ name: "executor",
347
+ type: "address",
348
+ indexed: true,
349
+ internalType: "address"
350
+ },
351
+ {
352
+ name: "validator",
353
+ type: "address",
354
+ indexed: true,
355
+ internalType: "address"
356
+ }
357
+ ],
358
+ anonymous: false
359
+ },
360
+ {
361
+ type: "event",
362
+ name: "Upgraded",
363
+ inputs: [
364
+ {
365
+ name: "newImplementation",
366
+ type: "address",
367
+ indexed: true,
368
+ internalType: "address"
369
+ }
370
+ ],
371
+ anonymous: false
372
+ }
373
+ ] as const
@@ -0,0 +1,111 @@
1
+ export const KernelFactoryV2Abi = [
2
+ {
3
+ type: "constructor",
4
+ inputs: [
5
+ {
6
+ name: "_entryPoint",
7
+ type: "address",
8
+ internalType: "contract IEntryPoint"
9
+ }
10
+ ],
11
+ stateMutability: "nonpayable"
12
+ },
13
+ {
14
+ type: "function",
15
+ name: "createAccount",
16
+ inputs: [
17
+ {
18
+ name: "_validator",
19
+ type: "address",
20
+ internalType: "contract IKernelValidator"
21
+ },
22
+ { name: "_data", type: "bytes", internalType: "bytes" },
23
+ { name: "_index", type: "uint256", internalType: "uint256" }
24
+ ],
25
+ outputs: [
26
+ {
27
+ name: "proxy",
28
+ type: "address",
29
+ internalType: "contract EIP1967Proxy"
30
+ }
31
+ ],
32
+ stateMutability: "nonpayable"
33
+ },
34
+ {
35
+ type: "function",
36
+ name: "entryPoint",
37
+ inputs: [],
38
+ outputs: [
39
+ {
40
+ name: "",
41
+ type: "address",
42
+ internalType: "contract IEntryPoint"
43
+ }
44
+ ],
45
+ stateMutability: "view"
46
+ },
47
+ {
48
+ type: "function",
49
+ name: "getAccountAddress",
50
+ inputs: [
51
+ {
52
+ name: "_validator",
53
+ type: "address",
54
+ internalType: "contract IKernelValidator"
55
+ },
56
+ { name: "_data", type: "bytes", internalType: "bytes" },
57
+ { name: "_index", type: "uint256", internalType: "uint256" }
58
+ ],
59
+ outputs: [{ name: "", type: "address", internalType: "address" }],
60
+ stateMutability: "view"
61
+ },
62
+ {
63
+ type: "function",
64
+ name: "kernelTemplate",
65
+ inputs: [],
66
+ outputs: [
67
+ { name: "", type: "address", internalType: "contract TempKernel" }
68
+ ],
69
+ stateMutability: "view"
70
+ },
71
+ {
72
+ type: "function",
73
+ name: "nextTemplate",
74
+ inputs: [],
75
+ outputs: [
76
+ { name: "", type: "address", internalType: "contract Kernel" }
77
+ ],
78
+ stateMutability: "view"
79
+ },
80
+ {
81
+ type: "event",
82
+ name: "AccountCreated",
83
+ inputs: [
84
+ {
85
+ name: "account",
86
+ type: "address",
87
+ indexed: true,
88
+ internalType: "address"
89
+ },
90
+ {
91
+ name: "validator",
92
+ type: "address",
93
+ indexed: true,
94
+ internalType: "address"
95
+ },
96
+ {
97
+ name: "data",
98
+ type: "bytes",
99
+ indexed: false,
100
+ internalType: "bytes"
101
+ },
102
+ {
103
+ name: "index",
104
+ type: "uint256",
105
+ indexed: false,
106
+ internalType: "uint256"
107
+ }
108
+ ],
109
+ anonymous: false
110
+ }
111
+ ] as const