@curvefi/api 1.17.2 → 1.20.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 (43) hide show
  1. package/README.md +57 -0
  2. package/lib/constants/abis/abis-ethereum.js +6 -6
  3. package/lib/constants/abis/json/factory-crypto/factory-crypto-pool-2.json +1112 -0
  4. package/lib/constants/abis/json/factory-crypto.json +635 -0
  5. package/lib/constants/abis/json/factory-v2/DepositZapMetaBtcPolygon.json +197 -0
  6. package/lib/constants/abis/json/factory-v2/DepositZapMetaUsdPolygon.json +197 -0
  7. package/lib/constants/abis/json/factory-v2/MetaBTC.json +919 -0
  8. package/lib/constants/abis/json/factory-v2/MetaBTCBalances.json +932 -0
  9. package/lib/constants/abis/json/factory-v2/MetaBTCBalancesRen.json +932 -0
  10. package/lib/constants/abis/json/factory-v2/MetaBTCRen.json +919 -0
  11. package/lib/constants/abis/json/factory-v2/MetaUSD.json +919 -0
  12. package/lib/constants/abis/json/factory-v2/MetaUSDBalances.json +932 -0
  13. package/lib/constants/abis/json/factory-v2/Plain2Balances.json +845 -0
  14. package/lib/constants/abis/json/factory-v2/Plain2Basic.json +845 -0
  15. package/lib/constants/abis/json/factory-v2/Plain2ETH.json +845 -0
  16. package/lib/constants/abis/json/factory-v2/Plain2Optimized.json +844 -0
  17. package/lib/constants/abis/json/factory-v2/Plain3Balances.json +845 -0
  18. package/lib/constants/abis/json/factory-v2/Plain3Basic.json +845 -0
  19. package/lib/constants/abis/json/factory-v2/Plain3ETH.json +845 -0
  20. package/lib/constants/abis/json/factory-v2/Plain3Optimized.json +845 -0
  21. package/lib/constants/abis/json/factory-v2/Plain4Balances.json +845 -0
  22. package/lib/constants/abis/json/factory-v2/Plain4Basic.json +845 -0
  23. package/lib/constants/abis/json/factory-v2/Plain4ETH.json +845 -0
  24. package/lib/constants/abis/json/factory-v2/Plain4Optimized.json +845 -0
  25. package/lib/constants/abis/json/factory.json +1063 -0
  26. package/lib/constants/abis/json/registry_exchange.json +207 -84
  27. package/lib/constants/aliases.d.ts +4 -0
  28. package/lib/constants/aliases.js +4 -0
  29. package/lib/constants/coins-polygon.js +3 -2
  30. package/lib/curve.d.ts +5 -0
  31. package/lib/curve.js +62 -0
  32. package/lib/factory-crypto.d.ts +32 -0
  33. package/lib/factory-crypto.js +377 -0
  34. package/lib/factory.d.ts +32 -0
  35. package/lib/factory.js +607 -0
  36. package/lib/index.d.ts +7 -0
  37. package/lib/index.js +28 -0
  38. package/lib/interfaces.d.ts +28 -1
  39. package/lib/pools.d.ts +5 -0
  40. package/lib/pools.js +359 -159
  41. package/lib/utils.d.ts +8 -1
  42. package/lib/utils.js +111 -8
  43. package/package.json +4 -2
@@ -0,0 +1,844 @@
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": "394688",
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": "2107",
364
+ "inputs": [],
365
+ "name": "get_balances",
366
+ "outputs": [
367
+ {
368
+ "name": "",
369
+ "type": "uint256[2]"
370
+ }
371
+ ],
372
+ "stateMutability": "view",
373
+ "type": "function"
374
+ },
375
+ {
376
+ "gas": "468",
377
+ "inputs": [],
378
+ "name": "admin_fee",
379
+ "outputs": [
380
+ {
381
+ "name": "",
382
+ "type": "uint256"
383
+ }
384
+ ],
385
+ "stateMutability": "view",
386
+ "type": "function"
387
+ },
388
+ {
389
+ "gas": "5564",
390
+ "inputs": [],
391
+ "name": "A",
392
+ "outputs": [
393
+ {
394
+ "name": "",
395
+ "type": "uint256"
396
+ }
397
+ ],
398
+ "stateMutability": "view",
399
+ "type": "function"
400
+ },
401
+ {
402
+ "gas": "5526",
403
+ "inputs": [],
404
+ "name": "A_precise",
405
+ "outputs": [
406
+ {
407
+ "name": "",
408
+ "type": "uint256"
409
+ }
410
+ ],
411
+ "stateMutability": "view",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "gas": "833181",
416
+ "inputs": [],
417
+ "name": "get_virtual_price",
418
+ "outputs": [
419
+ {
420
+ "name": "",
421
+ "type": "uint256"
422
+ }
423
+ ],
424
+ "stateMutability": "view",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "gas": "1659345",
429
+ "inputs": [
430
+ {
431
+ "name": "_amounts",
432
+ "type": "uint256[2]"
433
+ },
434
+ {
435
+ "name": "_is_deposit",
436
+ "type": "bool"
437
+ }
438
+ ],
439
+ "name": "calc_token_amount",
440
+ "outputs": [
441
+ {
442
+ "name": "",
443
+ "type": "uint256"
444
+ }
445
+ ],
446
+ "stateMutability": "view",
447
+ "type": "function"
448
+ },
449
+ {
450
+ "inputs": [
451
+ {
452
+ "name": "_amounts",
453
+ "type": "uint256[2]"
454
+ },
455
+ {
456
+ "name": "_min_mint_amount",
457
+ "type": "uint256"
458
+ }
459
+ ],
460
+ "name": "add_liquidity",
461
+ "outputs": [
462
+ {
463
+ "name": "",
464
+ "type": "uint256"
465
+ }
466
+ ],
467
+ "stateMutability": "nonpayable",
468
+ "type": "function"
469
+ },
470
+ {
471
+ "gas": "2096207",
472
+ "inputs": [
473
+ {
474
+ "name": "i",
475
+ "type": "int128"
476
+ },
477
+ {
478
+ "name": "j",
479
+ "type": "int128"
480
+ },
481
+ {
482
+ "name": "dx",
483
+ "type": "uint256"
484
+ }
485
+ ],
486
+ "name": "get_dy",
487
+ "outputs": [
488
+ {
489
+ "name": "",
490
+ "type": "uint256"
491
+ }
492
+ ],
493
+ "stateMutability": "view",
494
+ "type": "function"
495
+ },
496
+ {
497
+ "inputs": [
498
+ {
499
+ "name": "i",
500
+ "type": "int128"
501
+ },
502
+ {
503
+ "name": "j",
504
+ "type": "int128"
505
+ },
506
+ {
507
+ "name": "_dx",
508
+ "type": "uint256"
509
+ },
510
+ {
511
+ "name": "_min_dy",
512
+ "type": "uint256"
513
+ }
514
+ ],
515
+ "name": "exchange",
516
+ "outputs": [
517
+ {
518
+ "name": "",
519
+ "type": "uint256"
520
+ }
521
+ ],
522
+ "stateMutability": "nonpayable",
523
+ "type": "function"
524
+ },
525
+ {
526
+ "inputs": [
527
+ {
528
+ "name": "_burn_amount",
529
+ "type": "uint256"
530
+ },
531
+ {
532
+ "name": "_min_amounts",
533
+ "type": "uint256[2]"
534
+ }
535
+ ],
536
+ "name": "remove_liquidity",
537
+ "outputs": [
538
+ {
539
+ "name": "",
540
+ "type": "uint256[2]"
541
+ }
542
+ ],
543
+ "stateMutability": "nonpayable",
544
+ "type": "function"
545
+ },
546
+ {
547
+ "inputs": [
548
+ {
549
+ "name": "_amounts",
550
+ "type": "uint256[2]"
551
+ },
552
+ {
553
+ "name": "_max_burn_amount",
554
+ "type": "uint256"
555
+ }
556
+ ],
557
+ "name": "remove_liquidity_imbalance",
558
+ "outputs": [
559
+ {
560
+ "name": "",
561
+ "type": "uint256"
562
+ }
563
+ ],
564
+ "stateMutability": "nonpayable",
565
+ "type": "function"
566
+ },
567
+ {
568
+ "inputs": [
569
+ {
570
+ "name": "_burn_amount",
571
+ "type": "uint256"
572
+ },
573
+ {
574
+ "name": "i",
575
+ "type": "int128"
576
+ }
577
+ ],
578
+ "name": "calc_withdraw_one_coin",
579
+ "outputs": [
580
+ {
581
+ "name": "",
582
+ "type": "uint256"
583
+ }
584
+ ],
585
+ "stateMutability": "view",
586
+ "type": "function"
587
+ },
588
+ {
589
+ "inputs": [
590
+ {
591
+ "name": "_burn_amount",
592
+ "type": "uint256"
593
+ },
594
+ {
595
+ "name": "i",
596
+ "type": "int128"
597
+ },
598
+ {
599
+ "name": "_min_received",
600
+ "type": "uint256"
601
+ }
602
+ ],
603
+ "name": "remove_liquidity_one_coin",
604
+ "outputs": [
605
+ {
606
+ "name": "",
607
+ "type": "uint256"
608
+ }
609
+ ],
610
+ "stateMutability": "nonpayable",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "gas": "152901",
615
+ "inputs": [
616
+ {
617
+ "name": "_future_A",
618
+ "type": "uint256"
619
+ },
620
+ {
621
+ "name": "_future_time",
622
+ "type": "uint256"
623
+ }
624
+ ],
625
+ "name": "ramp_A",
626
+ "outputs": [],
627
+ "stateMutability": "nonpayable",
628
+ "type": "function"
629
+ },
630
+ {
631
+ "gas": "149665",
632
+ "inputs": [],
633
+ "name": "stop_ramp_A",
634
+ "outputs": [],
635
+ "stateMutability": "nonpayable",
636
+ "type": "function"
637
+ },
638
+ {
639
+ "gas": "3740",
640
+ "inputs": [
641
+ {
642
+ "name": "i",
643
+ "type": "uint256"
644
+ }
645
+ ],
646
+ "name": "admin_balances",
647
+ "outputs": [
648
+ {
649
+ "name": "",
650
+ "type": "uint256"
651
+ }
652
+ ],
653
+ "stateMutability": "view",
654
+ "type": "function"
655
+ },
656
+ {
657
+ "gas": "10546",
658
+ "inputs": [],
659
+ "name": "withdraw_admin_fees",
660
+ "outputs": [],
661
+ "stateMutability": "nonpayable",
662
+ "type": "function"
663
+ },
664
+ {
665
+ "gas": "1793",
666
+ "inputs": [
667
+ {
668
+ "name": "arg0",
669
+ "type": "uint256"
670
+ }
671
+ ],
672
+ "name": "coins",
673
+ "outputs": [
674
+ {
675
+ "name": "",
676
+ "type": "address"
677
+ }
678
+ ],
679
+ "stateMutability": "view",
680
+ "type": "function"
681
+ },
682
+ {
683
+ "gas": "1823",
684
+ "inputs": [
685
+ {
686
+ "name": "arg0",
687
+ "type": "uint256"
688
+ }
689
+ ],
690
+ "name": "balances",
691
+ "outputs": [
692
+ {
693
+ "name": "",
694
+ "type": "uint256"
695
+ }
696
+ ],
697
+ "stateMutability": "view",
698
+ "type": "function"
699
+ },
700
+ {
701
+ "gas": "1808",
702
+ "inputs": [],
703
+ "name": "fee",
704
+ "outputs": [
705
+ {
706
+ "name": "",
707
+ "type": "uint256"
708
+ }
709
+ ],
710
+ "stateMutability": "view",
711
+ "type": "function"
712
+ },
713
+ {
714
+ "gas": "1838",
715
+ "inputs": [],
716
+ "name": "initial_A",
717
+ "outputs": [
718
+ {
719
+ "name": "",
720
+ "type": "uint256"
721
+ }
722
+ ],
723
+ "stateMutability": "view",
724
+ "type": "function"
725
+ },
726
+ {
727
+ "gas": "1868",
728
+ "inputs": [],
729
+ "name": "future_A",
730
+ "outputs": [
731
+ {
732
+ "name": "",
733
+ "type": "uint256"
734
+ }
735
+ ],
736
+ "stateMutability": "view",
737
+ "type": "function"
738
+ },
739
+ {
740
+ "gas": "1898",
741
+ "inputs": [],
742
+ "name": "initial_A_time",
743
+ "outputs": [
744
+ {
745
+ "name": "",
746
+ "type": "uint256"
747
+ }
748
+ ],
749
+ "stateMutability": "view",
750
+ "type": "function"
751
+ },
752
+ {
753
+ "gas": "1928",
754
+ "inputs": [],
755
+ "name": "future_A_time",
756
+ "outputs": [
757
+ {
758
+ "name": "",
759
+ "type": "uint256"
760
+ }
761
+ ],
762
+ "stateMutability": "view",
763
+ "type": "function"
764
+ },
765
+ {
766
+ "gas": "8288",
767
+ "inputs": [],
768
+ "name": "name",
769
+ "outputs": [
770
+ {
771
+ "name": "",
772
+ "type": "string"
773
+ }
774
+ ],
775
+ "stateMutability": "view",
776
+ "type": "function"
777
+ },
778
+ {
779
+ "gas": "7341",
780
+ "inputs": [],
781
+ "name": "symbol",
782
+ "outputs": [
783
+ {
784
+ "name": "",
785
+ "type": "string"
786
+ }
787
+ ],
788
+ "stateMutability": "view",
789
+ "type": "function"
790
+ },
791
+ {
792
+ "gas": "2233",
793
+ "inputs": [
794
+ {
795
+ "name": "arg0",
796
+ "type": "address"
797
+ }
798
+ ],
799
+ "name": "balanceOf",
800
+ "outputs": [
801
+ {
802
+ "name": "",
803
+ "type": "uint256"
804
+ }
805
+ ],
806
+ "stateMutability": "view",
807
+ "type": "function"
808
+ },
809
+ {
810
+ "gas": "2478",
811
+ "inputs": [
812
+ {
813
+ "name": "arg0",
814
+ "type": "address"
815
+ },
816
+ {
817
+ "name": "arg1",
818
+ "type": "address"
819
+ }
820
+ ],
821
+ "name": "allowance",
822
+ "outputs": [
823
+ {
824
+ "name": "",
825
+ "type": "uint256"
826
+ }
827
+ ],
828
+ "stateMutability": "view",
829
+ "type": "function"
830
+ },
831
+ {
832
+ "gas": "2078",
833
+ "inputs": [],
834
+ "name": "totalSupply",
835
+ "outputs": [
836
+ {
837
+ "name": "",
838
+ "type": "uint256"
839
+ }
840
+ ],
841
+ "stateMutability": "view",
842
+ "type": "function"
843
+ }
844
+ ]