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