@gitmyabi-stg/srusde 0.0.1

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,3078 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * Tranche ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TrancheAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "account",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "bytes32",
19
+ "name": "neededRole",
20
+ "type": "bytes32"
21
+ }
22
+ ],
23
+ "name": "AccessControlUnauthorizedAccount",
24
+ "type": "error"
25
+ },
26
+ {
27
+ "inputs": [],
28
+ "name": "AlreadyConfigured",
29
+ "type": "error"
30
+ },
31
+ {
32
+ "inputs": [
33
+ {
34
+ "internalType": "address",
35
+ "name": "tranche",
36
+ "type": "address"
37
+ }
38
+ ],
39
+ "name": "DepositCapReached",
40
+ "type": "error"
41
+ },
42
+ {
43
+ "inputs": [
44
+ {
45
+ "internalType": "address",
46
+ "name": "tranche",
47
+ "type": "address"
48
+ }
49
+ ],
50
+ "name": "DepositsDisabled",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [],
55
+ "name": "ECDSAInvalidSignature",
56
+ "type": "error"
57
+ },
58
+ {
59
+ "inputs": [
60
+ {
61
+ "internalType": "uint256",
62
+ "name": "length",
63
+ "type": "uint256"
64
+ }
65
+ ],
66
+ "name": "ECDSAInvalidSignatureLength",
67
+ "type": "error"
68
+ },
69
+ {
70
+ "inputs": [
71
+ {
72
+ "internalType": "bytes32",
73
+ "name": "s",
74
+ "type": "bytes32"
75
+ }
76
+ ],
77
+ "name": "ECDSAInvalidSignatureS",
78
+ "type": "error"
79
+ },
80
+ {
81
+ "inputs": [
82
+ {
83
+ "internalType": "address",
84
+ "name": "spender",
85
+ "type": "address"
86
+ },
87
+ {
88
+ "internalType": "uint256",
89
+ "name": "allowance",
90
+ "type": "uint256"
91
+ },
92
+ {
93
+ "internalType": "uint256",
94
+ "name": "needed",
95
+ "type": "uint256"
96
+ }
97
+ ],
98
+ "name": "ERC20InsufficientAllowance",
99
+ "type": "error"
100
+ },
101
+ {
102
+ "inputs": [
103
+ {
104
+ "internalType": "address",
105
+ "name": "sender",
106
+ "type": "address"
107
+ },
108
+ {
109
+ "internalType": "uint256",
110
+ "name": "balance",
111
+ "type": "uint256"
112
+ },
113
+ {
114
+ "internalType": "uint256",
115
+ "name": "needed",
116
+ "type": "uint256"
117
+ }
118
+ ],
119
+ "name": "ERC20InsufficientBalance",
120
+ "type": "error"
121
+ },
122
+ {
123
+ "inputs": [
124
+ {
125
+ "internalType": "address",
126
+ "name": "approver",
127
+ "type": "address"
128
+ }
129
+ ],
130
+ "name": "ERC20InvalidApprover",
131
+ "type": "error"
132
+ },
133
+ {
134
+ "inputs": [
135
+ {
136
+ "internalType": "address",
137
+ "name": "receiver",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "name": "ERC20InvalidReceiver",
142
+ "type": "error"
143
+ },
144
+ {
145
+ "inputs": [
146
+ {
147
+ "internalType": "address",
148
+ "name": "sender",
149
+ "type": "address"
150
+ }
151
+ ],
152
+ "name": "ERC20InvalidSender",
153
+ "type": "error"
154
+ },
155
+ {
156
+ "inputs": [
157
+ {
158
+ "internalType": "address",
159
+ "name": "spender",
160
+ "type": "address"
161
+ }
162
+ ],
163
+ "name": "ERC20InvalidSpender",
164
+ "type": "error"
165
+ },
166
+ {
167
+ "inputs": [
168
+ {
169
+ "internalType": "uint256",
170
+ "name": "deadline",
171
+ "type": "uint256"
172
+ }
173
+ ],
174
+ "name": "ERC2612ExpiredSignature",
175
+ "type": "error"
176
+ },
177
+ {
178
+ "inputs": [
179
+ {
180
+ "internalType": "address",
181
+ "name": "signer",
182
+ "type": "address"
183
+ },
184
+ {
185
+ "internalType": "address",
186
+ "name": "owner",
187
+ "type": "address"
188
+ }
189
+ ],
190
+ "name": "ERC2612InvalidSigner",
191
+ "type": "error"
192
+ },
193
+ {
194
+ "inputs": [
195
+ {
196
+ "internalType": "address",
197
+ "name": "receiver",
198
+ "type": "address"
199
+ },
200
+ {
201
+ "internalType": "uint256",
202
+ "name": "assets",
203
+ "type": "uint256"
204
+ },
205
+ {
206
+ "internalType": "uint256",
207
+ "name": "max",
208
+ "type": "uint256"
209
+ }
210
+ ],
211
+ "name": "ERC4626ExceededMaxDeposit",
212
+ "type": "error"
213
+ },
214
+ {
215
+ "inputs": [
216
+ {
217
+ "internalType": "address",
218
+ "name": "receiver",
219
+ "type": "address"
220
+ },
221
+ {
222
+ "internalType": "uint256",
223
+ "name": "shares",
224
+ "type": "uint256"
225
+ },
226
+ {
227
+ "internalType": "uint256",
228
+ "name": "max",
229
+ "type": "uint256"
230
+ }
231
+ ],
232
+ "name": "ERC4626ExceededMaxMint",
233
+ "type": "error"
234
+ },
235
+ {
236
+ "inputs": [
237
+ {
238
+ "internalType": "address",
239
+ "name": "owner",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "internalType": "uint256",
244
+ "name": "shares",
245
+ "type": "uint256"
246
+ },
247
+ {
248
+ "internalType": "uint256",
249
+ "name": "max",
250
+ "type": "uint256"
251
+ }
252
+ ],
253
+ "name": "ERC4626ExceededMaxRedeem",
254
+ "type": "error"
255
+ },
256
+ {
257
+ "inputs": [
258
+ {
259
+ "internalType": "address",
260
+ "name": "owner",
261
+ "type": "address"
262
+ },
263
+ {
264
+ "internalType": "uint256",
265
+ "name": "assets",
266
+ "type": "uint256"
267
+ },
268
+ {
269
+ "internalType": "uint256",
270
+ "name": "max",
271
+ "type": "uint256"
272
+ }
273
+ ],
274
+ "name": "ERC4626ExceededMaxWithdraw",
275
+ "type": "error"
276
+ },
277
+ {
278
+ "inputs": [
279
+ {
280
+ "internalType": "address",
281
+ "name": "account",
282
+ "type": "address"
283
+ },
284
+ {
285
+ "internalType": "uint256",
286
+ "name": "currentNonce",
287
+ "type": "uint256"
288
+ }
289
+ ],
290
+ "name": "InvalidAccountNonce",
291
+ "type": "error"
292
+ },
293
+ {
294
+ "inputs": [
295
+ {
296
+ "internalType": "address",
297
+ "name": "caller",
298
+ "type": "address"
299
+ }
300
+ ],
301
+ "name": "InvalidCaller",
302
+ "type": "error"
303
+ },
304
+ {
305
+ "inputs": [],
306
+ "name": "InvalidConfigCooldown",
307
+ "type": "error"
308
+ },
309
+ {
310
+ "inputs": [],
311
+ "name": "InvalidInitialization",
312
+ "type": "error"
313
+ },
314
+ {
315
+ "inputs": [
316
+ {
317
+ "internalType": "address",
318
+ "name": "tranche",
319
+ "type": "address"
320
+ }
321
+ ],
322
+ "name": "InvalidTranche",
323
+ "type": "error"
324
+ },
325
+ {
326
+ "inputs": [],
327
+ "name": "MinSharesViolation",
328
+ "type": "error"
329
+ },
330
+ {
331
+ "inputs": [],
332
+ "name": "NotInitializing",
333
+ "type": "error"
334
+ },
335
+ {
336
+ "inputs": [
337
+ {
338
+ "internalType": "address",
339
+ "name": "owner",
340
+ "type": "address"
341
+ }
342
+ ],
343
+ "name": "OwnableInvalidOwner",
344
+ "type": "error"
345
+ },
346
+ {
347
+ "inputs": [
348
+ {
349
+ "internalType": "address",
350
+ "name": "account",
351
+ "type": "address"
352
+ }
353
+ ],
354
+ "name": "OwnableUnauthorizedAccount",
355
+ "type": "error"
356
+ },
357
+ {
358
+ "inputs": [],
359
+ "name": "ReentrancyGuardReentrantCall",
360
+ "type": "error"
361
+ },
362
+ {
363
+ "inputs": [
364
+ {
365
+ "internalType": "address",
366
+ "name": "token",
367
+ "type": "address"
368
+ }
369
+ ],
370
+ "name": "SafeERC20FailedOperation",
371
+ "type": "error"
372
+ },
373
+ {
374
+ "inputs": [
375
+ {
376
+ "internalType": "address",
377
+ "name": "sender",
378
+ "type": "address"
379
+ },
380
+ {
381
+ "internalType": "address",
382
+ "name": "calledContract",
383
+ "type": "address"
384
+ },
385
+ {
386
+ "internalType": "bytes4",
387
+ "name": "sel",
388
+ "type": "bytes4"
389
+ }
390
+ ],
391
+ "name": "Unauthorized",
392
+ "type": "error"
393
+ },
394
+ {
395
+ "inputs": [
396
+ {
397
+ "internalType": "address",
398
+ "name": "token",
399
+ "type": "address"
400
+ }
401
+ ],
402
+ "name": "UnsupportedToken",
403
+ "type": "error"
404
+ },
405
+ {
406
+ "inputs": [
407
+ {
408
+ "internalType": "address",
409
+ "name": "tranche",
410
+ "type": "address"
411
+ }
412
+ ],
413
+ "name": "WithdrawalCapReached",
414
+ "type": "error"
415
+ },
416
+ {
417
+ "inputs": [
418
+ {
419
+ "internalType": "address",
420
+ "name": "tranche",
421
+ "type": "address"
422
+ }
423
+ ],
424
+ "name": "WithdrawalsDisabled",
425
+ "type": "error"
426
+ },
427
+ {
428
+ "inputs": [],
429
+ "name": "ZeroAddress",
430
+ "type": "error"
431
+ },
432
+ {
433
+ "inputs": [],
434
+ "name": "ZeroAmount",
435
+ "type": "error"
436
+ },
437
+ {
438
+ "anonymous": false,
439
+ "inputs": [
440
+ {
441
+ "indexed": true,
442
+ "internalType": "address",
443
+ "name": "owner",
444
+ "type": "address"
445
+ },
446
+ {
447
+ "indexed": true,
448
+ "internalType": "address",
449
+ "name": "spender",
450
+ "type": "address"
451
+ },
452
+ {
453
+ "indexed": false,
454
+ "internalType": "uint256",
455
+ "name": "value",
456
+ "type": "uint256"
457
+ }
458
+ ],
459
+ "name": "Approval",
460
+ "type": "event"
461
+ },
462
+ {
463
+ "anonymous": false,
464
+ "inputs": [
465
+ {
466
+ "indexed": true,
467
+ "internalType": "address",
468
+ "name": "sender",
469
+ "type": "address"
470
+ },
471
+ {
472
+ "indexed": true,
473
+ "internalType": "address",
474
+ "name": "owner",
475
+ "type": "address"
476
+ },
477
+ {
478
+ "indexed": false,
479
+ "internalType": "uint256",
480
+ "name": "assets",
481
+ "type": "uint256"
482
+ },
483
+ {
484
+ "indexed": false,
485
+ "internalType": "uint256",
486
+ "name": "shares",
487
+ "type": "uint256"
488
+ }
489
+ ],
490
+ "name": "Deposit",
491
+ "type": "event"
492
+ },
493
+ {
494
+ "anonymous": false,
495
+ "inputs": [],
496
+ "name": "EIP712DomainChanged",
497
+ "type": "event"
498
+ },
499
+ {
500
+ "anonymous": false,
501
+ "inputs": [
502
+ {
503
+ "indexed": false,
504
+ "internalType": "uint64",
505
+ "name": "version",
506
+ "type": "uint64"
507
+ }
508
+ ],
509
+ "name": "Initialized",
510
+ "type": "event"
511
+ },
512
+ {
513
+ "anonymous": false,
514
+ "inputs": [
515
+ {
516
+ "indexed": false,
517
+ "internalType": "address",
518
+ "name": "accessControlManager",
519
+ "type": "address"
520
+ }
521
+ ],
522
+ "name": "NewAccessControlManager",
523
+ "type": "event"
524
+ },
525
+ {
526
+ "anonymous": false,
527
+ "inputs": [
528
+ {
529
+ "indexed": false,
530
+ "internalType": "address",
531
+ "name": "twoStepConfigManager",
532
+ "type": "address"
533
+ }
534
+ ],
535
+ "name": "NewTwoStepConfigManager",
536
+ "type": "event"
537
+ },
538
+ {
539
+ "anonymous": false,
540
+ "inputs": [
541
+ {
542
+ "indexed": true,
543
+ "internalType": "address",
544
+ "name": "owner",
545
+ "type": "address"
546
+ },
547
+ {
548
+ "indexed": true,
549
+ "internalType": "address",
550
+ "name": "token",
551
+ "type": "address"
552
+ },
553
+ {
554
+ "indexed": false,
555
+ "internalType": "uint256",
556
+ "name": "tokenAssets",
557
+ "type": "uint256"
558
+ },
559
+ {
560
+ "indexed": false,
561
+ "internalType": "uint256",
562
+ "name": "shares",
563
+ "type": "uint256"
564
+ }
565
+ ],
566
+ "name": "OnMetaDeposit",
567
+ "type": "event"
568
+ },
569
+ {
570
+ "anonymous": false,
571
+ "inputs": [
572
+ {
573
+ "indexed": true,
574
+ "internalType": "address",
575
+ "name": "owner",
576
+ "type": "address"
577
+ },
578
+ {
579
+ "indexed": true,
580
+ "internalType": "address",
581
+ "name": "token",
582
+ "type": "address"
583
+ },
584
+ {
585
+ "indexed": false,
586
+ "internalType": "uint256",
587
+ "name": "tokenAssets",
588
+ "type": "uint256"
589
+ },
590
+ {
591
+ "indexed": false,
592
+ "internalType": "uint256",
593
+ "name": "shares",
594
+ "type": "uint256"
595
+ }
596
+ ],
597
+ "name": "OnMetaWithdraw",
598
+ "type": "event"
599
+ },
600
+ {
601
+ "anonymous": false,
602
+ "inputs": [
603
+ {
604
+ "indexed": true,
605
+ "internalType": "address",
606
+ "name": "previousOwner",
607
+ "type": "address"
608
+ },
609
+ {
610
+ "indexed": true,
611
+ "internalType": "address",
612
+ "name": "newOwner",
613
+ "type": "address"
614
+ }
615
+ ],
616
+ "name": "OwnershipTransferStarted",
617
+ "type": "event"
618
+ },
619
+ {
620
+ "anonymous": false,
621
+ "inputs": [
622
+ {
623
+ "indexed": true,
624
+ "internalType": "address",
625
+ "name": "previousOwner",
626
+ "type": "address"
627
+ },
628
+ {
629
+ "indexed": true,
630
+ "internalType": "address",
631
+ "name": "newOwner",
632
+ "type": "address"
633
+ }
634
+ ],
635
+ "name": "OwnershipTransferred",
636
+ "type": "event"
637
+ },
638
+ {
639
+ "anonymous": false,
640
+ "inputs": [
641
+ {
642
+ "indexed": true,
643
+ "internalType": "address",
644
+ "name": "from",
645
+ "type": "address"
646
+ },
647
+ {
648
+ "indexed": true,
649
+ "internalType": "address",
650
+ "name": "to",
651
+ "type": "address"
652
+ },
653
+ {
654
+ "indexed": false,
655
+ "internalType": "uint256",
656
+ "name": "value",
657
+ "type": "uint256"
658
+ }
659
+ ],
660
+ "name": "Transfer",
661
+ "type": "event"
662
+ },
663
+ {
664
+ "anonymous": false,
665
+ "inputs": [
666
+ {
667
+ "indexed": true,
668
+ "internalType": "address",
669
+ "name": "sender",
670
+ "type": "address"
671
+ },
672
+ {
673
+ "indexed": true,
674
+ "internalType": "address",
675
+ "name": "receiver",
676
+ "type": "address"
677
+ },
678
+ {
679
+ "indexed": true,
680
+ "internalType": "address",
681
+ "name": "owner",
682
+ "type": "address"
683
+ },
684
+ {
685
+ "indexed": false,
686
+ "internalType": "uint256",
687
+ "name": "assets",
688
+ "type": "uint256"
689
+ },
690
+ {
691
+ "indexed": false,
692
+ "internalType": "uint256",
693
+ "name": "shares",
694
+ "type": "uint256"
695
+ }
696
+ ],
697
+ "name": "Withdraw",
698
+ "type": "event"
699
+ },
700
+ {
701
+ "inputs": [],
702
+ "name": "COOLDOWN_WORKER_ROLE",
703
+ "outputs": [
704
+ {
705
+ "internalType": "bytes32",
706
+ "name": "",
707
+ "type": "bytes32"
708
+ }
709
+ ],
710
+ "stateMutability": "view",
711
+ "type": "function"
712
+ },
713
+ {
714
+ "inputs": [],
715
+ "name": "DOMAIN_SEPARATOR",
716
+ "outputs": [
717
+ {
718
+ "internalType": "bytes32",
719
+ "name": "",
720
+ "type": "bytes32"
721
+ }
722
+ ],
723
+ "stateMutability": "view",
724
+ "type": "function"
725
+ },
726
+ {
727
+ "inputs": [],
728
+ "name": "PAUSER_ROLE",
729
+ "outputs": [
730
+ {
731
+ "internalType": "bytes32",
732
+ "name": "",
733
+ "type": "bytes32"
734
+ }
735
+ ],
736
+ "stateMutability": "view",
737
+ "type": "function"
738
+ },
739
+ {
740
+ "inputs": [],
741
+ "name": "PROPOSER_CONFIG_ROLE",
742
+ "outputs": [
743
+ {
744
+ "internalType": "bytes32",
745
+ "name": "",
746
+ "type": "bytes32"
747
+ }
748
+ ],
749
+ "stateMutability": "view",
750
+ "type": "function"
751
+ },
752
+ {
753
+ "inputs": [],
754
+ "name": "RESERVE_MANAGER_ROLE",
755
+ "outputs": [
756
+ {
757
+ "internalType": "bytes32",
758
+ "name": "",
759
+ "type": "bytes32"
760
+ }
761
+ ],
762
+ "stateMutability": "view",
763
+ "type": "function"
764
+ },
765
+ {
766
+ "inputs": [],
767
+ "name": "UPDATER_CDO_APR_ROLE",
768
+ "outputs": [
769
+ {
770
+ "internalType": "bytes32",
771
+ "name": "",
772
+ "type": "bytes32"
773
+ }
774
+ ],
775
+ "stateMutability": "view",
776
+ "type": "function"
777
+ },
778
+ {
779
+ "inputs": [],
780
+ "name": "UPDATER_FEED_ROLE",
781
+ "outputs": [
782
+ {
783
+ "internalType": "bytes32",
784
+ "name": "",
785
+ "type": "bytes32"
786
+ }
787
+ ],
788
+ "stateMutability": "view",
789
+ "type": "function"
790
+ },
791
+ {
792
+ "inputs": [],
793
+ "name": "UPDATER_STRAT_CONFIG_ROLE",
794
+ "outputs": [
795
+ {
796
+ "internalType": "bytes32",
797
+ "name": "",
798
+ "type": "bytes32"
799
+ }
800
+ ],
801
+ "stateMutability": "view",
802
+ "type": "function"
803
+ },
804
+ {
805
+ "inputs": [],
806
+ "name": "acceptOwnership",
807
+ "outputs": [],
808
+ "stateMutability": "nonpayable",
809
+ "type": "function"
810
+ },
811
+ {
812
+ "inputs": [],
813
+ "name": "acm",
814
+ "outputs": [
815
+ {
816
+ "internalType": "contract IAccessControlManager",
817
+ "name": "",
818
+ "type": "address"
819
+ }
820
+ ],
821
+ "stateMutability": "view",
822
+ "type": "function"
823
+ },
824
+ {
825
+ "inputs": [
826
+ {
827
+ "internalType": "address",
828
+ "name": "owner",
829
+ "type": "address"
830
+ },
831
+ {
832
+ "internalType": "address",
833
+ "name": "spender",
834
+ "type": "address"
835
+ }
836
+ ],
837
+ "name": "allowance",
838
+ "outputs": [
839
+ {
840
+ "internalType": "uint256",
841
+ "name": "",
842
+ "type": "uint256"
843
+ }
844
+ ],
845
+ "stateMutability": "view",
846
+ "type": "function"
847
+ },
848
+ {
849
+ "inputs": [
850
+ {
851
+ "internalType": "address",
852
+ "name": "spender",
853
+ "type": "address"
854
+ },
855
+ {
856
+ "internalType": "uint256",
857
+ "name": "value",
858
+ "type": "uint256"
859
+ }
860
+ ],
861
+ "name": "approve",
862
+ "outputs": [
863
+ {
864
+ "internalType": "bool",
865
+ "name": "",
866
+ "type": "bool"
867
+ }
868
+ ],
869
+ "stateMutability": "nonpayable",
870
+ "type": "function"
871
+ },
872
+ {
873
+ "inputs": [],
874
+ "name": "asset",
875
+ "outputs": [
876
+ {
877
+ "internalType": "address",
878
+ "name": "",
879
+ "type": "address"
880
+ }
881
+ ],
882
+ "stateMutability": "view",
883
+ "type": "function"
884
+ },
885
+ {
886
+ "inputs": [
887
+ {
888
+ "internalType": "address",
889
+ "name": "account",
890
+ "type": "address"
891
+ }
892
+ ],
893
+ "name": "balanceOf",
894
+ "outputs": [
895
+ {
896
+ "internalType": "uint256",
897
+ "name": "",
898
+ "type": "uint256"
899
+ }
900
+ ],
901
+ "stateMutability": "view",
902
+ "type": "function"
903
+ },
904
+ {
905
+ "inputs": [],
906
+ "name": "cdo",
907
+ "outputs": [
908
+ {
909
+ "internalType": "contract IStrataCDO",
910
+ "name": "",
911
+ "type": "address"
912
+ }
913
+ ],
914
+ "stateMutability": "view",
915
+ "type": "function"
916
+ },
917
+ {
918
+ "inputs": [],
919
+ "name": "configure",
920
+ "outputs": [],
921
+ "stateMutability": "nonpayable",
922
+ "type": "function"
923
+ },
924
+ {
925
+ "inputs": [
926
+ {
927
+ "internalType": "uint256",
928
+ "name": "shares",
929
+ "type": "uint256"
930
+ }
931
+ ],
932
+ "name": "convertToAssets",
933
+ "outputs": [
934
+ {
935
+ "internalType": "uint256",
936
+ "name": "",
937
+ "type": "uint256"
938
+ }
939
+ ],
940
+ "stateMutability": "view",
941
+ "type": "function"
942
+ },
943
+ {
944
+ "inputs": [
945
+ {
946
+ "internalType": "uint256",
947
+ "name": "assets",
948
+ "type": "uint256"
949
+ }
950
+ ],
951
+ "name": "convertToShares",
952
+ "outputs": [
953
+ {
954
+ "internalType": "uint256",
955
+ "name": "",
956
+ "type": "uint256"
957
+ }
958
+ ],
959
+ "stateMutability": "view",
960
+ "type": "function"
961
+ },
962
+ {
963
+ "inputs": [],
964
+ "name": "decimals",
965
+ "outputs": [
966
+ {
967
+ "internalType": "uint8",
968
+ "name": "",
969
+ "type": "uint8"
970
+ }
971
+ ],
972
+ "stateMutability": "view",
973
+ "type": "function"
974
+ },
975
+ {
976
+ "inputs": [
977
+ {
978
+ "internalType": "uint256",
979
+ "name": "tokenAssets",
980
+ "type": "uint256"
981
+ },
982
+ {
983
+ "internalType": "address",
984
+ "name": "receiver",
985
+ "type": "address"
986
+ }
987
+ ],
988
+ "name": "deposit",
989
+ "outputs": [
990
+ {
991
+ "internalType": "uint256",
992
+ "name": "",
993
+ "type": "uint256"
994
+ }
995
+ ],
996
+ "stateMutability": "nonpayable",
997
+ "type": "function"
998
+ },
999
+ {
1000
+ "inputs": [
1001
+ {
1002
+ "internalType": "address",
1003
+ "name": "token",
1004
+ "type": "address"
1005
+ },
1006
+ {
1007
+ "internalType": "uint256",
1008
+ "name": "tokenAmount",
1009
+ "type": "uint256"
1010
+ },
1011
+ {
1012
+ "internalType": "address",
1013
+ "name": "receiver",
1014
+ "type": "address"
1015
+ }
1016
+ ],
1017
+ "name": "deposit",
1018
+ "outputs": [
1019
+ {
1020
+ "internalType": "uint256",
1021
+ "name": "",
1022
+ "type": "uint256"
1023
+ }
1024
+ ],
1025
+ "stateMutability": "nonpayable",
1026
+ "type": "function"
1027
+ },
1028
+ {
1029
+ "inputs": [],
1030
+ "name": "eip712Domain",
1031
+ "outputs": [
1032
+ {
1033
+ "internalType": "bytes1",
1034
+ "name": "fields",
1035
+ "type": "bytes1"
1036
+ },
1037
+ {
1038
+ "internalType": "string",
1039
+ "name": "name",
1040
+ "type": "string"
1041
+ },
1042
+ {
1043
+ "internalType": "string",
1044
+ "name": "version",
1045
+ "type": "string"
1046
+ },
1047
+ {
1048
+ "internalType": "uint256",
1049
+ "name": "chainId",
1050
+ "type": "uint256"
1051
+ },
1052
+ {
1053
+ "internalType": "address",
1054
+ "name": "verifyingContract",
1055
+ "type": "address"
1056
+ },
1057
+ {
1058
+ "internalType": "bytes32",
1059
+ "name": "salt",
1060
+ "type": "bytes32"
1061
+ },
1062
+ {
1063
+ "internalType": "uint256[]",
1064
+ "name": "extensions",
1065
+ "type": "uint256[]"
1066
+ }
1067
+ ],
1068
+ "stateMutability": "view",
1069
+ "type": "function"
1070
+ },
1071
+ {
1072
+ "inputs": [],
1073
+ "name": "getCDOAddress",
1074
+ "outputs": [
1075
+ {
1076
+ "internalType": "address",
1077
+ "name": "",
1078
+ "type": "address"
1079
+ }
1080
+ ],
1081
+ "stateMutability": "view",
1082
+ "type": "function"
1083
+ },
1084
+ {
1085
+ "inputs": [
1086
+ {
1087
+ "internalType": "address",
1088
+ "name": "owner_",
1089
+ "type": "address"
1090
+ },
1091
+ {
1092
+ "internalType": "address",
1093
+ "name": "acm_",
1094
+ "type": "address"
1095
+ },
1096
+ {
1097
+ "internalType": "string",
1098
+ "name": "name",
1099
+ "type": "string"
1100
+ },
1101
+ {
1102
+ "internalType": "string",
1103
+ "name": "symbol",
1104
+ "type": "string"
1105
+ },
1106
+ {
1107
+ "internalType": "contract IERC20",
1108
+ "name": "baseAsset",
1109
+ "type": "address"
1110
+ },
1111
+ {
1112
+ "internalType": "contract IStrataCDO",
1113
+ "name": "cdo_",
1114
+ "type": "address"
1115
+ }
1116
+ ],
1117
+ "name": "initialize",
1118
+ "outputs": [],
1119
+ "stateMutability": "nonpayable",
1120
+ "type": "function"
1121
+ },
1122
+ {
1123
+ "inputs": [
1124
+ {
1125
+ "internalType": "address",
1126
+ "name": "owner",
1127
+ "type": "address"
1128
+ }
1129
+ ],
1130
+ "name": "maxDeposit",
1131
+ "outputs": [
1132
+ {
1133
+ "internalType": "uint256",
1134
+ "name": "",
1135
+ "type": "uint256"
1136
+ }
1137
+ ],
1138
+ "stateMutability": "view",
1139
+ "type": "function"
1140
+ },
1141
+ {
1142
+ "inputs": [
1143
+ {
1144
+ "internalType": "address",
1145
+ "name": "token",
1146
+ "type": "address"
1147
+ },
1148
+ {
1149
+ "internalType": "address",
1150
+ "name": "owner",
1151
+ "type": "address"
1152
+ }
1153
+ ],
1154
+ "name": "maxDeposit",
1155
+ "outputs": [
1156
+ {
1157
+ "internalType": "uint256",
1158
+ "name": "",
1159
+ "type": "uint256"
1160
+ }
1161
+ ],
1162
+ "stateMutability": "view",
1163
+ "type": "function"
1164
+ },
1165
+ {
1166
+ "inputs": [
1167
+ {
1168
+ "internalType": "address",
1169
+ "name": "owner",
1170
+ "type": "address"
1171
+ }
1172
+ ],
1173
+ "name": "maxMint",
1174
+ "outputs": [
1175
+ {
1176
+ "internalType": "uint256",
1177
+ "name": "",
1178
+ "type": "uint256"
1179
+ }
1180
+ ],
1181
+ "stateMutability": "view",
1182
+ "type": "function"
1183
+ },
1184
+ {
1185
+ "inputs": [
1186
+ {
1187
+ "internalType": "address",
1188
+ "name": "owner",
1189
+ "type": "address"
1190
+ }
1191
+ ],
1192
+ "name": "maxRedeem",
1193
+ "outputs": [
1194
+ {
1195
+ "internalType": "uint256",
1196
+ "name": "sharesGross",
1197
+ "type": "uint256"
1198
+ }
1199
+ ],
1200
+ "stateMutability": "view",
1201
+ "type": "function"
1202
+ },
1203
+ {
1204
+ "inputs": [
1205
+ {
1206
+ "internalType": "address",
1207
+ "name": "token",
1208
+ "type": "address"
1209
+ },
1210
+ {
1211
+ "internalType": "address",
1212
+ "name": "owner",
1213
+ "type": "address"
1214
+ }
1215
+ ],
1216
+ "name": "maxWithdraw",
1217
+ "outputs": [
1218
+ {
1219
+ "internalType": "uint256",
1220
+ "name": "",
1221
+ "type": "uint256"
1222
+ }
1223
+ ],
1224
+ "stateMutability": "view",
1225
+ "type": "function"
1226
+ },
1227
+ {
1228
+ "inputs": [
1229
+ {
1230
+ "internalType": "address",
1231
+ "name": "owner",
1232
+ "type": "address"
1233
+ }
1234
+ ],
1235
+ "name": "maxWithdraw",
1236
+ "outputs": [
1237
+ {
1238
+ "internalType": "uint256",
1239
+ "name": "assetsNet",
1240
+ "type": "uint256"
1241
+ }
1242
+ ],
1243
+ "stateMutability": "view",
1244
+ "type": "function"
1245
+ },
1246
+ {
1247
+ "inputs": [
1248
+ {
1249
+ "internalType": "address",
1250
+ "name": "token",
1251
+ "type": "address"
1252
+ },
1253
+ {
1254
+ "internalType": "uint256",
1255
+ "name": "shares",
1256
+ "type": "uint256"
1257
+ },
1258
+ {
1259
+ "internalType": "address",
1260
+ "name": "receiver",
1261
+ "type": "address"
1262
+ }
1263
+ ],
1264
+ "name": "mint",
1265
+ "outputs": [
1266
+ {
1267
+ "internalType": "uint256",
1268
+ "name": "",
1269
+ "type": "uint256"
1270
+ }
1271
+ ],
1272
+ "stateMutability": "nonpayable",
1273
+ "type": "function"
1274
+ },
1275
+ {
1276
+ "inputs": [
1277
+ {
1278
+ "internalType": "uint256",
1279
+ "name": "shares",
1280
+ "type": "uint256"
1281
+ },
1282
+ {
1283
+ "internalType": "address",
1284
+ "name": "receiver",
1285
+ "type": "address"
1286
+ }
1287
+ ],
1288
+ "name": "mint",
1289
+ "outputs": [
1290
+ {
1291
+ "internalType": "uint256",
1292
+ "name": "",
1293
+ "type": "uint256"
1294
+ }
1295
+ ],
1296
+ "stateMutability": "nonpayable",
1297
+ "type": "function"
1298
+ },
1299
+ {
1300
+ "inputs": [],
1301
+ "name": "name",
1302
+ "outputs": [
1303
+ {
1304
+ "internalType": "string",
1305
+ "name": "",
1306
+ "type": "string"
1307
+ }
1308
+ ],
1309
+ "stateMutability": "view",
1310
+ "type": "function"
1311
+ },
1312
+ {
1313
+ "inputs": [
1314
+ {
1315
+ "internalType": "address",
1316
+ "name": "owner",
1317
+ "type": "address"
1318
+ }
1319
+ ],
1320
+ "name": "nonces",
1321
+ "outputs": [
1322
+ {
1323
+ "internalType": "uint256",
1324
+ "name": "",
1325
+ "type": "uint256"
1326
+ }
1327
+ ],
1328
+ "stateMutability": "view",
1329
+ "type": "function"
1330
+ },
1331
+ {
1332
+ "inputs": [],
1333
+ "name": "owner",
1334
+ "outputs": [
1335
+ {
1336
+ "internalType": "address",
1337
+ "name": "",
1338
+ "type": "address"
1339
+ }
1340
+ ],
1341
+ "stateMutability": "view",
1342
+ "type": "function"
1343
+ },
1344
+ {
1345
+ "inputs": [],
1346
+ "name": "pendingOwner",
1347
+ "outputs": [
1348
+ {
1349
+ "internalType": "address",
1350
+ "name": "",
1351
+ "type": "address"
1352
+ }
1353
+ ],
1354
+ "stateMutability": "view",
1355
+ "type": "function"
1356
+ },
1357
+ {
1358
+ "inputs": [
1359
+ {
1360
+ "internalType": "address",
1361
+ "name": "owner",
1362
+ "type": "address"
1363
+ },
1364
+ {
1365
+ "internalType": "address",
1366
+ "name": "spender",
1367
+ "type": "address"
1368
+ },
1369
+ {
1370
+ "internalType": "uint256",
1371
+ "name": "value",
1372
+ "type": "uint256"
1373
+ },
1374
+ {
1375
+ "internalType": "uint256",
1376
+ "name": "deadline",
1377
+ "type": "uint256"
1378
+ },
1379
+ {
1380
+ "internalType": "uint8",
1381
+ "name": "v",
1382
+ "type": "uint8"
1383
+ },
1384
+ {
1385
+ "internalType": "bytes32",
1386
+ "name": "r",
1387
+ "type": "bytes32"
1388
+ },
1389
+ {
1390
+ "internalType": "bytes32",
1391
+ "name": "s",
1392
+ "type": "bytes32"
1393
+ }
1394
+ ],
1395
+ "name": "permit",
1396
+ "outputs": [],
1397
+ "stateMutability": "nonpayable",
1398
+ "type": "function"
1399
+ },
1400
+ {
1401
+ "inputs": [
1402
+ {
1403
+ "internalType": "address",
1404
+ "name": "token",
1405
+ "type": "address"
1406
+ },
1407
+ {
1408
+ "internalType": "uint256",
1409
+ "name": "tokenAmount",
1410
+ "type": "uint256"
1411
+ }
1412
+ ],
1413
+ "name": "previewDeposit",
1414
+ "outputs": [
1415
+ {
1416
+ "internalType": "uint256",
1417
+ "name": "",
1418
+ "type": "uint256"
1419
+ }
1420
+ ],
1421
+ "stateMutability": "view",
1422
+ "type": "function"
1423
+ },
1424
+ {
1425
+ "inputs": [
1426
+ {
1427
+ "internalType": "uint256",
1428
+ "name": "assets",
1429
+ "type": "uint256"
1430
+ }
1431
+ ],
1432
+ "name": "previewDeposit",
1433
+ "outputs": [
1434
+ {
1435
+ "internalType": "uint256",
1436
+ "name": "",
1437
+ "type": "uint256"
1438
+ }
1439
+ ],
1440
+ "stateMutability": "view",
1441
+ "type": "function"
1442
+ },
1443
+ {
1444
+ "inputs": [
1445
+ {
1446
+ "internalType": "uint256",
1447
+ "name": "shares",
1448
+ "type": "uint256"
1449
+ }
1450
+ ],
1451
+ "name": "previewMint",
1452
+ "outputs": [
1453
+ {
1454
+ "internalType": "uint256",
1455
+ "name": "",
1456
+ "type": "uint256"
1457
+ }
1458
+ ],
1459
+ "stateMutability": "view",
1460
+ "type": "function"
1461
+ },
1462
+ {
1463
+ "inputs": [
1464
+ {
1465
+ "internalType": "address",
1466
+ "name": "token",
1467
+ "type": "address"
1468
+ },
1469
+ {
1470
+ "internalType": "uint256",
1471
+ "name": "shares",
1472
+ "type": "uint256"
1473
+ }
1474
+ ],
1475
+ "name": "previewMint",
1476
+ "outputs": [
1477
+ {
1478
+ "internalType": "uint256",
1479
+ "name": "",
1480
+ "type": "uint256"
1481
+ }
1482
+ ],
1483
+ "stateMutability": "view",
1484
+ "type": "function"
1485
+ },
1486
+ {
1487
+ "inputs": [
1488
+ {
1489
+ "internalType": "uint256",
1490
+ "name": "sharesGross",
1491
+ "type": "uint256"
1492
+ }
1493
+ ],
1494
+ "name": "previewRedeem",
1495
+ "outputs": [
1496
+ {
1497
+ "internalType": "uint256",
1498
+ "name": "assetsNet",
1499
+ "type": "uint256"
1500
+ }
1501
+ ],
1502
+ "stateMutability": "view",
1503
+ "type": "function"
1504
+ },
1505
+ {
1506
+ "inputs": [
1507
+ {
1508
+ "internalType": "address",
1509
+ "name": "token",
1510
+ "type": "address"
1511
+ },
1512
+ {
1513
+ "internalType": "uint256",
1514
+ "name": "shares",
1515
+ "type": "uint256"
1516
+ }
1517
+ ],
1518
+ "name": "previewRedeem",
1519
+ "outputs": [
1520
+ {
1521
+ "internalType": "uint256",
1522
+ "name": "",
1523
+ "type": "uint256"
1524
+ }
1525
+ ],
1526
+ "stateMutability": "view",
1527
+ "type": "function"
1528
+ },
1529
+ {
1530
+ "inputs": [
1531
+ {
1532
+ "internalType": "uint256",
1533
+ "name": "assetsNet",
1534
+ "type": "uint256"
1535
+ }
1536
+ ],
1537
+ "name": "previewWithdraw",
1538
+ "outputs": [
1539
+ {
1540
+ "internalType": "uint256",
1541
+ "name": "sharesGross",
1542
+ "type": "uint256"
1543
+ }
1544
+ ],
1545
+ "stateMutability": "view",
1546
+ "type": "function"
1547
+ },
1548
+ {
1549
+ "inputs": [
1550
+ {
1551
+ "internalType": "address",
1552
+ "name": "token",
1553
+ "type": "address"
1554
+ },
1555
+ {
1556
+ "internalType": "uint256",
1557
+ "name": "tokenAmount",
1558
+ "type": "uint256"
1559
+ }
1560
+ ],
1561
+ "name": "previewWithdraw",
1562
+ "outputs": [
1563
+ {
1564
+ "internalType": "uint256",
1565
+ "name": "",
1566
+ "type": "uint256"
1567
+ }
1568
+ ],
1569
+ "stateMutability": "view",
1570
+ "type": "function"
1571
+ },
1572
+ {
1573
+ "inputs": [
1574
+ {
1575
+ "internalType": "uint256",
1576
+ "name": "shares",
1577
+ "type": "uint256"
1578
+ },
1579
+ {
1580
+ "internalType": "address",
1581
+ "name": "receiver",
1582
+ "type": "address"
1583
+ },
1584
+ {
1585
+ "internalType": "address",
1586
+ "name": "owner",
1587
+ "type": "address"
1588
+ }
1589
+ ],
1590
+ "name": "redeem",
1591
+ "outputs": [
1592
+ {
1593
+ "internalType": "uint256",
1594
+ "name": "",
1595
+ "type": "uint256"
1596
+ }
1597
+ ],
1598
+ "stateMutability": "nonpayable",
1599
+ "type": "function"
1600
+ },
1601
+ {
1602
+ "inputs": [
1603
+ {
1604
+ "internalType": "address",
1605
+ "name": "token",
1606
+ "type": "address"
1607
+ },
1608
+ {
1609
+ "internalType": "uint256",
1610
+ "name": "shares",
1611
+ "type": "uint256"
1612
+ },
1613
+ {
1614
+ "internalType": "address",
1615
+ "name": "receiver",
1616
+ "type": "address"
1617
+ },
1618
+ {
1619
+ "internalType": "address",
1620
+ "name": "owner",
1621
+ "type": "address"
1622
+ }
1623
+ ],
1624
+ "name": "redeem",
1625
+ "outputs": [
1626
+ {
1627
+ "internalType": "uint256",
1628
+ "name": "",
1629
+ "type": "uint256"
1630
+ }
1631
+ ],
1632
+ "stateMutability": "nonpayable",
1633
+ "type": "function"
1634
+ },
1635
+ {
1636
+ "inputs": [],
1637
+ "name": "renounceOwnership",
1638
+ "outputs": [],
1639
+ "stateMutability": "nonpayable",
1640
+ "type": "function"
1641
+ },
1642
+ {
1643
+ "inputs": [
1644
+ {
1645
+ "internalType": "address",
1646
+ "name": "accessControlManager_",
1647
+ "type": "address"
1648
+ }
1649
+ ],
1650
+ "name": "setAccessControlManager",
1651
+ "outputs": [],
1652
+ "stateMutability": "nonpayable",
1653
+ "type": "function"
1654
+ },
1655
+ {
1656
+ "inputs": [
1657
+ {
1658
+ "internalType": "address",
1659
+ "name": "twoStepConfigManager_",
1660
+ "type": "address"
1661
+ }
1662
+ ],
1663
+ "name": "setTwoStepConfigManager",
1664
+ "outputs": [],
1665
+ "stateMutability": "nonpayable",
1666
+ "type": "function"
1667
+ },
1668
+ {
1669
+ "inputs": [],
1670
+ "name": "symbol",
1671
+ "outputs": [
1672
+ {
1673
+ "internalType": "string",
1674
+ "name": "",
1675
+ "type": "string"
1676
+ }
1677
+ ],
1678
+ "stateMutability": "view",
1679
+ "type": "function"
1680
+ },
1681
+ {
1682
+ "inputs": [],
1683
+ "name": "totalAssets",
1684
+ "outputs": [
1685
+ {
1686
+ "internalType": "uint256",
1687
+ "name": "",
1688
+ "type": "uint256"
1689
+ }
1690
+ ],
1691
+ "stateMutability": "view",
1692
+ "type": "function"
1693
+ },
1694
+ {
1695
+ "inputs": [],
1696
+ "name": "totalSupply",
1697
+ "outputs": [
1698
+ {
1699
+ "internalType": "uint256",
1700
+ "name": "",
1701
+ "type": "uint256"
1702
+ }
1703
+ ],
1704
+ "stateMutability": "view",
1705
+ "type": "function"
1706
+ },
1707
+ {
1708
+ "inputs": [
1709
+ {
1710
+ "internalType": "address",
1711
+ "name": "to",
1712
+ "type": "address"
1713
+ },
1714
+ {
1715
+ "internalType": "uint256",
1716
+ "name": "value",
1717
+ "type": "uint256"
1718
+ }
1719
+ ],
1720
+ "name": "transfer",
1721
+ "outputs": [
1722
+ {
1723
+ "internalType": "bool",
1724
+ "name": "",
1725
+ "type": "bool"
1726
+ }
1727
+ ],
1728
+ "stateMutability": "nonpayable",
1729
+ "type": "function"
1730
+ },
1731
+ {
1732
+ "inputs": [
1733
+ {
1734
+ "internalType": "address",
1735
+ "name": "from",
1736
+ "type": "address"
1737
+ },
1738
+ {
1739
+ "internalType": "address",
1740
+ "name": "to",
1741
+ "type": "address"
1742
+ },
1743
+ {
1744
+ "internalType": "uint256",
1745
+ "name": "value",
1746
+ "type": "uint256"
1747
+ }
1748
+ ],
1749
+ "name": "transferFrom",
1750
+ "outputs": [
1751
+ {
1752
+ "internalType": "bool",
1753
+ "name": "",
1754
+ "type": "bool"
1755
+ }
1756
+ ],
1757
+ "stateMutability": "nonpayable",
1758
+ "type": "function"
1759
+ },
1760
+ {
1761
+ "inputs": [
1762
+ {
1763
+ "internalType": "address",
1764
+ "name": "newOwner",
1765
+ "type": "address"
1766
+ }
1767
+ ],
1768
+ "name": "transferOwnership",
1769
+ "outputs": [],
1770
+ "stateMutability": "nonpayable",
1771
+ "type": "function"
1772
+ },
1773
+ {
1774
+ "inputs": [],
1775
+ "name": "twoStepConfigManager",
1776
+ "outputs": [
1777
+ {
1778
+ "internalType": "address",
1779
+ "name": "",
1780
+ "type": "address"
1781
+ }
1782
+ ],
1783
+ "stateMutability": "view",
1784
+ "type": "function"
1785
+ },
1786
+ {
1787
+ "inputs": [
1788
+ {
1789
+ "internalType": "uint256",
1790
+ "name": "assets",
1791
+ "type": "uint256"
1792
+ },
1793
+ {
1794
+ "internalType": "address",
1795
+ "name": "receiver",
1796
+ "type": "address"
1797
+ },
1798
+ {
1799
+ "internalType": "address",
1800
+ "name": "owner",
1801
+ "type": "address"
1802
+ }
1803
+ ],
1804
+ "name": "withdraw",
1805
+ "outputs": [
1806
+ {
1807
+ "internalType": "uint256",
1808
+ "name": "",
1809
+ "type": "uint256"
1810
+ }
1811
+ ],
1812
+ "stateMutability": "nonpayable",
1813
+ "type": "function"
1814
+ },
1815
+ {
1816
+ "inputs": [
1817
+ {
1818
+ "internalType": "address",
1819
+ "name": "token",
1820
+ "type": "address"
1821
+ },
1822
+ {
1823
+ "internalType": "uint256",
1824
+ "name": "tokenAmount",
1825
+ "type": "uint256"
1826
+ },
1827
+ {
1828
+ "internalType": "address",
1829
+ "name": "receiver",
1830
+ "type": "address"
1831
+ },
1832
+ {
1833
+ "internalType": "address",
1834
+ "name": "owner",
1835
+ "type": "address"
1836
+ }
1837
+ ],
1838
+ "name": "withdraw",
1839
+ "outputs": [
1840
+ {
1841
+ "internalType": "uint256",
1842
+ "name": "",
1843
+ "type": "uint256"
1844
+ }
1845
+ ],
1846
+ "stateMutability": "nonpayable",
1847
+ "type": "function"
1848
+ }
1849
+ ] as const satisfies Abi;
1850
+
1851
+ /**
1852
+ * Type-safe ABI for Tranche
1853
+ */
1854
+ export type TrancheAbi = typeof TrancheAbi;
1855
+
1856
+ /**
1857
+ * Contract instance type for Tranche
1858
+ */
1859
+ // Use any for contract type to avoid complex viem type issues
1860
+ // The runtime behavior is type-safe through viem's ABI typing
1861
+ export type TrancheContract = any;
1862
+
1863
+ /**
1864
+ * Tranche Contract Class
1865
+ *
1866
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1867
+ *
1868
+ * @example
1869
+ * ```typescript
1870
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1871
+ * import { mainnet } from 'viem/chains';
1872
+ * import { Tranche } from 'Tranche';
1873
+ *
1874
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1875
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1876
+ *
1877
+ * const contract = new Tranche('0x...', { publicClient, walletClient });
1878
+ *
1879
+ * // Read functions
1880
+ * const result = await contract.balanceOf('0x...');
1881
+ *
1882
+ * // Write functions
1883
+ * const hash = await contract.transfer('0x...', 1000n);
1884
+ *
1885
+ * // Simulate transactions (dry-run)
1886
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1887
+ * console.log('Gas estimate:', simulation.request.gas);
1888
+ *
1889
+ * // Watch events
1890
+ * const unwatch = contract.watch.Transfer((event) => {
1891
+ * console.log('Transfer event:', event);
1892
+ * });
1893
+ * ```
1894
+ */
1895
+ export class Tranche {
1896
+ private contract: TrancheContract;
1897
+ private contractAddress: Address;
1898
+ private publicClient: PublicClient;
1899
+
1900
+ constructor(
1901
+ address: Address,
1902
+ clients: {
1903
+ publicClient: PublicClient;
1904
+ walletClient?: WalletClient;
1905
+ }
1906
+ ) {
1907
+ this.contractAddress = address;
1908
+ this.publicClient = clients.publicClient;
1909
+ this.contract = getContract({
1910
+ address,
1911
+ abi: TrancheAbi,
1912
+ client: {
1913
+ public: clients.publicClient,
1914
+ wallet: clients.walletClient,
1915
+ },
1916
+ });
1917
+ }
1918
+
1919
+ /**
1920
+ * Get the contract address
1921
+ */
1922
+ get address(): Address {
1923
+ return this.contractAddress;
1924
+ }
1925
+
1926
+ /**
1927
+ * Get the underlying viem contract instance.
1928
+ */
1929
+ getContract(): TrancheContract {
1930
+ return this.contract;
1931
+ }
1932
+
1933
+ /**
1934
+ * COOLDOWN_WORKER_ROLE
1935
+ * view
1936
+ */
1937
+ async COOLDOWN_WORKER_ROLE(): Promise<`0x${string}`> {
1938
+ return this.contract.read.COOLDOWN_WORKER_ROLE() as Promise<`0x${string}`>;
1939
+ }
1940
+
1941
+ /**
1942
+ * DOMAIN_SEPARATOR
1943
+ * view
1944
+ */
1945
+ async DOMAIN_SEPARATOR(): Promise<`0x${string}`> {
1946
+ return this.contract.read.DOMAIN_SEPARATOR() as Promise<`0x${string}`>;
1947
+ }
1948
+
1949
+ /**
1950
+ * PAUSER_ROLE
1951
+ * view
1952
+ */
1953
+ async PAUSER_ROLE(): Promise<`0x${string}`> {
1954
+ return this.contract.read.PAUSER_ROLE() as Promise<`0x${string}`>;
1955
+ }
1956
+
1957
+ /**
1958
+ * PROPOSER_CONFIG_ROLE
1959
+ * view
1960
+ */
1961
+ async PROPOSER_CONFIG_ROLE(): Promise<`0x${string}`> {
1962
+ return this.contract.read.PROPOSER_CONFIG_ROLE() as Promise<`0x${string}`>;
1963
+ }
1964
+
1965
+ /**
1966
+ * RESERVE_MANAGER_ROLE
1967
+ * view
1968
+ */
1969
+ async RESERVE_MANAGER_ROLE(): Promise<`0x${string}`> {
1970
+ return this.contract.read.RESERVE_MANAGER_ROLE() as Promise<`0x${string}`>;
1971
+ }
1972
+
1973
+ /**
1974
+ * UPDATER_CDO_APR_ROLE
1975
+ * view
1976
+ */
1977
+ async UPDATER_CDO_APR_ROLE(): Promise<`0x${string}`> {
1978
+ return this.contract.read.UPDATER_CDO_APR_ROLE() as Promise<`0x${string}`>;
1979
+ }
1980
+
1981
+ /**
1982
+ * UPDATER_FEED_ROLE
1983
+ * view
1984
+ */
1985
+ async UPDATER_FEED_ROLE(): Promise<`0x${string}`> {
1986
+ return this.contract.read.UPDATER_FEED_ROLE() as Promise<`0x${string}`>;
1987
+ }
1988
+
1989
+ /**
1990
+ * UPDATER_STRAT_CONFIG_ROLE
1991
+ * view
1992
+ */
1993
+ async UPDATER_STRAT_CONFIG_ROLE(): Promise<`0x${string}`> {
1994
+ return this.contract.read.UPDATER_STRAT_CONFIG_ROLE() as Promise<`0x${string}`>;
1995
+ }
1996
+
1997
+ /**
1998
+ * acm
1999
+ * view
2000
+ */
2001
+ async acm(): Promise<`0x${string}`> {
2002
+ return this.contract.read.acm() as Promise<`0x${string}`>;
2003
+ }
2004
+
2005
+ /**
2006
+ * allowance
2007
+ * view
2008
+ */
2009
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
2010
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
2011
+ }
2012
+
2013
+ /**
2014
+ * asset
2015
+ * view
2016
+ */
2017
+ async asset(): Promise<`0x${string}`> {
2018
+ return this.contract.read.asset() as Promise<`0x${string}`>;
2019
+ }
2020
+
2021
+ /**
2022
+ * balanceOf
2023
+ * view
2024
+ */
2025
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
2026
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
2027
+ }
2028
+
2029
+ /**
2030
+ * cdo
2031
+ * view
2032
+ */
2033
+ async cdo(): Promise<`0x${string}`> {
2034
+ return this.contract.read.cdo() as Promise<`0x${string}`>;
2035
+ }
2036
+
2037
+ /**
2038
+ * convertToAssets
2039
+ * view
2040
+ */
2041
+ async convertToAssets(shares: bigint): Promise<bigint> {
2042
+ return this.contract.read.convertToAssets([shares] as const) as Promise<bigint>;
2043
+ }
2044
+
2045
+ /**
2046
+ * convertToShares
2047
+ * view
2048
+ */
2049
+ async convertToShares(assets: bigint): Promise<bigint> {
2050
+ return this.contract.read.convertToShares([assets] as const) as Promise<bigint>;
2051
+ }
2052
+
2053
+ /**
2054
+ * decimals
2055
+ * view
2056
+ */
2057
+ async decimals(): Promise<bigint> {
2058
+ return this.contract.read.decimals() as Promise<bigint>;
2059
+ }
2060
+
2061
+ /**
2062
+ * eip712Domain
2063
+ * view
2064
+ */
2065
+ async eip712Domain(): Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]> {
2066
+ return this.contract.read.eip712Domain() as Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]>;
2067
+ }
2068
+
2069
+ /**
2070
+ * getCDOAddress
2071
+ * view
2072
+ */
2073
+ async getCDOAddress(): Promise<`0x${string}`> {
2074
+ return this.contract.read.getCDOAddress() as Promise<`0x${string}`>;
2075
+ }
2076
+
2077
+ async maxDeposit(owner: `0x${string}`): Promise<bigint>;
2078
+ async maxDeposit(token: `0x${string}`, owner: `0x${string}`): Promise<bigint>;
2079
+ async maxDeposit(...args: any[]): Promise<any> {
2080
+ return this.contract.read.maxDeposit(args as any) as Promise<any>;
2081
+ }
2082
+
2083
+ /**
2084
+ * maxMint
2085
+ * view
2086
+ */
2087
+ async maxMint(owner: `0x${string}`): Promise<bigint> {
2088
+ return this.contract.read.maxMint([owner] as const) as Promise<bigint>;
2089
+ }
2090
+
2091
+ /**
2092
+ * maxRedeem
2093
+ * view
2094
+ */
2095
+ async maxRedeem(owner: `0x${string}`): Promise<bigint> {
2096
+ return this.contract.read.maxRedeem([owner] as const) as Promise<bigint>;
2097
+ }
2098
+
2099
+ async maxWithdraw(token: `0x${string}`, owner: `0x${string}`): Promise<bigint>;
2100
+ async maxWithdraw(owner: `0x${string}`): Promise<bigint>;
2101
+ async maxWithdraw(...args: any[]): Promise<any> {
2102
+ return this.contract.read.maxWithdraw(args as any) as Promise<any>;
2103
+ }
2104
+
2105
+ /**
2106
+ * name
2107
+ * view
2108
+ */
2109
+ async name(): Promise<string> {
2110
+ return this.contract.read.name() as Promise<string>;
2111
+ }
2112
+
2113
+ /**
2114
+ * nonces
2115
+ * view
2116
+ */
2117
+ async nonces(owner: `0x${string}`): Promise<bigint> {
2118
+ return this.contract.read.nonces([owner] as const) as Promise<bigint>;
2119
+ }
2120
+
2121
+ /**
2122
+ * owner
2123
+ * view
2124
+ */
2125
+ async owner(): Promise<`0x${string}`> {
2126
+ return this.contract.read.owner() as Promise<`0x${string}`>;
2127
+ }
2128
+
2129
+ /**
2130
+ * pendingOwner
2131
+ * view
2132
+ */
2133
+ async pendingOwner(): Promise<`0x${string}`> {
2134
+ return this.contract.read.pendingOwner() as Promise<`0x${string}`>;
2135
+ }
2136
+
2137
+ async previewDeposit(token: `0x${string}`, tokenAmount: bigint): Promise<bigint>;
2138
+ async previewDeposit(assets: bigint): Promise<bigint>;
2139
+ async previewDeposit(...args: any[]): Promise<any> {
2140
+ return this.contract.read.previewDeposit(args as any) as Promise<any>;
2141
+ }
2142
+
2143
+ async previewMint(shares: bigint): Promise<bigint>;
2144
+ async previewMint(token: `0x${string}`, shares: bigint): Promise<bigint>;
2145
+ async previewMint(...args: any[]): Promise<any> {
2146
+ return this.contract.read.previewMint(args as any) as Promise<any>;
2147
+ }
2148
+
2149
+ async previewRedeem(sharesGross: bigint): Promise<bigint>;
2150
+ async previewRedeem(token: `0x${string}`, shares: bigint): Promise<bigint>;
2151
+ async previewRedeem(...args: any[]): Promise<any> {
2152
+ return this.contract.read.previewRedeem(args as any) as Promise<any>;
2153
+ }
2154
+
2155
+ async previewWithdraw(assetsNet: bigint): Promise<bigint>;
2156
+ async previewWithdraw(token: `0x${string}`, tokenAmount: bigint): Promise<bigint>;
2157
+ async previewWithdraw(...args: any[]): Promise<any> {
2158
+ return this.contract.read.previewWithdraw(args as any) as Promise<any>;
2159
+ }
2160
+
2161
+ /**
2162
+ * symbol
2163
+ * view
2164
+ */
2165
+ async symbol(): Promise<string> {
2166
+ return this.contract.read.symbol() as Promise<string>;
2167
+ }
2168
+
2169
+ /**
2170
+ * totalAssets
2171
+ * view
2172
+ */
2173
+ async totalAssets(): Promise<bigint> {
2174
+ return this.contract.read.totalAssets() as Promise<bigint>;
2175
+ }
2176
+
2177
+ /**
2178
+ * totalSupply
2179
+ * view
2180
+ */
2181
+ async totalSupply(): Promise<bigint> {
2182
+ return this.contract.read.totalSupply() as Promise<bigint>;
2183
+ }
2184
+
2185
+ /**
2186
+ * twoStepConfigManager
2187
+ * view
2188
+ */
2189
+ async twoStepConfigManager(): Promise<`0x${string}`> {
2190
+ return this.contract.read.twoStepConfigManager() as Promise<`0x${string}`>;
2191
+ }
2192
+
2193
+ /**
2194
+ * acceptOwnership
2195
+ * nonpayable
2196
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2197
+ */
2198
+ async acceptOwnership(options?: {
2199
+ accessList?: import('viem').AccessList;
2200
+ authorizationList?: import('viem').AuthorizationList;
2201
+ chain?: import('viem').Chain | null;
2202
+ dataSuffix?: `0x${string}`;
2203
+ gas?: bigint;
2204
+ gasPrice?: bigint;
2205
+ maxFeePerGas?: bigint;
2206
+ maxPriorityFeePerGas?: bigint;
2207
+ nonce?: number;
2208
+ value?: bigint;
2209
+ }): Promise<`0x${string}`> {
2210
+ if (!this.contract.write) {
2211
+ throw new Error('Wallet client is required for write operations');
2212
+ }
2213
+ return this.contract.write.acceptOwnership(options) as Promise<`0x${string}`>;
2214
+ }
2215
+
2216
+ /**
2217
+ * approve
2218
+ * nonpayable
2219
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2220
+ */
2221
+ async approve(spender: `0x${string}`, value: bigint, options?: {
2222
+ accessList?: import('viem').AccessList;
2223
+ authorizationList?: import('viem').AuthorizationList;
2224
+ chain?: import('viem').Chain | null;
2225
+ dataSuffix?: `0x${string}`;
2226
+ gas?: bigint;
2227
+ gasPrice?: bigint;
2228
+ maxFeePerGas?: bigint;
2229
+ maxPriorityFeePerGas?: bigint;
2230
+ nonce?: number;
2231
+ value?: bigint;
2232
+ }): Promise<`0x${string}`> {
2233
+ if (!this.contract.write) {
2234
+ throw new Error('Wallet client is required for write operations');
2235
+ }
2236
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
2237
+ }
2238
+
2239
+ /**
2240
+ * configure
2241
+ * nonpayable
2242
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2243
+ */
2244
+ async configure(options?: {
2245
+ accessList?: import('viem').AccessList;
2246
+ authorizationList?: import('viem').AuthorizationList;
2247
+ chain?: import('viem').Chain | null;
2248
+ dataSuffix?: `0x${string}`;
2249
+ gas?: bigint;
2250
+ gasPrice?: bigint;
2251
+ maxFeePerGas?: bigint;
2252
+ maxPriorityFeePerGas?: bigint;
2253
+ nonce?: number;
2254
+ value?: bigint;
2255
+ }): Promise<`0x${string}`> {
2256
+ if (!this.contract.write) {
2257
+ throw new Error('Wallet client is required for write operations');
2258
+ }
2259
+ return this.contract.write.configure(options) as Promise<`0x${string}`>;
2260
+ }
2261
+
2262
+ async deposit(tokenAssets: bigint, receiver: `0x${string}`, options?: {
2263
+ accessList?: import('viem').AccessList;
2264
+ authorizationList?: import('viem').AuthorizationList;
2265
+ chain?: import('viem').Chain | null;
2266
+ dataSuffix?: `0x${string}`;
2267
+ gas?: bigint;
2268
+ gasPrice?: bigint;
2269
+ maxFeePerGas?: bigint;
2270
+ maxPriorityFeePerGas?: bigint;
2271
+ nonce?: number;
2272
+ value?: bigint;
2273
+ }): Promise<`0x${string}`>;
2274
+ async deposit(token: `0x${string}`, tokenAmount: bigint, receiver: `0x${string}`, options?: {
2275
+ accessList?: import('viem').AccessList;
2276
+ authorizationList?: import('viem').AuthorizationList;
2277
+ chain?: import('viem').Chain | null;
2278
+ dataSuffix?: `0x${string}`;
2279
+ gas?: bigint;
2280
+ gasPrice?: bigint;
2281
+ maxFeePerGas?: bigint;
2282
+ maxPriorityFeePerGas?: bigint;
2283
+ nonce?: number;
2284
+ value?: bigint;
2285
+ }): Promise<`0x${string}`>;
2286
+ async deposit(...args: any[]): Promise<`0x${string}`> {
2287
+ if (!this.contract.write) {
2288
+ throw new Error('Wallet client is required for write operations');
2289
+ }
2290
+ return this.contract.write.deposit(args as any) as Promise<`0x${string}`>;
2291
+ }
2292
+
2293
+ /**
2294
+ * initialize
2295
+ * nonpayable
2296
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2297
+ */
2298
+ async initialize(owner_: `0x${string}`, acm_: `0x${string}`, name: string, symbol: string, baseAsset: `0x${string}`, cdo_: `0x${string}`, options?: {
2299
+ accessList?: import('viem').AccessList;
2300
+ authorizationList?: import('viem').AuthorizationList;
2301
+ chain?: import('viem').Chain | null;
2302
+ dataSuffix?: `0x${string}`;
2303
+ gas?: bigint;
2304
+ gasPrice?: bigint;
2305
+ maxFeePerGas?: bigint;
2306
+ maxPriorityFeePerGas?: bigint;
2307
+ nonce?: number;
2308
+ value?: bigint;
2309
+ }): Promise<`0x${string}`> {
2310
+ if (!this.contract.write) {
2311
+ throw new Error('Wallet client is required for write operations');
2312
+ }
2313
+ return this.contract.write.initialize([owner_, acm_, name, symbol, baseAsset, cdo_] as const, options) as Promise<`0x${string}`>;
2314
+ }
2315
+
2316
+ async mint(token: `0x${string}`, shares: bigint, receiver: `0x${string}`, options?: {
2317
+ accessList?: import('viem').AccessList;
2318
+ authorizationList?: import('viem').AuthorizationList;
2319
+ chain?: import('viem').Chain | null;
2320
+ dataSuffix?: `0x${string}`;
2321
+ gas?: bigint;
2322
+ gasPrice?: bigint;
2323
+ maxFeePerGas?: bigint;
2324
+ maxPriorityFeePerGas?: bigint;
2325
+ nonce?: number;
2326
+ value?: bigint;
2327
+ }): Promise<`0x${string}`>;
2328
+ async mint(shares: bigint, receiver: `0x${string}`, options?: {
2329
+ accessList?: import('viem').AccessList;
2330
+ authorizationList?: import('viem').AuthorizationList;
2331
+ chain?: import('viem').Chain | null;
2332
+ dataSuffix?: `0x${string}`;
2333
+ gas?: bigint;
2334
+ gasPrice?: bigint;
2335
+ maxFeePerGas?: bigint;
2336
+ maxPriorityFeePerGas?: bigint;
2337
+ nonce?: number;
2338
+ value?: bigint;
2339
+ }): Promise<`0x${string}`>;
2340
+ async mint(...args: any[]): Promise<`0x${string}`> {
2341
+ if (!this.contract.write) {
2342
+ throw new Error('Wallet client is required for write operations');
2343
+ }
2344
+ return this.contract.write.mint(args as any) as Promise<`0x${string}`>;
2345
+ }
2346
+
2347
+ /**
2348
+ * permit
2349
+ * nonpayable
2350
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2351
+ */
2352
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
2353
+ accessList?: import('viem').AccessList;
2354
+ authorizationList?: import('viem').AuthorizationList;
2355
+ chain?: import('viem').Chain | null;
2356
+ dataSuffix?: `0x${string}`;
2357
+ gas?: bigint;
2358
+ gasPrice?: bigint;
2359
+ maxFeePerGas?: bigint;
2360
+ maxPriorityFeePerGas?: bigint;
2361
+ nonce?: number;
2362
+ value?: bigint;
2363
+ }): Promise<`0x${string}`> {
2364
+ if (!this.contract.write) {
2365
+ throw new Error('Wallet client is required for write operations');
2366
+ }
2367
+ return this.contract.write.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<`0x${string}`>;
2368
+ }
2369
+
2370
+ async redeem(shares: bigint, receiver: `0x${string}`, owner: `0x${string}`, options?: {
2371
+ accessList?: import('viem').AccessList;
2372
+ authorizationList?: import('viem').AuthorizationList;
2373
+ chain?: import('viem').Chain | null;
2374
+ dataSuffix?: `0x${string}`;
2375
+ gas?: bigint;
2376
+ gasPrice?: bigint;
2377
+ maxFeePerGas?: bigint;
2378
+ maxPriorityFeePerGas?: bigint;
2379
+ nonce?: number;
2380
+ value?: bigint;
2381
+ }): Promise<`0x${string}`>;
2382
+ async redeem(token: `0x${string}`, shares: bigint, receiver: `0x${string}`, owner: `0x${string}`, options?: {
2383
+ accessList?: import('viem').AccessList;
2384
+ authorizationList?: import('viem').AuthorizationList;
2385
+ chain?: import('viem').Chain | null;
2386
+ dataSuffix?: `0x${string}`;
2387
+ gas?: bigint;
2388
+ gasPrice?: bigint;
2389
+ maxFeePerGas?: bigint;
2390
+ maxPriorityFeePerGas?: bigint;
2391
+ nonce?: number;
2392
+ value?: bigint;
2393
+ }): Promise<`0x${string}`>;
2394
+ async redeem(...args: any[]): Promise<`0x${string}`> {
2395
+ if (!this.contract.write) {
2396
+ throw new Error('Wallet client is required for write operations');
2397
+ }
2398
+ return this.contract.write.redeem(args as any) as Promise<`0x${string}`>;
2399
+ }
2400
+
2401
+ /**
2402
+ * renounceOwnership
2403
+ * nonpayable
2404
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2405
+ */
2406
+ async renounceOwnership(options?: {
2407
+ accessList?: import('viem').AccessList;
2408
+ authorizationList?: import('viem').AuthorizationList;
2409
+ chain?: import('viem').Chain | null;
2410
+ dataSuffix?: `0x${string}`;
2411
+ gas?: bigint;
2412
+ gasPrice?: bigint;
2413
+ maxFeePerGas?: bigint;
2414
+ maxPriorityFeePerGas?: bigint;
2415
+ nonce?: number;
2416
+ value?: bigint;
2417
+ }): Promise<`0x${string}`> {
2418
+ if (!this.contract.write) {
2419
+ throw new Error('Wallet client is required for write operations');
2420
+ }
2421
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
2422
+ }
2423
+
2424
+ /**
2425
+ * setAccessControlManager
2426
+ * nonpayable
2427
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2428
+ */
2429
+ async setAccessControlManager(accessControlManager_: `0x${string}`, options?: {
2430
+ accessList?: import('viem').AccessList;
2431
+ authorizationList?: import('viem').AuthorizationList;
2432
+ chain?: import('viem').Chain | null;
2433
+ dataSuffix?: `0x${string}`;
2434
+ gas?: bigint;
2435
+ gasPrice?: bigint;
2436
+ maxFeePerGas?: bigint;
2437
+ maxPriorityFeePerGas?: bigint;
2438
+ nonce?: number;
2439
+ value?: bigint;
2440
+ }): Promise<`0x${string}`> {
2441
+ if (!this.contract.write) {
2442
+ throw new Error('Wallet client is required for write operations');
2443
+ }
2444
+ return this.contract.write.setAccessControlManager([accessControlManager_] as const, options) as Promise<`0x${string}`>;
2445
+ }
2446
+
2447
+ /**
2448
+ * setTwoStepConfigManager
2449
+ * nonpayable
2450
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2451
+ */
2452
+ async setTwoStepConfigManager(twoStepConfigManager_: `0x${string}`, options?: {
2453
+ accessList?: import('viem').AccessList;
2454
+ authorizationList?: import('viem').AuthorizationList;
2455
+ chain?: import('viem').Chain | null;
2456
+ dataSuffix?: `0x${string}`;
2457
+ gas?: bigint;
2458
+ gasPrice?: bigint;
2459
+ maxFeePerGas?: bigint;
2460
+ maxPriorityFeePerGas?: bigint;
2461
+ nonce?: number;
2462
+ value?: bigint;
2463
+ }): Promise<`0x${string}`> {
2464
+ if (!this.contract.write) {
2465
+ throw new Error('Wallet client is required for write operations');
2466
+ }
2467
+ return this.contract.write.setTwoStepConfigManager([twoStepConfigManager_] as const, options) as Promise<`0x${string}`>;
2468
+ }
2469
+
2470
+ /**
2471
+ * transfer
2472
+ * nonpayable
2473
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2474
+ */
2475
+ async transfer(to: `0x${string}`, value: bigint, options?: {
2476
+ accessList?: import('viem').AccessList;
2477
+ authorizationList?: import('viem').AuthorizationList;
2478
+ chain?: import('viem').Chain | null;
2479
+ dataSuffix?: `0x${string}`;
2480
+ gas?: bigint;
2481
+ gasPrice?: bigint;
2482
+ maxFeePerGas?: bigint;
2483
+ maxPriorityFeePerGas?: bigint;
2484
+ nonce?: number;
2485
+ value?: bigint;
2486
+ }): Promise<`0x${string}`> {
2487
+ if (!this.contract.write) {
2488
+ throw new Error('Wallet client is required for write operations');
2489
+ }
2490
+ return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
2491
+ }
2492
+
2493
+ /**
2494
+ * transferFrom
2495
+ * nonpayable
2496
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2497
+ */
2498
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2499
+ accessList?: import('viem').AccessList;
2500
+ authorizationList?: import('viem').AuthorizationList;
2501
+ chain?: import('viem').Chain | null;
2502
+ dataSuffix?: `0x${string}`;
2503
+ gas?: bigint;
2504
+ gasPrice?: bigint;
2505
+ maxFeePerGas?: bigint;
2506
+ maxPriorityFeePerGas?: bigint;
2507
+ nonce?: number;
2508
+ value?: bigint;
2509
+ }): Promise<`0x${string}`> {
2510
+ if (!this.contract.write) {
2511
+ throw new Error('Wallet client is required for write operations');
2512
+ }
2513
+ return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
2514
+ }
2515
+
2516
+ /**
2517
+ * transferOwnership
2518
+ * nonpayable
2519
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2520
+ */
2521
+ async transferOwnership(newOwner: `0x${string}`, options?: {
2522
+ accessList?: import('viem').AccessList;
2523
+ authorizationList?: import('viem').AuthorizationList;
2524
+ chain?: import('viem').Chain | null;
2525
+ dataSuffix?: `0x${string}`;
2526
+ gas?: bigint;
2527
+ gasPrice?: bigint;
2528
+ maxFeePerGas?: bigint;
2529
+ maxPriorityFeePerGas?: bigint;
2530
+ nonce?: number;
2531
+ value?: bigint;
2532
+ }): Promise<`0x${string}`> {
2533
+ if (!this.contract.write) {
2534
+ throw new Error('Wallet client is required for write operations');
2535
+ }
2536
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
2537
+ }
2538
+
2539
+ async withdraw(assets: bigint, receiver: `0x${string}`, owner: `0x${string}`, options?: {
2540
+ accessList?: import('viem').AccessList;
2541
+ authorizationList?: import('viem').AuthorizationList;
2542
+ chain?: import('viem').Chain | null;
2543
+ dataSuffix?: `0x${string}`;
2544
+ gas?: bigint;
2545
+ gasPrice?: bigint;
2546
+ maxFeePerGas?: bigint;
2547
+ maxPriorityFeePerGas?: bigint;
2548
+ nonce?: number;
2549
+ value?: bigint;
2550
+ }): Promise<`0x${string}`>;
2551
+ async withdraw(token: `0x${string}`, tokenAmount: bigint, receiver: `0x${string}`, owner: `0x${string}`, options?: {
2552
+ accessList?: import('viem').AccessList;
2553
+ authorizationList?: import('viem').AuthorizationList;
2554
+ chain?: import('viem').Chain | null;
2555
+ dataSuffix?: `0x${string}`;
2556
+ gas?: bigint;
2557
+ gasPrice?: bigint;
2558
+ maxFeePerGas?: bigint;
2559
+ maxPriorityFeePerGas?: bigint;
2560
+ nonce?: number;
2561
+ value?: bigint;
2562
+ }): Promise<`0x${string}`>;
2563
+ async withdraw(...args: any[]): Promise<`0x${string}`> {
2564
+ if (!this.contract.write) {
2565
+ throw new Error('Wallet client is required for write operations');
2566
+ }
2567
+ return this.contract.write.withdraw(args as any) as Promise<`0x${string}`>;
2568
+ }
2569
+
2570
+
2571
+
2572
+ /**
2573
+ * Simulate contract write operations (dry-run without sending transaction)
2574
+ *
2575
+ * @example
2576
+ * const result = await contract.simulate.transfer('0x...', 1000n);
2577
+ * console.log('Gas estimate:', result.request.gas);
2578
+ * console.log('Would succeed:', result.result);
2579
+ */
2580
+ get simulate() {
2581
+ const contract = this.contract;
2582
+ if (!contract.simulate) {
2583
+ throw new Error('Public client is required for simulation');
2584
+ }
2585
+ return {
2586
+ /**
2587
+ * Simulate acceptOwnership
2588
+ * Returns gas estimate and result without sending transaction
2589
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2590
+ */
2591
+ async acceptOwnership(options?: {
2592
+ accessList?: import('viem').AccessList;
2593
+ authorizationList?: import('viem').AuthorizationList;
2594
+ chain?: import('viem').Chain | null;
2595
+ dataSuffix?: `0x${string}`;
2596
+ gas?: bigint;
2597
+ gasPrice?: bigint;
2598
+ maxFeePerGas?: bigint;
2599
+ maxPriorityFeePerGas?: bigint;
2600
+ nonce?: number;
2601
+ value?: bigint;
2602
+ }): Promise<void> {
2603
+ return contract.simulate.acceptOwnership(options) as Promise<void>;
2604
+ },
2605
+ /**
2606
+ * Simulate approve
2607
+ * Returns gas estimate and result without sending transaction
2608
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2609
+ */
2610
+ async approve(spender: `0x${string}`, value: bigint, options?: {
2611
+ accessList?: import('viem').AccessList;
2612
+ authorizationList?: import('viem').AuthorizationList;
2613
+ chain?: import('viem').Chain | null;
2614
+ dataSuffix?: `0x${string}`;
2615
+ gas?: bigint;
2616
+ gasPrice?: bigint;
2617
+ maxFeePerGas?: bigint;
2618
+ maxPriorityFeePerGas?: bigint;
2619
+ nonce?: number;
2620
+ value?: bigint;
2621
+ }): Promise<boolean> {
2622
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
2623
+ },
2624
+ /**
2625
+ * Simulate configure
2626
+ * Returns gas estimate and result without sending transaction
2627
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2628
+ */
2629
+ async configure(options?: {
2630
+ accessList?: import('viem').AccessList;
2631
+ authorizationList?: import('viem').AuthorizationList;
2632
+ chain?: import('viem').Chain | null;
2633
+ dataSuffix?: `0x${string}`;
2634
+ gas?: bigint;
2635
+ gasPrice?: bigint;
2636
+ maxFeePerGas?: bigint;
2637
+ maxPriorityFeePerGas?: bigint;
2638
+ nonce?: number;
2639
+ value?: bigint;
2640
+ }): Promise<void> {
2641
+ return contract.simulate.configure(options) as Promise<void>;
2642
+ },
2643
+ /**
2644
+ * Simulate deposit
2645
+ * Returns gas estimate and result without sending transaction
2646
+ * Supports multiple overloads: (uint256, address), (address, uint256, address)
2647
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2648
+ */
2649
+ async deposit(...args: any[]): Promise<any> {
2650
+ return contract.simulate.deposit(args as any) as Promise<any>;
2651
+ },
2652
+ /**
2653
+ * Simulate initialize
2654
+ * Returns gas estimate and result without sending transaction
2655
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2656
+ */
2657
+ async initialize(owner_: `0x${string}`, acm_: `0x${string}`, name: string, symbol: string, baseAsset: `0x${string}`, cdo_: `0x${string}`, options?: {
2658
+ accessList?: import('viem').AccessList;
2659
+ authorizationList?: import('viem').AuthorizationList;
2660
+ chain?: import('viem').Chain | null;
2661
+ dataSuffix?: `0x${string}`;
2662
+ gas?: bigint;
2663
+ gasPrice?: bigint;
2664
+ maxFeePerGas?: bigint;
2665
+ maxPriorityFeePerGas?: bigint;
2666
+ nonce?: number;
2667
+ value?: bigint;
2668
+ }): Promise<void> {
2669
+ return contract.simulate.initialize([owner_, acm_, name, symbol, baseAsset, cdo_] as const, options) as Promise<void>;
2670
+ },
2671
+ /**
2672
+ * Simulate mint
2673
+ * Returns gas estimate and result without sending transaction
2674
+ * Supports multiple overloads: (address, uint256, address), (uint256, address)
2675
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2676
+ */
2677
+ async mint(...args: any[]): Promise<any> {
2678
+ return contract.simulate.mint(args as any) as Promise<any>;
2679
+ },
2680
+ /**
2681
+ * Simulate permit
2682
+ * Returns gas estimate and result without sending transaction
2683
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2684
+ */
2685
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
2686
+ accessList?: import('viem').AccessList;
2687
+ authorizationList?: import('viem').AuthorizationList;
2688
+ chain?: import('viem').Chain | null;
2689
+ dataSuffix?: `0x${string}`;
2690
+ gas?: bigint;
2691
+ gasPrice?: bigint;
2692
+ maxFeePerGas?: bigint;
2693
+ maxPriorityFeePerGas?: bigint;
2694
+ nonce?: number;
2695
+ value?: bigint;
2696
+ }): Promise<void> {
2697
+ return contract.simulate.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<void>;
2698
+ },
2699
+ /**
2700
+ * Simulate redeem
2701
+ * Returns gas estimate and result without sending transaction
2702
+ * Supports multiple overloads: (uint256, address, address), (address, uint256, address, address)
2703
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2704
+ */
2705
+ async redeem(...args: any[]): Promise<any> {
2706
+ return contract.simulate.redeem(args as any) as Promise<any>;
2707
+ },
2708
+ /**
2709
+ * Simulate renounceOwnership
2710
+ * Returns gas estimate and result without sending transaction
2711
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2712
+ */
2713
+ async renounceOwnership(options?: {
2714
+ accessList?: import('viem').AccessList;
2715
+ authorizationList?: import('viem').AuthorizationList;
2716
+ chain?: import('viem').Chain | null;
2717
+ dataSuffix?: `0x${string}`;
2718
+ gas?: bigint;
2719
+ gasPrice?: bigint;
2720
+ maxFeePerGas?: bigint;
2721
+ maxPriorityFeePerGas?: bigint;
2722
+ nonce?: number;
2723
+ value?: bigint;
2724
+ }): Promise<void> {
2725
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
2726
+ },
2727
+ /**
2728
+ * Simulate setAccessControlManager
2729
+ * Returns gas estimate and result without sending transaction
2730
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2731
+ */
2732
+ async setAccessControlManager(accessControlManager_: `0x${string}`, options?: {
2733
+ accessList?: import('viem').AccessList;
2734
+ authorizationList?: import('viem').AuthorizationList;
2735
+ chain?: import('viem').Chain | null;
2736
+ dataSuffix?: `0x${string}`;
2737
+ gas?: bigint;
2738
+ gasPrice?: bigint;
2739
+ maxFeePerGas?: bigint;
2740
+ maxPriorityFeePerGas?: bigint;
2741
+ nonce?: number;
2742
+ value?: bigint;
2743
+ }): Promise<void> {
2744
+ return contract.simulate.setAccessControlManager([accessControlManager_] as const, options) as Promise<void>;
2745
+ },
2746
+ /**
2747
+ * Simulate setTwoStepConfigManager
2748
+ * Returns gas estimate and result without sending transaction
2749
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2750
+ */
2751
+ async setTwoStepConfigManager(twoStepConfigManager_: `0x${string}`, options?: {
2752
+ accessList?: import('viem').AccessList;
2753
+ authorizationList?: import('viem').AuthorizationList;
2754
+ chain?: import('viem').Chain | null;
2755
+ dataSuffix?: `0x${string}`;
2756
+ gas?: bigint;
2757
+ gasPrice?: bigint;
2758
+ maxFeePerGas?: bigint;
2759
+ maxPriorityFeePerGas?: bigint;
2760
+ nonce?: number;
2761
+ value?: bigint;
2762
+ }): Promise<void> {
2763
+ return contract.simulate.setTwoStepConfigManager([twoStepConfigManager_] as const, options) as Promise<void>;
2764
+ },
2765
+ /**
2766
+ * Simulate transfer
2767
+ * Returns gas estimate and result without sending transaction
2768
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2769
+ */
2770
+ async transfer(to: `0x${string}`, value: bigint, options?: {
2771
+ accessList?: import('viem').AccessList;
2772
+ authorizationList?: import('viem').AuthorizationList;
2773
+ chain?: import('viem').Chain | null;
2774
+ dataSuffix?: `0x${string}`;
2775
+ gas?: bigint;
2776
+ gasPrice?: bigint;
2777
+ maxFeePerGas?: bigint;
2778
+ maxPriorityFeePerGas?: bigint;
2779
+ nonce?: number;
2780
+ value?: bigint;
2781
+ }): Promise<boolean> {
2782
+ return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
2783
+ },
2784
+ /**
2785
+ * Simulate transferFrom
2786
+ * Returns gas estimate and result without sending transaction
2787
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2788
+ */
2789
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2790
+ accessList?: import('viem').AccessList;
2791
+ authorizationList?: import('viem').AuthorizationList;
2792
+ chain?: import('viem').Chain | null;
2793
+ dataSuffix?: `0x${string}`;
2794
+ gas?: bigint;
2795
+ gasPrice?: bigint;
2796
+ maxFeePerGas?: bigint;
2797
+ maxPriorityFeePerGas?: bigint;
2798
+ nonce?: number;
2799
+ value?: bigint;
2800
+ }): Promise<boolean> {
2801
+ return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
2802
+ },
2803
+ /**
2804
+ * Simulate transferOwnership
2805
+ * Returns gas estimate and result without sending transaction
2806
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2807
+ */
2808
+ async transferOwnership(newOwner: `0x${string}`, options?: {
2809
+ accessList?: import('viem').AccessList;
2810
+ authorizationList?: import('viem').AuthorizationList;
2811
+ chain?: import('viem').Chain | null;
2812
+ dataSuffix?: `0x${string}`;
2813
+ gas?: bigint;
2814
+ gasPrice?: bigint;
2815
+ maxFeePerGas?: bigint;
2816
+ maxPriorityFeePerGas?: bigint;
2817
+ nonce?: number;
2818
+ value?: bigint;
2819
+ }): Promise<void> {
2820
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
2821
+ },
2822
+ /**
2823
+ * Simulate withdraw
2824
+ * Returns gas estimate and result without sending transaction
2825
+ * Supports multiple overloads: (uint256, address, address), (address, uint256, address, address)
2826
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2827
+ */
2828
+ async withdraw(...args: any[]): Promise<any> {
2829
+ return contract.simulate.withdraw(args as any) as Promise<any>;
2830
+ }
2831
+ };
2832
+ }
2833
+
2834
+ /**
2835
+ * Watch contract events
2836
+ *
2837
+ * @example
2838
+ * // Watch all Transfer events
2839
+ * const unwatch = contract.watch.Transfer((event) => {
2840
+ * console.log('Transfer:', event);
2841
+ * });
2842
+ *
2843
+ * // Stop watching
2844
+ * unwatch();
2845
+ */
2846
+ get watch() {
2847
+ return {
2848
+ /**
2849
+ * Watch Approval events
2850
+ * @param callback Function to call when event is emitted
2851
+ * @param filter Optional filter for indexed parameters
2852
+ * @returns Unwatch function to stop listening
2853
+ */
2854
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
2855
+ return this.publicClient.watchContractEvent({
2856
+ address: this.contractAddress,
2857
+ abi: TrancheAbi,
2858
+ eventName: 'Approval',
2859
+ args: filter as any,
2860
+ onLogs: (logs: any[]) => {
2861
+ logs.forEach((log: any) => {
2862
+ callback(log.args as any);
2863
+ });
2864
+ },
2865
+ }) as () => void;
2866
+ },
2867
+ /**
2868
+ * Watch Deposit events
2869
+ * @param callback Function to call when event is emitted
2870
+ * @param filter Optional filter for indexed parameters
2871
+ * @returns Unwatch function to stop listening
2872
+ */
2873
+ Deposit: (callback: (event: { sender: `0x${string}`; owner: `0x${string}`; assets: bigint; shares: bigint }) => void, filter?: { sender?: `0x${string}` | `0x${string}`[] | null; owner?: `0x${string}` | `0x${string}`[] | null }) => {
2874
+ return this.publicClient.watchContractEvent({
2875
+ address: this.contractAddress,
2876
+ abi: TrancheAbi,
2877
+ eventName: 'Deposit',
2878
+ args: filter as any,
2879
+ onLogs: (logs: any[]) => {
2880
+ logs.forEach((log: any) => {
2881
+ callback(log.args as any);
2882
+ });
2883
+ },
2884
+ }) as () => void;
2885
+ },
2886
+ /**
2887
+ * Watch EIP712DomainChanged events
2888
+ * @param callback Function to call when event is emitted
2889
+ * @param filter Optional filter for indexed parameters
2890
+ * @returns Unwatch function to stop listening
2891
+ */
2892
+ EIP712DomainChanged: (callback: (event: { }) => void) => {
2893
+ return this.publicClient.watchContractEvent({
2894
+ address: this.contractAddress,
2895
+ abi: TrancheAbi,
2896
+ eventName: 'EIP712DomainChanged',
2897
+
2898
+ onLogs: (logs: any[]) => {
2899
+ logs.forEach((log: any) => {
2900
+ callback(log.args as any);
2901
+ });
2902
+ },
2903
+ }) as () => void;
2904
+ },
2905
+ /**
2906
+ * Watch Initialized events
2907
+ * @param callback Function to call when event is emitted
2908
+ * @param filter Optional filter for indexed parameters
2909
+ * @returns Unwatch function to stop listening
2910
+ */
2911
+ Initialized: (callback: (event: { version: bigint }) => void) => {
2912
+ return this.publicClient.watchContractEvent({
2913
+ address: this.contractAddress,
2914
+ abi: TrancheAbi,
2915
+ eventName: 'Initialized',
2916
+
2917
+ onLogs: (logs: any[]) => {
2918
+ logs.forEach((log: any) => {
2919
+ callback(log.args as any);
2920
+ });
2921
+ },
2922
+ }) as () => void;
2923
+ },
2924
+ /**
2925
+ * Watch NewAccessControlManager events
2926
+ * @param callback Function to call when event is emitted
2927
+ * @param filter Optional filter for indexed parameters
2928
+ * @returns Unwatch function to stop listening
2929
+ */
2930
+ NewAccessControlManager: (callback: (event: { accessControlManager: `0x${string}` }) => void) => {
2931
+ return this.publicClient.watchContractEvent({
2932
+ address: this.contractAddress,
2933
+ abi: TrancheAbi,
2934
+ eventName: 'NewAccessControlManager',
2935
+
2936
+ onLogs: (logs: any[]) => {
2937
+ logs.forEach((log: any) => {
2938
+ callback(log.args as any);
2939
+ });
2940
+ },
2941
+ }) as () => void;
2942
+ },
2943
+ /**
2944
+ * Watch NewTwoStepConfigManager events
2945
+ * @param callback Function to call when event is emitted
2946
+ * @param filter Optional filter for indexed parameters
2947
+ * @returns Unwatch function to stop listening
2948
+ */
2949
+ NewTwoStepConfigManager: (callback: (event: { twoStepConfigManager: `0x${string}` }) => void) => {
2950
+ return this.publicClient.watchContractEvent({
2951
+ address: this.contractAddress,
2952
+ abi: TrancheAbi,
2953
+ eventName: 'NewTwoStepConfigManager',
2954
+
2955
+ onLogs: (logs: any[]) => {
2956
+ logs.forEach((log: any) => {
2957
+ callback(log.args as any);
2958
+ });
2959
+ },
2960
+ }) as () => void;
2961
+ },
2962
+ /**
2963
+ * Watch OnMetaDeposit events
2964
+ * @param callback Function to call when event is emitted
2965
+ * @param filter Optional filter for indexed parameters
2966
+ * @returns Unwatch function to stop listening
2967
+ */
2968
+ OnMetaDeposit: (callback: (event: { owner: `0x${string}`; token: `0x${string}`; tokenAssets: bigint; shares: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; token?: `0x${string}` | `0x${string}`[] | null }) => {
2969
+ return this.publicClient.watchContractEvent({
2970
+ address: this.contractAddress,
2971
+ abi: TrancheAbi,
2972
+ eventName: 'OnMetaDeposit',
2973
+ args: filter as any,
2974
+ onLogs: (logs: any[]) => {
2975
+ logs.forEach((log: any) => {
2976
+ callback(log.args as any);
2977
+ });
2978
+ },
2979
+ }) as () => void;
2980
+ },
2981
+ /**
2982
+ * Watch OnMetaWithdraw events
2983
+ * @param callback Function to call when event is emitted
2984
+ * @param filter Optional filter for indexed parameters
2985
+ * @returns Unwatch function to stop listening
2986
+ */
2987
+ OnMetaWithdraw: (callback: (event: { owner: `0x${string}`; token: `0x${string}`; tokenAssets: bigint; shares: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; token?: `0x${string}` | `0x${string}`[] | null }) => {
2988
+ return this.publicClient.watchContractEvent({
2989
+ address: this.contractAddress,
2990
+ abi: TrancheAbi,
2991
+ eventName: 'OnMetaWithdraw',
2992
+ args: filter as any,
2993
+ onLogs: (logs: any[]) => {
2994
+ logs.forEach((log: any) => {
2995
+ callback(log.args as any);
2996
+ });
2997
+ },
2998
+ }) as () => void;
2999
+ },
3000
+ /**
3001
+ * Watch OwnershipTransferStarted events
3002
+ * @param callback Function to call when event is emitted
3003
+ * @param filter Optional filter for indexed parameters
3004
+ * @returns Unwatch function to stop listening
3005
+ */
3006
+ OwnershipTransferStarted: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
3007
+ return this.publicClient.watchContractEvent({
3008
+ address: this.contractAddress,
3009
+ abi: TrancheAbi,
3010
+ eventName: 'OwnershipTransferStarted',
3011
+ args: filter as any,
3012
+ onLogs: (logs: any[]) => {
3013
+ logs.forEach((log: any) => {
3014
+ callback(log.args as any);
3015
+ });
3016
+ },
3017
+ }) as () => void;
3018
+ },
3019
+ /**
3020
+ * Watch OwnershipTransferred events
3021
+ * @param callback Function to call when event is emitted
3022
+ * @param filter Optional filter for indexed parameters
3023
+ * @returns Unwatch function to stop listening
3024
+ */
3025
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
3026
+ return this.publicClient.watchContractEvent({
3027
+ address: this.contractAddress,
3028
+ abi: TrancheAbi,
3029
+ eventName: 'OwnershipTransferred',
3030
+ args: filter as any,
3031
+ onLogs: (logs: any[]) => {
3032
+ logs.forEach((log: any) => {
3033
+ callback(log.args as any);
3034
+ });
3035
+ },
3036
+ }) as () => void;
3037
+ },
3038
+ /**
3039
+ * Watch Transfer events
3040
+ * @param callback Function to call when event is emitted
3041
+ * @param filter Optional filter for indexed parameters
3042
+ * @returns Unwatch function to stop listening
3043
+ */
3044
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
3045
+ return this.publicClient.watchContractEvent({
3046
+ address: this.contractAddress,
3047
+ abi: TrancheAbi,
3048
+ eventName: 'Transfer',
3049
+ args: filter as any,
3050
+ onLogs: (logs: any[]) => {
3051
+ logs.forEach((log: any) => {
3052
+ callback(log.args as any);
3053
+ });
3054
+ },
3055
+ }) as () => void;
3056
+ },
3057
+ /**
3058
+ * Watch Withdraw events
3059
+ * @param callback Function to call when event is emitted
3060
+ * @param filter Optional filter for indexed parameters
3061
+ * @returns Unwatch function to stop listening
3062
+ */
3063
+ Withdraw: (callback: (event: { sender: `0x${string}`; receiver: `0x${string}`; owner: `0x${string}`; assets: bigint; shares: bigint }) => void, filter?: { sender?: `0x${string}` | `0x${string}`[] | null; receiver?: `0x${string}` | `0x${string}`[] | null; owner?: `0x${string}` | `0x${string}`[] | null }) => {
3064
+ return this.publicClient.watchContractEvent({
3065
+ address: this.contractAddress,
3066
+ abi: TrancheAbi,
3067
+ eventName: 'Withdraw',
3068
+ args: filter as any,
3069
+ onLogs: (logs: any[]) => {
3070
+ logs.forEach((log: any) => {
3071
+ callback(log.args as any);
3072
+ });
3073
+ },
3074
+ }) as () => void;
3075
+ }
3076
+ };
3077
+ }
3078
+ }