@curvefi/api 1.17.2 → 1.18.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.
Files changed (38) hide show
  1. package/README.md +37 -0
  2. package/lib/constants/abis/abis-ethereum.js +6 -6
  3. package/lib/constants/abis/json/factory-v2/DepositZapMetaBtcPolygon.json +197 -0
  4. package/lib/constants/abis/json/factory-v2/DepositZapMetaUsdPolygon.json +197 -0
  5. package/lib/constants/abis/json/factory-v2/MetaBTC.json +919 -0
  6. package/lib/constants/abis/json/factory-v2/MetaBTCBalances.json +932 -0
  7. package/lib/constants/abis/json/factory-v2/MetaBTCBalancesRen.json +932 -0
  8. package/lib/constants/abis/json/factory-v2/MetaBTCRen.json +919 -0
  9. package/lib/constants/abis/json/factory-v2/MetaUSD.json +919 -0
  10. package/lib/constants/abis/json/factory-v2/MetaUSDBalances.json +932 -0
  11. package/lib/constants/abis/json/factory-v2/Plain2Balances.json +845 -0
  12. package/lib/constants/abis/json/factory-v2/Plain2Basic.json +845 -0
  13. package/lib/constants/abis/json/factory-v2/Plain2ETH.json +845 -0
  14. package/lib/constants/abis/json/factory-v2/Plain2Optimized.json +844 -0
  15. package/lib/constants/abis/json/factory-v2/Plain3Balances.json +845 -0
  16. package/lib/constants/abis/json/factory-v2/Plain3Basic.json +845 -0
  17. package/lib/constants/abis/json/factory-v2/Plain3ETH.json +845 -0
  18. package/lib/constants/abis/json/factory-v2/Plain3Optimized.json +845 -0
  19. package/lib/constants/abis/json/factory-v2/Plain4Balances.json +845 -0
  20. package/lib/constants/abis/json/factory-v2/Plain4Basic.json +845 -0
  21. package/lib/constants/abis/json/factory-v2/Plain4ETH.json +845 -0
  22. package/lib/constants/abis/json/factory-v2/Plain4Optimized.json +845 -0
  23. package/lib/constants/abis/json/factory.json +1063 -0
  24. package/lib/constants/aliases.d.ts +2 -0
  25. package/lib/constants/aliases.js +2 -0
  26. package/lib/constants/coins-polygon.js +3 -2
  27. package/lib/curve.d.ts +3 -0
  28. package/lib/curve.js +34 -0
  29. package/lib/factory.d.ts +32 -0
  30. package/lib/factory.js +607 -0
  31. package/lib/index.d.ts +3 -0
  32. package/lib/index.js +14 -0
  33. package/lib/interfaces.d.ts +15 -1
  34. package/lib/pools.d.ts +3 -0
  35. package/lib/pools.js +149 -62
  36. package/lib/utils.d.ts +7 -1
  37. package/lib/utils.js +109 -8
  38. package/package.json +4 -2
@@ -0,0 +1,845 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": true,
7
+ "name": "sender",
8
+ "type": "address"
9
+ },
10
+ {
11
+ "indexed": true,
12
+ "name": "receiver",
13
+ "type": "address"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "name": "value",
18
+ "type": "uint256"
19
+ }
20
+ ],
21
+ "name": "Transfer",
22
+ "type": "event"
23
+ },
24
+ {
25
+ "anonymous": false,
26
+ "inputs": [
27
+ {
28
+ "indexed": true,
29
+ "name": "owner",
30
+ "type": "address"
31
+ },
32
+ {
33
+ "indexed": true,
34
+ "name": "spender",
35
+ "type": "address"
36
+ },
37
+ {
38
+ "indexed": false,
39
+ "name": "value",
40
+ "type": "uint256"
41
+ }
42
+ ],
43
+ "name": "Approval",
44
+ "type": "event"
45
+ },
46
+ {
47
+ "anonymous": false,
48
+ "inputs": [
49
+ {
50
+ "indexed": true,
51
+ "name": "buyer",
52
+ "type": "address"
53
+ },
54
+ {
55
+ "indexed": false,
56
+ "name": "sold_id",
57
+ "type": "int128"
58
+ },
59
+ {
60
+ "indexed": false,
61
+ "name": "tokens_sold",
62
+ "type": "uint256"
63
+ },
64
+ {
65
+ "indexed": false,
66
+ "name": "bought_id",
67
+ "type": "int128"
68
+ },
69
+ {
70
+ "indexed": false,
71
+ "name": "tokens_bought",
72
+ "type": "uint256"
73
+ }
74
+ ],
75
+ "name": "TokenExchange",
76
+ "type": "event"
77
+ },
78
+ {
79
+ "anonymous": false,
80
+ "inputs": [
81
+ {
82
+ "indexed": true,
83
+ "name": "provider",
84
+ "type": "address"
85
+ },
86
+ {
87
+ "indexed": false,
88
+ "name": "token_amounts",
89
+ "type": "uint256[2]"
90
+ },
91
+ {
92
+ "indexed": false,
93
+ "name": "fees",
94
+ "type": "uint256[2]"
95
+ },
96
+ {
97
+ "indexed": false,
98
+ "name": "invariant",
99
+ "type": "uint256"
100
+ },
101
+ {
102
+ "indexed": false,
103
+ "name": "token_supply",
104
+ "type": "uint256"
105
+ }
106
+ ],
107
+ "name": "AddLiquidity",
108
+ "type": "event"
109
+ },
110
+ {
111
+ "anonymous": false,
112
+ "inputs": [
113
+ {
114
+ "indexed": true,
115
+ "name": "provider",
116
+ "type": "address"
117
+ },
118
+ {
119
+ "indexed": false,
120
+ "name": "token_amounts",
121
+ "type": "uint256[2]"
122
+ },
123
+ {
124
+ "indexed": false,
125
+ "name": "fees",
126
+ "type": "uint256[2]"
127
+ },
128
+ {
129
+ "indexed": false,
130
+ "name": "token_supply",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "name": "RemoveLiquidity",
135
+ "type": "event"
136
+ },
137
+ {
138
+ "anonymous": false,
139
+ "inputs": [
140
+ {
141
+ "indexed": true,
142
+ "name": "provider",
143
+ "type": "address"
144
+ },
145
+ {
146
+ "indexed": false,
147
+ "name": "token_amount",
148
+ "type": "uint256"
149
+ },
150
+ {
151
+ "indexed": false,
152
+ "name": "coin_amount",
153
+ "type": "uint256"
154
+ },
155
+ {
156
+ "indexed": false,
157
+ "name": "token_supply",
158
+ "type": "uint256"
159
+ }
160
+ ],
161
+ "name": "RemoveLiquidityOne",
162
+ "type": "event"
163
+ },
164
+ {
165
+ "anonymous": false,
166
+ "inputs": [
167
+ {
168
+ "indexed": true,
169
+ "name": "provider",
170
+ "type": "address"
171
+ },
172
+ {
173
+ "indexed": false,
174
+ "name": "token_amounts",
175
+ "type": "uint256[2]"
176
+ },
177
+ {
178
+ "indexed": false,
179
+ "name": "fees",
180
+ "type": "uint256[2]"
181
+ },
182
+ {
183
+ "indexed": false,
184
+ "name": "invariant",
185
+ "type": "uint256"
186
+ },
187
+ {
188
+ "indexed": false,
189
+ "name": "token_supply",
190
+ "type": "uint256"
191
+ }
192
+ ],
193
+ "name": "RemoveLiquidityImbalance",
194
+ "type": "event"
195
+ },
196
+ {
197
+ "anonymous": false,
198
+ "inputs": [
199
+ {
200
+ "indexed": false,
201
+ "name": "old_A",
202
+ "type": "uint256"
203
+ },
204
+ {
205
+ "indexed": false,
206
+ "name": "new_A",
207
+ "type": "uint256"
208
+ },
209
+ {
210
+ "indexed": false,
211
+ "name": "initial_time",
212
+ "type": "uint256"
213
+ },
214
+ {
215
+ "indexed": false,
216
+ "name": "future_time",
217
+ "type": "uint256"
218
+ }
219
+ ],
220
+ "name": "RampA",
221
+ "type": "event"
222
+ },
223
+ {
224
+ "anonymous": false,
225
+ "inputs": [
226
+ {
227
+ "indexed": false,
228
+ "name": "A",
229
+ "type": "uint256"
230
+ },
231
+ {
232
+ "indexed": false,
233
+ "name": "t",
234
+ "type": "uint256"
235
+ }
236
+ ],
237
+ "name": "StopRampA",
238
+ "type": "event"
239
+ },
240
+ {
241
+ "inputs": [],
242
+ "outputs": [],
243
+ "stateMutability": "nonpayable",
244
+ "type": "constructor"
245
+ },
246
+ {
247
+ "gas": "464602",
248
+ "inputs": [
249
+ {
250
+ "name": "_name",
251
+ "type": "string"
252
+ },
253
+ {
254
+ "name": "_symbol",
255
+ "type": "string"
256
+ },
257
+ {
258
+ "name": "_coins",
259
+ "type": "address[4]"
260
+ },
261
+ {
262
+ "name": "_rate_multipliers",
263
+ "type": "uint256[4]"
264
+ },
265
+ {
266
+ "name": "_A",
267
+ "type": "uint256"
268
+ },
269
+ {
270
+ "name": "_fee",
271
+ "type": "uint256"
272
+ }
273
+ ],
274
+ "name": "initialize",
275
+ "outputs": [],
276
+ "stateMutability": "nonpayable",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "gas": "318",
281
+ "inputs": [],
282
+ "name": "decimals",
283
+ "outputs": [
284
+ {
285
+ "name": "",
286
+ "type": "uint256"
287
+ }
288
+ ],
289
+ "stateMutability": "view",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "gas": "75377",
294
+ "inputs": [
295
+ {
296
+ "name": "_to",
297
+ "type": "address"
298
+ },
299
+ {
300
+ "name": "_value",
301
+ "type": "uint256"
302
+ }
303
+ ],
304
+ "name": "transfer",
305
+ "outputs": [
306
+ {
307
+ "name": "",
308
+ "type": "bool"
309
+ }
310
+ ],
311
+ "stateMutability": "nonpayable",
312
+ "type": "function"
313
+ },
314
+ {
315
+ "gas": "112012",
316
+ "inputs": [
317
+ {
318
+ "name": "_from",
319
+ "type": "address"
320
+ },
321
+ {
322
+ "name": "_to",
323
+ "type": "address"
324
+ },
325
+ {
326
+ "name": "_value",
327
+ "type": "uint256"
328
+ }
329
+ ],
330
+ "name": "transferFrom",
331
+ "outputs": [
332
+ {
333
+ "name": "",
334
+ "type": "bool"
335
+ }
336
+ ],
337
+ "stateMutability": "nonpayable",
338
+ "type": "function"
339
+ },
340
+ {
341
+ "gas": "37851",
342
+ "inputs": [
343
+ {
344
+ "name": "_spender",
345
+ "type": "address"
346
+ },
347
+ {
348
+ "name": "_value",
349
+ "type": "uint256"
350
+ }
351
+ ],
352
+ "name": "approve",
353
+ "outputs": [
354
+ {
355
+ "name": "",
356
+ "type": "bool"
357
+ }
358
+ ],
359
+ "stateMutability": "nonpayable",
360
+ "type": "function"
361
+ },
362
+ {
363
+ "gas": "7163",
364
+ "inputs": [
365
+ {
366
+ "name": "i",
367
+ "type": "uint256"
368
+ }
369
+ ],
370
+ "name": "balances",
371
+ "outputs": [
372
+ {
373
+ "name": "",
374
+ "type": "uint256"
375
+ }
376
+ ],
377
+ "stateMutability": "view",
378
+ "type": "function"
379
+ },
380
+ {
381
+ "gas": "7139",
382
+ "inputs": [],
383
+ "name": "get_balances",
384
+ "outputs": [
385
+ {
386
+ "name": "",
387
+ "type": "uint256[2]"
388
+ }
389
+ ],
390
+ "stateMutability": "view",
391
+ "type": "function"
392
+ },
393
+ {
394
+ "gas": "498",
395
+ "inputs": [],
396
+ "name": "admin_fee",
397
+ "outputs": [
398
+ {
399
+ "name": "",
400
+ "type": "uint256"
401
+ }
402
+ ],
403
+ "stateMutability": "view",
404
+ "type": "function"
405
+ },
406
+ {
407
+ "gas": "5624",
408
+ "inputs": [],
409
+ "name": "A",
410
+ "outputs": [
411
+ {
412
+ "name": "",
413
+ "type": "uint256"
414
+ }
415
+ ],
416
+ "stateMutability": "view",
417
+ "type": "function"
418
+ },
419
+ {
420
+ "gas": "5586",
421
+ "inputs": [],
422
+ "name": "A_precise",
423
+ "outputs": [
424
+ {
425
+ "name": "",
426
+ "type": "uint256"
427
+ }
428
+ ],
429
+ "stateMutability": "view",
430
+ "type": "function"
431
+ },
432
+ {
433
+ "gas": "842268",
434
+ "inputs": [],
435
+ "name": "get_virtual_price",
436
+ "outputs": [
437
+ {
438
+ "name": "",
439
+ "type": "uint256"
440
+ }
441
+ ],
442
+ "stateMutability": "view",
443
+ "type": "function"
444
+ },
445
+ {
446
+ "gas": "3327481",
447
+ "inputs": [
448
+ {
449
+ "name": "_amounts",
450
+ "type": "uint256[2]"
451
+ },
452
+ {
453
+ "name": "_is_deposit",
454
+ "type": "bool"
455
+ }
456
+ ],
457
+ "name": "calc_token_amount",
458
+ "outputs": [
459
+ {
460
+ "name": "",
461
+ "type": "uint256"
462
+ }
463
+ ],
464
+ "stateMutability": "view",
465
+ "type": "function"
466
+ },
467
+ {
468
+ "inputs": [
469
+ {
470
+ "name": "_amounts",
471
+ "type": "uint256[2]"
472
+ },
473
+ {
474
+ "name": "_min_mint_amount",
475
+ "type": "uint256"
476
+ }
477
+ ],
478
+ "name": "add_liquidity",
479
+ "outputs": [
480
+ {
481
+ "name": "",
482
+ "type": "uint256"
483
+ }
484
+ ],
485
+ "stateMutability": "nonpayable",
486
+ "type": "function"
487
+ },
488
+ {
489
+ "gas": "2106104",
490
+ "inputs": [
491
+ {
492
+ "name": "i",
493
+ "type": "int128"
494
+ },
495
+ {
496
+ "name": "j",
497
+ "type": "int128"
498
+ },
499
+ {
500
+ "name": "dx",
501
+ "type": "uint256"
502
+ }
503
+ ],
504
+ "name": "get_dy",
505
+ "outputs": [
506
+ {
507
+ "name": "",
508
+ "type": "uint256"
509
+ }
510
+ ],
511
+ "stateMutability": "view",
512
+ "type": "function"
513
+ },
514
+ {
515
+ "inputs": [
516
+ {
517
+ "name": "i",
518
+ "type": "int128"
519
+ },
520
+ {
521
+ "name": "j",
522
+ "type": "int128"
523
+ },
524
+ {
525
+ "name": "_dx",
526
+ "type": "uint256"
527
+ },
528
+ {
529
+ "name": "_min_dy",
530
+ "type": "uint256"
531
+ }
532
+ ],
533
+ "name": "exchange",
534
+ "outputs": [
535
+ {
536
+ "name": "",
537
+ "type": "uint256"
538
+ }
539
+ ],
540
+ "stateMutability": "nonpayable",
541
+ "type": "function"
542
+ },
543
+ {
544
+ "inputs": [
545
+ {
546
+ "name": "_burn_amount",
547
+ "type": "uint256"
548
+ },
549
+ {
550
+ "name": "_min_amounts",
551
+ "type": "uint256[2]"
552
+ }
553
+ ],
554
+ "name": "remove_liquidity",
555
+ "outputs": [
556
+ {
557
+ "name": "",
558
+ "type": "uint256[2]"
559
+ }
560
+ ],
561
+ "stateMutability": "nonpayable",
562
+ "type": "function"
563
+ },
564
+ {
565
+ "inputs": [
566
+ {
567
+ "name": "_amounts",
568
+ "type": "uint256[2]"
569
+ },
570
+ {
571
+ "name": "_max_burn_amount",
572
+ "type": "uint256"
573
+ }
574
+ ],
575
+ "name": "remove_liquidity_imbalance",
576
+ "outputs": [
577
+ {
578
+ "name": "",
579
+ "type": "uint256"
580
+ }
581
+ ],
582
+ "stateMutability": "nonpayable",
583
+ "type": "function"
584
+ },
585
+ {
586
+ "gas": "1130",
587
+ "inputs": [
588
+ {
589
+ "name": "_burn_amount",
590
+ "type": "uint256"
591
+ },
592
+ {
593
+ "name": "i",
594
+ "type": "int128"
595
+ }
596
+ ],
597
+ "name": "calc_withdraw_one_coin",
598
+ "outputs": [
599
+ {
600
+ "name": "",
601
+ "type": "uint256"
602
+ }
603
+ ],
604
+ "stateMutability": "view",
605
+ "type": "function"
606
+ },
607
+ {
608
+ "inputs": [
609
+ {
610
+ "name": "_burn_amount",
611
+ "type": "uint256"
612
+ },
613
+ {
614
+ "name": "i",
615
+ "type": "int128"
616
+ },
617
+ {
618
+ "name": "_min_received",
619
+ "type": "uint256"
620
+ }
621
+ ],
622
+ "name": "remove_liquidity_one_coin",
623
+ "outputs": [
624
+ {
625
+ "name": "",
626
+ "type": "uint256"
627
+ }
628
+ ],
629
+ "stateMutability": "nonpayable",
630
+ "type": "function"
631
+ },
632
+ {
633
+ "gas": "152961",
634
+ "inputs": [
635
+ {
636
+ "name": "_future_A",
637
+ "type": "uint256"
638
+ },
639
+ {
640
+ "name": "_future_time",
641
+ "type": "uint256"
642
+ }
643
+ ],
644
+ "name": "ramp_A",
645
+ "outputs": [],
646
+ "stateMutability": "nonpayable",
647
+ "type": "function"
648
+ },
649
+ {
650
+ "gas": "149725",
651
+ "inputs": [],
652
+ "name": "stop_ramp_A",
653
+ "outputs": [],
654
+ "stateMutability": "nonpayable",
655
+ "type": "function"
656
+ },
657
+ {
658
+ "gas": "52006",
659
+ "inputs": [],
660
+ "name": "withdraw_admin_fees",
661
+ "outputs": [],
662
+ "stateMutability": "nonpayable",
663
+ "type": "function"
664
+ },
665
+ {
666
+ "gas": "1793",
667
+ "inputs": [
668
+ {
669
+ "name": "arg0",
670
+ "type": "uint256"
671
+ }
672
+ ],
673
+ "name": "coins",
674
+ "outputs": [
675
+ {
676
+ "name": "",
677
+ "type": "address"
678
+ }
679
+ ],
680
+ "stateMutability": "view",
681
+ "type": "function"
682
+ },
683
+ {
684
+ "gas": "1823",
685
+ "inputs": [
686
+ {
687
+ "name": "arg0",
688
+ "type": "uint256"
689
+ }
690
+ ],
691
+ "name": "admin_balances",
692
+ "outputs": [
693
+ {
694
+ "name": "",
695
+ "type": "uint256"
696
+ }
697
+ ],
698
+ "stateMutability": "view",
699
+ "type": "function"
700
+ },
701
+ {
702
+ "gas": "1808",
703
+ "inputs": [],
704
+ "name": "fee",
705
+ "outputs": [
706
+ {
707
+ "name": "",
708
+ "type": "uint256"
709
+ }
710
+ ],
711
+ "stateMutability": "view",
712
+ "type": "function"
713
+ },
714
+ {
715
+ "gas": "1838",
716
+ "inputs": [],
717
+ "name": "initial_A",
718
+ "outputs": [
719
+ {
720
+ "name": "",
721
+ "type": "uint256"
722
+ }
723
+ ],
724
+ "stateMutability": "view",
725
+ "type": "function"
726
+ },
727
+ {
728
+ "gas": "1868",
729
+ "inputs": [],
730
+ "name": "future_A",
731
+ "outputs": [
732
+ {
733
+ "name": "",
734
+ "type": "uint256"
735
+ }
736
+ ],
737
+ "stateMutability": "view",
738
+ "type": "function"
739
+ },
740
+ {
741
+ "gas": "1898",
742
+ "inputs": [],
743
+ "name": "initial_A_time",
744
+ "outputs": [
745
+ {
746
+ "name": "",
747
+ "type": "uint256"
748
+ }
749
+ ],
750
+ "stateMutability": "view",
751
+ "type": "function"
752
+ },
753
+ {
754
+ "gas": "1928",
755
+ "inputs": [],
756
+ "name": "future_A_time",
757
+ "outputs": [
758
+ {
759
+ "name": "",
760
+ "type": "uint256"
761
+ }
762
+ ],
763
+ "stateMutability": "view",
764
+ "type": "function"
765
+ },
766
+ {
767
+ "gas": "8288",
768
+ "inputs": [],
769
+ "name": "name",
770
+ "outputs": [
771
+ {
772
+ "name": "",
773
+ "type": "string"
774
+ }
775
+ ],
776
+ "stateMutability": "view",
777
+ "type": "function"
778
+ },
779
+ {
780
+ "gas": "7341",
781
+ "inputs": [],
782
+ "name": "symbol",
783
+ "outputs": [
784
+ {
785
+ "name": "",
786
+ "type": "string"
787
+ }
788
+ ],
789
+ "stateMutability": "view",
790
+ "type": "function"
791
+ },
792
+ {
793
+ "gas": "2233",
794
+ "inputs": [
795
+ {
796
+ "name": "arg0",
797
+ "type": "address"
798
+ }
799
+ ],
800
+ "name": "balanceOf",
801
+ "outputs": [
802
+ {
803
+ "name": "",
804
+ "type": "uint256"
805
+ }
806
+ ],
807
+ "stateMutability": "view",
808
+ "type": "function"
809
+ },
810
+ {
811
+ "gas": "2478",
812
+ "inputs": [
813
+ {
814
+ "name": "arg0",
815
+ "type": "address"
816
+ },
817
+ {
818
+ "name": "arg1",
819
+ "type": "address"
820
+ }
821
+ ],
822
+ "name": "allowance",
823
+ "outputs": [
824
+ {
825
+ "name": "",
826
+ "type": "uint256"
827
+ }
828
+ ],
829
+ "stateMutability": "view",
830
+ "type": "function"
831
+ },
832
+ {
833
+ "gas": "2078",
834
+ "inputs": [],
835
+ "name": "totalSupply",
836
+ "outputs": [
837
+ {
838
+ "name": "",
839
+ "type": "uint256"
840
+ }
841
+ ],
842
+ "stateMutability": "view",
843
+ "type": "function"
844
+ }
845
+ ]