@gitmyabi/safe 1.0.146 → 1.0.147

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