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