@gitmyabi/safel 1.0.0

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