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