@gitmyabi/safe 1.0.4 → 1.0.5

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,2127 @@
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": false,
78
+ "internalType": "uint256",
79
+ "name": "threshold",
80
+ "type": "uint256"
81
+ }
82
+ ],
83
+ "name": "ChangedThreshold",
84
+ "type": "event"
85
+ },
86
+ {
87
+ "anonymous": false,
88
+ "inputs": [
89
+ {
90
+ "indexed": true,
91
+ "internalType": "address",
92
+ "name": "module",
93
+ "type": "address"
94
+ }
95
+ ],
96
+ "name": "DisabledModule",
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": "EnabledModule",
110
+ "type": "event"
111
+ },
112
+ {
113
+ "anonymous": false,
114
+ "inputs": [
115
+ {
116
+ "indexed": true,
117
+ "internalType": "bytes32",
118
+ "name": "txHash",
119
+ "type": "bytes32"
120
+ },
121
+ {
122
+ "indexed": false,
123
+ "internalType": "uint256",
124
+ "name": "payment",
125
+ "type": "uint256"
126
+ }
127
+ ],
128
+ "name": "ExecutionFailure",
129
+ "type": "event"
130
+ },
131
+ {
132
+ "anonymous": false,
133
+ "inputs": [
134
+ {
135
+ "indexed": true,
136
+ "internalType": "address",
137
+ "name": "module",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "name": "ExecutionFromModuleFailure",
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": "ExecutionFromModuleSuccess",
155
+ "type": "event"
156
+ },
157
+ {
158
+ "anonymous": false,
159
+ "inputs": [
160
+ {
161
+ "indexed": true,
162
+ "internalType": "bytes32",
163
+ "name": "txHash",
164
+ "type": "bytes32"
165
+ },
166
+ {
167
+ "indexed": false,
168
+ "internalType": "uint256",
169
+ "name": "payment",
170
+ "type": "uint256"
171
+ }
172
+ ],
173
+ "name": "ExecutionSuccess",
174
+ "type": "event"
175
+ },
176
+ {
177
+ "anonymous": false,
178
+ "inputs": [
179
+ {
180
+ "indexed": true,
181
+ "internalType": "address",
182
+ "name": "owner",
183
+ "type": "address"
184
+ }
185
+ ],
186
+ "name": "RemovedOwner",
187
+ "type": "event"
188
+ },
189
+ {
190
+ "anonymous": false,
191
+ "inputs": [
192
+ {
193
+ "indexed": true,
194
+ "internalType": "address",
195
+ "name": "sender",
196
+ "type": "address"
197
+ },
198
+ {
199
+ "indexed": false,
200
+ "internalType": "uint256",
201
+ "name": "value",
202
+ "type": "uint256"
203
+ }
204
+ ],
205
+ "name": "SafeReceived",
206
+ "type": "event"
207
+ },
208
+ {
209
+ "anonymous": false,
210
+ "inputs": [
211
+ {
212
+ "indexed": true,
213
+ "internalType": "address",
214
+ "name": "initiator",
215
+ "type": "address"
216
+ },
217
+ {
218
+ "indexed": false,
219
+ "internalType": "address[]",
220
+ "name": "owners",
221
+ "type": "address[]"
222
+ },
223
+ {
224
+ "indexed": false,
225
+ "internalType": "uint256",
226
+ "name": "threshold",
227
+ "type": "uint256"
228
+ },
229
+ {
230
+ "indexed": false,
231
+ "internalType": "address",
232
+ "name": "initializer",
233
+ "type": "address"
234
+ },
235
+ {
236
+ "indexed": false,
237
+ "internalType": "address",
238
+ "name": "fallbackHandler",
239
+ "type": "address"
240
+ }
241
+ ],
242
+ "name": "SafeSetup",
243
+ "type": "event"
244
+ },
245
+ {
246
+ "anonymous": false,
247
+ "inputs": [
248
+ {
249
+ "indexed": true,
250
+ "internalType": "bytes32",
251
+ "name": "msgHash",
252
+ "type": "bytes32"
253
+ }
254
+ ],
255
+ "name": "SignMsg",
256
+ "type": "event"
257
+ },
258
+ {
259
+ "stateMutability": "nonpayable",
260
+ "type": "fallback"
261
+ },
262
+ {
263
+ "inputs": [],
264
+ "name": "VERSION",
265
+ "outputs": [
266
+ {
267
+ "internalType": "string",
268
+ "name": "",
269
+ "type": "string"
270
+ }
271
+ ],
272
+ "stateMutability": "view",
273
+ "type": "function"
274
+ },
275
+ {
276
+ "inputs": [
277
+ {
278
+ "internalType": "address",
279
+ "name": "owner",
280
+ "type": "address"
281
+ },
282
+ {
283
+ "internalType": "uint256",
284
+ "name": "_threshold",
285
+ "type": "uint256"
286
+ }
287
+ ],
288
+ "name": "addOwnerWithThreshold",
289
+ "outputs": [],
290
+ "stateMutability": "nonpayable",
291
+ "type": "function"
292
+ },
293
+ {
294
+ "inputs": [
295
+ {
296
+ "internalType": "bytes32",
297
+ "name": "hashToApprove",
298
+ "type": "bytes32"
299
+ }
300
+ ],
301
+ "name": "approveHash",
302
+ "outputs": [],
303
+ "stateMutability": "nonpayable",
304
+ "type": "function"
305
+ },
306
+ {
307
+ "inputs": [
308
+ {
309
+ "internalType": "address",
310
+ "name": "",
311
+ "type": "address"
312
+ },
313
+ {
314
+ "internalType": "bytes32",
315
+ "name": "",
316
+ "type": "bytes32"
317
+ }
318
+ ],
319
+ "name": "approvedHashes",
320
+ "outputs": [
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "",
324
+ "type": "uint256"
325
+ }
326
+ ],
327
+ "stateMutability": "view",
328
+ "type": "function"
329
+ },
330
+ {
331
+ "inputs": [
332
+ {
333
+ "internalType": "uint256",
334
+ "name": "_threshold",
335
+ "type": "uint256"
336
+ }
337
+ ],
338
+ "name": "changeThreshold",
339
+ "outputs": [],
340
+ "stateMutability": "nonpayable",
341
+ "type": "function"
342
+ },
343
+ {
344
+ "inputs": [
345
+ {
346
+ "internalType": "bytes32",
347
+ "name": "dataHash",
348
+ "type": "bytes32"
349
+ },
350
+ {
351
+ "internalType": "bytes",
352
+ "name": "data",
353
+ "type": "bytes"
354
+ },
355
+ {
356
+ "internalType": "bytes",
357
+ "name": "signatures",
358
+ "type": "bytes"
359
+ },
360
+ {
361
+ "internalType": "uint256",
362
+ "name": "requiredSignatures",
363
+ "type": "uint256"
364
+ }
365
+ ],
366
+ "name": "checkNSignatures",
367
+ "outputs": [],
368
+ "stateMutability": "view",
369
+ "type": "function"
370
+ },
371
+ {
372
+ "inputs": [
373
+ {
374
+ "internalType": "bytes32",
375
+ "name": "dataHash",
376
+ "type": "bytes32"
377
+ },
378
+ {
379
+ "internalType": "bytes",
380
+ "name": "data",
381
+ "type": "bytes"
382
+ },
383
+ {
384
+ "internalType": "bytes",
385
+ "name": "signatures",
386
+ "type": "bytes"
387
+ }
388
+ ],
389
+ "name": "checkSignatures",
390
+ "outputs": [],
391
+ "stateMutability": "view",
392
+ "type": "function"
393
+ },
394
+ {
395
+ "inputs": [
396
+ {
397
+ "internalType": "address",
398
+ "name": "prevModule",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "internalType": "address",
403
+ "name": "module",
404
+ "type": "address"
405
+ }
406
+ ],
407
+ "name": "disableModule",
408
+ "outputs": [],
409
+ "stateMutability": "nonpayable",
410
+ "type": "function"
411
+ },
412
+ {
413
+ "inputs": [],
414
+ "name": "domainSeparator",
415
+ "outputs": [
416
+ {
417
+ "internalType": "bytes32",
418
+ "name": "",
419
+ "type": "bytes32"
420
+ }
421
+ ],
422
+ "stateMutability": "view",
423
+ "type": "function"
424
+ },
425
+ {
426
+ "inputs": [
427
+ {
428
+ "internalType": "address",
429
+ "name": "module",
430
+ "type": "address"
431
+ }
432
+ ],
433
+ "name": "enableModule",
434
+ "outputs": [],
435
+ "stateMutability": "nonpayable",
436
+ "type": "function"
437
+ },
438
+ {
439
+ "inputs": [
440
+ {
441
+ "internalType": "address",
442
+ "name": "to",
443
+ "type": "address"
444
+ },
445
+ {
446
+ "internalType": "uint256",
447
+ "name": "value",
448
+ "type": "uint256"
449
+ },
450
+ {
451
+ "internalType": "bytes",
452
+ "name": "data",
453
+ "type": "bytes"
454
+ },
455
+ {
456
+ "internalType": "enum Enum.Operation",
457
+ "name": "operation",
458
+ "type": "uint8"
459
+ },
460
+ {
461
+ "internalType": "uint256",
462
+ "name": "safeTxGas",
463
+ "type": "uint256"
464
+ },
465
+ {
466
+ "internalType": "uint256",
467
+ "name": "baseGas",
468
+ "type": "uint256"
469
+ },
470
+ {
471
+ "internalType": "uint256",
472
+ "name": "gasPrice",
473
+ "type": "uint256"
474
+ },
475
+ {
476
+ "internalType": "address",
477
+ "name": "gasToken",
478
+ "type": "address"
479
+ },
480
+ {
481
+ "internalType": "address",
482
+ "name": "refundReceiver",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "internalType": "uint256",
487
+ "name": "_nonce",
488
+ "type": "uint256"
489
+ }
490
+ ],
491
+ "name": "encodeTransactionData",
492
+ "outputs": [
493
+ {
494
+ "internalType": "bytes",
495
+ "name": "",
496
+ "type": "bytes"
497
+ }
498
+ ],
499
+ "stateMutability": "view",
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
+ "name": "getChainId",
642
+ "outputs": [
643
+ {
644
+ "internalType": "uint256",
645
+ "name": "",
646
+ "type": "uint256"
647
+ }
648
+ ],
649
+ "stateMutability": "view",
650
+ "type": "function"
651
+ },
652
+ {
653
+ "inputs": [
654
+ {
655
+ "internalType": "address",
656
+ "name": "start",
657
+ "type": "address"
658
+ },
659
+ {
660
+ "internalType": "uint256",
661
+ "name": "pageSize",
662
+ "type": "uint256"
663
+ }
664
+ ],
665
+ "name": "getModulesPaginated",
666
+ "outputs": [
667
+ {
668
+ "internalType": "address[]",
669
+ "name": "array",
670
+ "type": "address[]"
671
+ },
672
+ {
673
+ "internalType": "address",
674
+ "name": "next",
675
+ "type": "address"
676
+ }
677
+ ],
678
+ "stateMutability": "view",
679
+ "type": "function"
680
+ },
681
+ {
682
+ "inputs": [],
683
+ "name": "getOwners",
684
+ "outputs": [
685
+ {
686
+ "internalType": "address[]",
687
+ "name": "",
688
+ "type": "address[]"
689
+ }
690
+ ],
691
+ "stateMutability": "view",
692
+ "type": "function"
693
+ },
694
+ {
695
+ "inputs": [
696
+ {
697
+ "internalType": "uint256",
698
+ "name": "offset",
699
+ "type": "uint256"
700
+ },
701
+ {
702
+ "internalType": "uint256",
703
+ "name": "length",
704
+ "type": "uint256"
705
+ }
706
+ ],
707
+ "name": "getStorageAt",
708
+ "outputs": [
709
+ {
710
+ "internalType": "bytes",
711
+ "name": "",
712
+ "type": "bytes"
713
+ }
714
+ ],
715
+ "stateMutability": "view",
716
+ "type": "function"
717
+ },
718
+ {
719
+ "inputs": [],
720
+ "name": "getThreshold",
721
+ "outputs": [
722
+ {
723
+ "internalType": "uint256",
724
+ "name": "",
725
+ "type": "uint256"
726
+ }
727
+ ],
728
+ "stateMutability": "view",
729
+ "type": "function"
730
+ },
731
+ {
732
+ "inputs": [
733
+ {
734
+ "internalType": "address",
735
+ "name": "to",
736
+ "type": "address"
737
+ },
738
+ {
739
+ "internalType": "uint256",
740
+ "name": "value",
741
+ "type": "uint256"
742
+ },
743
+ {
744
+ "internalType": "bytes",
745
+ "name": "data",
746
+ "type": "bytes"
747
+ },
748
+ {
749
+ "internalType": "enum Enum.Operation",
750
+ "name": "operation",
751
+ "type": "uint8"
752
+ },
753
+ {
754
+ "internalType": "uint256",
755
+ "name": "safeTxGas",
756
+ "type": "uint256"
757
+ },
758
+ {
759
+ "internalType": "uint256",
760
+ "name": "baseGas",
761
+ "type": "uint256"
762
+ },
763
+ {
764
+ "internalType": "uint256",
765
+ "name": "gasPrice",
766
+ "type": "uint256"
767
+ },
768
+ {
769
+ "internalType": "address",
770
+ "name": "gasToken",
771
+ "type": "address"
772
+ },
773
+ {
774
+ "internalType": "address",
775
+ "name": "refundReceiver",
776
+ "type": "address"
777
+ },
778
+ {
779
+ "internalType": "uint256",
780
+ "name": "_nonce",
781
+ "type": "uint256"
782
+ }
783
+ ],
784
+ "name": "getTransactionHash",
785
+ "outputs": [
786
+ {
787
+ "internalType": "bytes32",
788
+ "name": "",
789
+ "type": "bytes32"
790
+ }
791
+ ],
792
+ "stateMutability": "view",
793
+ "type": "function"
794
+ },
795
+ {
796
+ "inputs": [
797
+ {
798
+ "internalType": "address",
799
+ "name": "module",
800
+ "type": "address"
801
+ }
802
+ ],
803
+ "name": "isModuleEnabled",
804
+ "outputs": [
805
+ {
806
+ "internalType": "bool",
807
+ "name": "",
808
+ "type": "bool"
809
+ }
810
+ ],
811
+ "stateMutability": "view",
812
+ "type": "function"
813
+ },
814
+ {
815
+ "inputs": [
816
+ {
817
+ "internalType": "address",
818
+ "name": "owner",
819
+ "type": "address"
820
+ }
821
+ ],
822
+ "name": "isOwner",
823
+ "outputs": [
824
+ {
825
+ "internalType": "bool",
826
+ "name": "",
827
+ "type": "bool"
828
+ }
829
+ ],
830
+ "stateMutability": "view",
831
+ "type": "function"
832
+ },
833
+ {
834
+ "inputs": [],
835
+ "name": "nonce",
836
+ "outputs": [
837
+ {
838
+ "internalType": "uint256",
839
+ "name": "",
840
+ "type": "uint256"
841
+ }
842
+ ],
843
+ "stateMutability": "view",
844
+ "type": "function"
845
+ },
846
+ {
847
+ "inputs": [
848
+ {
849
+ "internalType": "address",
850
+ "name": "prevOwner",
851
+ "type": "address"
852
+ },
853
+ {
854
+ "internalType": "address",
855
+ "name": "owner",
856
+ "type": "address"
857
+ },
858
+ {
859
+ "internalType": "uint256",
860
+ "name": "_threshold",
861
+ "type": "uint256"
862
+ }
863
+ ],
864
+ "name": "removeOwner",
865
+ "outputs": [],
866
+ "stateMutability": "nonpayable",
867
+ "type": "function"
868
+ },
869
+ {
870
+ "inputs": [
871
+ {
872
+ "internalType": "address",
873
+ "name": "handler",
874
+ "type": "address"
875
+ }
876
+ ],
877
+ "name": "setFallbackHandler",
878
+ "outputs": [],
879
+ "stateMutability": "nonpayable",
880
+ "type": "function"
881
+ },
882
+ {
883
+ "inputs": [
884
+ {
885
+ "internalType": "address",
886
+ "name": "guard",
887
+ "type": "address"
888
+ }
889
+ ],
890
+ "name": "setGuard",
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
+ /**
1108
+ * checkNSignatures
1109
+ * view
1110
+ */
1111
+ async checkNSignatures(dataHash: `0x${string}`, data: `0x${string}`, signatures: `0x${string}`, requiredSignatures: bigint): Promise<void> {
1112
+ return this.contract.read.checkNSignatures([dataHash, data, signatures, requiredSignatures] as const) as Promise<void>;
1113
+ }
1114
+
1115
+ /**
1116
+ * checkSignatures
1117
+ * view
1118
+ */
1119
+ async checkSignatures(dataHash: `0x${string}`, data: `0x${string}`, signatures: `0x${string}`): Promise<void> {
1120
+ return this.contract.read.checkSignatures([dataHash, data, signatures] as const) as Promise<void>;
1121
+ }
1122
+
1123
+ /**
1124
+ * domainSeparator
1125
+ * view
1126
+ */
1127
+ async domainSeparator(): Promise<`0x${string}`> {
1128
+ return this.contract.read.domainSeparator() as Promise<`0x${string}`>;
1129
+ }
1130
+
1131
+ /**
1132
+ * encodeTransactionData
1133
+ * view
1134
+ */
1135
+ 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}`> {
1136
+ return this.contract.read.encodeTransactionData([to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce] as const) as Promise<`0x${string}`>;
1137
+ }
1138
+
1139
+ /**
1140
+ * getChainId
1141
+ * view
1142
+ */
1143
+ async getChainId(): Promise<bigint> {
1144
+ return this.contract.read.getChainId() as Promise<bigint>;
1145
+ }
1146
+
1147
+ /**
1148
+ * getModulesPaginated
1149
+ * view
1150
+ */
1151
+ async getModulesPaginated(start: `0x${string}`, pageSize: bigint): Promise<[`0x${string}`[], `0x${string}`]> {
1152
+ return this.contract.read.getModulesPaginated([start, pageSize] as const) as Promise<[`0x${string}`[], `0x${string}`]>;
1153
+ }
1154
+
1155
+ /**
1156
+ * getOwners
1157
+ * view
1158
+ */
1159
+ async getOwners(): Promise<`0x${string}`[]> {
1160
+ return this.contract.read.getOwners() as Promise<`0x${string}`[]>;
1161
+ }
1162
+
1163
+ /**
1164
+ * getStorageAt
1165
+ * view
1166
+ */
1167
+ async getStorageAt(offset: bigint, length: bigint): Promise<`0x${string}`> {
1168
+ return this.contract.read.getStorageAt([offset, length] as const) as Promise<`0x${string}`>;
1169
+ }
1170
+
1171
+ /**
1172
+ * getThreshold
1173
+ * view
1174
+ */
1175
+ async getThreshold(): Promise<bigint> {
1176
+ return this.contract.read.getThreshold() as Promise<bigint>;
1177
+ }
1178
+
1179
+ /**
1180
+ * getTransactionHash
1181
+ * view
1182
+ */
1183
+ 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}`> {
1184
+ return this.contract.read.getTransactionHash([to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce] as const) as Promise<`0x${string}`>;
1185
+ }
1186
+
1187
+ /**
1188
+ * isModuleEnabled
1189
+ * view
1190
+ */
1191
+ async isModuleEnabled(module: `0x${string}`): Promise<boolean> {
1192
+ return this.contract.read.isModuleEnabled([module] as const) as Promise<boolean>;
1193
+ }
1194
+
1195
+ /**
1196
+ * isOwner
1197
+ * view
1198
+ */
1199
+ async isOwner(owner: `0x${string}`): Promise<boolean> {
1200
+ return this.contract.read.isOwner([owner] as const) as Promise<boolean>;
1201
+ }
1202
+
1203
+ /**
1204
+ * nonce
1205
+ * view
1206
+ */
1207
+ async nonce(): Promise<bigint> {
1208
+ return this.contract.read.nonce() as Promise<bigint>;
1209
+ }
1210
+
1211
+ /**
1212
+ * signedMessages
1213
+ * view
1214
+ */
1215
+ async signedMessages(arg0: `0x${string}`): Promise<bigint> {
1216
+ return this.contract.read.signedMessages([arg0] as const) as Promise<bigint>;
1217
+ }
1218
+
1219
+ /**
1220
+ * addOwnerWithThreshold
1221
+ * nonpayable
1222
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1223
+ */
1224
+ async addOwnerWithThreshold(owner: `0x${string}`, _threshold: bigint, options?: {
1225
+ accessList?: import('viem').AccessList;
1226
+ authorizationList?: import('viem').AuthorizationList;
1227
+ chain?: import('viem').Chain | null;
1228
+ dataSuffix?: `0x${string}`;
1229
+ gas?: bigint;
1230
+ gasPrice?: bigint;
1231
+ maxFeePerGas?: bigint;
1232
+ maxPriorityFeePerGas?: bigint;
1233
+ nonce?: number;
1234
+ value?: bigint;
1235
+ }): Promise<`0x${string}`> {
1236
+ if (!this.contract.write) {
1237
+ throw new Error('Wallet client is required for write operations');
1238
+ }
1239
+ return this.contract.write.addOwnerWithThreshold([owner, _threshold] as const, options) as Promise<`0x${string}`>;
1240
+ }
1241
+
1242
+ /**
1243
+ * approveHash
1244
+ * nonpayable
1245
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1246
+ */
1247
+ async approveHash(hashToApprove: `0x${string}`, options?: {
1248
+ accessList?: import('viem').AccessList;
1249
+ authorizationList?: import('viem').AuthorizationList;
1250
+ chain?: import('viem').Chain | null;
1251
+ dataSuffix?: `0x${string}`;
1252
+ gas?: bigint;
1253
+ gasPrice?: bigint;
1254
+ maxFeePerGas?: bigint;
1255
+ maxPriorityFeePerGas?: bigint;
1256
+ nonce?: number;
1257
+ value?: bigint;
1258
+ }): Promise<`0x${string}`> {
1259
+ if (!this.contract.write) {
1260
+ throw new Error('Wallet client is required for write operations');
1261
+ }
1262
+ return this.contract.write.approveHash([hashToApprove] as const, options) as Promise<`0x${string}`>;
1263
+ }
1264
+
1265
+ /**
1266
+ * changeThreshold
1267
+ * nonpayable
1268
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1269
+ */
1270
+ async changeThreshold(_threshold: bigint, options?: {
1271
+ accessList?: import('viem').AccessList;
1272
+ authorizationList?: import('viem').AuthorizationList;
1273
+ chain?: import('viem').Chain | null;
1274
+ dataSuffix?: `0x${string}`;
1275
+ gas?: bigint;
1276
+ gasPrice?: bigint;
1277
+ maxFeePerGas?: bigint;
1278
+ maxPriorityFeePerGas?: bigint;
1279
+ nonce?: number;
1280
+ value?: bigint;
1281
+ }): Promise<`0x${string}`> {
1282
+ if (!this.contract.write) {
1283
+ throw new Error('Wallet client is required for write operations');
1284
+ }
1285
+ return this.contract.write.changeThreshold([_threshold] as const, options) as Promise<`0x${string}`>;
1286
+ }
1287
+
1288
+ /**
1289
+ * disableModule
1290
+ * nonpayable
1291
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1292
+ */
1293
+ async disableModule(prevModule: `0x${string}`, module: `0x${string}`, options?: {
1294
+ accessList?: import('viem').AccessList;
1295
+ authorizationList?: import('viem').AuthorizationList;
1296
+ chain?: import('viem').Chain | null;
1297
+ dataSuffix?: `0x${string}`;
1298
+ gas?: bigint;
1299
+ gasPrice?: bigint;
1300
+ maxFeePerGas?: bigint;
1301
+ maxPriorityFeePerGas?: bigint;
1302
+ nonce?: number;
1303
+ value?: bigint;
1304
+ }): Promise<`0x${string}`> {
1305
+ if (!this.contract.write) {
1306
+ throw new Error('Wallet client is required for write operations');
1307
+ }
1308
+ return this.contract.write.disableModule([prevModule, module] as const, options) as Promise<`0x${string}`>;
1309
+ }
1310
+
1311
+ /**
1312
+ * enableModule
1313
+ * nonpayable
1314
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1315
+ */
1316
+ async enableModule(module: `0x${string}`, options?: {
1317
+ accessList?: import('viem').AccessList;
1318
+ authorizationList?: import('viem').AuthorizationList;
1319
+ chain?: import('viem').Chain | null;
1320
+ dataSuffix?: `0x${string}`;
1321
+ gas?: bigint;
1322
+ gasPrice?: bigint;
1323
+ maxFeePerGas?: bigint;
1324
+ maxPriorityFeePerGas?: bigint;
1325
+ nonce?: number;
1326
+ value?: bigint;
1327
+ }): Promise<`0x${string}`> {
1328
+ if (!this.contract.write) {
1329
+ throw new Error('Wallet client is required for write operations');
1330
+ }
1331
+ return this.contract.write.enableModule([module] as const, options) as Promise<`0x${string}`>;
1332
+ }
1333
+
1334
+ /**
1335
+ * execTransaction
1336
+ * payable
1337
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1338
+ */
1339
+ 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?: {
1340
+ accessList?: import('viem').AccessList;
1341
+ authorizationList?: import('viem').AuthorizationList;
1342
+ chain?: import('viem').Chain | null;
1343
+ dataSuffix?: `0x${string}`;
1344
+ gas?: bigint;
1345
+ gasPrice?: bigint;
1346
+ maxFeePerGas?: bigint;
1347
+ maxPriorityFeePerGas?: bigint;
1348
+ nonce?: number;
1349
+ value?: bigint;
1350
+ }): Promise<`0x${string}`> {
1351
+ if (!this.contract.write) {
1352
+ throw new Error('Wallet client is required for write operations');
1353
+ }
1354
+ return this.contract.write.execTransaction([to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures] as const, options) as Promise<`0x${string}`>;
1355
+ }
1356
+
1357
+ /**
1358
+ * execTransactionFromModule
1359
+ * nonpayable
1360
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1361
+ */
1362
+ async execTransactionFromModule(to: `0x${string}`, value: bigint, data: `0x${string}`, operation: bigint, options?: {
1363
+ accessList?: import('viem').AccessList;
1364
+ authorizationList?: import('viem').AuthorizationList;
1365
+ chain?: import('viem').Chain | null;
1366
+ dataSuffix?: `0x${string}`;
1367
+ gas?: bigint;
1368
+ gasPrice?: bigint;
1369
+ maxFeePerGas?: bigint;
1370
+ maxPriorityFeePerGas?: bigint;
1371
+ nonce?: number;
1372
+ value?: bigint;
1373
+ }): Promise<`0x${string}`> {
1374
+ if (!this.contract.write) {
1375
+ throw new Error('Wallet client is required for write operations');
1376
+ }
1377
+ return this.contract.write.execTransactionFromModule([to, value, data, operation] as const, options) as Promise<`0x${string}`>;
1378
+ }
1379
+
1380
+ /**
1381
+ * execTransactionFromModuleReturnData
1382
+ * nonpayable
1383
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1384
+ */
1385
+ async execTransactionFromModuleReturnData(to: `0x${string}`, value: bigint, data: `0x${string}`, operation: bigint, options?: {
1386
+ accessList?: import('viem').AccessList;
1387
+ authorizationList?: import('viem').AuthorizationList;
1388
+ chain?: import('viem').Chain | null;
1389
+ dataSuffix?: `0x${string}`;
1390
+ gas?: bigint;
1391
+ gasPrice?: bigint;
1392
+ maxFeePerGas?: bigint;
1393
+ maxPriorityFeePerGas?: bigint;
1394
+ nonce?: number;
1395
+ value?: bigint;
1396
+ }): Promise<`0x${string}`> {
1397
+ if (!this.contract.write) {
1398
+ throw new Error('Wallet client is required for write operations');
1399
+ }
1400
+ return this.contract.write.execTransactionFromModuleReturnData([to, value, data, operation] as const, options) as Promise<`0x${string}`>;
1401
+ }
1402
+
1403
+ /**
1404
+ * removeOwner
1405
+ * nonpayable
1406
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1407
+ */
1408
+ async removeOwner(prevOwner: `0x${string}`, owner: `0x${string}`, _threshold: bigint, options?: {
1409
+ accessList?: import('viem').AccessList;
1410
+ authorizationList?: import('viem').AuthorizationList;
1411
+ chain?: import('viem').Chain | null;
1412
+ dataSuffix?: `0x${string}`;
1413
+ gas?: bigint;
1414
+ gasPrice?: bigint;
1415
+ maxFeePerGas?: bigint;
1416
+ maxPriorityFeePerGas?: bigint;
1417
+ nonce?: number;
1418
+ value?: bigint;
1419
+ }): Promise<`0x${string}`> {
1420
+ if (!this.contract.write) {
1421
+ throw new Error('Wallet client is required for write operations');
1422
+ }
1423
+ return this.contract.write.removeOwner([prevOwner, owner, _threshold] as const, options) as Promise<`0x${string}`>;
1424
+ }
1425
+
1426
+ /**
1427
+ * setFallbackHandler
1428
+ * nonpayable
1429
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1430
+ */
1431
+ async setFallbackHandler(handler: `0x${string}`, options?: {
1432
+ accessList?: import('viem').AccessList;
1433
+ authorizationList?: import('viem').AuthorizationList;
1434
+ chain?: import('viem').Chain | null;
1435
+ dataSuffix?: `0x${string}`;
1436
+ gas?: bigint;
1437
+ gasPrice?: bigint;
1438
+ maxFeePerGas?: bigint;
1439
+ maxPriorityFeePerGas?: bigint;
1440
+ nonce?: number;
1441
+ value?: bigint;
1442
+ }): Promise<`0x${string}`> {
1443
+ if (!this.contract.write) {
1444
+ throw new Error('Wallet client is required for write operations');
1445
+ }
1446
+ return this.contract.write.setFallbackHandler([handler] as const, options) as Promise<`0x${string}`>;
1447
+ }
1448
+
1449
+ /**
1450
+ * setGuard
1451
+ * nonpayable
1452
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1453
+ */
1454
+ async setGuard(guard: `0x${string}`, options?: {
1455
+ accessList?: import('viem').AccessList;
1456
+ authorizationList?: import('viem').AuthorizationList;
1457
+ chain?: import('viem').Chain | null;
1458
+ dataSuffix?: `0x${string}`;
1459
+ gas?: bigint;
1460
+ gasPrice?: bigint;
1461
+ maxFeePerGas?: bigint;
1462
+ maxPriorityFeePerGas?: bigint;
1463
+ nonce?: number;
1464
+ value?: bigint;
1465
+ }): Promise<`0x${string}`> {
1466
+ if (!this.contract.write) {
1467
+ throw new Error('Wallet client is required for write operations');
1468
+ }
1469
+ return this.contract.write.setGuard([guard] as const, options) as Promise<`0x${string}`>;
1470
+ }
1471
+
1472
+ /**
1473
+ * setup
1474
+ * nonpayable
1475
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1476
+ */
1477
+ 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?: {
1478
+ accessList?: import('viem').AccessList;
1479
+ authorizationList?: import('viem').AuthorizationList;
1480
+ chain?: import('viem').Chain | null;
1481
+ dataSuffix?: `0x${string}`;
1482
+ gas?: bigint;
1483
+ gasPrice?: bigint;
1484
+ maxFeePerGas?: bigint;
1485
+ maxPriorityFeePerGas?: bigint;
1486
+ nonce?: number;
1487
+ value?: bigint;
1488
+ }): Promise<`0x${string}`> {
1489
+ if (!this.contract.write) {
1490
+ throw new Error('Wallet client is required for write operations');
1491
+ }
1492
+ return this.contract.write.setup([_owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver] as const, options) as Promise<`0x${string}`>;
1493
+ }
1494
+
1495
+ /**
1496
+ * simulateAndRevert
1497
+ * nonpayable
1498
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1499
+ */
1500
+ async simulateAndRevert(targetContract: `0x${string}`, calldataPayload: `0x${string}`, options?: {
1501
+ accessList?: import('viem').AccessList;
1502
+ authorizationList?: import('viem').AuthorizationList;
1503
+ chain?: import('viem').Chain | null;
1504
+ dataSuffix?: `0x${string}`;
1505
+ gas?: bigint;
1506
+ gasPrice?: bigint;
1507
+ maxFeePerGas?: bigint;
1508
+ maxPriorityFeePerGas?: bigint;
1509
+ nonce?: number;
1510
+ value?: bigint;
1511
+ }): Promise<`0x${string}`> {
1512
+ if (!this.contract.write) {
1513
+ throw new Error('Wallet client is required for write operations');
1514
+ }
1515
+ return this.contract.write.simulateAndRevert([targetContract, calldataPayload] as const, options) as Promise<`0x${string}`>;
1516
+ }
1517
+
1518
+ /**
1519
+ * swapOwner
1520
+ * nonpayable
1521
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1522
+ */
1523
+ async swapOwner(prevOwner: `0x${string}`, oldOwner: `0x${string}`, newOwner: `0x${string}`, options?: {
1524
+ accessList?: import('viem').AccessList;
1525
+ authorizationList?: import('viem').AuthorizationList;
1526
+ chain?: import('viem').Chain | null;
1527
+ dataSuffix?: `0x${string}`;
1528
+ gas?: bigint;
1529
+ gasPrice?: bigint;
1530
+ maxFeePerGas?: bigint;
1531
+ maxPriorityFeePerGas?: bigint;
1532
+ nonce?: number;
1533
+ value?: bigint;
1534
+ }): Promise<`0x${string}`> {
1535
+ if (!this.contract.write) {
1536
+ throw new Error('Wallet client is required for write operations');
1537
+ }
1538
+ return this.contract.write.swapOwner([prevOwner, oldOwner, newOwner] as const, options) as Promise<`0x${string}`>;
1539
+ }
1540
+
1541
+
1542
+
1543
+ /**
1544
+ * Simulate contract write operations (dry-run without sending transaction)
1545
+ *
1546
+ * @example
1547
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1548
+ * console.log('Gas estimate:', result.request.gas);
1549
+ * console.log('Would succeed:', result.result);
1550
+ */
1551
+ get simulate() {
1552
+ const contract = this.contract;
1553
+ if (!contract.simulate) {
1554
+ throw new Error('Public client is required for simulation');
1555
+ }
1556
+ return {
1557
+ /**
1558
+ * Simulate addOwnerWithThreshold
1559
+ * Returns gas estimate and result without sending transaction
1560
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1561
+ */
1562
+ async addOwnerWithThreshold(owner: `0x${string}`, _threshold: bigint, options?: {
1563
+ accessList?: import('viem').AccessList;
1564
+ authorizationList?: import('viem').AuthorizationList;
1565
+ chain?: import('viem').Chain | null;
1566
+ dataSuffix?: `0x${string}`;
1567
+ gas?: bigint;
1568
+ gasPrice?: bigint;
1569
+ maxFeePerGas?: bigint;
1570
+ maxPriorityFeePerGas?: bigint;
1571
+ nonce?: number;
1572
+ value?: bigint;
1573
+ }): Promise<void> {
1574
+ return contract.simulate.addOwnerWithThreshold([owner, _threshold] as const, options) as Promise<void>;
1575
+ },
1576
+ /**
1577
+ * Simulate approveHash
1578
+ * Returns gas estimate and result without sending transaction
1579
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1580
+ */
1581
+ async approveHash(hashToApprove: `0x${string}`, options?: {
1582
+ accessList?: import('viem').AccessList;
1583
+ authorizationList?: import('viem').AuthorizationList;
1584
+ chain?: import('viem').Chain | null;
1585
+ dataSuffix?: `0x${string}`;
1586
+ gas?: bigint;
1587
+ gasPrice?: bigint;
1588
+ maxFeePerGas?: bigint;
1589
+ maxPriorityFeePerGas?: bigint;
1590
+ nonce?: number;
1591
+ value?: bigint;
1592
+ }): Promise<void> {
1593
+ return contract.simulate.approveHash([hashToApprove] as const, options) as Promise<void>;
1594
+ },
1595
+ /**
1596
+ * Simulate changeThreshold
1597
+ * Returns gas estimate and result without sending transaction
1598
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1599
+ */
1600
+ async changeThreshold(_threshold: bigint, options?: {
1601
+ accessList?: import('viem').AccessList;
1602
+ authorizationList?: import('viem').AuthorizationList;
1603
+ chain?: import('viem').Chain | null;
1604
+ dataSuffix?: `0x${string}`;
1605
+ gas?: bigint;
1606
+ gasPrice?: bigint;
1607
+ maxFeePerGas?: bigint;
1608
+ maxPriorityFeePerGas?: bigint;
1609
+ nonce?: number;
1610
+ value?: bigint;
1611
+ }): Promise<void> {
1612
+ return contract.simulate.changeThreshold([_threshold] as const, options) as Promise<void>;
1613
+ },
1614
+ /**
1615
+ * Simulate disableModule
1616
+ * Returns gas estimate and result without sending transaction
1617
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1618
+ */
1619
+ async disableModule(prevModule: `0x${string}`, module: `0x${string}`, options?: {
1620
+ accessList?: import('viem').AccessList;
1621
+ authorizationList?: import('viem').AuthorizationList;
1622
+ chain?: import('viem').Chain | null;
1623
+ dataSuffix?: `0x${string}`;
1624
+ gas?: bigint;
1625
+ gasPrice?: bigint;
1626
+ maxFeePerGas?: bigint;
1627
+ maxPriorityFeePerGas?: bigint;
1628
+ nonce?: number;
1629
+ value?: bigint;
1630
+ }): Promise<void> {
1631
+ return contract.simulate.disableModule([prevModule, module] as const, options) as Promise<void>;
1632
+ },
1633
+ /**
1634
+ * Simulate enableModule
1635
+ * Returns gas estimate and result without sending transaction
1636
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1637
+ */
1638
+ async enableModule(module: `0x${string}`, options?: {
1639
+ accessList?: import('viem').AccessList;
1640
+ authorizationList?: import('viem').AuthorizationList;
1641
+ chain?: import('viem').Chain | null;
1642
+ dataSuffix?: `0x${string}`;
1643
+ gas?: bigint;
1644
+ gasPrice?: bigint;
1645
+ maxFeePerGas?: bigint;
1646
+ maxPriorityFeePerGas?: bigint;
1647
+ nonce?: number;
1648
+ value?: bigint;
1649
+ }): Promise<void> {
1650
+ return contract.simulate.enableModule([module] as const, options) as Promise<void>;
1651
+ },
1652
+ /**
1653
+ * Simulate execTransaction
1654
+ * Returns gas estimate and result without sending transaction
1655
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1656
+ */
1657
+ 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?: {
1658
+ accessList?: import('viem').AccessList;
1659
+ authorizationList?: import('viem').AuthorizationList;
1660
+ chain?: import('viem').Chain | null;
1661
+ dataSuffix?: `0x${string}`;
1662
+ gas?: bigint;
1663
+ gasPrice?: bigint;
1664
+ maxFeePerGas?: bigint;
1665
+ maxPriorityFeePerGas?: bigint;
1666
+ nonce?: number;
1667
+ value?: bigint;
1668
+ }): Promise<boolean> {
1669
+ return contract.simulate.execTransaction([to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures] as const, options) as Promise<boolean>;
1670
+ },
1671
+ /**
1672
+ * Simulate execTransactionFromModule
1673
+ * Returns gas estimate and result without sending transaction
1674
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1675
+ */
1676
+ async execTransactionFromModule(to: `0x${string}`, value: bigint, data: `0x${string}`, operation: bigint, options?: {
1677
+ accessList?: import('viem').AccessList;
1678
+ authorizationList?: import('viem').AuthorizationList;
1679
+ chain?: import('viem').Chain | null;
1680
+ dataSuffix?: `0x${string}`;
1681
+ gas?: bigint;
1682
+ gasPrice?: bigint;
1683
+ maxFeePerGas?: bigint;
1684
+ maxPriorityFeePerGas?: bigint;
1685
+ nonce?: number;
1686
+ value?: bigint;
1687
+ }): Promise<boolean> {
1688
+ return contract.simulate.execTransactionFromModule([to, value, data, operation] as const, options) as Promise<boolean>;
1689
+ },
1690
+ /**
1691
+ * Simulate execTransactionFromModuleReturnData
1692
+ * Returns gas estimate and result without sending transaction
1693
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1694
+ */
1695
+ async execTransactionFromModuleReturnData(to: `0x${string}`, value: bigint, data: `0x${string}`, operation: bigint, options?: {
1696
+ accessList?: import('viem').AccessList;
1697
+ authorizationList?: import('viem').AuthorizationList;
1698
+ chain?: import('viem').Chain | null;
1699
+ dataSuffix?: `0x${string}`;
1700
+ gas?: bigint;
1701
+ gasPrice?: bigint;
1702
+ maxFeePerGas?: bigint;
1703
+ maxPriorityFeePerGas?: bigint;
1704
+ nonce?: number;
1705
+ value?: bigint;
1706
+ }): Promise<[boolean, `0x${string}`]> {
1707
+ return contract.simulate.execTransactionFromModuleReturnData([to, value, data, operation] as const, options) as Promise<[boolean, `0x${string}`]>;
1708
+ },
1709
+ /**
1710
+ * Simulate removeOwner
1711
+ * Returns gas estimate and result without sending transaction
1712
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1713
+ */
1714
+ async removeOwner(prevOwner: `0x${string}`, owner: `0x${string}`, _threshold: bigint, options?: {
1715
+ accessList?: import('viem').AccessList;
1716
+ authorizationList?: import('viem').AuthorizationList;
1717
+ chain?: import('viem').Chain | null;
1718
+ dataSuffix?: `0x${string}`;
1719
+ gas?: bigint;
1720
+ gasPrice?: bigint;
1721
+ maxFeePerGas?: bigint;
1722
+ maxPriorityFeePerGas?: bigint;
1723
+ nonce?: number;
1724
+ value?: bigint;
1725
+ }): Promise<void> {
1726
+ return contract.simulate.removeOwner([prevOwner, owner, _threshold] as const, options) as Promise<void>;
1727
+ },
1728
+ /**
1729
+ * Simulate setFallbackHandler
1730
+ * Returns gas estimate and result without sending transaction
1731
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1732
+ */
1733
+ async setFallbackHandler(handler: `0x${string}`, options?: {
1734
+ accessList?: import('viem').AccessList;
1735
+ authorizationList?: import('viem').AuthorizationList;
1736
+ chain?: import('viem').Chain | null;
1737
+ dataSuffix?: `0x${string}`;
1738
+ gas?: bigint;
1739
+ gasPrice?: bigint;
1740
+ maxFeePerGas?: bigint;
1741
+ maxPriorityFeePerGas?: bigint;
1742
+ nonce?: number;
1743
+ value?: bigint;
1744
+ }): Promise<void> {
1745
+ return contract.simulate.setFallbackHandler([handler] as const, options) as Promise<void>;
1746
+ },
1747
+ /**
1748
+ * Simulate setGuard
1749
+ * Returns gas estimate and result without sending transaction
1750
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1751
+ */
1752
+ async setGuard(guard: `0x${string}`, options?: {
1753
+ accessList?: import('viem').AccessList;
1754
+ authorizationList?: import('viem').AuthorizationList;
1755
+ chain?: import('viem').Chain | null;
1756
+ dataSuffix?: `0x${string}`;
1757
+ gas?: bigint;
1758
+ gasPrice?: bigint;
1759
+ maxFeePerGas?: bigint;
1760
+ maxPriorityFeePerGas?: bigint;
1761
+ nonce?: number;
1762
+ value?: bigint;
1763
+ }): Promise<void> {
1764
+ return contract.simulate.setGuard([guard] as const, options) as Promise<void>;
1765
+ },
1766
+ /**
1767
+ * Simulate setup
1768
+ * Returns gas estimate and result without sending transaction
1769
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1770
+ */
1771
+ 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?: {
1772
+ accessList?: import('viem').AccessList;
1773
+ authorizationList?: import('viem').AuthorizationList;
1774
+ chain?: import('viem').Chain | null;
1775
+ dataSuffix?: `0x${string}`;
1776
+ gas?: bigint;
1777
+ gasPrice?: bigint;
1778
+ maxFeePerGas?: bigint;
1779
+ maxPriorityFeePerGas?: bigint;
1780
+ nonce?: number;
1781
+ value?: bigint;
1782
+ }): Promise<void> {
1783
+ return contract.simulate.setup([_owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver] as const, options) as Promise<void>;
1784
+ },
1785
+ /**
1786
+ * Simulate simulateAndRevert
1787
+ * Returns gas estimate and result without sending transaction
1788
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1789
+ */
1790
+ async simulateAndRevert(targetContract: `0x${string}`, calldataPayload: `0x${string}`, options?: {
1791
+ accessList?: import('viem').AccessList;
1792
+ authorizationList?: import('viem').AuthorizationList;
1793
+ chain?: import('viem').Chain | null;
1794
+ dataSuffix?: `0x${string}`;
1795
+ gas?: bigint;
1796
+ gasPrice?: bigint;
1797
+ maxFeePerGas?: bigint;
1798
+ maxPriorityFeePerGas?: bigint;
1799
+ nonce?: number;
1800
+ value?: bigint;
1801
+ }): Promise<void> {
1802
+ return contract.simulate.simulateAndRevert([targetContract, calldataPayload] as const, options) as Promise<void>;
1803
+ },
1804
+ /**
1805
+ * Simulate swapOwner
1806
+ * Returns gas estimate and result without sending transaction
1807
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1808
+ */
1809
+ async swapOwner(prevOwner: `0x${string}`, oldOwner: `0x${string}`, newOwner: `0x${string}`, options?: {
1810
+ accessList?: import('viem').AccessList;
1811
+ authorizationList?: import('viem').AuthorizationList;
1812
+ chain?: import('viem').Chain | null;
1813
+ dataSuffix?: `0x${string}`;
1814
+ gas?: bigint;
1815
+ gasPrice?: bigint;
1816
+ maxFeePerGas?: bigint;
1817
+ maxPriorityFeePerGas?: bigint;
1818
+ nonce?: number;
1819
+ value?: bigint;
1820
+ }): Promise<void> {
1821
+ return contract.simulate.swapOwner([prevOwner, oldOwner, newOwner] as const, options) as Promise<void>;
1822
+ }
1823
+ };
1824
+ }
1825
+
1826
+ /**
1827
+ * Watch contract events
1828
+ *
1829
+ * @example
1830
+ * // Watch all Transfer events
1831
+ * const unwatch = contract.watch.Transfer((event) => {
1832
+ * console.log('Transfer:', event);
1833
+ * });
1834
+ *
1835
+ * // Stop watching
1836
+ * unwatch();
1837
+ */
1838
+ get watch() {
1839
+ return {
1840
+ /**
1841
+ * Watch AddedOwner events
1842
+ * @param callback Function to call when event is emitted
1843
+ * @param filter Optional filter for indexed parameters
1844
+ * @returns Unwatch function to stop listening
1845
+ */
1846
+ AddedOwner: (callback: (event: { owner: `0x${string}` }) => void, filter?: { owner: `0x${string}` }) => {
1847
+ return this.publicClient.watchContractEvent({
1848
+ address: this.contractAddress,
1849
+ abi: Safe_jsonAbi,
1850
+ eventName: 'AddedOwner',
1851
+ args: filter,
1852
+ onLogs: (logs: any[]) => {
1853
+ logs.forEach((log: any) => {
1854
+ callback(log.args as any);
1855
+ });
1856
+ },
1857
+ }) as () => void;
1858
+ },
1859
+ /**
1860
+ * Watch ApproveHash events
1861
+ * @param callback Function to call when event is emitted
1862
+ * @param filter Optional filter for indexed parameters
1863
+ * @returns Unwatch function to stop listening
1864
+ */
1865
+ ApproveHash: (callback: (event: { approvedHash: `0x${string}`; owner: `0x${string}` }) => void, filter?: { approvedHash: `0x${string}`; owner: `0x${string}` }) => {
1866
+ return this.publicClient.watchContractEvent({
1867
+ address: this.contractAddress,
1868
+ abi: Safe_jsonAbi,
1869
+ eventName: 'ApproveHash',
1870
+ args: filter,
1871
+ onLogs: (logs: any[]) => {
1872
+ logs.forEach((log: any) => {
1873
+ callback(log.args as any);
1874
+ });
1875
+ },
1876
+ }) as () => void;
1877
+ },
1878
+ /**
1879
+ * Watch ChangedFallbackHandler events
1880
+ * @param callback Function to call when event is emitted
1881
+ * @param filter Optional filter for indexed parameters
1882
+ * @returns Unwatch function to stop listening
1883
+ */
1884
+ ChangedFallbackHandler: (callback: (event: { handler: `0x${string}` }) => void, filter?: { handler: `0x${string}` }) => {
1885
+ return this.publicClient.watchContractEvent({
1886
+ address: this.contractAddress,
1887
+ abi: Safe_jsonAbi,
1888
+ eventName: 'ChangedFallbackHandler',
1889
+ args: filter,
1890
+ onLogs: (logs: any[]) => {
1891
+ logs.forEach((log: any) => {
1892
+ callback(log.args as any);
1893
+ });
1894
+ },
1895
+ }) as () => void;
1896
+ },
1897
+ /**
1898
+ * Watch ChangedGuard events
1899
+ * @param callback Function to call when event is emitted
1900
+ * @param filter Optional filter for indexed parameters
1901
+ * @returns Unwatch function to stop listening
1902
+ */
1903
+ ChangedGuard: (callback: (event: { guard: `0x${string}` }) => void, filter?: { guard: `0x${string}` }) => {
1904
+ return this.publicClient.watchContractEvent({
1905
+ address: this.contractAddress,
1906
+ abi: Safe_jsonAbi,
1907
+ eventName: 'ChangedGuard',
1908
+ args: filter,
1909
+ onLogs: (logs: any[]) => {
1910
+ logs.forEach((log: any) => {
1911
+ callback(log.args as any);
1912
+ });
1913
+ },
1914
+ }) as () => void;
1915
+ },
1916
+ /**
1917
+ * Watch ChangedThreshold events
1918
+ * @param callback Function to call when event is emitted
1919
+ * @param filter Optional filter for indexed parameters
1920
+ * @returns Unwatch function to stop listening
1921
+ */
1922
+ ChangedThreshold: (callback: (event: { threshold: bigint }) => void) => {
1923
+ return this.publicClient.watchContractEvent({
1924
+ address: this.contractAddress,
1925
+ abi: Safe_jsonAbi,
1926
+ eventName: 'ChangedThreshold',
1927
+
1928
+ onLogs: (logs: any[]) => {
1929
+ logs.forEach((log: any) => {
1930
+ callback(log.args as any);
1931
+ });
1932
+ },
1933
+ }) as () => void;
1934
+ },
1935
+ /**
1936
+ * Watch DisabledModule events
1937
+ * @param callback Function to call when event is emitted
1938
+ * @param filter Optional filter for indexed parameters
1939
+ * @returns Unwatch function to stop listening
1940
+ */
1941
+ DisabledModule: (callback: (event: { module: `0x${string}` }) => void, filter?: { module: `0x${string}` }) => {
1942
+ return this.publicClient.watchContractEvent({
1943
+ address: this.contractAddress,
1944
+ abi: Safe_jsonAbi,
1945
+ eventName: 'DisabledModule',
1946
+ args: filter,
1947
+ onLogs: (logs: any[]) => {
1948
+ logs.forEach((log: any) => {
1949
+ callback(log.args as any);
1950
+ });
1951
+ },
1952
+ }) as () => void;
1953
+ },
1954
+ /**
1955
+ * Watch EnabledModule events
1956
+ * @param callback Function to call when event is emitted
1957
+ * @param filter Optional filter for indexed parameters
1958
+ * @returns Unwatch function to stop listening
1959
+ */
1960
+ EnabledModule: (callback: (event: { module: `0x${string}` }) => void, filter?: { module: `0x${string}` }) => {
1961
+ return this.publicClient.watchContractEvent({
1962
+ address: this.contractAddress,
1963
+ abi: Safe_jsonAbi,
1964
+ eventName: 'EnabledModule',
1965
+ args: filter,
1966
+ onLogs: (logs: any[]) => {
1967
+ logs.forEach((log: any) => {
1968
+ callback(log.args as any);
1969
+ });
1970
+ },
1971
+ }) as () => void;
1972
+ },
1973
+ /**
1974
+ * Watch ExecutionFailure events
1975
+ * @param callback Function to call when event is emitted
1976
+ * @param filter Optional filter for indexed parameters
1977
+ * @returns Unwatch function to stop listening
1978
+ */
1979
+ ExecutionFailure: (callback: (event: { txHash: `0x${string}`; payment: bigint }) => void, filter?: { txHash: `0x${string}` }) => {
1980
+ return this.publicClient.watchContractEvent({
1981
+ address: this.contractAddress,
1982
+ abi: Safe_jsonAbi,
1983
+ eventName: 'ExecutionFailure',
1984
+ args: filter,
1985
+ onLogs: (logs: any[]) => {
1986
+ logs.forEach((log: any) => {
1987
+ callback(log.args as any);
1988
+ });
1989
+ },
1990
+ }) as () => void;
1991
+ },
1992
+ /**
1993
+ * Watch ExecutionFromModuleFailure events
1994
+ * @param callback Function to call when event is emitted
1995
+ * @param filter Optional filter for indexed parameters
1996
+ * @returns Unwatch function to stop listening
1997
+ */
1998
+ ExecutionFromModuleFailure: (callback: (event: { module: `0x${string}` }) => void, filter?: { module: `0x${string}` }) => {
1999
+ return this.publicClient.watchContractEvent({
2000
+ address: this.contractAddress,
2001
+ abi: Safe_jsonAbi,
2002
+ eventName: 'ExecutionFromModuleFailure',
2003
+ args: filter,
2004
+ onLogs: (logs: any[]) => {
2005
+ logs.forEach((log: any) => {
2006
+ callback(log.args as any);
2007
+ });
2008
+ },
2009
+ }) as () => void;
2010
+ },
2011
+ /**
2012
+ * Watch ExecutionFromModuleSuccess events
2013
+ * @param callback Function to call when event is emitted
2014
+ * @param filter Optional filter for indexed parameters
2015
+ * @returns Unwatch function to stop listening
2016
+ */
2017
+ ExecutionFromModuleSuccess: (callback: (event: { module: `0x${string}` }) => void, filter?: { module: `0x${string}` }) => {
2018
+ return this.publicClient.watchContractEvent({
2019
+ address: this.contractAddress,
2020
+ abi: Safe_jsonAbi,
2021
+ eventName: 'ExecutionFromModuleSuccess',
2022
+ args: filter,
2023
+ onLogs: (logs: any[]) => {
2024
+ logs.forEach((log: any) => {
2025
+ callback(log.args as any);
2026
+ });
2027
+ },
2028
+ }) as () => void;
2029
+ },
2030
+ /**
2031
+ * Watch ExecutionSuccess events
2032
+ * @param callback Function to call when event is emitted
2033
+ * @param filter Optional filter for indexed parameters
2034
+ * @returns Unwatch function to stop listening
2035
+ */
2036
+ ExecutionSuccess: (callback: (event: { txHash: `0x${string}`; payment: bigint }) => void, filter?: { txHash: `0x${string}` }) => {
2037
+ return this.publicClient.watchContractEvent({
2038
+ address: this.contractAddress,
2039
+ abi: Safe_jsonAbi,
2040
+ eventName: 'ExecutionSuccess',
2041
+ args: filter,
2042
+ onLogs: (logs: any[]) => {
2043
+ logs.forEach((log: any) => {
2044
+ callback(log.args as any);
2045
+ });
2046
+ },
2047
+ }) as () => void;
2048
+ },
2049
+ /**
2050
+ * Watch RemovedOwner events
2051
+ * @param callback Function to call when event is emitted
2052
+ * @param filter Optional filter for indexed parameters
2053
+ * @returns Unwatch function to stop listening
2054
+ */
2055
+ RemovedOwner: (callback: (event: { owner: `0x${string}` }) => void, filter?: { owner: `0x${string}` }) => {
2056
+ return this.publicClient.watchContractEvent({
2057
+ address: this.contractAddress,
2058
+ abi: Safe_jsonAbi,
2059
+ eventName: 'RemovedOwner',
2060
+ args: filter,
2061
+ onLogs: (logs: any[]) => {
2062
+ logs.forEach((log: any) => {
2063
+ callback(log.args as any);
2064
+ });
2065
+ },
2066
+ }) as () => void;
2067
+ },
2068
+ /**
2069
+ * Watch SafeReceived events
2070
+ * @param callback Function to call when event is emitted
2071
+ * @param filter Optional filter for indexed parameters
2072
+ * @returns Unwatch function to stop listening
2073
+ */
2074
+ SafeReceived: (callback: (event: { sender: `0x${string}`; value: bigint }) => void, filter?: { sender: `0x${string}` }) => {
2075
+ return this.publicClient.watchContractEvent({
2076
+ address: this.contractAddress,
2077
+ abi: Safe_jsonAbi,
2078
+ eventName: 'SafeReceived',
2079
+ args: filter,
2080
+ onLogs: (logs: any[]) => {
2081
+ logs.forEach((log: any) => {
2082
+ callback(log.args as any);
2083
+ });
2084
+ },
2085
+ }) as () => void;
2086
+ },
2087
+ /**
2088
+ * Watch SafeSetup events
2089
+ * @param callback Function to call when event is emitted
2090
+ * @param filter Optional filter for indexed parameters
2091
+ * @returns Unwatch function to stop listening
2092
+ */
2093
+ SafeSetup: (callback: (event: { initiator: `0x${string}`; owners: `0x${string}`[]; threshold: bigint; initializer: `0x${string}`; fallbackHandler: `0x${string}` }) => void, filter?: { initiator: `0x${string}` }) => {
2094
+ return this.publicClient.watchContractEvent({
2095
+ address: this.contractAddress,
2096
+ abi: Safe_jsonAbi,
2097
+ eventName: 'SafeSetup',
2098
+ args: filter,
2099
+ onLogs: (logs: any[]) => {
2100
+ logs.forEach((log: any) => {
2101
+ callback(log.args as any);
2102
+ });
2103
+ },
2104
+ }) as () => void;
2105
+ },
2106
+ /**
2107
+ * Watch SignMsg events
2108
+ * @param callback Function to call when event is emitted
2109
+ * @param filter Optional filter for indexed parameters
2110
+ * @returns Unwatch function to stop listening
2111
+ */
2112
+ SignMsg: (callback: (event: { msgHash: `0x${string}` }) => void, filter?: { msgHash: `0x${string}` }) => {
2113
+ return this.publicClient.watchContractEvent({
2114
+ address: this.contractAddress,
2115
+ abi: Safe_jsonAbi,
2116
+ eventName: 'SignMsg',
2117
+ args: filter,
2118
+ onLogs: (logs: any[]) => {
2119
+ logs.forEach((log: any) => {
2120
+ callback(log.args as any);
2121
+ });
2122
+ },
2123
+ }) as () => void;
2124
+ }
2125
+ };
2126
+ }
2127
+ }