@gitmyabi/cawbrl 1.0.0

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