@zerodev/sdk 5.2.1-alpha-2 → 5.2.1-alpha-3
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 +99 -54
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_cjs/accounts/kernel/createKernelAccount.js +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +3 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +1 -4
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/actions/paymaster/sponsorUserOperation.js +1 -2
- package/_cjs/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_cjs/constants.js +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +99 -54
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.js +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +4 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +3 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/actions/paymaster/sponsorUserOperation.js +1 -2
- package/_esm/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_esm/constants.js +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts +92 -16
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts.map +1 -1
- package/_types/actions/paymaster/sponsorUserOperation.d.ts.map +1 -1
- package/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.ts +99 -54
- package/accounts/kernel/createKernelAccount.ts +1 -1
- package/accounts/kernel/utils/account/ep0_7/getKernelV3Nonce.ts +1 -1
- package/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.ts +4 -1
- package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +3 -1
- package/actions/paymaster/sponsorUserOperation.ts +1 -3
- package/constants.ts +1 -1
- package/package.json +1 -1
|
@@ -23,11 +23,7 @@ export const KernelV3ExecuteAbi = [
|
|
|
23
23
|
name: "execute",
|
|
24
24
|
inputs: [
|
|
25
25
|
{ name: "execMode", type: "bytes32", internalType: "ExecMode" },
|
|
26
|
-
{
|
|
27
|
-
name: "executionCalldata",
|
|
28
|
-
type: "bytes",
|
|
29
|
-
internalType: "bytes"
|
|
30
|
-
}
|
|
26
|
+
{ name: "executionCalldata", type: "bytes", internalType: "bytes" }
|
|
31
27
|
],
|
|
32
28
|
outputs: [],
|
|
33
29
|
stateMutability: "payable"
|
|
@@ -37,11 +33,7 @@ export const KernelV3ExecuteAbi = [
|
|
|
37
33
|
name: "executeFromExecutor",
|
|
38
34
|
inputs: [
|
|
39
35
|
{ name: "execMode", type: "bytes32", internalType: "ExecMode" },
|
|
40
|
-
{
|
|
41
|
-
name: "executionCalldata",
|
|
42
|
-
type: "bytes",
|
|
43
|
-
internalType: "bytes"
|
|
44
|
-
}
|
|
36
|
+
{ name: "executionCalldata", type: "bytes", internalType: "bytes" }
|
|
45
37
|
],
|
|
46
38
|
outputs: [
|
|
47
39
|
{ name: "returnData", type: "bytes[]", internalType: "bytes[]" }
|
|
@@ -144,11 +136,7 @@ export const KernelV3AccountAbi = [
|
|
|
144
136
|
internalType: "address"
|
|
145
137
|
},
|
|
146
138
|
{ name: "salt", type: "bytes32", internalType: "bytes32" },
|
|
147
|
-
{
|
|
148
|
-
name: "extensions",
|
|
149
|
-
type: "uint256[]",
|
|
150
|
-
internalType: "uint256[]"
|
|
151
|
-
}
|
|
139
|
+
{ name: "extensions", type: "uint256[]", internalType: "uint256[]" }
|
|
152
140
|
],
|
|
153
141
|
stateMutability: "view"
|
|
154
142
|
},
|
|
@@ -157,11 +145,7 @@ export const KernelV3AccountAbi = [
|
|
|
157
145
|
name: "entrypoint",
|
|
158
146
|
inputs: [],
|
|
159
147
|
outputs: [
|
|
160
|
-
{
|
|
161
|
-
name: "",
|
|
162
|
-
type: "address",
|
|
163
|
-
internalType: "contract IEntryPoint"
|
|
164
|
-
}
|
|
148
|
+
{ name: "", type: "address", internalType: "contract IEntryPoint" }
|
|
165
149
|
],
|
|
166
150
|
stateMutability: "view"
|
|
167
151
|
},
|
|
@@ -170,11 +154,7 @@ export const KernelV3AccountAbi = [
|
|
|
170
154
|
name: "execute",
|
|
171
155
|
inputs: [
|
|
172
156
|
{ name: "execMode", type: "bytes32", internalType: "ExecMode" },
|
|
173
|
-
{
|
|
174
|
-
name: "executionCalldata",
|
|
175
|
-
type: "bytes",
|
|
176
|
-
internalType: "bytes"
|
|
177
|
-
}
|
|
157
|
+
{ name: "executionCalldata", type: "bytes", internalType: "bytes" }
|
|
178
158
|
],
|
|
179
159
|
outputs: [],
|
|
180
160
|
stateMutability: "payable"
|
|
@@ -184,11 +164,7 @@ export const KernelV3AccountAbi = [
|
|
|
184
164
|
name: "executeFromExecutor",
|
|
185
165
|
inputs: [
|
|
186
166
|
{ name: "execMode", type: "bytes32", internalType: "ExecMode" },
|
|
187
|
-
{
|
|
188
|
-
name: "executionCalldata",
|
|
189
|
-
type: "bytes",
|
|
190
|
-
internalType: "bytes"
|
|
191
|
-
}
|
|
167
|
+
{ name: "executionCalldata", type: "bytes", internalType: "bytes" }
|
|
192
168
|
],
|
|
193
169
|
outputs: [
|
|
194
170
|
{ name: "returnData", type: "bytes[]", internalType: "bytes[]" }
|
|
@@ -266,16 +242,6 @@ export const KernelV3AccountAbi = [
|
|
|
266
242
|
],
|
|
267
243
|
stateMutability: "view"
|
|
268
244
|
},
|
|
269
|
-
{
|
|
270
|
-
type: "function",
|
|
271
|
-
name: "fallbackConfig",
|
|
272
|
-
inputs: [],
|
|
273
|
-
outputs: [
|
|
274
|
-
{ name: "", type: "address", internalType: "contract IFallback" },
|
|
275
|
-
{ name: "", type: "address", internalType: "contract IHook" }
|
|
276
|
-
],
|
|
277
|
-
stateMutability: "view"
|
|
278
|
-
},
|
|
279
245
|
{
|
|
280
246
|
type: "function",
|
|
281
247
|
name: "initialize",
|
|
@@ -303,6 +269,34 @@ export const KernelV3AccountAbi = [
|
|
|
303
269
|
outputs: [],
|
|
304
270
|
stateMutability: "payable"
|
|
305
271
|
},
|
|
272
|
+
{
|
|
273
|
+
type: "function",
|
|
274
|
+
name: "installValidations",
|
|
275
|
+
inputs: [
|
|
276
|
+
{ name: "vIds", type: "bytes21[]", internalType: "ValidationId[]" },
|
|
277
|
+
{
|
|
278
|
+
name: "configs",
|
|
279
|
+
type: "tuple[]",
|
|
280
|
+
internalType: "struct ValidationManager.ValidationConfig[]",
|
|
281
|
+
components: [
|
|
282
|
+
{ name: "nonce", type: "uint32", internalType: "uint32" },
|
|
283
|
+
{
|
|
284
|
+
name: "hook",
|
|
285
|
+
type: "address",
|
|
286
|
+
internalType: "contract IHook"
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "validationData",
|
|
292
|
+
type: "bytes[]",
|
|
293
|
+
internalType: "bytes[]"
|
|
294
|
+
},
|
|
295
|
+
{ name: "hookData", type: "bytes[]", internalType: "bytes[]" }
|
|
296
|
+
],
|
|
297
|
+
outputs: [],
|
|
298
|
+
stateMutability: "nonpayable"
|
|
299
|
+
},
|
|
306
300
|
{
|
|
307
301
|
type: "function",
|
|
308
302
|
name: "invalidateNonce",
|
|
@@ -326,11 +320,7 @@ export const KernelV3AccountAbi = [
|
|
|
326
320
|
inputs: [
|
|
327
321
|
{ name: "moduleType", type: "uint256", internalType: "uint256" },
|
|
328
322
|
{ name: "module", type: "address", internalType: "address" },
|
|
329
|
-
{
|
|
330
|
-
name: "additionalContext",
|
|
331
|
-
type: "bytes",
|
|
332
|
-
internalType: "bytes"
|
|
333
|
-
}
|
|
323
|
+
{ name: "additionalContext", type: "bytes", internalType: "bytes" }
|
|
334
324
|
],
|
|
335
325
|
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
336
326
|
stateMutability: "view"
|
|
@@ -399,7 +389,16 @@ export const KernelV3AccountAbi = [
|
|
|
399
389
|
type: "address",
|
|
400
390
|
internalType: "contract IHook"
|
|
401
391
|
},
|
|
402
|
-
{
|
|
392
|
+
{
|
|
393
|
+
name: "target",
|
|
394
|
+
type: "address",
|
|
395
|
+
internalType: "address"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "callType",
|
|
399
|
+
type: "bytes1",
|
|
400
|
+
internalType: "CallType"
|
|
401
|
+
}
|
|
403
402
|
]
|
|
404
403
|
}
|
|
405
404
|
],
|
|
@@ -425,7 +424,7 @@ export const KernelV3AccountAbi = [
|
|
|
425
424
|
type: "function",
|
|
426
425
|
name: "uninstallModule",
|
|
427
426
|
inputs: [
|
|
428
|
-
{ name: "", type: "uint256", internalType: "uint256" },
|
|
427
|
+
{ name: "moduleType", type: "uint256", internalType: "uint256" },
|
|
429
428
|
{ name: "module", type: "address", internalType: "address" },
|
|
430
429
|
{ name: "deInitData", type: "bytes", internalType: "bytes" }
|
|
431
430
|
],
|
|
@@ -437,7 +436,21 @@ export const KernelV3AccountAbi = [
|
|
|
437
436
|
name: "uninstallValidation",
|
|
438
437
|
inputs: [
|
|
439
438
|
{ name: "vId", type: "bytes21", internalType: "ValidationId" },
|
|
440
|
-
{ name: "deinitData", type: "bytes", internalType: "bytes" }
|
|
439
|
+
{ name: "deinitData", type: "bytes", internalType: "bytes" },
|
|
440
|
+
{ name: "hookDeinitData", type: "bytes", internalType: "bytes" }
|
|
441
|
+
],
|
|
442
|
+
outputs: [],
|
|
443
|
+
stateMutability: "payable"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
type: "function",
|
|
447
|
+
name: "upgradeTo",
|
|
448
|
+
inputs: [
|
|
449
|
+
{
|
|
450
|
+
name: "_newImplementation",
|
|
451
|
+
type: "address",
|
|
452
|
+
internalType: "address"
|
|
453
|
+
}
|
|
441
454
|
],
|
|
442
455
|
outputs: [],
|
|
443
456
|
stateMutability: "payable"
|
|
@@ -507,7 +520,7 @@ export const KernelV3AccountAbi = [
|
|
|
507
520
|
},
|
|
508
521
|
{
|
|
509
522
|
type: "function",
|
|
510
|
-
name: "
|
|
523
|
+
name: "validationConfig",
|
|
511
524
|
inputs: [
|
|
512
525
|
{ name: "vId", type: "bytes21", internalType: "ValidationId" }
|
|
513
526
|
],
|
|
@@ -547,6 +560,25 @@ export const KernelV3AccountAbi = [
|
|
|
547
560
|
],
|
|
548
561
|
anonymous: false
|
|
549
562
|
},
|
|
563
|
+
{
|
|
564
|
+
type: "event",
|
|
565
|
+
name: "ModuleUninstallResult",
|
|
566
|
+
inputs: [
|
|
567
|
+
{
|
|
568
|
+
name: "module",
|
|
569
|
+
type: "address",
|
|
570
|
+
indexed: false,
|
|
571
|
+
internalType: "address"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "result",
|
|
575
|
+
type: "bool",
|
|
576
|
+
indexed: false,
|
|
577
|
+
internalType: "bool"
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
anonymous: false
|
|
581
|
+
},
|
|
550
582
|
{
|
|
551
583
|
type: "event",
|
|
552
584
|
name: "ModuleUninstalled",
|
|
@@ -674,6 +706,19 @@ export const KernelV3AccountAbi = [
|
|
|
674
706
|
],
|
|
675
707
|
anonymous: false
|
|
676
708
|
},
|
|
709
|
+
{
|
|
710
|
+
type: "event",
|
|
711
|
+
name: "Upgraded",
|
|
712
|
+
inputs: [
|
|
713
|
+
{
|
|
714
|
+
name: "implementation",
|
|
715
|
+
type: "address",
|
|
716
|
+
indexed: true,
|
|
717
|
+
internalType: "address"
|
|
718
|
+
}
|
|
719
|
+
],
|
|
720
|
+
anonymous: false
|
|
721
|
+
},
|
|
677
722
|
{
|
|
678
723
|
type: "event",
|
|
679
724
|
name: "ValidatorInstalled",
|
|
@@ -715,15 +760,15 @@ export const KernelV3AccountAbi = [
|
|
|
715
760
|
{ type: "error", name: "InvalidMode", inputs: [] },
|
|
716
761
|
{ type: "error", name: "InvalidModuleType", inputs: [] },
|
|
717
762
|
{ type: "error", name: "InvalidNonce", inputs: [] },
|
|
763
|
+
{ type: "error", name: "InvalidSelector", inputs: [] },
|
|
718
764
|
{ type: "error", name: "InvalidSignature", inputs: [] },
|
|
719
765
|
{ type: "error", name: "InvalidValidationType", inputs: [] },
|
|
720
766
|
{ type: "error", name: "InvalidValidator", inputs: [] },
|
|
767
|
+
{ type: "error", name: "NonceInvalidationError", inputs: [] },
|
|
768
|
+
{ type: "error", name: "NotSupportedCallType", inputs: [] },
|
|
721
769
|
{ type: "error", name: "OnlyExecuteUserOp", inputs: [] },
|
|
722
|
-
{
|
|
723
|
-
|
|
724
|
-
name: "PermissionNotAlllowedForSignature",
|
|
725
|
-
inputs: []
|
|
726
|
-
},
|
|
770
|
+
{ type: "error", name: "PermissionDataLengthMismatch", inputs: [] },
|
|
771
|
+
{ type: "error", name: "PermissionNotAlllowedForSignature", inputs: [] },
|
|
727
772
|
{ type: "error", name: "PermissionNotAlllowedForUserOp", inputs: [] },
|
|
728
773
|
{ type: "error", name: "PolicyDataTooLarge", inputs: [] },
|
|
729
774
|
{
|
|
@@ -116,7 +116,7 @@ export const KERNEL_ADDRESSES: {
|
|
|
116
116
|
ENTRYPOINT_V0_6: Address
|
|
117
117
|
} = {
|
|
118
118
|
ACCOUNT_LOGIC_V0_6: "0xd3082872F8B06073A021b4602e022d5A070d7cfC",
|
|
119
|
-
ACCOUNT_LOGIC_V0_7: "
|
|
119
|
+
ACCOUNT_LOGIC_V0_7: "0x541E811D24A54745619a5B9f0c1d4B08D5740144",
|
|
120
120
|
FACTORY_ADDRESS: "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",
|
|
121
121
|
ENTRYPOINT_V0_6: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
|
|
122
122
|
}
|
|
@@ -35,7 +35,10 @@ export const getEncodedPluginsData = async <
|
|
|
35
35
|
[
|
|
36
36
|
enableData,
|
|
37
37
|
"0x",
|
|
38
|
-
|
|
38
|
+
// [TODO]: Integrate custom target contract and hook
|
|
39
|
+
concat([
|
|
40
|
+
action.selector /*, action.address, zeroAddress, "0x"*/
|
|
41
|
+
]),
|
|
39
42
|
enableSignature,
|
|
40
43
|
userOpSignature
|
|
41
44
|
]
|
|
@@ -50,10 +50,12 @@ export const getPluginsEnableTypedData = async <
|
|
|
50
50
|
validatorData: await validator.getEnableData(accountAddress),
|
|
51
51
|
hookData: "0x",
|
|
52
52
|
selectorData: concat([
|
|
53
|
-
action.selector
|
|
53
|
+
action.selector
|
|
54
|
+
/*
|
|
54
55
|
action.address,
|
|
55
56
|
zeroAddress,
|
|
56
57
|
"0x"
|
|
58
|
+
*/
|
|
57
59
|
])
|
|
58
60
|
},
|
|
59
61
|
primaryType: "Enable"
|
|
@@ -10,7 +10,6 @@ import type {
|
|
|
10
10
|
import { ENTRYPOINT_ADDRESS_V06, deepHexlify } from "permissionless/utils"
|
|
11
11
|
import type { Address, Hex } from "viem"
|
|
12
12
|
import type { PartialBy } from "viem/types/utils"
|
|
13
|
-
import { KERNEL_ADDRESSES } from "../../accounts/index.js"
|
|
14
13
|
import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js"
|
|
15
14
|
|
|
16
15
|
export type SponsorUserOperationParameters<entryPoint extends EntryPoint> = {
|
|
@@ -70,8 +69,7 @@ export const sponsorUserOperation = async <entryPoint extends EntryPoint>(
|
|
|
70
69
|
) as UserOperationWithBigIntAsHex<
|
|
71
70
|
GetEntryPointVersion<entryPoint>
|
|
72
71
|
>,
|
|
73
|
-
entryPointAddress:
|
|
74
|
-
args.entryPoint ?? KERNEL_ADDRESSES.ENTRYPOINT_V0_6,
|
|
72
|
+
entryPointAddress: args.entryPoint,
|
|
75
73
|
gasTokenData: args.gasToken && {
|
|
76
74
|
tokenAddress: args.gasToken
|
|
77
75
|
},
|
package/constants.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const KernelImplToVersionMap: { [key: Address]: string } = {
|
|
|
10
10
|
"0xD3F582F6B4814E989Ee8E96bc3175320B5A540ab": "0.2.3",
|
|
11
11
|
"0x5FC0236D6c88a65beD32EECDC5D60a5CAb377717": "0.2.3",
|
|
12
12
|
"0xd3082872F8B06073A021b4602e022d5A070d7cfC": "0.2.4",
|
|
13
|
-
"
|
|
13
|
+
"0x541E811D24A54745619a5B9f0c1d4B08D5740144": "0.3.0-beta"
|
|
14
14
|
}
|
|
15
15
|
export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1"
|
|
16
16
|
export const KERNEL_NAME = "Kernel"
|