@gitmyabi/kernel 1.0.0

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