@jup-ag/lend 0.1.8 → 0.1.10-beta.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.
@@ -1,2175 +0,0 @@
1
- import { PublicKey } from '@solana/web3.js';
2
- import { a as address$2 } from './lend.CioR9-te.mjs';
3
-
4
- const address$1 = "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9";
5
- const metadata = {
6
- name: "lending",
7
- version: "0.1.0",
8
- spec: "0.1.0",
9
- description: "Created with Anchor"
10
- };
11
- const instructions = [
12
- {
13
- name: "deposit",
14
- discriminator: [
15
- 242,
16
- 35,
17
- 198,
18
- 137,
19
- 82,
20
- 225,
21
- 242,
22
- 182
23
- ],
24
- accounts: [
25
- {
26
- name: "signer",
27
- writable: true,
28
- signer: true
29
- },
30
- {
31
- name: "depositor_token_account",
32
- writable: true
33
- },
34
- {
35
- name: "recipient_token_account",
36
- writable: true
37
- },
38
- {
39
- name: "mint",
40
- relations: [
41
- "lending",
42
- "rewards_rate_model"
43
- ]
44
- },
45
- {
46
- name: "lending_admin"
47
- },
48
- {
49
- name: "lending",
50
- writable: true
51
- },
52
- {
53
- name: "f_token_mint",
54
- writable: true,
55
- relations: [
56
- "lending"
57
- ]
58
- },
59
- {
60
- name: "supply_token_reserves_liquidity",
61
- writable: true
62
- },
63
- {
64
- name: "lending_supply_position_on_liquidity",
65
- writable: true
66
- },
67
- {
68
- name: "rate_model"
69
- },
70
- {
71
- name: "vault",
72
- writable: true
73
- },
74
- {
75
- name: "liquidity",
76
- writable: true
77
- },
78
- {
79
- name: "liquidity_program",
80
- writable: true,
81
- relations: [
82
- "lending_admin"
83
- ]
84
- },
85
- {
86
- name: "rewards_rate_model"
87
- },
88
- {
89
- name: "token_program"
90
- },
91
- {
92
- name: "associated_token_program",
93
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
94
- },
95
- {
96
- name: "system_program",
97
- address: "11111111111111111111111111111111"
98
- }
99
- ],
100
- args: [
101
- {
102
- name: "assets",
103
- type: "u64"
104
- }
105
- ],
106
- returns: "u64"
107
- },
108
- {
109
- name: "deposit_with_min_amount_out",
110
- discriminator: [
111
- 116,
112
- 144,
113
- 16,
114
- 97,
115
- 118,
116
- 109,
117
- 40,
118
- 119
119
- ],
120
- accounts: [
121
- {
122
- name: "signer",
123
- writable: true,
124
- signer: true
125
- },
126
- {
127
- name: "depositor_token_account",
128
- writable: true
129
- },
130
- {
131
- name: "recipient_token_account",
132
- writable: true
133
- },
134
- {
135
- name: "mint",
136
- relations: [
137
- "lending",
138
- "rewards_rate_model"
139
- ]
140
- },
141
- {
142
- name: "lending_admin"
143
- },
144
- {
145
- name: "lending",
146
- writable: true
147
- },
148
- {
149
- name: "f_token_mint",
150
- writable: true,
151
- relations: [
152
- "lending"
153
- ]
154
- },
155
- {
156
- name: "supply_token_reserves_liquidity",
157
- writable: true
158
- },
159
- {
160
- name: "lending_supply_position_on_liquidity",
161
- writable: true
162
- },
163
- {
164
- name: "rate_model"
165
- },
166
- {
167
- name: "vault",
168
- writable: true
169
- },
170
- {
171
- name: "liquidity",
172
- writable: true
173
- },
174
- {
175
- name: "liquidity_program",
176
- writable: true,
177
- relations: [
178
- "lending_admin"
179
- ]
180
- },
181
- {
182
- name: "rewards_rate_model"
183
- },
184
- {
185
- name: "token_program"
186
- },
187
- {
188
- name: "associated_token_program",
189
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
190
- },
191
- {
192
- name: "system_program",
193
- address: "11111111111111111111111111111111"
194
- }
195
- ],
196
- args: [
197
- {
198
- name: "assets",
199
- type: "u64"
200
- },
201
- {
202
- name: "min_amount_out",
203
- type: "u64"
204
- }
205
- ]
206
- },
207
- {
208
- name: "init_lending",
209
- discriminator: [
210
- 156,
211
- 224,
212
- 67,
213
- 46,
214
- 89,
215
- 189,
216
- 157,
217
- 209
218
- ],
219
- accounts: [
220
- {
221
- name: "signer",
222
- writable: true,
223
- signer: true
224
- },
225
- {
226
- name: "lending_admin",
227
- writable: true
228
- },
229
- {
230
- name: "mint",
231
- relations: [
232
- "token_reserves_liquidity"
233
- ]
234
- },
235
- {
236
- name: "f_token_mint",
237
- writable: true,
238
- pda: {
239
- seeds: [
240
- {
241
- kind: "const",
242
- value: [
243
- 102,
244
- 95,
245
- 116,
246
- 111,
247
- 107,
248
- 101,
249
- 110,
250
- 95,
251
- 109,
252
- 105,
253
- 110,
254
- 116
255
- ]
256
- },
257
- {
258
- kind: "account",
259
- path: "mint"
260
- }
261
- ]
262
- }
263
- },
264
- {
265
- name: "metadata_account",
266
- writable: true,
267
- pda: {
268
- seeds: [
269
- {
270
- kind: "const",
271
- value: [
272
- 109,
273
- 101,
274
- 116,
275
- 97,
276
- 100,
277
- 97,
278
- 116,
279
- 97
280
- ]
281
- },
282
- {
283
- kind: "const",
284
- value: [
285
- 11,
286
- 112,
287
- 101,
288
- 177,
289
- 227,
290
- 209,
291
- 124,
292
- 69,
293
- 56,
294
- 157,
295
- 82,
296
- 127,
297
- 107,
298
- 4,
299
- 195,
300
- 205,
301
- 88,
302
- 184,
303
- 108,
304
- 115,
305
- 26,
306
- 160,
307
- 253,
308
- 181,
309
- 73,
310
- 182,
311
- 209,
312
- 188,
313
- 3,
314
- 248,
315
- 41,
316
- 70
317
- ]
318
- },
319
- {
320
- kind: "account",
321
- path: "f_token_mint"
322
- }
323
- ],
324
- program: {
325
- kind: "const",
326
- value: [
327
- 11,
328
- 112,
329
- 101,
330
- 177,
331
- 227,
332
- 209,
333
- 124,
334
- 69,
335
- 56,
336
- 157,
337
- 82,
338
- 127,
339
- 107,
340
- 4,
341
- 195,
342
- 205,
343
- 88,
344
- 184,
345
- 108,
346
- 115,
347
- 26,
348
- 160,
349
- 253,
350
- 181,
351
- 73,
352
- 182,
353
- 209,
354
- 188,
355
- 3,
356
- 248,
357
- 41,
358
- 70
359
- ]
360
- }
361
- }
362
- },
363
- {
364
- name: "lending",
365
- writable: true,
366
- pda: {
367
- seeds: [
368
- {
369
- kind: "const",
370
- value: [
371
- 108,
372
- 101,
373
- 110,
374
- 100,
375
- 105,
376
- 110,
377
- 103
378
- ]
379
- },
380
- {
381
- kind: "account",
382
- path: "mint"
383
- },
384
- {
385
- kind: "account",
386
- path: "f_token_mint"
387
- }
388
- ]
389
- }
390
- },
391
- {
392
- name: "token_reserves_liquidity"
393
- },
394
- {
395
- name: "token_program"
396
- },
397
- {
398
- name: "system_program",
399
- address: "11111111111111111111111111111111"
400
- },
401
- {
402
- name: "sysvar_instruction",
403
- address: "Sysvar1nstructions1111111111111111111111111"
404
- },
405
- {
406
- name: "metadata_program",
407
- address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
408
- },
409
- {
410
- name: "rent",
411
- address: "SysvarRent111111111111111111111111111111111"
412
- }
413
- ],
414
- args: [
415
- {
416
- name: "symbol",
417
- type: "string"
418
- },
419
- {
420
- name: "liquidity_program",
421
- type: "pubkey"
422
- }
423
- ]
424
- },
425
- {
426
- name: "init_lending_admin",
427
- discriminator: [
428
- 203,
429
- 185,
430
- 241,
431
- 165,
432
- 56,
433
- 254,
434
- 33,
435
- 9
436
- ],
437
- accounts: [
438
- {
439
- name: "authority",
440
- writable: true,
441
- signer: true
442
- },
443
- {
444
- name: "lending_admin",
445
- writable: true,
446
- pda: {
447
- seeds: [
448
- {
449
- kind: "const",
450
- value: [
451
- 108,
452
- 101,
453
- 110,
454
- 100,
455
- 105,
456
- 110,
457
- 103,
458
- 95,
459
- 97,
460
- 100,
461
- 109,
462
- 105,
463
- 110
464
- ]
465
- }
466
- ]
467
- }
468
- },
469
- {
470
- name: "system_program",
471
- address: "11111111111111111111111111111111"
472
- }
473
- ],
474
- args: [
475
- {
476
- name: "liquidity_program",
477
- type: "pubkey"
478
- },
479
- {
480
- name: "rebalancer",
481
- type: "pubkey"
482
- },
483
- {
484
- name: "authority",
485
- type: "pubkey"
486
- }
487
- ]
488
- },
489
- {
490
- name: "mint",
491
- discriminator: [
492
- 51,
493
- 57,
494
- 225,
495
- 47,
496
- 182,
497
- 146,
498
- 137,
499
- 166
500
- ],
501
- accounts: [
502
- {
503
- name: "signer",
504
- writable: true,
505
- signer: true
506
- },
507
- {
508
- name: "depositor_token_account",
509
- writable: true
510
- },
511
- {
512
- name: "recipient_token_account",
513
- writable: true
514
- },
515
- {
516
- name: "mint",
517
- relations: [
518
- "lending",
519
- "rewards_rate_model"
520
- ]
521
- },
522
- {
523
- name: "lending_admin"
524
- },
525
- {
526
- name: "lending",
527
- writable: true
528
- },
529
- {
530
- name: "f_token_mint",
531
- writable: true,
532
- relations: [
533
- "lending"
534
- ]
535
- },
536
- {
537
- name: "supply_token_reserves_liquidity",
538
- writable: true
539
- },
540
- {
541
- name: "lending_supply_position_on_liquidity",
542
- writable: true
543
- },
544
- {
545
- name: "rate_model"
546
- },
547
- {
548
- name: "vault",
549
- writable: true
550
- },
551
- {
552
- name: "liquidity",
553
- writable: true
554
- },
555
- {
556
- name: "liquidity_program",
557
- writable: true,
558
- relations: [
559
- "lending_admin"
560
- ]
561
- },
562
- {
563
- name: "rewards_rate_model"
564
- },
565
- {
566
- name: "token_program"
567
- },
568
- {
569
- name: "associated_token_program",
570
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
571
- },
572
- {
573
- name: "system_program",
574
- address: "11111111111111111111111111111111"
575
- }
576
- ],
577
- args: [
578
- {
579
- name: "shares",
580
- type: "u64"
581
- }
582
- ],
583
- returns: "u64"
584
- },
585
- {
586
- name: "mint_with_max_assets",
587
- discriminator: [
588
- 6,
589
- 94,
590
- 69,
591
- 122,
592
- 30,
593
- 179,
594
- 146,
595
- 171
596
- ],
597
- accounts: [
598
- {
599
- name: "signer",
600
- writable: true,
601
- signer: true
602
- },
603
- {
604
- name: "depositor_token_account",
605
- writable: true
606
- },
607
- {
608
- name: "recipient_token_account",
609
- writable: true
610
- },
611
- {
612
- name: "mint",
613
- relations: [
614
- "lending",
615
- "rewards_rate_model"
616
- ]
617
- },
618
- {
619
- name: "lending_admin"
620
- },
621
- {
622
- name: "lending",
623
- writable: true
624
- },
625
- {
626
- name: "f_token_mint",
627
- writable: true,
628
- relations: [
629
- "lending"
630
- ]
631
- },
632
- {
633
- name: "supply_token_reserves_liquidity",
634
- writable: true
635
- },
636
- {
637
- name: "lending_supply_position_on_liquidity",
638
- writable: true
639
- },
640
- {
641
- name: "rate_model"
642
- },
643
- {
644
- name: "vault",
645
- writable: true
646
- },
647
- {
648
- name: "liquidity",
649
- writable: true
650
- },
651
- {
652
- name: "liquidity_program",
653
- writable: true,
654
- relations: [
655
- "lending_admin"
656
- ]
657
- },
658
- {
659
- name: "rewards_rate_model"
660
- },
661
- {
662
- name: "token_program"
663
- },
664
- {
665
- name: "associated_token_program",
666
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
667
- },
668
- {
669
- name: "system_program",
670
- address: "11111111111111111111111111111111"
671
- }
672
- ],
673
- args: [
674
- {
675
- name: "shares",
676
- type: "u64"
677
- },
678
- {
679
- name: "max_assets",
680
- type: "u64"
681
- }
682
- ],
683
- returns: "u64"
684
- },
685
- {
686
- name: "rebalance",
687
- discriminator: [
688
- 108,
689
- 158,
690
- 77,
691
- 9,
692
- 210,
693
- 52,
694
- 88,
695
- 62
696
- ],
697
- accounts: [
698
- {
699
- name: "signer",
700
- writable: true,
701
- signer: true
702
- },
703
- {
704
- name: "depositor_token_account",
705
- writable: true,
706
- pda: {
707
- seeds: [
708
- {
709
- kind: "account",
710
- path: "signer"
711
- },
712
- {
713
- kind: "account",
714
- path: "token_program"
715
- },
716
- {
717
- kind: "account",
718
- path: "mint"
719
- }
720
- ],
721
- program: {
722
- kind: "const",
723
- value: [
724
- 140,
725
- 151,
726
- 37,
727
- 143,
728
- 78,
729
- 36,
730
- 137,
731
- 241,
732
- 187,
733
- 61,
734
- 16,
735
- 41,
736
- 20,
737
- 142,
738
- 13,
739
- 131,
740
- 11,
741
- 90,
742
- 19,
743
- 153,
744
- 218,
745
- 255,
746
- 16,
747
- 132,
748
- 4,
749
- 142,
750
- 123,
751
- 216,
752
- 219,
753
- 233,
754
- 248,
755
- 89
756
- ]
757
- }
758
- }
759
- },
760
- {
761
- name: "lending_admin"
762
- },
763
- {
764
- name: "lending",
765
- writable: true
766
- },
767
- {
768
- name: "mint",
769
- relations: [
770
- "lending",
771
- "rewards_rate_model"
772
- ]
773
- },
774
- {
775
- name: "f_token_mint",
776
- writable: true,
777
- relations: [
778
- "lending"
779
- ]
780
- },
781
- {
782
- name: "supply_token_reserves_liquidity",
783
- writable: true
784
- },
785
- {
786
- name: "lending_supply_position_on_liquidity",
787
- writable: true
788
- },
789
- {
790
- name: "rate_model",
791
- writable: true
792
- },
793
- {
794
- name: "vault",
795
- writable: true
796
- },
797
- {
798
- name: "liquidity",
799
- writable: true
800
- },
801
- {
802
- name: "liquidity_program",
803
- writable: true,
804
- relations: [
805
- "lending_admin"
806
- ]
807
- },
808
- {
809
- name: "rewards_rate_model"
810
- },
811
- {
812
- name: "token_program"
813
- },
814
- {
815
- name: "associated_token_program",
816
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
817
- },
818
- {
819
- name: "system_program",
820
- address: "11111111111111111111111111111111"
821
- }
822
- ],
823
- args: [
824
- ]
825
- },
826
- {
827
- name: "redeem",
828
- discriminator: [
829
- 184,
830
- 12,
831
- 86,
832
- 149,
833
- 70,
834
- 196,
835
- 97,
836
- 225
837
- ],
838
- accounts: [
839
- {
840
- name: "signer",
841
- writable: true,
842
- signer: true
843
- },
844
- {
845
- name: "owner_token_account",
846
- writable: true
847
- },
848
- {
849
- name: "recipient_token_account",
850
- writable: true
851
- },
852
- {
853
- name: "lending_admin"
854
- },
855
- {
856
- name: "lending",
857
- writable: true
858
- },
859
- {
860
- name: "mint",
861
- relations: [
862
- "lending",
863
- "rewards_rate_model"
864
- ]
865
- },
866
- {
867
- name: "f_token_mint",
868
- writable: true,
869
- relations: [
870
- "lending"
871
- ]
872
- },
873
- {
874
- name: "supply_token_reserves_liquidity",
875
- writable: true
876
- },
877
- {
878
- name: "lending_supply_position_on_liquidity",
879
- writable: true
880
- },
881
- {
882
- name: "rate_model"
883
- },
884
- {
885
- name: "vault",
886
- writable: true
887
- },
888
- {
889
- name: "claim_account",
890
- writable: true
891
- },
892
- {
893
- name: "liquidity",
894
- writable: true
895
- },
896
- {
897
- name: "liquidity_program",
898
- writable: true,
899
- relations: [
900
- "lending_admin"
901
- ]
902
- },
903
- {
904
- name: "rewards_rate_model"
905
- },
906
- {
907
- name: "token_program"
908
- },
909
- {
910
- name: "associated_token_program",
911
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
912
- },
913
- {
914
- name: "system_program",
915
- address: "11111111111111111111111111111111"
916
- }
917
- ],
918
- args: [
919
- {
920
- name: "shares",
921
- type: "u64"
922
- }
923
- ],
924
- returns: "u64"
925
- },
926
- {
927
- name: "redeem_with_min_amount_out",
928
- discriminator: [
929
- 235,
930
- 189,
931
- 237,
932
- 56,
933
- 166,
934
- 180,
935
- 184,
936
- 149
937
- ],
938
- accounts: [
939
- {
940
- name: "signer",
941
- writable: true,
942
- signer: true
943
- },
944
- {
945
- name: "owner_token_account",
946
- writable: true
947
- },
948
- {
949
- name: "recipient_token_account",
950
- writable: true
951
- },
952
- {
953
- name: "lending_admin"
954
- },
955
- {
956
- name: "lending",
957
- writable: true
958
- },
959
- {
960
- name: "mint",
961
- relations: [
962
- "lending",
963
- "rewards_rate_model"
964
- ]
965
- },
966
- {
967
- name: "f_token_mint",
968
- writable: true,
969
- relations: [
970
- "lending"
971
- ]
972
- },
973
- {
974
- name: "supply_token_reserves_liquidity",
975
- writable: true
976
- },
977
- {
978
- name: "lending_supply_position_on_liquidity",
979
- writable: true
980
- },
981
- {
982
- name: "rate_model"
983
- },
984
- {
985
- name: "vault",
986
- writable: true
987
- },
988
- {
989
- name: "claim_account",
990
- writable: true
991
- },
992
- {
993
- name: "liquidity",
994
- writable: true
995
- },
996
- {
997
- name: "liquidity_program",
998
- writable: true,
999
- relations: [
1000
- "lending_admin"
1001
- ]
1002
- },
1003
- {
1004
- name: "rewards_rate_model"
1005
- },
1006
- {
1007
- name: "token_program"
1008
- },
1009
- {
1010
- name: "associated_token_program",
1011
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1012
- },
1013
- {
1014
- name: "system_program",
1015
- address: "11111111111111111111111111111111"
1016
- }
1017
- ],
1018
- args: [
1019
- {
1020
- name: "shares",
1021
- type: "u64"
1022
- },
1023
- {
1024
- name: "min_amount_out",
1025
- type: "u64"
1026
- }
1027
- ]
1028
- },
1029
- {
1030
- name: "set_rewards_rate_model",
1031
- discriminator: [
1032
- 174,
1033
- 231,
1034
- 116,
1035
- 203,
1036
- 8,
1037
- 58,
1038
- 143,
1039
- 203
1040
- ],
1041
- accounts: [
1042
- {
1043
- name: "signer",
1044
- signer: true
1045
- },
1046
- {
1047
- name: "lending_admin"
1048
- },
1049
- {
1050
- name: "lending",
1051
- writable: true
1052
- },
1053
- {
1054
- name: "f_token_mint",
1055
- relations: [
1056
- "lending"
1057
- ]
1058
- },
1059
- {
1060
- name: "new_rewards_rate_model"
1061
- },
1062
- {
1063
- name: "supply_token_reserves_liquidity"
1064
- }
1065
- ],
1066
- args: [
1067
- {
1068
- name: "mint",
1069
- type: "pubkey"
1070
- }
1071
- ]
1072
- },
1073
- {
1074
- name: "update_authority",
1075
- discriminator: [
1076
- 32,
1077
- 46,
1078
- 64,
1079
- 28,
1080
- 149,
1081
- 75,
1082
- 243,
1083
- 88
1084
- ],
1085
- accounts: [
1086
- {
1087
- name: "signer",
1088
- signer: true
1089
- },
1090
- {
1091
- name: "lending_admin",
1092
- writable: true
1093
- }
1094
- ],
1095
- args: [
1096
- {
1097
- name: "new_authority",
1098
- type: "pubkey"
1099
- }
1100
- ]
1101
- },
1102
- {
1103
- name: "update_auths",
1104
- discriminator: [
1105
- 93,
1106
- 96,
1107
- 178,
1108
- 156,
1109
- 57,
1110
- 117,
1111
- 253,
1112
- 209
1113
- ],
1114
- accounts: [
1115
- {
1116
- name: "signer",
1117
- signer: true
1118
- },
1119
- {
1120
- name: "lending_admin",
1121
- writable: true
1122
- }
1123
- ],
1124
- args: [
1125
- {
1126
- name: "auth_status",
1127
- type: {
1128
- vec: {
1129
- defined: {
1130
- name: "AddressBool"
1131
- }
1132
- }
1133
- }
1134
- }
1135
- ]
1136
- },
1137
- {
1138
- name: "update_rate",
1139
- discriminator: [
1140
- 24,
1141
- 225,
1142
- 53,
1143
- 189,
1144
- 72,
1145
- 212,
1146
- 225,
1147
- 178
1148
- ],
1149
- accounts: [
1150
- {
1151
- name: "lending",
1152
- writable: true
1153
- },
1154
- {
1155
- name: "mint",
1156
- relations: [
1157
- "lending",
1158
- "supply_token_reserves_liquidity"
1159
- ]
1160
- },
1161
- {
1162
- name: "f_token_mint",
1163
- relations: [
1164
- "lending"
1165
- ]
1166
- },
1167
- {
1168
- name: "supply_token_reserves_liquidity"
1169
- },
1170
- {
1171
- name: "rewards_rate_model"
1172
- }
1173
- ],
1174
- args: [
1175
- ]
1176
- },
1177
- {
1178
- name: "update_rebalancer",
1179
- discriminator: [
1180
- 206,
1181
- 187,
1182
- 54,
1183
- 228,
1184
- 145,
1185
- 8,
1186
- 203,
1187
- 111
1188
- ],
1189
- accounts: [
1190
- {
1191
- name: "signer",
1192
- signer: true
1193
- },
1194
- {
1195
- name: "lending_admin",
1196
- writable: true
1197
- }
1198
- ],
1199
- args: [
1200
- {
1201
- name: "new_rebalancer",
1202
- type: "pubkey"
1203
- }
1204
- ]
1205
- },
1206
- {
1207
- name: "withdraw",
1208
- discriminator: [
1209
- 183,
1210
- 18,
1211
- 70,
1212
- 156,
1213
- 148,
1214
- 109,
1215
- 161,
1216
- 34
1217
- ],
1218
- accounts: [
1219
- {
1220
- name: "signer",
1221
- writable: true,
1222
- signer: true
1223
- },
1224
- {
1225
- name: "owner_token_account",
1226
- writable: true
1227
- },
1228
- {
1229
- name: "recipient_token_account",
1230
- writable: true
1231
- },
1232
- {
1233
- name: "lending_admin"
1234
- },
1235
- {
1236
- name: "lending",
1237
- writable: true
1238
- },
1239
- {
1240
- name: "mint",
1241
- relations: [
1242
- "lending",
1243
- "rewards_rate_model"
1244
- ]
1245
- },
1246
- {
1247
- name: "f_token_mint",
1248
- writable: true,
1249
- relations: [
1250
- "lending"
1251
- ]
1252
- },
1253
- {
1254
- name: "supply_token_reserves_liquidity",
1255
- writable: true
1256
- },
1257
- {
1258
- name: "lending_supply_position_on_liquidity",
1259
- writable: true
1260
- },
1261
- {
1262
- name: "rate_model"
1263
- },
1264
- {
1265
- name: "vault",
1266
- writable: true
1267
- },
1268
- {
1269
- name: "claim_account",
1270
- writable: true
1271
- },
1272
- {
1273
- name: "liquidity",
1274
- writable: true
1275
- },
1276
- {
1277
- name: "liquidity_program",
1278
- writable: true,
1279
- relations: [
1280
- "lending_admin"
1281
- ]
1282
- },
1283
- {
1284
- name: "rewards_rate_model"
1285
- },
1286
- {
1287
- name: "token_program"
1288
- },
1289
- {
1290
- name: "associated_token_program",
1291
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1292
- },
1293
- {
1294
- name: "system_program",
1295
- address: "11111111111111111111111111111111"
1296
- }
1297
- ],
1298
- args: [
1299
- {
1300
- name: "amount",
1301
- type: "u64"
1302
- }
1303
- ],
1304
- returns: "u64"
1305
- },
1306
- {
1307
- name: "withdraw_with_max_shares_burn",
1308
- discriminator: [
1309
- 47,
1310
- 197,
1311
- 183,
1312
- 171,
1313
- 239,
1314
- 18,
1315
- 245,
1316
- 171
1317
- ],
1318
- accounts: [
1319
- {
1320
- name: "signer",
1321
- writable: true,
1322
- signer: true
1323
- },
1324
- {
1325
- name: "owner_token_account",
1326
- writable: true
1327
- },
1328
- {
1329
- name: "recipient_token_account",
1330
- writable: true
1331
- },
1332
- {
1333
- name: "lending_admin"
1334
- },
1335
- {
1336
- name: "lending",
1337
- writable: true
1338
- },
1339
- {
1340
- name: "mint",
1341
- relations: [
1342
- "lending",
1343
- "rewards_rate_model"
1344
- ]
1345
- },
1346
- {
1347
- name: "f_token_mint",
1348
- writable: true,
1349
- relations: [
1350
- "lending"
1351
- ]
1352
- },
1353
- {
1354
- name: "supply_token_reserves_liquidity",
1355
- writable: true
1356
- },
1357
- {
1358
- name: "lending_supply_position_on_liquidity",
1359
- writable: true
1360
- },
1361
- {
1362
- name: "rate_model"
1363
- },
1364
- {
1365
- name: "vault",
1366
- writable: true
1367
- },
1368
- {
1369
- name: "claim_account",
1370
- writable: true
1371
- },
1372
- {
1373
- name: "liquidity",
1374
- writable: true
1375
- },
1376
- {
1377
- name: "liquidity_program",
1378
- writable: true,
1379
- relations: [
1380
- "lending_admin"
1381
- ]
1382
- },
1383
- {
1384
- name: "rewards_rate_model"
1385
- },
1386
- {
1387
- name: "token_program"
1388
- },
1389
- {
1390
- name: "associated_token_program",
1391
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1392
- },
1393
- {
1394
- name: "system_program",
1395
- address: "11111111111111111111111111111111"
1396
- }
1397
- ],
1398
- args: [
1399
- {
1400
- name: "amount",
1401
- type: "u64"
1402
- },
1403
- {
1404
- name: "max_shares_burn",
1405
- type: "u64"
1406
- }
1407
- ],
1408
- returns: "u64"
1409
- }
1410
- ];
1411
- const accounts = [
1412
- {
1413
- name: "Lending",
1414
- discriminator: [
1415
- 135,
1416
- 199,
1417
- 82,
1418
- 16,
1419
- 249,
1420
- 131,
1421
- 182,
1422
- 241
1423
- ]
1424
- },
1425
- {
1426
- name: "LendingAdmin",
1427
- discriminator: [
1428
- 42,
1429
- 8,
1430
- 33,
1431
- 220,
1432
- 163,
1433
- 40,
1434
- 210,
1435
- 5
1436
- ]
1437
- },
1438
- {
1439
- name: "LendingRewardsRateModel",
1440
- discriminator: [
1441
- 166,
1442
- 72,
1443
- 71,
1444
- 131,
1445
- 172,
1446
- 74,
1447
- 166,
1448
- 181
1449
- ]
1450
- },
1451
- {
1452
- name: "TokenReserve",
1453
- discriminator: [
1454
- 21,
1455
- 18,
1456
- 59,
1457
- 135,
1458
- 120,
1459
- 20,
1460
- 31,
1461
- 12
1462
- ]
1463
- },
1464
- {
1465
- name: "UserSupplyPosition",
1466
- discriminator: [
1467
- 202,
1468
- 219,
1469
- 136,
1470
- 118,
1471
- 61,
1472
- 177,
1473
- 21,
1474
- 146
1475
- ]
1476
- }
1477
- ];
1478
- const events = [
1479
- {
1480
- name: "LogDeposit",
1481
- discriminator: [
1482
- 176,
1483
- 243,
1484
- 1,
1485
- 56,
1486
- 142,
1487
- 206,
1488
- 1,
1489
- 106
1490
- ]
1491
- },
1492
- {
1493
- name: "LogRebalance",
1494
- discriminator: [
1495
- 90,
1496
- 67,
1497
- 219,
1498
- 41,
1499
- 181,
1500
- 118,
1501
- 132,
1502
- 9
1503
- ]
1504
- },
1505
- {
1506
- name: "LogUpdateAuthority",
1507
- discriminator: [
1508
- 150,
1509
- 152,
1510
- 157,
1511
- 143,
1512
- 6,
1513
- 135,
1514
- 193,
1515
- 101
1516
- ]
1517
- },
1518
- {
1519
- name: "LogUpdateAuths",
1520
- discriminator: [
1521
- 88,
1522
- 80,
1523
- 109,
1524
- 48,
1525
- 111,
1526
- 203,
1527
- 76,
1528
- 251
1529
- ]
1530
- },
1531
- {
1532
- name: "LogUpdateRates",
1533
- discriminator: [
1534
- 222,
1535
- 11,
1536
- 113,
1537
- 60,
1538
- 147,
1539
- 15,
1540
- 68,
1541
- 217
1542
- ]
1543
- },
1544
- {
1545
- name: "LogUpdateRebalancer",
1546
- discriminator: [
1547
- 66,
1548
- 79,
1549
- 144,
1550
- 204,
1551
- 26,
1552
- 217,
1553
- 153,
1554
- 225
1555
- ]
1556
- },
1557
- {
1558
- name: "LogUpdateRewards",
1559
- discriminator: [
1560
- 37,
1561
- 13,
1562
- 111,
1563
- 186,
1564
- 47,
1565
- 245,
1566
- 162,
1567
- 121
1568
- ]
1569
- },
1570
- {
1571
- name: "LogWithdraw",
1572
- discriminator: [
1573
- 49,
1574
- 9,
1575
- 176,
1576
- 179,
1577
- 222,
1578
- 190,
1579
- 6,
1580
- 117
1581
- ]
1582
- }
1583
- ];
1584
- const errors = [
1585
- {
1586
- code: 6000,
1587
- name: "FTokenDepositInsignificant",
1588
- msg: "F_TOKEN_DEPOSIT_INSIGNIFICANT"
1589
- },
1590
- {
1591
- code: 6001,
1592
- name: "FTokenMinAmountOut",
1593
- msg: "F_TOKEN_MIN_AMOUNT_OUT"
1594
- },
1595
- {
1596
- code: 6002,
1597
- name: "FTokenMaxAmount",
1598
- msg: "F_TOKEN_MAX_AMOUNT"
1599
- },
1600
- {
1601
- code: 6003,
1602
- name: "FTokenInvalidParams",
1603
- msg: "F_TOKEN_INVALID_PARAMS"
1604
- },
1605
- {
1606
- code: 6004,
1607
- name: "FTokenRewardsRateModelAlreadySet",
1608
- msg: "F_TOKEN_REWARDS_RATE_MODEL_ALREADY_SET"
1609
- },
1610
- {
1611
- code: 6005,
1612
- name: "FTokenMaxAuthCountReached",
1613
- msg: "F_TOKEN_MAX_AUTH_COUNT"
1614
- },
1615
- {
1616
- code: 6006,
1617
- name: "FTokenLiquidityExchangePriceUnexpected",
1618
- msg: "F_TOKEN_LIQUIDITY_EXCHANGE_PRICE_UNEXPECTED"
1619
- },
1620
- {
1621
- code: 6007,
1622
- name: "FTokenCpiToLiquidityFailed",
1623
- msg: "F_TOKEN_CPI_TO_LIQUIDITY_FAILED"
1624
- },
1625
- {
1626
- code: 6008,
1627
- name: "FTokenOnlyAuth",
1628
- msg: "F_TOKEN_ONLY_AUTH"
1629
- },
1630
- {
1631
- code: 6009,
1632
- name: "FTokenOnlyAuthority",
1633
- msg: "F_TOKEN_ONLY_AUTHORITY"
1634
- },
1635
- {
1636
- code: 6010,
1637
- name: "FTokenOnlyRebalancer",
1638
- msg: "F_TOKEN_ONLY_REBALANCER"
1639
- },
1640
- {
1641
- code: 6011,
1642
- name: "FTokenUserSupplyPositionRequired",
1643
- msg: "F_TOKEN_USER_SUPPLY_POSITION_REQUIRED"
1644
- },
1645
- {
1646
- code: 6012,
1647
- name: "FTokenLiquidityProgramMismatch",
1648
- msg: "F_TOKEN_LIQUIDITY_PROGRAM_MISMATCH"
1649
- }
1650
- ];
1651
- const types = [
1652
- {
1653
- name: "AddressBool",
1654
- type: {
1655
- kind: "struct",
1656
- fields: [
1657
- {
1658
- name: "addr",
1659
- type: "pubkey"
1660
- },
1661
- {
1662
- name: "value",
1663
- type: "bool"
1664
- }
1665
- ]
1666
- }
1667
- },
1668
- {
1669
- name: "Lending",
1670
- type: {
1671
- kind: "struct",
1672
- fields: [
1673
- {
1674
- name: "mint",
1675
- type: "pubkey"
1676
- },
1677
- {
1678
- name: "f_token_mint",
1679
- type: "pubkey"
1680
- },
1681
- {
1682
- name: "lending_id",
1683
- type: "u16"
1684
- },
1685
- {
1686
- name: "decimals",
1687
- docs: [
1688
- "@dev number of decimals for the fToken, same as ASSET"
1689
- ],
1690
- type: "u8"
1691
- },
1692
- {
1693
- name: "rewards_rate_model",
1694
- docs: [
1695
- "@dev To read PDA of rewards rate model to get_rate instruction"
1696
- ],
1697
- type: "pubkey"
1698
- },
1699
- {
1700
- name: "liquidity_exchange_price",
1701
- docs: [
1702
- "@dev exchange price for the underlying asset in the liquidity protocol (without rewards)"
1703
- ],
1704
- type: "u64"
1705
- },
1706
- {
1707
- name: "token_exchange_price",
1708
- docs: [
1709
- "@dev exchange price between fToken and the underlying asset (with rewards)"
1710
- ],
1711
- type: "u64"
1712
- },
1713
- {
1714
- name: "last_update_timestamp",
1715
- docs: [
1716
- "@dev timestamp when exchange prices were updated the last time"
1717
- ],
1718
- type: "u64"
1719
- },
1720
- {
1721
- name: "token_reserves_liquidity",
1722
- type: "pubkey"
1723
- },
1724
- {
1725
- name: "supply_position_on_liquidity",
1726
- type: "pubkey"
1727
- },
1728
- {
1729
- name: "bump",
1730
- type: "u8"
1731
- }
1732
- ]
1733
- }
1734
- },
1735
- {
1736
- name: "LendingAdmin",
1737
- type: {
1738
- kind: "struct",
1739
- fields: [
1740
- {
1741
- name: "authority",
1742
- type: "pubkey"
1743
- },
1744
- {
1745
- name: "liquidity_program",
1746
- type: "pubkey"
1747
- },
1748
- {
1749
- name: "rebalancer",
1750
- type: "pubkey"
1751
- },
1752
- {
1753
- name: "next_lending_id",
1754
- type: "u16"
1755
- },
1756
- {
1757
- name: "auths",
1758
- type: {
1759
- vec: "pubkey"
1760
- }
1761
- },
1762
- {
1763
- name: "bump",
1764
- type: "u8"
1765
- }
1766
- ]
1767
- }
1768
- },
1769
- {
1770
- name: "LendingRewardsRateModel",
1771
- type: {
1772
- kind: "struct",
1773
- fields: [
1774
- {
1775
- name: "mint",
1776
- docs: [
1777
- "@dev mint address"
1778
- ],
1779
- type: "pubkey"
1780
- },
1781
- {
1782
- name: "start_tvl",
1783
- docs: [
1784
- "@dev tvl below which rewards rate is 0. If current TVL is below this value, triggering `update_rate()` on the fToken",
1785
- "might bring the total TVL above this cut-off."
1786
- ],
1787
- type: "u64"
1788
- },
1789
- {
1790
- name: "duration",
1791
- docs: [
1792
- "@dev for how long current rewards should run"
1793
- ],
1794
- type: "u64"
1795
- },
1796
- {
1797
- name: "start_time",
1798
- docs: [
1799
- "@dev when current rewards got started"
1800
- ],
1801
- type: "u64"
1802
- },
1803
- {
1804
- name: "yearly_reward",
1805
- docs: [
1806
- "@dev current annualized reward based on input params (duration, rewardAmount)"
1807
- ],
1808
- type: "u64"
1809
- },
1810
- {
1811
- name: "next_duration",
1812
- docs: [
1813
- "@dev Duration for the next rewards phase"
1814
- ],
1815
- type: "u64"
1816
- },
1817
- {
1818
- name: "next_reward_amount",
1819
- docs: [
1820
- "@dev Amount of rewards for the next phase"
1821
- ],
1822
- type: "u64"
1823
- },
1824
- {
1825
- name: "bump",
1826
- type: "u8"
1827
- }
1828
- ]
1829
- }
1830
- },
1831
- {
1832
- name: "LogDeposit",
1833
- type: {
1834
- kind: "struct",
1835
- fields: [
1836
- {
1837
- name: "sender",
1838
- type: "pubkey"
1839
- },
1840
- {
1841
- name: "receiver",
1842
- type: "pubkey"
1843
- },
1844
- {
1845
- name: "assets",
1846
- type: "u64"
1847
- },
1848
- {
1849
- name: "shares_minted",
1850
- type: "u64"
1851
- }
1852
- ]
1853
- }
1854
- },
1855
- {
1856
- name: "LogRebalance",
1857
- type: {
1858
- kind: "struct",
1859
- fields: [
1860
- {
1861
- name: "assets",
1862
- type: "u64"
1863
- }
1864
- ]
1865
- }
1866
- },
1867
- {
1868
- name: "LogUpdateAuthority",
1869
- type: {
1870
- kind: "struct",
1871
- fields: [
1872
- {
1873
- name: "new_authority",
1874
- type: "pubkey"
1875
- }
1876
- ]
1877
- }
1878
- },
1879
- {
1880
- name: "LogUpdateAuths",
1881
- type: {
1882
- kind: "struct",
1883
- fields: [
1884
- {
1885
- name: "auth_status",
1886
- type: {
1887
- vec: {
1888
- defined: {
1889
- name: "AddressBool"
1890
- }
1891
- }
1892
- }
1893
- }
1894
- ]
1895
- }
1896
- },
1897
- {
1898
- name: "LogUpdateRates",
1899
- type: {
1900
- kind: "struct",
1901
- fields: [
1902
- {
1903
- name: "token_exchange_price",
1904
- type: "u64"
1905
- },
1906
- {
1907
- name: "liquidity_exchange_price",
1908
- type: "u64"
1909
- }
1910
- ]
1911
- }
1912
- },
1913
- {
1914
- name: "LogUpdateRebalancer",
1915
- type: {
1916
- kind: "struct",
1917
- fields: [
1918
- {
1919
- name: "new_rebalancer",
1920
- type: "pubkey"
1921
- }
1922
- ]
1923
- }
1924
- },
1925
- {
1926
- name: "LogUpdateRewards",
1927
- type: {
1928
- kind: "struct",
1929
- fields: [
1930
- {
1931
- name: "rewards_rate_model",
1932
- type: "pubkey"
1933
- }
1934
- ]
1935
- }
1936
- },
1937
- {
1938
- name: "LogWithdraw",
1939
- type: {
1940
- kind: "struct",
1941
- fields: [
1942
- {
1943
- name: "sender",
1944
- type: "pubkey"
1945
- },
1946
- {
1947
- name: "receiver",
1948
- type: "pubkey"
1949
- },
1950
- {
1951
- name: "owner",
1952
- type: "pubkey"
1953
- },
1954
- {
1955
- name: "assets",
1956
- type: "u64"
1957
- },
1958
- {
1959
- name: "shares_burned",
1960
- type: "u64"
1961
- }
1962
- ]
1963
- }
1964
- },
1965
- {
1966
- name: "TokenReserve",
1967
- docs: [
1968
- "Token configuration and exchange prices"
1969
- ],
1970
- serialization: "bytemuck",
1971
- repr: {
1972
- kind: "c",
1973
- packed: true
1974
- },
1975
- type: {
1976
- kind: "struct",
1977
- fields: [
1978
- {
1979
- name: "mint",
1980
- type: "pubkey"
1981
- },
1982
- {
1983
- name: "vault",
1984
- type: "pubkey"
1985
- },
1986
- {
1987
- name: "borrow_rate",
1988
- type: "u16"
1989
- },
1990
- {
1991
- name: "fee_on_interest",
1992
- type: "u16"
1993
- },
1994
- {
1995
- name: "last_utilization",
1996
- type: "u16"
1997
- },
1998
- {
1999
- name: "last_update_timestamp",
2000
- type: "u64"
2001
- },
2002
- {
2003
- name: "supply_exchange_price",
2004
- type: "u64"
2005
- },
2006
- {
2007
- name: "borrow_exchange_price",
2008
- type: "u64"
2009
- },
2010
- {
2011
- name: "max_utilization",
2012
- type: "u16"
2013
- },
2014
- {
2015
- name: "total_supply_with_interest",
2016
- type: "u64"
2017
- },
2018
- {
2019
- name: "total_supply_interest_free",
2020
- type: "u64"
2021
- },
2022
- {
2023
- name: "total_borrow_with_interest",
2024
- type: "u64"
2025
- },
2026
- {
2027
- name: "total_borrow_interest_free",
2028
- type: "u64"
2029
- },
2030
- {
2031
- name: "total_claim_amount",
2032
- type: "u64"
2033
- },
2034
- {
2035
- name: "interacting_protocol",
2036
- type: "pubkey"
2037
- },
2038
- {
2039
- name: "interacting_timestamp",
2040
- type: "u64"
2041
- },
2042
- {
2043
- name: "interacting_balance",
2044
- type: "u64"
2045
- }
2046
- ]
2047
- }
2048
- },
2049
- {
2050
- name: "UserSupplyPosition",
2051
- docs: [
2052
- "User supply position"
2053
- ],
2054
- serialization: "bytemuck",
2055
- repr: {
2056
- kind: "c",
2057
- packed: true
2058
- },
2059
- type: {
2060
- kind: "struct",
2061
- fields: [
2062
- {
2063
- name: "protocol",
2064
- type: "pubkey"
2065
- },
2066
- {
2067
- name: "mint",
2068
- type: "pubkey"
2069
- },
2070
- {
2071
- name: "with_interest",
2072
- type: "u8"
2073
- },
2074
- {
2075
- name: "amount",
2076
- type: "u64"
2077
- },
2078
- {
2079
- name: "withdrawal_limit",
2080
- type: "u128"
2081
- },
2082
- {
2083
- name: "last_update",
2084
- type: "u64"
2085
- },
2086
- {
2087
- name: "expand_pct",
2088
- type: "u16"
2089
- },
2090
- {
2091
- name: "expand_duration",
2092
- type: "u64"
2093
- },
2094
- {
2095
- name: "base_withdrawal_limit",
2096
- type: "u64"
2097
- },
2098
- {
2099
- name: "status",
2100
- type: "u8"
2101
- }
2102
- ]
2103
- }
2104
- }
2105
- ];
2106
- const lending$1 = {
2107
- address: address$1,
2108
- metadata: metadata,
2109
- instructions: instructions,
2110
- accounts: accounts,
2111
- events: events,
2112
- errors: errors,
2113
- types: types
2114
- };
2115
-
2116
- const LENDING_PROGRAM_ID = new PublicKey(address$1);
2117
- const LIQUIDITY_PROGRAM_ID = new PublicKey(address$2);
2118
- const getLendingToken = (assetAddress) => {
2119
- const [pda] = PublicKey.findProgramAddressSync(
2120
- [Buffer.from("f_token_mint"), assetAddress.toBuffer()],
2121
- LENDING_PROGRAM_ID
2122
- );
2123
- return pda;
2124
- };
2125
- const getLendingAdmin = () => {
2126
- const [pda] = PublicKey.findProgramAddressSync(
2127
- [Buffer.from("lending_admin")],
2128
- LENDING_PROGRAM_ID
2129
- );
2130
- return pda;
2131
- };
2132
- const getLending = (assetAddress) => {
2133
- const [pda] = PublicKey.findProgramAddressSync(
2134
- [
2135
- Buffer.from("lending"),
2136
- assetAddress.toBuffer(),
2137
- getLendingToken(assetAddress).toBuffer()
2138
- ],
2139
- LENDING_PROGRAM_ID
2140
- );
2141
- return pda;
2142
- };
2143
- const getClaimAccount = (assetAddress, user) => {
2144
- const [pda] = PublicKey.findProgramAddressSync(
2145
- [Buffer.from("user_claim"), user.toBuffer(), assetAddress.toBuffer()],
2146
- LIQUIDITY_PROGRAM_ID
2147
- );
2148
- return pda;
2149
- };
2150
-
2151
- const lending = {
2152
- __proto__: null,
2153
- getClaimAccount: getClaimAccount,
2154
- getLending: getLending,
2155
- getLendingAdmin: getLendingAdmin,
2156
- getLendingToken: getLendingToken
2157
- };
2158
-
2159
- const address = "jup7TthsMgcR9Y3L277b8Eo9uboVSmu1utkuXHNUKar";
2160
-
2161
- const PROGRAM_ID = new PublicKey(address);
2162
- const getLendingRewardsRateModel = (assetAddress) => {
2163
- const [pda] = PublicKey.findProgramAddressSync(
2164
- [Buffer.from("lending_rewards_rate_model"), assetAddress.toBuffer()],
2165
- PROGRAM_ID
2166
- );
2167
- return pda;
2168
- };
2169
-
2170
- const lendingRewardRateModel = {
2171
- __proto__: null,
2172
- getLendingRewardsRateModel: getLendingRewardsRateModel
2173
- };
2174
-
2175
- export { lendingRewardRateModel as a, lending$1 as b, getLending as c, getLendingRewardsRateModel as d, getClaimAccount as e, getLendingAdmin as f, getLendingToken as g, lending as l };