@curvefi/llamalend-api 1.0.2

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.
Files changed (125) hide show
  1. package/.eslintrc.json +40 -0
  2. package/.github/workflows/lint.yml +15 -0
  3. package/.github/workflows/publish.yml +55 -0
  4. package/LICENSE +21 -0
  5. package/README.md +1976 -0
  6. package/lib/cache/index.d.ts +14 -0
  7. package/lib/cache/index.js +31 -0
  8. package/lib/constants/L2Networks.d.ts +1 -0
  9. package/lib/constants/L2Networks.js +1 -0
  10. package/lib/constants/abis/Controller.json +1027 -0
  11. package/lib/constants/abis/ERC20.json +222 -0
  12. package/lib/constants/abis/ERC4626.json +1674 -0
  13. package/lib/constants/abis/GaugeController.json +794 -0
  14. package/lib/constants/abis/GaugeFactoryMainnet.json +1 -0
  15. package/lib/constants/abis/GaugeFactorySidechain.json +475 -0
  16. package/lib/constants/abis/GaugeV5.json +958 -0
  17. package/lib/constants/abis/LeverageZap.json +35 -0
  18. package/lib/constants/abis/Llamma.json +984 -0
  19. package/lib/constants/abis/Minter.json +1 -0
  20. package/lib/constants/abis/MonetaryPolicy.json +221 -0
  21. package/lib/constants/abis/OneWayLendingFactoryABI.json +899 -0
  22. package/lib/constants/abis/SidechainGauge.json +939 -0
  23. package/lib/constants/abis/Vault.json +721 -0
  24. package/lib/constants/abis/crvUSD/DeleverageZap.json +248 -0
  25. package/lib/constants/abis/crvUSD/Factory.json +514 -0
  26. package/lib/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  27. package/lib/constants/abis/crvUSD/LeverageZap.json +312 -0
  28. package/lib/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  29. package/lib/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  30. package/lib/constants/abis/crvUSD/PegKeeper.json +411 -0
  31. package/lib/constants/abis/crvUSD/controller.json +991 -0
  32. package/lib/constants/abis/crvUSD/llamma.json +984 -0
  33. package/lib/constants/abis/gas_oracle_optimism.json +149 -0
  34. package/lib/constants/abis/gas_oracle_optimism_blob.json +203 -0
  35. package/lib/constants/aliases.d.ts +16 -0
  36. package/lib/constants/aliases.js +124 -0
  37. package/lib/constants/coins.d.ts +16 -0
  38. package/lib/constants/coins.js +24 -0
  39. package/lib/constants/llammas.d.ts +2 -0
  40. package/lib/constants/llammas.js +96 -0
  41. package/lib/constants/utils.d.ts +4 -0
  42. package/lib/constants/utils.js +27 -0
  43. package/lib/external-api.d.ts +13 -0
  44. package/lib/external-api.js +436 -0
  45. package/lib/index.d.ts +104 -0
  46. package/lib/index.js +123 -0
  47. package/lib/interfaces.d.ts +228 -0
  48. package/lib/interfaces.js +1 -0
  49. package/lib/lendMarkets/LendMarketTemplate.d.ts +510 -0
  50. package/lib/lendMarkets/LendMarketTemplate.js +4682 -0
  51. package/lib/lendMarkets/index.d.ts +3 -0
  52. package/lib/lendMarkets/index.js +3 -0
  53. package/lib/lendMarkets/lendMarketConstructor.d.ts +2 -0
  54. package/lib/lendMarkets/lendMarketConstructor.js +6 -0
  55. package/lib/llamalend.d.ts +80 -0
  56. package/lib/llamalend.js +878 -0
  57. package/lib/mintMarkets/MintMarketTemplate.d.ts +308 -0
  58. package/lib/mintMarkets/MintMarketTemplate.js +2998 -0
  59. package/lib/mintMarkets/index.d.ts +3 -0
  60. package/lib/mintMarkets/index.js +3 -0
  61. package/lib/mintMarkets/mintMarketConstructor.d.ts +2 -0
  62. package/lib/mintMarkets/mintMarketConstructor.js +4 -0
  63. package/lib/st-crvUSD.d.ts +35 -0
  64. package/lib/st-crvUSD.js +505 -0
  65. package/lib/utils.d.ts +58 -0
  66. package/lib/utils.js +661 -0
  67. package/package.json +42 -0
  68. package/src/cache/index.ts +41 -0
  69. package/src/constants/L2Networks.ts +1 -0
  70. package/src/constants/abis/Controller.json +1027 -0
  71. package/src/constants/abis/ERC20.json +222 -0
  72. package/src/constants/abis/ERC4626.json +1674 -0
  73. package/src/constants/abis/GaugeController.json +794 -0
  74. package/src/constants/abis/GaugeFactoryMainnet.json +1 -0
  75. package/src/constants/abis/GaugeFactorySidechain.json +475 -0
  76. package/src/constants/abis/GaugeV5.json +958 -0
  77. package/src/constants/abis/LeverageZap.json +35 -0
  78. package/src/constants/abis/Llamma.json +984 -0
  79. package/src/constants/abis/Minter.json +1 -0
  80. package/src/constants/abis/MonetaryPolicy.json +221 -0
  81. package/src/constants/abis/OneWayLendingFactoryABI.json +899 -0
  82. package/src/constants/abis/SidechainGauge.json +939 -0
  83. package/src/constants/abis/Vault.json +721 -0
  84. package/src/constants/abis/crvUSD/DeleverageZap.json +248 -0
  85. package/src/constants/abis/crvUSD/ERC20.json +222 -0
  86. package/src/constants/abis/crvUSD/Factory.json +514 -0
  87. package/src/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  88. package/src/constants/abis/crvUSD/LeverageZap.json +312 -0
  89. package/src/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  90. package/src/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  91. package/src/constants/abis/crvUSD/PegKeeper.json +411 -0
  92. package/src/constants/abis/crvUSD/controller.json +991 -0
  93. package/src/constants/abis/crvUSD/llamma.json +984 -0
  94. package/src/constants/abis/gas_oracle_optimism.json +149 -0
  95. package/src/constants/abis/gas_oracle_optimism_blob.json +203 -0
  96. package/src/constants/aliases.ts +141 -0
  97. package/src/constants/coins.ts +41 -0
  98. package/src/constants/llammas.ts +99 -0
  99. package/src/constants/utils.ts +33 -0
  100. package/src/external-api.ts +325 -0
  101. package/src/index.ts +128 -0
  102. package/src/interfaces.ts +237 -0
  103. package/src/lendMarkets/LendMarketTemplate.ts +3022 -0
  104. package/src/lendMarkets/index.ts +7 -0
  105. package/src/lendMarkets/lendMarketConstructor.ts +7 -0
  106. package/src/llamalend.ts +785 -0
  107. package/src/mintMarkets/MintMarketTemplate.ts +1781 -0
  108. package/src/mintMarkets/index.ts +7 -0
  109. package/src/mintMarkets/mintMarketConstructor.ts +5 -0
  110. package/src/st-crvUSD.ts +244 -0
  111. package/src/utils.ts +497 -0
  112. package/test/fetch.test.ts +152 -0
  113. package/test/general.test.ts +216 -0
  114. package/test/leverageBorrowMore.test.ts +245 -0
  115. package/test/leverageCreateLoan.test.ts +236 -0
  116. package/test/leverageRepay.test.ts +240 -0
  117. package/test/readme.test.ts +475 -0
  118. package/test/selfLiquidate.test.ts +57 -0
  119. package/test/selfLiquidateCrvUSD.test.ts +54 -0
  120. package/test/st_crvUSD.test.ts +68 -0
  121. package/test/swap.test.ts +62 -0
  122. package/test/swapCrvUSD.test.ts +56 -0
  123. package/test/vault.test.ts +112 -0
  124. package/tsconfig.build.json +10 -0
  125. package/tsconfig.json +72 -0
@@ -0,0 +1 @@
1
+ [{ "name": "BridgerUpdated", "inputs": [{ "name": "_chain_id", "type": "uint256", "indexed": true }, { "name": "_old_bridger", "type": "address", "indexed": false }, { "name": "_new_bridger", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "DeployedGauge", "inputs": [{ "name": "_implementation", "type": "address", "indexed": true }, { "name": "_chain_id", "type": "uint256", "indexed": true }, { "name": "_deployer", "type": "address", "indexed": true }, { "name": "_salt", "type": "bytes32", "indexed": false }, { "name": "_gauge", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "TransferOwnership", "inputs": [{ "name": "_old_owner", "type": "address", "indexed": false }, { "name": "_new_owner", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "UpdateCallProxy", "inputs": [{ "name": "_old_call_proxy", "type": "address", "indexed": false }, { "name": "_new_call_proxy", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "UpdateImplementation", "inputs": [{ "name": "_old_implementation", "type": "address", "indexed": false }, { "name": "_new_implementation", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "_call_proxy", "type": "address" }, { "name": "_owner", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "transmit_emissions", "inputs": [{ "name": "_gauge", "type": "address" }], "outputs": [], "gas": 10132 }, { "stateMutability": "payable", "type": "function", "name": "deploy_gauge", "inputs": [{ "name": "_chain_id", "type": "uint256" }, { "name": "_salt", "type": "bytes32" }], "outputs": [{ "name": "", "type": "address" }], "gas": 165352 }, { "stateMutability": "nonpayable", "type": "function", "name": "deploy_child_gauge", "inputs": [{ "name": "_chain_id", "type": "uint256" }, { "name": "_lp_token", "type": "address" }, { "name": "_salt", "type": "bytes32" }], "outputs": [], "gas": 18165 }, { "stateMutability": "nonpayable", "type": "function", "name": "deploy_child_gauge", "inputs": [{ "name": "_chain_id", "type": "uint256" }, { "name": "_lp_token", "type": "address" }, { "name": "_salt", "type": "bytes32" }, { "name": "_manager", "type": "address" }], "outputs": [], "gas": 18165 }, { "stateMutability": "nonpayable", "type": "function", "name": "set_bridger", "inputs": [{ "name": "_chain_id", "type": "uint256" }, { "name": "_bridger", "type": "address" }], "outputs": [], "gas": 42889 }, { "stateMutability": "nonpayable", "type": "function", "name": "set_implementation", "inputs": [{ "name": "_implementation", "type": "address" }], "outputs": [], "gas": 41933 }, { "stateMutability": "nonpayable", "type": "function", "name": "set_call_proxy", "inputs": [{ "name": "_new_call_proxy", "type": "address" }], "outputs": [], "gas": 41963 }, { "stateMutability": "nonpayable", "type": "function", "name": "commit_transfer_ownership", "inputs": [{ "name": "_future_owner", "type": "address" }], "outputs": [], "gas": 37785 }, { "stateMutability": "nonpayable", "type": "function", "name": "accept_transfer_ownership", "inputs": [], "outputs": [], "gas": 41864 }, { "stateMutability": "view", "type": "function", "name": "call_proxy", "inputs": [], "outputs": [{ "name": "", "type": "address" }], "gas": 2700 }, { "stateMutability": "view", "type": "function", "name": "get_bridger", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }], "gas": 2845 }, { "stateMutability": "view", "type": "function", "name": "get_implementation", "inputs": [], "outputs": [{ "name": "", "type": "address" }], "gas": 2760 }, { "stateMutability": "view", "type": "function", "name": "get_gauge", "inputs": [{ "name": "arg0", "type": "uint256" }, { "name": "arg1", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }], "gas": 2950 }, { "stateMutability": "view", "type": "function", "name": "get_gauge_count", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }], "gas": 2935 }, { "stateMutability": "view", "type": "function", "name": "is_valid_gauge", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }], "gas": 3116 }, { "stateMutability": "view", "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address" }], "gas": 2880 }, { "stateMutability": "view", "type": "function", "name": "future_owner", "inputs": [], "outputs": [{ "name": "", "type": "address" }], "gas": 2910 }]
@@ -0,0 +1,475 @@
1
+ [
2
+ {
3
+ "name": "DeployedGauge",
4
+ "inputs": [
5
+ {
6
+ "name": "_implementation",
7
+ "type": "address",
8
+ "indexed": true
9
+ },
10
+ {
11
+ "name": "_lp_token",
12
+ "type": "address",
13
+ "indexed": true
14
+ },
15
+ {
16
+ "name": "_deployer",
17
+ "type": "address",
18
+ "indexed": true
19
+ },
20
+ {
21
+ "name": "_salt",
22
+ "type": "bytes32",
23
+ "indexed": false
24
+ },
25
+ {
26
+ "name": "_gauge",
27
+ "type": "address",
28
+ "indexed": false
29
+ }
30
+ ],
31
+ "anonymous": false,
32
+ "type": "event"
33
+ },
34
+ {
35
+ "name": "Minted",
36
+ "inputs": [
37
+ {
38
+ "name": "_user",
39
+ "type": "address",
40
+ "indexed": true
41
+ },
42
+ {
43
+ "name": "_gauge",
44
+ "type": "address",
45
+ "indexed": true
46
+ },
47
+ {
48
+ "name": "_new_total",
49
+ "type": "uint256",
50
+ "indexed": false
51
+ }
52
+ ],
53
+ "anonymous": false,
54
+ "type": "event"
55
+ },
56
+ {
57
+ "name": "UpdateImplementation",
58
+ "inputs": [
59
+ {
60
+ "name": "_old_implementation",
61
+ "type": "address",
62
+ "indexed": false
63
+ },
64
+ {
65
+ "name": "_new_implementation",
66
+ "type": "address",
67
+ "indexed": false
68
+ }
69
+ ],
70
+ "anonymous": false,
71
+ "type": "event"
72
+ },
73
+ {
74
+ "name": "UpdateVotingEscrow",
75
+ "inputs": [
76
+ {
77
+ "name": "_old_voting_escrow",
78
+ "type": "address",
79
+ "indexed": false
80
+ },
81
+ {
82
+ "name": "_new_voting_escrow",
83
+ "type": "address",
84
+ "indexed": false
85
+ }
86
+ ],
87
+ "anonymous": false,
88
+ "type": "event"
89
+ },
90
+ {
91
+ "name": "UpdateCallProxy",
92
+ "inputs": [
93
+ {
94
+ "name": "_old_call_proxy",
95
+ "type": "address",
96
+ "indexed": false
97
+ },
98
+ {
99
+ "name": "_new_call_proxy",
100
+ "type": "address",
101
+ "indexed": false
102
+ }
103
+ ],
104
+ "anonymous": false,
105
+ "type": "event"
106
+ },
107
+ {
108
+ "name": "UpdateMirrored",
109
+ "inputs": [
110
+ {
111
+ "name": "_gauge",
112
+ "type": "address",
113
+ "indexed": true
114
+ },
115
+ {
116
+ "name": "_mirrored",
117
+ "type": "bool",
118
+ "indexed": false
119
+ }
120
+ ],
121
+ "anonymous": false,
122
+ "type": "event"
123
+ },
124
+ {
125
+ "name": "TransferOwnership",
126
+ "inputs": [
127
+ {
128
+ "name": "_old_owner",
129
+ "type": "address",
130
+ "indexed": false
131
+ },
132
+ {
133
+ "name": "_new_owner",
134
+ "type": "address",
135
+ "indexed": false
136
+ }
137
+ ],
138
+ "anonymous": false,
139
+ "type": "event"
140
+ },
141
+ {
142
+ "stateMutability": "nonpayable",
143
+ "type": "constructor",
144
+ "inputs": [
145
+ {
146
+ "name": "_call_proxy",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "name": "_crv",
151
+ "type": "address"
152
+ },
153
+ {
154
+ "name": "_owner",
155
+ "type": "address"
156
+ }
157
+ ],
158
+ "outputs": []
159
+ },
160
+ {
161
+ "stateMutability": "nonpayable",
162
+ "type": "function",
163
+ "name": "mint",
164
+ "inputs": [
165
+ {
166
+ "name": "_gauge",
167
+ "type": "address"
168
+ }
169
+ ],
170
+ "outputs": []
171
+ },
172
+ {
173
+ "stateMutability": "nonpayable",
174
+ "type": "function",
175
+ "name": "mint_many",
176
+ "inputs": [
177
+ {
178
+ "name": "_gauges",
179
+ "type": "address[32]"
180
+ }
181
+ ],
182
+ "outputs": []
183
+ },
184
+ {
185
+ "stateMutability": "nonpayable",
186
+ "type": "function",
187
+ "name": "deploy_gauge",
188
+ "inputs": [
189
+ {
190
+ "name": "_lp_token",
191
+ "type": "address"
192
+ },
193
+ {
194
+ "name": "_salt",
195
+ "type": "bytes32"
196
+ },
197
+ {
198
+ "name": "_manager",
199
+ "type": "address"
200
+ }
201
+ ],
202
+ "outputs": [
203
+ {
204
+ "name": "",
205
+ "type": "address"
206
+ }
207
+ ]
208
+ },
209
+ {
210
+ "stateMutability": "nonpayable",
211
+ "type": "function",
212
+ "name": "set_voting_escrow",
213
+ "inputs": [
214
+ {
215
+ "name": "_voting_escrow",
216
+ "type": "address"
217
+ }
218
+ ],
219
+ "outputs": []
220
+ },
221
+ {
222
+ "stateMutability": "nonpayable",
223
+ "type": "function",
224
+ "name": "set_implementation",
225
+ "inputs": [
226
+ {
227
+ "name": "_implementation",
228
+ "type": "address"
229
+ }
230
+ ],
231
+ "outputs": []
232
+ },
233
+ {
234
+ "stateMutability": "nonpayable",
235
+ "type": "function",
236
+ "name": "set_mirrored",
237
+ "inputs": [
238
+ {
239
+ "name": "_gauge",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "name": "_mirrored",
244
+ "type": "bool"
245
+ }
246
+ ],
247
+ "outputs": []
248
+ },
249
+ {
250
+ "stateMutability": "nonpayable",
251
+ "type": "function",
252
+ "name": "set_call_proxy",
253
+ "inputs": [
254
+ {
255
+ "name": "_new_call_proxy",
256
+ "type": "address"
257
+ }
258
+ ],
259
+ "outputs": []
260
+ },
261
+ {
262
+ "stateMutability": "nonpayable",
263
+ "type": "function",
264
+ "name": "commit_transfer_ownership",
265
+ "inputs": [
266
+ {
267
+ "name": "_future_owner",
268
+ "type": "address"
269
+ }
270
+ ],
271
+ "outputs": []
272
+ },
273
+ {
274
+ "stateMutability": "nonpayable",
275
+ "type": "function",
276
+ "name": "accept_transfer_ownership",
277
+ "inputs": [],
278
+ "outputs": []
279
+ },
280
+ {
281
+ "stateMutability": "view",
282
+ "type": "function",
283
+ "name": "is_valid_gauge",
284
+ "inputs": [
285
+ {
286
+ "name": "_gauge",
287
+ "type": "address"
288
+ }
289
+ ],
290
+ "outputs": [
291
+ {
292
+ "name": "",
293
+ "type": "bool"
294
+ }
295
+ ]
296
+ },
297
+ {
298
+ "stateMutability": "view",
299
+ "type": "function",
300
+ "name": "is_mirrored",
301
+ "inputs": [
302
+ {
303
+ "name": "_gauge",
304
+ "type": "address"
305
+ }
306
+ ],
307
+ "outputs": [
308
+ {
309
+ "name": "",
310
+ "type": "bool"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "stateMutability": "view",
316
+ "type": "function",
317
+ "name": "last_request",
318
+ "inputs": [
319
+ {
320
+ "name": "_gauge",
321
+ "type": "address"
322
+ }
323
+ ],
324
+ "outputs": [
325
+ {
326
+ "name": "",
327
+ "type": "uint256"
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ "stateMutability": "view",
333
+ "type": "function",
334
+ "name": "get_implementation",
335
+ "inputs": [],
336
+ "outputs": [
337
+ {
338
+ "name": "",
339
+ "type": "address"
340
+ }
341
+ ]
342
+ },
343
+ {
344
+ "stateMutability": "view",
345
+ "type": "function",
346
+ "name": "voting_escrow",
347
+ "inputs": [],
348
+ "outputs": [
349
+ {
350
+ "name": "",
351
+ "type": "address"
352
+ }
353
+ ]
354
+ },
355
+ {
356
+ "stateMutability": "view",
357
+ "type": "function",
358
+ "name": "owner",
359
+ "inputs": [],
360
+ "outputs": [
361
+ {
362
+ "name": "",
363
+ "type": "address"
364
+ }
365
+ ]
366
+ },
367
+ {
368
+ "stateMutability": "view",
369
+ "type": "function",
370
+ "name": "future_owner",
371
+ "inputs": [],
372
+ "outputs": [
373
+ {
374
+ "name": "",
375
+ "type": "address"
376
+ }
377
+ ]
378
+ },
379
+ {
380
+ "stateMutability": "view",
381
+ "type": "function",
382
+ "name": "call_proxy",
383
+ "inputs": [],
384
+ "outputs": [
385
+ {
386
+ "name": "",
387
+ "type": "address"
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "stateMutability": "view",
393
+ "type": "function",
394
+ "name": "gauge_data",
395
+ "inputs": [
396
+ {
397
+ "name": "arg0",
398
+ "type": "address"
399
+ }
400
+ ],
401
+ "outputs": [
402
+ {
403
+ "name": "",
404
+ "type": "uint256"
405
+ }
406
+ ]
407
+ },
408
+ {
409
+ "stateMutability": "view",
410
+ "type": "function",
411
+ "name": "minted",
412
+ "inputs": [
413
+ {
414
+ "name": "arg0",
415
+ "type": "address"
416
+ },
417
+ {
418
+ "name": "arg1",
419
+ "type": "address"
420
+ }
421
+ ],
422
+ "outputs": [
423
+ {
424
+ "name": "",
425
+ "type": "uint256"
426
+ }
427
+ ]
428
+ },
429
+ {
430
+ "stateMutability": "view",
431
+ "type": "function",
432
+ "name": "get_gauge_from_lp_token",
433
+ "inputs": [
434
+ {
435
+ "name": "arg0",
436
+ "type": "address"
437
+ }
438
+ ],
439
+ "outputs": [
440
+ {
441
+ "name": "",
442
+ "type": "address"
443
+ }
444
+ ]
445
+ },
446
+ {
447
+ "stateMutability": "view",
448
+ "type": "function",
449
+ "name": "get_gauge_count",
450
+ "inputs": [],
451
+ "outputs": [
452
+ {
453
+ "name": "",
454
+ "type": "uint256"
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ "stateMutability": "view",
460
+ "type": "function",
461
+ "name": "get_gauge",
462
+ "inputs": [
463
+ {
464
+ "name": "arg0",
465
+ "type": "uint256"
466
+ }
467
+ ],
468
+ "outputs": [
469
+ {
470
+ "name": "",
471
+ "type": "address"
472
+ }
473
+ ]
474
+ }
475
+ ]