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