@gitmyabi/kernel 1.0.1 → 1.0.2

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