@gitmyabi/kernel 1.0.17 → 1.0.18

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.
@@ -0,0 +1,2043 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Kernel = exports.KernelAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * Kernel ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.KernelAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "contract IEntryPoint",
15
+ "name": "_entrypoint",
16
+ "type": "address"
17
+ }
18
+ ],
19
+ "stateMutability": "nonpayable",
20
+ "type": "constructor"
21
+ },
22
+ {
23
+ "inputs": [],
24
+ "name": "AlreadyInitialized",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "EnableNotApproved",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "ExecutionReverted",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [
39
+ {
40
+ "internalType": "uint256",
41
+ "name": "idx",
42
+ "type": "uint256"
43
+ }
44
+ ],
45
+ "name": "InitConfigError",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "inputs": [],
50
+ "name": "InvalidCallType",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [],
55
+ "name": "InvalidCaller",
56
+ "type": "error"
57
+ },
58
+ {
59
+ "inputs": [],
60
+ "name": "InvalidExecutor",
61
+ "type": "error"
62
+ },
63
+ {
64
+ "inputs": [],
65
+ "name": "InvalidFallback",
66
+ "type": "error"
67
+ },
68
+ {
69
+ "inputs": [],
70
+ "name": "InvalidMode",
71
+ "type": "error"
72
+ },
73
+ {
74
+ "inputs": [],
75
+ "name": "InvalidModuleType",
76
+ "type": "error"
77
+ },
78
+ {
79
+ "inputs": [],
80
+ "name": "InvalidNonce",
81
+ "type": "error"
82
+ },
83
+ {
84
+ "inputs": [],
85
+ "name": "InvalidSelector",
86
+ "type": "error"
87
+ },
88
+ {
89
+ "inputs": [],
90
+ "name": "InvalidSelectorData",
91
+ "type": "error"
92
+ },
93
+ {
94
+ "inputs": [],
95
+ "name": "InvalidSignature",
96
+ "type": "error"
97
+ },
98
+ {
99
+ "inputs": [],
100
+ "name": "InvalidValidationType",
101
+ "type": "error"
102
+ },
103
+ {
104
+ "inputs": [],
105
+ "name": "InvalidValidator",
106
+ "type": "error"
107
+ },
108
+ {
109
+ "inputs": [],
110
+ "name": "NonceInvalidationError",
111
+ "type": "error"
112
+ },
113
+ {
114
+ "inputs": [],
115
+ "name": "NotSupportedCallType",
116
+ "type": "error"
117
+ },
118
+ {
119
+ "inputs": [],
120
+ "name": "OnlyExecuteUserOp",
121
+ "type": "error"
122
+ },
123
+ {
124
+ "inputs": [],
125
+ "name": "PermissionDataLengthMismatch",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [],
130
+ "name": "PermissionNotAlllowedForSignature",
131
+ "type": "error"
132
+ },
133
+ {
134
+ "inputs": [],
135
+ "name": "PermissionNotAlllowedForUserOp",
136
+ "type": "error"
137
+ },
138
+ {
139
+ "inputs": [],
140
+ "name": "PolicyDataTooLarge",
141
+ "type": "error"
142
+ },
143
+ {
144
+ "inputs": [
145
+ {
146
+ "internalType": "uint256",
147
+ "name": "i",
148
+ "type": "uint256"
149
+ }
150
+ ],
151
+ "name": "PolicyFailed",
152
+ "type": "error"
153
+ },
154
+ {
155
+ "inputs": [],
156
+ "name": "PolicySignatureOrderError",
157
+ "type": "error"
158
+ },
159
+ {
160
+ "inputs": [],
161
+ "name": "RootValidatorCannotBeRemoved",
162
+ "type": "error"
163
+ },
164
+ {
165
+ "inputs": [],
166
+ "name": "SignerPrefixNotPresent",
167
+ "type": "error"
168
+ },
169
+ {
170
+ "anonymous": false,
171
+ "inputs": [
172
+ {
173
+ "indexed": false,
174
+ "internalType": "uint256",
175
+ "name": "moduleTypeId",
176
+ "type": "uint256"
177
+ },
178
+ {
179
+ "indexed": false,
180
+ "internalType": "address",
181
+ "name": "module",
182
+ "type": "address"
183
+ }
184
+ ],
185
+ "name": "ModuleInstalled",
186
+ "type": "event"
187
+ },
188
+ {
189
+ "anonymous": false,
190
+ "inputs": [
191
+ {
192
+ "indexed": false,
193
+ "internalType": "address",
194
+ "name": "module",
195
+ "type": "address"
196
+ },
197
+ {
198
+ "indexed": false,
199
+ "internalType": "bool",
200
+ "name": "result",
201
+ "type": "bool"
202
+ }
203
+ ],
204
+ "name": "ModuleUninstallResult",
205
+ "type": "event"
206
+ },
207
+ {
208
+ "anonymous": false,
209
+ "inputs": [
210
+ {
211
+ "indexed": false,
212
+ "internalType": "uint256",
213
+ "name": "moduleTypeId",
214
+ "type": "uint256"
215
+ },
216
+ {
217
+ "indexed": false,
218
+ "internalType": "address",
219
+ "name": "module",
220
+ "type": "address"
221
+ }
222
+ ],
223
+ "name": "ModuleUninstalled",
224
+ "type": "event"
225
+ },
226
+ {
227
+ "anonymous": false,
228
+ "inputs": [
229
+ {
230
+ "indexed": false,
231
+ "internalType": "uint32",
232
+ "name": "nonce",
233
+ "type": "uint32"
234
+ }
235
+ ],
236
+ "name": "NonceInvalidated",
237
+ "type": "event"
238
+ },
239
+ {
240
+ "anonymous": false,
241
+ "inputs": [
242
+ {
243
+ "indexed": false,
244
+ "internalType": "PermissionId",
245
+ "name": "permission",
246
+ "type": "bytes4"
247
+ },
248
+ {
249
+ "indexed": false,
250
+ "internalType": "uint32",
251
+ "name": "nonce",
252
+ "type": "uint32"
253
+ }
254
+ ],
255
+ "name": "PermissionInstalled",
256
+ "type": "event"
257
+ },
258
+ {
259
+ "anonymous": false,
260
+ "inputs": [
261
+ {
262
+ "indexed": false,
263
+ "internalType": "PermissionId",
264
+ "name": "permission",
265
+ "type": "bytes4"
266
+ }
267
+ ],
268
+ "name": "PermissionUninstalled",
269
+ "type": "event"
270
+ },
271
+ {
272
+ "anonymous": false,
273
+ "inputs": [
274
+ {
275
+ "indexed": false,
276
+ "internalType": "address",
277
+ "name": "sender",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "indexed": false,
282
+ "internalType": "uint256",
283
+ "name": "amount",
284
+ "type": "uint256"
285
+ }
286
+ ],
287
+ "name": "Received",
288
+ "type": "event"
289
+ },
290
+ {
291
+ "anonymous": false,
292
+ "inputs": [
293
+ {
294
+ "indexed": false,
295
+ "internalType": "ValidationId",
296
+ "name": "rootValidator",
297
+ "type": "bytes21"
298
+ }
299
+ ],
300
+ "name": "RootValidatorUpdated",
301
+ "type": "event"
302
+ },
303
+ {
304
+ "anonymous": false,
305
+ "inputs": [
306
+ {
307
+ "indexed": false,
308
+ "internalType": "bytes4",
309
+ "name": "selector",
310
+ "type": "bytes4"
311
+ },
312
+ {
313
+ "indexed": false,
314
+ "internalType": "ValidationId",
315
+ "name": "vId",
316
+ "type": "bytes21"
317
+ },
318
+ {
319
+ "indexed": false,
320
+ "internalType": "bool",
321
+ "name": "allowed",
322
+ "type": "bool"
323
+ }
324
+ ],
325
+ "name": "SelectorSet",
326
+ "type": "event"
327
+ },
328
+ {
329
+ "anonymous": false,
330
+ "inputs": [
331
+ {
332
+ "indexed": false,
333
+ "internalType": "uint256",
334
+ "name": "batchExecutionindex",
335
+ "type": "uint256"
336
+ },
337
+ {
338
+ "indexed": false,
339
+ "internalType": "bytes",
340
+ "name": "result",
341
+ "type": "bytes"
342
+ }
343
+ ],
344
+ "name": "TryExecuteUnsuccessful",
345
+ "type": "event"
346
+ },
347
+ {
348
+ "anonymous": false,
349
+ "inputs": [
350
+ {
351
+ "indexed": true,
352
+ "internalType": "address",
353
+ "name": "implementation",
354
+ "type": "address"
355
+ }
356
+ ],
357
+ "name": "Upgraded",
358
+ "type": "event"
359
+ },
360
+ {
361
+ "anonymous": false,
362
+ "inputs": [
363
+ {
364
+ "indexed": false,
365
+ "internalType": "contract IValidator",
366
+ "name": "validator",
367
+ "type": "address"
368
+ },
369
+ {
370
+ "indexed": false,
371
+ "internalType": "uint32",
372
+ "name": "nonce",
373
+ "type": "uint32"
374
+ }
375
+ ],
376
+ "name": "ValidatorInstalled",
377
+ "type": "event"
378
+ },
379
+ {
380
+ "anonymous": false,
381
+ "inputs": [
382
+ {
383
+ "indexed": false,
384
+ "internalType": "contract IValidator",
385
+ "name": "validator",
386
+ "type": "address"
387
+ }
388
+ ],
389
+ "name": "ValidatorUninstalled",
390
+ "type": "event"
391
+ },
392
+ {
393
+ "stateMutability": "payable",
394
+ "type": "fallback"
395
+ },
396
+ {
397
+ "inputs": [],
398
+ "name": "accountId",
399
+ "outputs": [
400
+ {
401
+ "internalType": "string",
402
+ "name": "accountImplementationId",
403
+ "type": "string"
404
+ }
405
+ ],
406
+ "stateMutability": "pure",
407
+ "type": "function"
408
+ },
409
+ {
410
+ "inputs": [
411
+ {
412
+ "internalType": "ValidationId",
413
+ "name": "_rootValidator",
414
+ "type": "bytes21"
415
+ },
416
+ {
417
+ "internalType": "contract IHook",
418
+ "name": "hook",
419
+ "type": "address"
420
+ },
421
+ {
422
+ "internalType": "bytes",
423
+ "name": "validatorData",
424
+ "type": "bytes"
425
+ },
426
+ {
427
+ "internalType": "bytes",
428
+ "name": "hookData",
429
+ "type": "bytes"
430
+ }
431
+ ],
432
+ "name": "changeRootValidator",
433
+ "outputs": [],
434
+ "stateMutability": "payable",
435
+ "type": "function"
436
+ },
437
+ {
438
+ "inputs": [],
439
+ "name": "currentNonce",
440
+ "outputs": [
441
+ {
442
+ "internalType": "uint32",
443
+ "name": "",
444
+ "type": "uint32"
445
+ }
446
+ ],
447
+ "stateMutability": "view",
448
+ "type": "function"
449
+ },
450
+ {
451
+ "inputs": [],
452
+ "name": "eip712Domain",
453
+ "outputs": [
454
+ {
455
+ "internalType": "bytes1",
456
+ "name": "fields",
457
+ "type": "bytes1"
458
+ },
459
+ {
460
+ "internalType": "string",
461
+ "name": "name",
462
+ "type": "string"
463
+ },
464
+ {
465
+ "internalType": "string",
466
+ "name": "version",
467
+ "type": "string"
468
+ },
469
+ {
470
+ "internalType": "uint256",
471
+ "name": "chainId",
472
+ "type": "uint256"
473
+ },
474
+ {
475
+ "internalType": "address",
476
+ "name": "verifyingContract",
477
+ "type": "address"
478
+ },
479
+ {
480
+ "internalType": "bytes32",
481
+ "name": "salt",
482
+ "type": "bytes32"
483
+ },
484
+ {
485
+ "internalType": "uint256[]",
486
+ "name": "extensions",
487
+ "type": "uint256[]"
488
+ }
489
+ ],
490
+ "stateMutability": "view",
491
+ "type": "function"
492
+ },
493
+ {
494
+ "inputs": [],
495
+ "name": "entrypoint",
496
+ "outputs": [
497
+ {
498
+ "internalType": "contract IEntryPoint",
499
+ "name": "",
500
+ "type": "address"
501
+ }
502
+ ],
503
+ "stateMutability": "view",
504
+ "type": "function"
505
+ },
506
+ {
507
+ "inputs": [
508
+ {
509
+ "internalType": "ExecMode",
510
+ "name": "execMode",
511
+ "type": "bytes32"
512
+ },
513
+ {
514
+ "internalType": "bytes",
515
+ "name": "executionCalldata",
516
+ "type": "bytes"
517
+ }
518
+ ],
519
+ "name": "execute",
520
+ "outputs": [],
521
+ "stateMutability": "payable",
522
+ "type": "function"
523
+ },
524
+ {
525
+ "inputs": [
526
+ {
527
+ "internalType": "ExecMode",
528
+ "name": "execMode",
529
+ "type": "bytes32"
530
+ },
531
+ {
532
+ "internalType": "bytes",
533
+ "name": "executionCalldata",
534
+ "type": "bytes"
535
+ }
536
+ ],
537
+ "name": "executeFromExecutor",
538
+ "outputs": [
539
+ {
540
+ "internalType": "bytes[]",
541
+ "name": "returnData",
542
+ "type": "bytes[]"
543
+ }
544
+ ],
545
+ "stateMutability": "payable",
546
+ "type": "function"
547
+ },
548
+ {
549
+ "inputs": [
550
+ {
551
+ "components": [
552
+ {
553
+ "internalType": "address",
554
+ "name": "sender",
555
+ "type": "address"
556
+ },
557
+ {
558
+ "internalType": "uint256",
559
+ "name": "nonce",
560
+ "type": "uint256"
561
+ },
562
+ {
563
+ "internalType": "bytes",
564
+ "name": "initCode",
565
+ "type": "bytes"
566
+ },
567
+ {
568
+ "internalType": "bytes",
569
+ "name": "callData",
570
+ "type": "bytes"
571
+ },
572
+ {
573
+ "internalType": "bytes32",
574
+ "name": "accountGasLimits",
575
+ "type": "bytes32"
576
+ },
577
+ {
578
+ "internalType": "uint256",
579
+ "name": "preVerificationGas",
580
+ "type": "uint256"
581
+ },
582
+ {
583
+ "internalType": "bytes32",
584
+ "name": "gasFees",
585
+ "type": "bytes32"
586
+ },
587
+ {
588
+ "internalType": "bytes",
589
+ "name": "paymasterAndData",
590
+ "type": "bytes"
591
+ },
592
+ {
593
+ "internalType": "bytes",
594
+ "name": "signature",
595
+ "type": "bytes"
596
+ }
597
+ ],
598
+ "internalType": "struct PackedUserOperation",
599
+ "name": "userOp",
600
+ "type": "tuple"
601
+ },
602
+ {
603
+ "internalType": "bytes32",
604
+ "name": "userOpHash",
605
+ "type": "bytes32"
606
+ }
607
+ ],
608
+ "name": "executeUserOp",
609
+ "outputs": [],
610
+ "stateMutability": "payable",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [
615
+ {
616
+ "internalType": "contract IExecutor",
617
+ "name": "executor",
618
+ "type": "address"
619
+ }
620
+ ],
621
+ "name": "executorConfig",
622
+ "outputs": [
623
+ {
624
+ "components": [
625
+ {
626
+ "internalType": "contract IHook",
627
+ "name": "hook",
628
+ "type": "address"
629
+ }
630
+ ],
631
+ "internalType": "struct ExecutorManager.ExecutorConfig",
632
+ "name": "",
633
+ "type": "tuple"
634
+ }
635
+ ],
636
+ "stateMutability": "view",
637
+ "type": "function"
638
+ },
639
+ {
640
+ "inputs": [
641
+ {
642
+ "internalType": "ValidationId",
643
+ "name": "vId",
644
+ "type": "bytes21"
645
+ },
646
+ {
647
+ "internalType": "bytes4",
648
+ "name": "selector",
649
+ "type": "bytes4"
650
+ },
651
+ {
652
+ "internalType": "bool",
653
+ "name": "allow",
654
+ "type": "bool"
655
+ }
656
+ ],
657
+ "name": "grantAccess",
658
+ "outputs": [],
659
+ "stateMutability": "payable",
660
+ "type": "function"
661
+ },
662
+ {
663
+ "inputs": [
664
+ {
665
+ "internalType": "ValidationId",
666
+ "name": "_rootValidator",
667
+ "type": "bytes21"
668
+ },
669
+ {
670
+ "internalType": "contract IHook",
671
+ "name": "hook",
672
+ "type": "address"
673
+ },
674
+ {
675
+ "internalType": "bytes",
676
+ "name": "validatorData",
677
+ "type": "bytes"
678
+ },
679
+ {
680
+ "internalType": "bytes",
681
+ "name": "hookData",
682
+ "type": "bytes"
683
+ },
684
+ {
685
+ "internalType": "bytes[]",
686
+ "name": "initConfig",
687
+ "type": "bytes[]"
688
+ }
689
+ ],
690
+ "name": "initialize",
691
+ "outputs": [],
692
+ "stateMutability": "nonpayable",
693
+ "type": "function"
694
+ },
695
+ {
696
+ "inputs": [
697
+ {
698
+ "internalType": "uint256",
699
+ "name": "moduleType",
700
+ "type": "uint256"
701
+ },
702
+ {
703
+ "internalType": "address",
704
+ "name": "module",
705
+ "type": "address"
706
+ },
707
+ {
708
+ "internalType": "bytes",
709
+ "name": "initData",
710
+ "type": "bytes"
711
+ }
712
+ ],
713
+ "name": "installModule",
714
+ "outputs": [],
715
+ "stateMutability": "payable",
716
+ "type": "function"
717
+ },
718
+ {
719
+ "inputs": [
720
+ {
721
+ "internalType": "ValidationId[]",
722
+ "name": "vIds",
723
+ "type": "bytes21[]"
724
+ },
725
+ {
726
+ "components": [
727
+ {
728
+ "internalType": "uint32",
729
+ "name": "nonce",
730
+ "type": "uint32"
731
+ },
732
+ {
733
+ "internalType": "contract IHook",
734
+ "name": "hook",
735
+ "type": "address"
736
+ }
737
+ ],
738
+ "internalType": "struct ValidationManager.ValidationConfig[]",
739
+ "name": "configs",
740
+ "type": "tuple[]"
741
+ },
742
+ {
743
+ "internalType": "bytes[]",
744
+ "name": "validationData",
745
+ "type": "bytes[]"
746
+ },
747
+ {
748
+ "internalType": "bytes[]",
749
+ "name": "hookData",
750
+ "type": "bytes[]"
751
+ }
752
+ ],
753
+ "name": "installValidations",
754
+ "outputs": [],
755
+ "stateMutability": "payable",
756
+ "type": "function"
757
+ },
758
+ {
759
+ "inputs": [
760
+ {
761
+ "internalType": "uint32",
762
+ "name": "nonce",
763
+ "type": "uint32"
764
+ }
765
+ ],
766
+ "name": "invalidateNonce",
767
+ "outputs": [],
768
+ "stateMutability": "payable",
769
+ "type": "function"
770
+ },
771
+ {
772
+ "inputs": [
773
+ {
774
+ "internalType": "ValidationId",
775
+ "name": "vId",
776
+ "type": "bytes21"
777
+ },
778
+ {
779
+ "internalType": "bytes4",
780
+ "name": "selector",
781
+ "type": "bytes4"
782
+ }
783
+ ],
784
+ "name": "isAllowedSelector",
785
+ "outputs": [
786
+ {
787
+ "internalType": "bool",
788
+ "name": "",
789
+ "type": "bool"
790
+ }
791
+ ],
792
+ "stateMutability": "view",
793
+ "type": "function"
794
+ },
795
+ {
796
+ "inputs": [
797
+ {
798
+ "internalType": "uint256",
799
+ "name": "moduleType",
800
+ "type": "uint256"
801
+ },
802
+ {
803
+ "internalType": "address",
804
+ "name": "module",
805
+ "type": "address"
806
+ },
807
+ {
808
+ "internalType": "bytes",
809
+ "name": "additionalContext",
810
+ "type": "bytes"
811
+ }
812
+ ],
813
+ "name": "isModuleInstalled",
814
+ "outputs": [
815
+ {
816
+ "internalType": "bool",
817
+ "name": "",
818
+ "type": "bool"
819
+ }
820
+ ],
821
+ "stateMutability": "view",
822
+ "type": "function"
823
+ },
824
+ {
825
+ "inputs": [
826
+ {
827
+ "internalType": "bytes32",
828
+ "name": "hash",
829
+ "type": "bytes32"
830
+ },
831
+ {
832
+ "internalType": "bytes",
833
+ "name": "data",
834
+ "type": "bytes"
835
+ }
836
+ ],
837
+ "name": "isValidSignature",
838
+ "outputs": [
839
+ {
840
+ "internalType": "bytes4",
841
+ "name": "",
842
+ "type": "bytes4"
843
+ }
844
+ ],
845
+ "stateMutability": "view",
846
+ "type": "function"
847
+ },
848
+ {
849
+ "inputs": [
850
+ {
851
+ "internalType": "address",
852
+ "name": "",
853
+ "type": "address"
854
+ },
855
+ {
856
+ "internalType": "address",
857
+ "name": "",
858
+ "type": "address"
859
+ },
860
+ {
861
+ "internalType": "uint256[]",
862
+ "name": "",
863
+ "type": "uint256[]"
864
+ },
865
+ {
866
+ "internalType": "uint256[]",
867
+ "name": "",
868
+ "type": "uint256[]"
869
+ },
870
+ {
871
+ "internalType": "bytes",
872
+ "name": "",
873
+ "type": "bytes"
874
+ }
875
+ ],
876
+ "name": "onERC1155BatchReceived",
877
+ "outputs": [
878
+ {
879
+ "internalType": "bytes4",
880
+ "name": "",
881
+ "type": "bytes4"
882
+ }
883
+ ],
884
+ "stateMutability": "pure",
885
+ "type": "function"
886
+ },
887
+ {
888
+ "inputs": [
889
+ {
890
+ "internalType": "address",
891
+ "name": "",
892
+ "type": "address"
893
+ },
894
+ {
895
+ "internalType": "address",
896
+ "name": "",
897
+ "type": "address"
898
+ },
899
+ {
900
+ "internalType": "uint256",
901
+ "name": "",
902
+ "type": "uint256"
903
+ },
904
+ {
905
+ "internalType": "uint256",
906
+ "name": "",
907
+ "type": "uint256"
908
+ },
909
+ {
910
+ "internalType": "bytes",
911
+ "name": "",
912
+ "type": "bytes"
913
+ }
914
+ ],
915
+ "name": "onERC1155Received",
916
+ "outputs": [
917
+ {
918
+ "internalType": "bytes4",
919
+ "name": "",
920
+ "type": "bytes4"
921
+ }
922
+ ],
923
+ "stateMutability": "pure",
924
+ "type": "function"
925
+ },
926
+ {
927
+ "inputs": [
928
+ {
929
+ "internalType": "address",
930
+ "name": "",
931
+ "type": "address"
932
+ },
933
+ {
934
+ "internalType": "address",
935
+ "name": "",
936
+ "type": "address"
937
+ },
938
+ {
939
+ "internalType": "uint256",
940
+ "name": "",
941
+ "type": "uint256"
942
+ },
943
+ {
944
+ "internalType": "bytes",
945
+ "name": "",
946
+ "type": "bytes"
947
+ }
948
+ ],
949
+ "name": "onERC721Received",
950
+ "outputs": [
951
+ {
952
+ "internalType": "bytes4",
953
+ "name": "",
954
+ "type": "bytes4"
955
+ }
956
+ ],
957
+ "stateMutability": "pure",
958
+ "type": "function"
959
+ },
960
+ {
961
+ "inputs": [
962
+ {
963
+ "internalType": "PermissionId",
964
+ "name": "pId",
965
+ "type": "bytes4"
966
+ }
967
+ ],
968
+ "name": "permissionConfig",
969
+ "outputs": [
970
+ {
971
+ "components": [
972
+ {
973
+ "internalType": "PassFlag",
974
+ "name": "permissionFlag",
975
+ "type": "bytes2"
976
+ },
977
+ {
978
+ "internalType": "contract ISigner",
979
+ "name": "signer",
980
+ "type": "address"
981
+ },
982
+ {
983
+ "internalType": "PolicyData[]",
984
+ "name": "policyData",
985
+ "type": "bytes22[]"
986
+ }
987
+ ],
988
+ "internalType": "struct ValidationManager.PermissionConfig",
989
+ "name": "",
990
+ "type": "tuple"
991
+ }
992
+ ],
993
+ "stateMutability": "view",
994
+ "type": "function"
995
+ },
996
+ {
997
+ "inputs": [
998
+ {
999
+ "components": [
1000
+ {
1001
+ "internalType": "address",
1002
+ "name": "sender",
1003
+ "type": "address"
1004
+ },
1005
+ {
1006
+ "internalType": "uint256",
1007
+ "name": "nonce",
1008
+ "type": "uint256"
1009
+ },
1010
+ {
1011
+ "internalType": "bytes",
1012
+ "name": "initCode",
1013
+ "type": "bytes"
1014
+ },
1015
+ {
1016
+ "internalType": "bytes",
1017
+ "name": "callData",
1018
+ "type": "bytes"
1019
+ },
1020
+ {
1021
+ "internalType": "bytes32",
1022
+ "name": "accountGasLimits",
1023
+ "type": "bytes32"
1024
+ },
1025
+ {
1026
+ "internalType": "uint256",
1027
+ "name": "preVerificationGas",
1028
+ "type": "uint256"
1029
+ },
1030
+ {
1031
+ "internalType": "bytes32",
1032
+ "name": "gasFees",
1033
+ "type": "bytes32"
1034
+ },
1035
+ {
1036
+ "internalType": "bytes",
1037
+ "name": "paymasterAndData",
1038
+ "type": "bytes"
1039
+ },
1040
+ {
1041
+ "internalType": "bytes",
1042
+ "name": "signature",
1043
+ "type": "bytes"
1044
+ }
1045
+ ],
1046
+ "internalType": "struct PackedUserOperation",
1047
+ "name": "userOp",
1048
+ "type": "tuple"
1049
+ },
1050
+ {
1051
+ "internalType": "address",
1052
+ "name": "entryPoint",
1053
+ "type": "address"
1054
+ }
1055
+ ],
1056
+ "name": "replayableUserOpHash",
1057
+ "outputs": [
1058
+ {
1059
+ "internalType": "bytes32",
1060
+ "name": "",
1061
+ "type": "bytes32"
1062
+ }
1063
+ ],
1064
+ "stateMutability": "pure",
1065
+ "type": "function"
1066
+ },
1067
+ {
1068
+ "inputs": [],
1069
+ "name": "rootValidator",
1070
+ "outputs": [
1071
+ {
1072
+ "internalType": "ValidationId",
1073
+ "name": "",
1074
+ "type": "bytes21"
1075
+ }
1076
+ ],
1077
+ "stateMutability": "view",
1078
+ "type": "function"
1079
+ },
1080
+ {
1081
+ "inputs": [
1082
+ {
1083
+ "internalType": "bytes4",
1084
+ "name": "selector",
1085
+ "type": "bytes4"
1086
+ }
1087
+ ],
1088
+ "name": "selectorConfig",
1089
+ "outputs": [
1090
+ {
1091
+ "components": [
1092
+ {
1093
+ "internalType": "contract IHook",
1094
+ "name": "hook",
1095
+ "type": "address"
1096
+ },
1097
+ {
1098
+ "internalType": "address",
1099
+ "name": "target",
1100
+ "type": "address"
1101
+ },
1102
+ {
1103
+ "internalType": "CallType",
1104
+ "name": "callType",
1105
+ "type": "bytes1"
1106
+ }
1107
+ ],
1108
+ "internalType": "struct SelectorManager.SelectorConfig",
1109
+ "name": "",
1110
+ "type": "tuple"
1111
+ }
1112
+ ],
1113
+ "stateMutability": "view",
1114
+ "type": "function"
1115
+ },
1116
+ {
1117
+ "inputs": [
1118
+ {
1119
+ "internalType": "ExecMode",
1120
+ "name": "mode",
1121
+ "type": "bytes32"
1122
+ }
1123
+ ],
1124
+ "name": "supportsExecutionMode",
1125
+ "outputs": [
1126
+ {
1127
+ "internalType": "bool",
1128
+ "name": "",
1129
+ "type": "bool"
1130
+ }
1131
+ ],
1132
+ "stateMutability": "pure",
1133
+ "type": "function"
1134
+ },
1135
+ {
1136
+ "inputs": [
1137
+ {
1138
+ "internalType": "uint256",
1139
+ "name": "moduleTypeId",
1140
+ "type": "uint256"
1141
+ }
1142
+ ],
1143
+ "name": "supportsModule",
1144
+ "outputs": [
1145
+ {
1146
+ "internalType": "bool",
1147
+ "name": "",
1148
+ "type": "bool"
1149
+ }
1150
+ ],
1151
+ "stateMutability": "pure",
1152
+ "type": "function"
1153
+ },
1154
+ {
1155
+ "inputs": [
1156
+ {
1157
+ "internalType": "uint256",
1158
+ "name": "moduleType",
1159
+ "type": "uint256"
1160
+ },
1161
+ {
1162
+ "internalType": "address",
1163
+ "name": "module",
1164
+ "type": "address"
1165
+ },
1166
+ {
1167
+ "internalType": "bytes",
1168
+ "name": "deInitData",
1169
+ "type": "bytes"
1170
+ }
1171
+ ],
1172
+ "name": "uninstallModule",
1173
+ "outputs": [],
1174
+ "stateMutability": "payable",
1175
+ "type": "function"
1176
+ },
1177
+ {
1178
+ "inputs": [
1179
+ {
1180
+ "internalType": "ValidationId",
1181
+ "name": "vId",
1182
+ "type": "bytes21"
1183
+ },
1184
+ {
1185
+ "internalType": "bytes",
1186
+ "name": "deinitData",
1187
+ "type": "bytes"
1188
+ },
1189
+ {
1190
+ "internalType": "bytes",
1191
+ "name": "hookDeinitData",
1192
+ "type": "bytes"
1193
+ }
1194
+ ],
1195
+ "name": "uninstallValidation",
1196
+ "outputs": [],
1197
+ "stateMutability": "payable",
1198
+ "type": "function"
1199
+ },
1200
+ {
1201
+ "inputs": [
1202
+ {
1203
+ "internalType": "address",
1204
+ "name": "_newImplementation",
1205
+ "type": "address"
1206
+ }
1207
+ ],
1208
+ "name": "upgradeTo",
1209
+ "outputs": [],
1210
+ "stateMutability": "payable",
1211
+ "type": "function"
1212
+ },
1213
+ {
1214
+ "inputs": [],
1215
+ "name": "validNonceFrom",
1216
+ "outputs": [
1217
+ {
1218
+ "internalType": "uint32",
1219
+ "name": "",
1220
+ "type": "uint32"
1221
+ }
1222
+ ],
1223
+ "stateMutability": "view",
1224
+ "type": "function"
1225
+ },
1226
+ {
1227
+ "inputs": [
1228
+ {
1229
+ "components": [
1230
+ {
1231
+ "internalType": "address",
1232
+ "name": "sender",
1233
+ "type": "address"
1234
+ },
1235
+ {
1236
+ "internalType": "uint256",
1237
+ "name": "nonce",
1238
+ "type": "uint256"
1239
+ },
1240
+ {
1241
+ "internalType": "bytes",
1242
+ "name": "initCode",
1243
+ "type": "bytes"
1244
+ },
1245
+ {
1246
+ "internalType": "bytes",
1247
+ "name": "callData",
1248
+ "type": "bytes"
1249
+ },
1250
+ {
1251
+ "internalType": "bytes32",
1252
+ "name": "accountGasLimits",
1253
+ "type": "bytes32"
1254
+ },
1255
+ {
1256
+ "internalType": "uint256",
1257
+ "name": "preVerificationGas",
1258
+ "type": "uint256"
1259
+ },
1260
+ {
1261
+ "internalType": "bytes32",
1262
+ "name": "gasFees",
1263
+ "type": "bytes32"
1264
+ },
1265
+ {
1266
+ "internalType": "bytes",
1267
+ "name": "paymasterAndData",
1268
+ "type": "bytes"
1269
+ },
1270
+ {
1271
+ "internalType": "bytes",
1272
+ "name": "signature",
1273
+ "type": "bytes"
1274
+ }
1275
+ ],
1276
+ "internalType": "struct PackedUserOperation",
1277
+ "name": "userOp",
1278
+ "type": "tuple"
1279
+ },
1280
+ {
1281
+ "internalType": "bytes32",
1282
+ "name": "userOpHash",
1283
+ "type": "bytes32"
1284
+ },
1285
+ {
1286
+ "internalType": "uint256",
1287
+ "name": "missingAccountFunds",
1288
+ "type": "uint256"
1289
+ }
1290
+ ],
1291
+ "name": "validateUserOp",
1292
+ "outputs": [
1293
+ {
1294
+ "internalType": "ValidationData",
1295
+ "name": "validationData",
1296
+ "type": "uint256"
1297
+ }
1298
+ ],
1299
+ "stateMutability": "payable",
1300
+ "type": "function"
1301
+ },
1302
+ {
1303
+ "inputs": [
1304
+ {
1305
+ "internalType": "ValidationId",
1306
+ "name": "vId",
1307
+ "type": "bytes21"
1308
+ }
1309
+ ],
1310
+ "name": "validationConfig",
1311
+ "outputs": [
1312
+ {
1313
+ "components": [
1314
+ {
1315
+ "internalType": "uint32",
1316
+ "name": "nonce",
1317
+ "type": "uint32"
1318
+ },
1319
+ {
1320
+ "internalType": "contract IHook",
1321
+ "name": "hook",
1322
+ "type": "address"
1323
+ }
1324
+ ],
1325
+ "internalType": "struct ValidationManager.ValidationConfig",
1326
+ "name": "",
1327
+ "type": "tuple"
1328
+ }
1329
+ ],
1330
+ "stateMutability": "view",
1331
+ "type": "function"
1332
+ },
1333
+ {
1334
+ "stateMutability": "payable",
1335
+ "type": "receive"
1336
+ }
1337
+ ];
1338
+ /**
1339
+ * Kernel Contract Class
1340
+ *
1341
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1342
+ *
1343
+ * @example
1344
+ * ```typescript
1345
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1346
+ * import { mainnet } from 'viem/chains';
1347
+ * import { Kernel } from 'Kernel';
1348
+ *
1349
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1350
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1351
+ *
1352
+ * const contract = new Kernel('0x...', { publicClient, walletClient });
1353
+ *
1354
+ * // Read functions
1355
+ * const result = await contract.balanceOf('0x...');
1356
+ *
1357
+ * // Write functions
1358
+ * const hash = await contract.transfer('0x...', 1000n);
1359
+ *
1360
+ * // Simulate transactions (dry-run)
1361
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1362
+ * console.log('Gas estimate:', simulation.request.gas);
1363
+ *
1364
+ * // Watch events
1365
+ * const unwatch = contract.watch.Transfer((event) => {
1366
+ * console.log('Transfer event:', event);
1367
+ * });
1368
+ * ```
1369
+ */
1370
+ class Kernel {
1371
+ constructor(address, clients) {
1372
+ this.contractAddress = address;
1373
+ this.publicClient = clients.publicClient;
1374
+ this.contract = (0, viem_1.getContract)({
1375
+ address,
1376
+ abi: exports.KernelAbi,
1377
+ client: {
1378
+ public: clients.publicClient,
1379
+ wallet: clients.walletClient,
1380
+ },
1381
+ });
1382
+ }
1383
+ /**
1384
+ * Get the contract address
1385
+ */
1386
+ get address() {
1387
+ return this.contractAddress;
1388
+ }
1389
+ /**
1390
+ * Get the underlying viem contract instance.
1391
+ */
1392
+ getContract() {
1393
+ return this.contract;
1394
+ }
1395
+ /**
1396
+ * accountId
1397
+ * pure
1398
+ */
1399
+ async accountId() {
1400
+ return this.contract.read.accountId();
1401
+ }
1402
+ /**
1403
+ * currentNonce
1404
+ * view
1405
+ */
1406
+ async currentNonce() {
1407
+ return this.contract.read.currentNonce();
1408
+ }
1409
+ /**
1410
+ * eip712Domain
1411
+ * view
1412
+ */
1413
+ async eip712Domain() {
1414
+ return this.contract.read.eip712Domain();
1415
+ }
1416
+ /**
1417
+ * entrypoint
1418
+ * view
1419
+ */
1420
+ async entrypoint() {
1421
+ return this.contract.read.entrypoint();
1422
+ }
1423
+ /**
1424
+ * executorConfig
1425
+ * view
1426
+ */
1427
+ async executorConfig(executor) {
1428
+ return this.contract.read.executorConfig([executor]);
1429
+ }
1430
+ /**
1431
+ * isAllowedSelector
1432
+ * view
1433
+ */
1434
+ async isAllowedSelector(vId, selector) {
1435
+ return this.contract.read.isAllowedSelector([vId, selector]);
1436
+ }
1437
+ /**
1438
+ * isModuleInstalled
1439
+ * view
1440
+ */
1441
+ async isModuleInstalled(moduleType, module, additionalContext) {
1442
+ return this.contract.read.isModuleInstalled([moduleType, module, additionalContext]);
1443
+ }
1444
+ /**
1445
+ * isValidSignature
1446
+ * view
1447
+ */
1448
+ async isValidSignature(hash, data) {
1449
+ return this.contract.read.isValidSignature([hash, data]);
1450
+ }
1451
+ /**
1452
+ * onERC1155BatchReceived
1453
+ * pure
1454
+ */
1455
+ async onERC1155BatchReceived(arg0, arg1, arg2, arg3, arg4) {
1456
+ return this.contract.read.onERC1155BatchReceived([arg0, arg1, arg2, arg3, arg4]);
1457
+ }
1458
+ /**
1459
+ * onERC1155Received
1460
+ * pure
1461
+ */
1462
+ async onERC1155Received(arg0, arg1, arg2, arg3, arg4) {
1463
+ return this.contract.read.onERC1155Received([arg0, arg1, arg2, arg3, arg4]);
1464
+ }
1465
+ /**
1466
+ * onERC721Received
1467
+ * pure
1468
+ */
1469
+ async onERC721Received(arg0, arg1, arg2, arg3) {
1470
+ return this.contract.read.onERC721Received([arg0, arg1, arg2, arg3]);
1471
+ }
1472
+ /**
1473
+ * permissionConfig
1474
+ * view
1475
+ */
1476
+ async permissionConfig(pId) {
1477
+ return this.contract.read.permissionConfig([pId]);
1478
+ }
1479
+ /**
1480
+ * replayableUserOpHash
1481
+ * pure
1482
+ */
1483
+ async replayableUserOpHash(userOp, entryPoint) {
1484
+ return this.contract.read.replayableUserOpHash([userOp, entryPoint]);
1485
+ }
1486
+ /**
1487
+ * rootValidator
1488
+ * view
1489
+ */
1490
+ async rootValidator() {
1491
+ return this.contract.read.rootValidator();
1492
+ }
1493
+ /**
1494
+ * selectorConfig
1495
+ * view
1496
+ */
1497
+ async selectorConfig(selector) {
1498
+ return this.contract.read.selectorConfig([selector]);
1499
+ }
1500
+ /**
1501
+ * supportsExecutionMode
1502
+ * pure
1503
+ */
1504
+ async supportsExecutionMode(mode) {
1505
+ return this.contract.read.supportsExecutionMode([mode]);
1506
+ }
1507
+ /**
1508
+ * supportsModule
1509
+ * pure
1510
+ */
1511
+ async supportsModule(moduleTypeId) {
1512
+ return this.contract.read.supportsModule([moduleTypeId]);
1513
+ }
1514
+ /**
1515
+ * validNonceFrom
1516
+ * view
1517
+ */
1518
+ async validNonceFrom() {
1519
+ return this.contract.read.validNonceFrom();
1520
+ }
1521
+ /**
1522
+ * validationConfig
1523
+ * view
1524
+ */
1525
+ async validationConfig(vId) {
1526
+ return this.contract.read.validationConfig([vId]);
1527
+ }
1528
+ /**
1529
+ * changeRootValidator
1530
+ * payable
1531
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1532
+ */
1533
+ async changeRootValidator(_rootValidator, hook, validatorData, hookData, options) {
1534
+ if (!this.contract.write) {
1535
+ throw new Error('Wallet client is required for write operations');
1536
+ }
1537
+ return this.contract.write.changeRootValidator([_rootValidator, hook, validatorData, hookData], options);
1538
+ }
1539
+ /**
1540
+ * execute
1541
+ * payable
1542
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1543
+ */
1544
+ async execute(execMode, executionCalldata, options) {
1545
+ if (!this.contract.write) {
1546
+ throw new Error('Wallet client is required for write operations');
1547
+ }
1548
+ return this.contract.write.execute([execMode, executionCalldata], options);
1549
+ }
1550
+ /**
1551
+ * executeFromExecutor
1552
+ * payable
1553
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1554
+ */
1555
+ async executeFromExecutor(execMode, executionCalldata, options) {
1556
+ if (!this.contract.write) {
1557
+ throw new Error('Wallet client is required for write operations');
1558
+ }
1559
+ return this.contract.write.executeFromExecutor([execMode, executionCalldata], options);
1560
+ }
1561
+ /**
1562
+ * executeUserOp
1563
+ * payable
1564
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1565
+ */
1566
+ async executeUserOp(userOp, userOpHash, options) {
1567
+ if (!this.contract.write) {
1568
+ throw new Error('Wallet client is required for write operations');
1569
+ }
1570
+ return this.contract.write.executeUserOp([userOp, userOpHash], options);
1571
+ }
1572
+ /**
1573
+ * grantAccess
1574
+ * payable
1575
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1576
+ */
1577
+ async grantAccess(vId, selector, allow, options) {
1578
+ if (!this.contract.write) {
1579
+ throw new Error('Wallet client is required for write operations');
1580
+ }
1581
+ return this.contract.write.grantAccess([vId, selector, allow], options);
1582
+ }
1583
+ /**
1584
+ * initialize
1585
+ * nonpayable
1586
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1587
+ */
1588
+ async initialize(_rootValidator, hook, validatorData, hookData, initConfig, options) {
1589
+ if (!this.contract.write) {
1590
+ throw new Error('Wallet client is required for write operations');
1591
+ }
1592
+ return this.contract.write.initialize([_rootValidator, hook, validatorData, hookData, initConfig], options);
1593
+ }
1594
+ /**
1595
+ * installModule
1596
+ * payable
1597
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1598
+ */
1599
+ async installModule(moduleType, module, initData, options) {
1600
+ if (!this.contract.write) {
1601
+ throw new Error('Wallet client is required for write operations');
1602
+ }
1603
+ return this.contract.write.installModule([moduleType, module, initData], options);
1604
+ }
1605
+ /**
1606
+ * installValidations
1607
+ * payable
1608
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1609
+ */
1610
+ async installValidations(vIds, configs, validationData, hookData, options) {
1611
+ if (!this.contract.write) {
1612
+ throw new Error('Wallet client is required for write operations');
1613
+ }
1614
+ return this.contract.write.installValidations([vIds, configs, validationData, hookData], options);
1615
+ }
1616
+ /**
1617
+ * invalidateNonce
1618
+ * payable
1619
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1620
+ */
1621
+ async invalidateNonce(nonce, options) {
1622
+ if (!this.contract.write) {
1623
+ throw new Error('Wallet client is required for write operations');
1624
+ }
1625
+ return this.contract.write.invalidateNonce([nonce], options);
1626
+ }
1627
+ /**
1628
+ * uninstallModule
1629
+ * payable
1630
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1631
+ */
1632
+ async uninstallModule(moduleType, module, deInitData, options) {
1633
+ if (!this.contract.write) {
1634
+ throw new Error('Wallet client is required for write operations');
1635
+ }
1636
+ return this.contract.write.uninstallModule([moduleType, module, deInitData], options);
1637
+ }
1638
+ /**
1639
+ * uninstallValidation
1640
+ * payable
1641
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1642
+ */
1643
+ async uninstallValidation(vId, deinitData, hookDeinitData, options) {
1644
+ if (!this.contract.write) {
1645
+ throw new Error('Wallet client is required for write operations');
1646
+ }
1647
+ return this.contract.write.uninstallValidation([vId, deinitData, hookDeinitData], options);
1648
+ }
1649
+ /**
1650
+ * upgradeTo
1651
+ * payable
1652
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1653
+ */
1654
+ async upgradeTo(_newImplementation, options) {
1655
+ if (!this.contract.write) {
1656
+ throw new Error('Wallet client is required for write operations');
1657
+ }
1658
+ return this.contract.write.upgradeTo([_newImplementation], options);
1659
+ }
1660
+ /**
1661
+ * validateUserOp
1662
+ * payable
1663
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1664
+ */
1665
+ async validateUserOp(userOp, userOpHash, missingAccountFunds, options) {
1666
+ if (!this.contract.write) {
1667
+ throw new Error('Wallet client is required for write operations');
1668
+ }
1669
+ return this.contract.write.validateUserOp([userOp, userOpHash, missingAccountFunds], options);
1670
+ }
1671
+ /**
1672
+ * Simulate contract write operations (dry-run without sending transaction)
1673
+ *
1674
+ * @example
1675
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1676
+ * console.log('Gas estimate:', result.request.gas);
1677
+ * console.log('Would succeed:', result.result);
1678
+ */
1679
+ get simulate() {
1680
+ const contract = this.contract;
1681
+ if (!contract.simulate) {
1682
+ throw new Error('Public client is required for simulation');
1683
+ }
1684
+ return {
1685
+ /**
1686
+ * Simulate changeRootValidator
1687
+ * Returns gas estimate and result without sending transaction
1688
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1689
+ */
1690
+ async changeRootValidator(_rootValidator, hook, validatorData, hookData, options) {
1691
+ return contract.simulate.changeRootValidator([_rootValidator, hook, validatorData, hookData], options);
1692
+ },
1693
+ /**
1694
+ * Simulate execute
1695
+ * Returns gas estimate and result without sending transaction
1696
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1697
+ */
1698
+ async execute(execMode, executionCalldata, options) {
1699
+ return contract.simulate.execute([execMode, executionCalldata], options);
1700
+ },
1701
+ /**
1702
+ * Simulate executeFromExecutor
1703
+ * Returns gas estimate and result without sending transaction
1704
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1705
+ */
1706
+ async executeFromExecutor(execMode, executionCalldata, options) {
1707
+ return contract.simulate.executeFromExecutor([execMode, executionCalldata], options);
1708
+ },
1709
+ /**
1710
+ * Simulate executeUserOp
1711
+ * Returns gas estimate and result without sending transaction
1712
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1713
+ */
1714
+ async executeUserOp(userOp, userOpHash, options) {
1715
+ return contract.simulate.executeUserOp([userOp, userOpHash], options);
1716
+ },
1717
+ /**
1718
+ * Simulate grantAccess
1719
+ * Returns gas estimate and result without sending transaction
1720
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1721
+ */
1722
+ async grantAccess(vId, selector, allow, options) {
1723
+ return contract.simulate.grantAccess([vId, selector, allow], options);
1724
+ },
1725
+ /**
1726
+ * Simulate initialize
1727
+ * Returns gas estimate and result without sending transaction
1728
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1729
+ */
1730
+ async initialize(_rootValidator, hook, validatorData, hookData, initConfig, options) {
1731
+ return contract.simulate.initialize([_rootValidator, hook, validatorData, hookData, initConfig], options);
1732
+ },
1733
+ /**
1734
+ * Simulate installModule
1735
+ * Returns gas estimate and result without sending transaction
1736
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1737
+ */
1738
+ async installModule(moduleType, module, initData, options) {
1739
+ return contract.simulate.installModule([moduleType, module, initData], options);
1740
+ },
1741
+ /**
1742
+ * Simulate installValidations
1743
+ * Returns gas estimate and result without sending transaction
1744
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1745
+ */
1746
+ async installValidations(vIds, configs, validationData, hookData, options) {
1747
+ return contract.simulate.installValidations([vIds, configs, validationData, hookData], options);
1748
+ },
1749
+ /**
1750
+ * Simulate invalidateNonce
1751
+ * Returns gas estimate and result without sending transaction
1752
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1753
+ */
1754
+ async invalidateNonce(nonce, options) {
1755
+ return contract.simulate.invalidateNonce([nonce], options);
1756
+ },
1757
+ /**
1758
+ * Simulate uninstallModule
1759
+ * Returns gas estimate and result without sending transaction
1760
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1761
+ */
1762
+ async uninstallModule(moduleType, module, deInitData, options) {
1763
+ return contract.simulate.uninstallModule([moduleType, module, deInitData], options);
1764
+ },
1765
+ /**
1766
+ * Simulate uninstallValidation
1767
+ * Returns gas estimate and result without sending transaction
1768
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1769
+ */
1770
+ async uninstallValidation(vId, deinitData, hookDeinitData, options) {
1771
+ return contract.simulate.uninstallValidation([vId, deinitData, hookDeinitData], options);
1772
+ },
1773
+ /**
1774
+ * Simulate upgradeTo
1775
+ * Returns gas estimate and result without sending transaction
1776
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1777
+ */
1778
+ async upgradeTo(_newImplementation, options) {
1779
+ return contract.simulate.upgradeTo([_newImplementation], options);
1780
+ },
1781
+ /**
1782
+ * Simulate validateUserOp
1783
+ * Returns gas estimate and result without sending transaction
1784
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1785
+ */
1786
+ async validateUserOp(userOp, userOpHash, missingAccountFunds, options) {
1787
+ return contract.simulate.validateUserOp([userOp, userOpHash, missingAccountFunds], options);
1788
+ }
1789
+ };
1790
+ }
1791
+ /**
1792
+ * Watch contract events
1793
+ *
1794
+ * @example
1795
+ * // Watch all Transfer events
1796
+ * const unwatch = contract.watch.Transfer((event) => {
1797
+ * console.log('Transfer:', event);
1798
+ * });
1799
+ *
1800
+ * // Stop watching
1801
+ * unwatch();
1802
+ */
1803
+ get watch() {
1804
+ return {
1805
+ /**
1806
+ * Watch ModuleInstalled events
1807
+ * @param callback Function to call when event is emitted
1808
+ * @param filter Optional filter for indexed parameters
1809
+ * @returns Unwatch function to stop listening
1810
+ */
1811
+ ModuleInstalled: (callback) => {
1812
+ return this.publicClient.watchContractEvent({
1813
+ address: this.contractAddress,
1814
+ abi: exports.KernelAbi,
1815
+ eventName: 'ModuleInstalled',
1816
+ onLogs: (logs) => {
1817
+ logs.forEach((log) => {
1818
+ callback(log.args);
1819
+ });
1820
+ },
1821
+ });
1822
+ },
1823
+ /**
1824
+ * Watch ModuleUninstallResult events
1825
+ * @param callback Function to call when event is emitted
1826
+ * @param filter Optional filter for indexed parameters
1827
+ * @returns Unwatch function to stop listening
1828
+ */
1829
+ ModuleUninstallResult: (callback) => {
1830
+ return this.publicClient.watchContractEvent({
1831
+ address: this.contractAddress,
1832
+ abi: exports.KernelAbi,
1833
+ eventName: 'ModuleUninstallResult',
1834
+ onLogs: (logs) => {
1835
+ logs.forEach((log) => {
1836
+ callback(log.args);
1837
+ });
1838
+ },
1839
+ });
1840
+ },
1841
+ /**
1842
+ * Watch ModuleUninstalled events
1843
+ * @param callback Function to call when event is emitted
1844
+ * @param filter Optional filter for indexed parameters
1845
+ * @returns Unwatch function to stop listening
1846
+ */
1847
+ ModuleUninstalled: (callback) => {
1848
+ return this.publicClient.watchContractEvent({
1849
+ address: this.contractAddress,
1850
+ abi: exports.KernelAbi,
1851
+ eventName: 'ModuleUninstalled',
1852
+ onLogs: (logs) => {
1853
+ logs.forEach((log) => {
1854
+ callback(log.args);
1855
+ });
1856
+ },
1857
+ });
1858
+ },
1859
+ /**
1860
+ * Watch NonceInvalidated events
1861
+ * @param callback Function to call when event is emitted
1862
+ * @param filter Optional filter for indexed parameters
1863
+ * @returns Unwatch function to stop listening
1864
+ */
1865
+ NonceInvalidated: (callback) => {
1866
+ return this.publicClient.watchContractEvent({
1867
+ address: this.contractAddress,
1868
+ abi: exports.KernelAbi,
1869
+ eventName: 'NonceInvalidated',
1870
+ onLogs: (logs) => {
1871
+ logs.forEach((log) => {
1872
+ callback(log.args);
1873
+ });
1874
+ },
1875
+ });
1876
+ },
1877
+ /**
1878
+ * Watch PermissionInstalled events
1879
+ * @param callback Function to call when event is emitted
1880
+ * @param filter Optional filter for indexed parameters
1881
+ * @returns Unwatch function to stop listening
1882
+ */
1883
+ PermissionInstalled: (callback) => {
1884
+ return this.publicClient.watchContractEvent({
1885
+ address: this.contractAddress,
1886
+ abi: exports.KernelAbi,
1887
+ eventName: 'PermissionInstalled',
1888
+ onLogs: (logs) => {
1889
+ logs.forEach((log) => {
1890
+ callback(log.args);
1891
+ });
1892
+ },
1893
+ });
1894
+ },
1895
+ /**
1896
+ * Watch PermissionUninstalled events
1897
+ * @param callback Function to call when event is emitted
1898
+ * @param filter Optional filter for indexed parameters
1899
+ * @returns Unwatch function to stop listening
1900
+ */
1901
+ PermissionUninstalled: (callback) => {
1902
+ return this.publicClient.watchContractEvent({
1903
+ address: this.contractAddress,
1904
+ abi: exports.KernelAbi,
1905
+ eventName: 'PermissionUninstalled',
1906
+ onLogs: (logs) => {
1907
+ logs.forEach((log) => {
1908
+ callback(log.args);
1909
+ });
1910
+ },
1911
+ });
1912
+ },
1913
+ /**
1914
+ * Watch Received events
1915
+ * @param callback Function to call when event is emitted
1916
+ * @param filter Optional filter for indexed parameters
1917
+ * @returns Unwatch function to stop listening
1918
+ */
1919
+ Received: (callback) => {
1920
+ return this.publicClient.watchContractEvent({
1921
+ address: this.contractAddress,
1922
+ abi: exports.KernelAbi,
1923
+ eventName: 'Received',
1924
+ onLogs: (logs) => {
1925
+ logs.forEach((log) => {
1926
+ callback(log.args);
1927
+ });
1928
+ },
1929
+ });
1930
+ },
1931
+ /**
1932
+ * Watch RootValidatorUpdated events
1933
+ * @param callback Function to call when event is emitted
1934
+ * @param filter Optional filter for indexed parameters
1935
+ * @returns Unwatch function to stop listening
1936
+ */
1937
+ RootValidatorUpdated: (callback) => {
1938
+ return this.publicClient.watchContractEvent({
1939
+ address: this.contractAddress,
1940
+ abi: exports.KernelAbi,
1941
+ eventName: 'RootValidatorUpdated',
1942
+ onLogs: (logs) => {
1943
+ logs.forEach((log) => {
1944
+ callback(log.args);
1945
+ });
1946
+ },
1947
+ });
1948
+ },
1949
+ /**
1950
+ * Watch SelectorSet events
1951
+ * @param callback Function to call when event is emitted
1952
+ * @param filter Optional filter for indexed parameters
1953
+ * @returns Unwatch function to stop listening
1954
+ */
1955
+ SelectorSet: (callback) => {
1956
+ return this.publicClient.watchContractEvent({
1957
+ address: this.contractAddress,
1958
+ abi: exports.KernelAbi,
1959
+ eventName: 'SelectorSet',
1960
+ onLogs: (logs) => {
1961
+ logs.forEach((log) => {
1962
+ callback(log.args);
1963
+ });
1964
+ },
1965
+ });
1966
+ },
1967
+ /**
1968
+ * Watch TryExecuteUnsuccessful events
1969
+ * @param callback Function to call when event is emitted
1970
+ * @param filter Optional filter for indexed parameters
1971
+ * @returns Unwatch function to stop listening
1972
+ */
1973
+ TryExecuteUnsuccessful: (callback) => {
1974
+ return this.publicClient.watchContractEvent({
1975
+ address: this.contractAddress,
1976
+ abi: exports.KernelAbi,
1977
+ eventName: 'TryExecuteUnsuccessful',
1978
+ onLogs: (logs) => {
1979
+ logs.forEach((log) => {
1980
+ callback(log.args);
1981
+ });
1982
+ },
1983
+ });
1984
+ },
1985
+ /**
1986
+ * Watch Upgraded events
1987
+ * @param callback Function to call when event is emitted
1988
+ * @param filter Optional filter for indexed parameters
1989
+ * @returns Unwatch function to stop listening
1990
+ */
1991
+ Upgraded: (callback, filter) => {
1992
+ return this.publicClient.watchContractEvent({
1993
+ address: this.contractAddress,
1994
+ abi: exports.KernelAbi,
1995
+ eventName: 'Upgraded',
1996
+ args: filter,
1997
+ onLogs: (logs) => {
1998
+ logs.forEach((log) => {
1999
+ callback(log.args);
2000
+ });
2001
+ },
2002
+ });
2003
+ },
2004
+ /**
2005
+ * Watch ValidatorInstalled events
2006
+ * @param callback Function to call when event is emitted
2007
+ * @param filter Optional filter for indexed parameters
2008
+ * @returns Unwatch function to stop listening
2009
+ */
2010
+ ValidatorInstalled: (callback) => {
2011
+ return this.publicClient.watchContractEvent({
2012
+ address: this.contractAddress,
2013
+ abi: exports.KernelAbi,
2014
+ eventName: 'ValidatorInstalled',
2015
+ onLogs: (logs) => {
2016
+ logs.forEach((log) => {
2017
+ callback(log.args);
2018
+ });
2019
+ },
2020
+ });
2021
+ },
2022
+ /**
2023
+ * Watch ValidatorUninstalled events
2024
+ * @param callback Function to call when event is emitted
2025
+ * @param filter Optional filter for indexed parameters
2026
+ * @returns Unwatch function to stop listening
2027
+ */
2028
+ ValidatorUninstalled: (callback) => {
2029
+ return this.publicClient.watchContractEvent({
2030
+ address: this.contractAddress,
2031
+ abi: exports.KernelAbi,
2032
+ eventName: 'ValidatorUninstalled',
2033
+ onLogs: (logs) => {
2034
+ logs.forEach((log) => {
2035
+ callback(log.args);
2036
+ });
2037
+ },
2038
+ });
2039
+ }
2040
+ };
2041
+ }
2042
+ }
2043
+ exports.Kernel = Kernel;