@curvefi/api 2.71.2 → 2.71.4
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.
|
@@ -464,60 +464,6 @@
|
|
|
464
464
|
"stateMutability": "nonpayable",
|
|
465
465
|
"type": "function"
|
|
466
466
|
},
|
|
467
|
-
{
|
|
468
|
-
"inputs": [
|
|
469
|
-
{
|
|
470
|
-
"name": "i",
|
|
471
|
-
"type": "uint256"
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
"name": "j",
|
|
475
|
-
"type": "uint256"
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
"name": "dx",
|
|
479
|
-
"type": "uint256"
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
"name": "min_dy",
|
|
483
|
-
"type": "uint256"
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
"name": "receiver",
|
|
487
|
-
"type": "address"
|
|
488
|
-
}
|
|
489
|
-
],
|
|
490
|
-
"name": "exchange_received",
|
|
491
|
-
"outputs": [
|
|
492
|
-
{
|
|
493
|
-
"name": "",
|
|
494
|
-
"type": "uint256"
|
|
495
|
-
}
|
|
496
|
-
],
|
|
497
|
-
"stateMutability": "nonpayable",
|
|
498
|
-
"type": "function"
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
"inputs": [
|
|
502
|
-
{
|
|
503
|
-
"name": "amounts",
|
|
504
|
-
"type": "uint256[2]"
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
"name": "min_mint_amount",
|
|
508
|
-
"type": "uint256"
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
"name": "add_liquidity",
|
|
512
|
-
"outputs": [
|
|
513
|
-
{
|
|
514
|
-
"name": "",
|
|
515
|
-
"type": "uint256"
|
|
516
|
-
}
|
|
517
|
-
],
|
|
518
|
-
"stateMutability": "nonpayable",
|
|
519
|
-
"type": "function"
|
|
520
|
-
},
|
|
521
467
|
{
|
|
522
468
|
"inputs": [
|
|
523
469
|
{
|
|
@@ -527,39 +473,6 @@
|
|
|
527
473
|
{
|
|
528
474
|
"name": "min_mint_amount",
|
|
529
475
|
"type": "uint256"
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
"name": "receiver",
|
|
533
|
-
"type": "address"
|
|
534
|
-
}
|
|
535
|
-
],
|
|
536
|
-
"name": "add_liquidity",
|
|
537
|
-
"outputs": [
|
|
538
|
-
{
|
|
539
|
-
"name": "",
|
|
540
|
-
"type": "uint256"
|
|
541
|
-
}
|
|
542
|
-
],
|
|
543
|
-
"stateMutability": "nonpayable",
|
|
544
|
-
"type": "function"
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
"inputs": [
|
|
548
|
-
{
|
|
549
|
-
"name": "amounts",
|
|
550
|
-
"type": "uint256[2]"
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
"name": "min_mint_amount",
|
|
554
|
-
"type": "uint256"
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
"name": "receiver",
|
|
558
|
-
"type": "address"
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
"name": "donation",
|
|
562
|
-
"type": "bool"
|
|
563
476
|
}
|
|
564
477
|
],
|
|
565
478
|
"name": "add_liquidity",
|
|
@@ -593,31 +506,6 @@
|
|
|
593
506
|
"stateMutability": "nonpayable",
|
|
594
507
|
"type": "function"
|
|
595
508
|
},
|
|
596
|
-
{
|
|
597
|
-
"inputs": [
|
|
598
|
-
{
|
|
599
|
-
"name": "amount",
|
|
600
|
-
"type": "uint256"
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
"name": "min_amounts",
|
|
604
|
-
"type": "uint256[2]"
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
"name": "receiver",
|
|
608
|
-
"type": "address"
|
|
609
|
-
}
|
|
610
|
-
],
|
|
611
|
-
"name": "remove_liquidity",
|
|
612
|
-
"outputs": [
|
|
613
|
-
{
|
|
614
|
-
"name": "",
|
|
615
|
-
"type": "uint256[2]"
|
|
616
|
-
}
|
|
617
|
-
],
|
|
618
|
-
"stateMutability": "nonpayable",
|
|
619
|
-
"type": "function"
|
|
620
|
-
},
|
|
621
509
|
{
|
|
622
510
|
"inputs": [
|
|
623
511
|
{
|
|
@@ -647,39 +535,6 @@
|
|
|
647
535
|
"stateMutability": "nonpayable",
|
|
648
536
|
"type": "function"
|
|
649
537
|
},
|
|
650
|
-
{
|
|
651
|
-
"inputs": [
|
|
652
|
-
{
|
|
653
|
-
"name": "token_amount",
|
|
654
|
-
"type": "uint256"
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
"name": "i",
|
|
658
|
-
"type": "uint256"
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
"name": "amount_i",
|
|
662
|
-
"type": "uint256"
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
"name": "min_amount_j",
|
|
666
|
-
"type": "uint256"
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
"name": "receiver",
|
|
670
|
-
"type": "address"
|
|
671
|
-
}
|
|
672
|
-
],
|
|
673
|
-
"name": "remove_liquidity_fixed_out",
|
|
674
|
-
"outputs": [
|
|
675
|
-
{
|
|
676
|
-
"name": "",
|
|
677
|
-
"type": "uint256"
|
|
678
|
-
}
|
|
679
|
-
],
|
|
680
|
-
"stateMutability": "nonpayable",
|
|
681
|
-
"type": "function"
|
|
682
|
-
},
|
|
683
538
|
{
|
|
684
539
|
"inputs": [
|
|
685
540
|
{
|
|
@@ -705,35 +560,6 @@
|
|
|
705
560
|
"stateMutability": "nonpayable",
|
|
706
561
|
"type": "function"
|
|
707
562
|
},
|
|
708
|
-
{
|
|
709
|
-
"inputs": [
|
|
710
|
-
{
|
|
711
|
-
"name": "lp_token_amount",
|
|
712
|
-
"type": "uint256"
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
"name": "i",
|
|
716
|
-
"type": "uint256"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
"name": "min_amount",
|
|
720
|
-
"type": "uint256"
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
"name": "receiver",
|
|
724
|
-
"type": "address"
|
|
725
|
-
}
|
|
726
|
-
],
|
|
727
|
-
"name": "remove_liquidity_one_coin",
|
|
728
|
-
"outputs": [
|
|
729
|
-
{
|
|
730
|
-
"name": "",
|
|
731
|
-
"type": "uint256"
|
|
732
|
-
}
|
|
733
|
-
],
|
|
734
|
-
"stateMutability": "nonpayable",
|
|
735
|
-
"type": "function"
|
|
736
|
-
},
|
|
737
563
|
{
|
|
738
564
|
"inputs": [],
|
|
739
565
|
"name": "user_supply",
|
|
@@ -954,35 +780,6 @@
|
|
|
954
780
|
"stateMutability": "view",
|
|
955
781
|
"type": "function"
|
|
956
782
|
},
|
|
957
|
-
{
|
|
958
|
-
"inputs": [
|
|
959
|
-
{
|
|
960
|
-
"name": "i",
|
|
961
|
-
"type": "uint256"
|
|
962
|
-
},
|
|
963
|
-
{
|
|
964
|
-
"name": "j",
|
|
965
|
-
"type": "uint256"
|
|
966
|
-
},
|
|
967
|
-
{
|
|
968
|
-
"name": "dy",
|
|
969
|
-
"type": "uint256"
|
|
970
|
-
},
|
|
971
|
-
{
|
|
972
|
-
"name": "n_iter",
|
|
973
|
-
"type": "uint256"
|
|
974
|
-
}
|
|
975
|
-
],
|
|
976
|
-
"name": "get_dx",
|
|
977
|
-
"outputs": [
|
|
978
|
-
{
|
|
979
|
-
"name": "",
|
|
980
|
-
"type": "uint256"
|
|
981
|
-
}
|
|
982
|
-
],
|
|
983
|
-
"stateMutability": "view",
|
|
984
|
-
"type": "function"
|
|
985
|
-
},
|
|
986
783
|
{
|
|
987
784
|
"inputs": [],
|
|
988
785
|
"name": "lp_price",
|
|
@@ -1064,60 +861,6 @@
|
|
|
1064
861
|
"stateMutability": "view",
|
|
1065
862
|
"type": "function"
|
|
1066
863
|
},
|
|
1067
|
-
{
|
|
1068
|
-
"inputs": [
|
|
1069
|
-
{
|
|
1070
|
-
"name": "amounts",
|
|
1071
|
-
"type": "uint256[2]"
|
|
1072
|
-
},
|
|
1073
|
-
{
|
|
1074
|
-
"name": "xp",
|
|
1075
|
-
"type": "uint256[2]"
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
"name": "donation",
|
|
1079
|
-
"type": "bool"
|
|
1080
|
-
}
|
|
1081
|
-
],
|
|
1082
|
-
"name": "calc_token_fee",
|
|
1083
|
-
"outputs": [
|
|
1084
|
-
{
|
|
1085
|
-
"name": "",
|
|
1086
|
-
"type": "uint256"
|
|
1087
|
-
}
|
|
1088
|
-
],
|
|
1089
|
-
"stateMutability": "view",
|
|
1090
|
-
"type": "function"
|
|
1091
|
-
},
|
|
1092
|
-
{
|
|
1093
|
-
"inputs": [
|
|
1094
|
-
{
|
|
1095
|
-
"name": "amounts",
|
|
1096
|
-
"type": "uint256[2]"
|
|
1097
|
-
},
|
|
1098
|
-
{
|
|
1099
|
-
"name": "xp",
|
|
1100
|
-
"type": "uint256[2]"
|
|
1101
|
-
},
|
|
1102
|
-
{
|
|
1103
|
-
"name": "donation",
|
|
1104
|
-
"type": "bool"
|
|
1105
|
-
},
|
|
1106
|
-
{
|
|
1107
|
-
"name": "deposit",
|
|
1108
|
-
"type": "bool"
|
|
1109
|
-
}
|
|
1110
|
-
],
|
|
1111
|
-
"name": "calc_token_fee",
|
|
1112
|
-
"outputs": [
|
|
1113
|
-
{
|
|
1114
|
-
"name": "",
|
|
1115
|
-
"type": "uint256"
|
|
1116
|
-
}
|
|
1117
|
-
],
|
|
1118
|
-
"stateMutability": "view",
|
|
1119
|
-
"type": "function"
|
|
1120
|
-
},
|
|
1121
864
|
{
|
|
1122
865
|
"inputs": [],
|
|
1123
866
|
"name": "A",
|
|
@@ -45,7 +45,7 @@ export const lowerCasePoolDataAddresses = (poolsData) => {
|
|
|
45
45
|
function getSwapAbiByFactoryType(factoryType, pool) {
|
|
46
46
|
var _a;
|
|
47
47
|
const isETHEnabled = pool.implementationAddress === ((_a = this.constants.CRYPTO_FACTORY_CONSTANTS.tricryptoDeployImplementations) === null || _a === void 0 ? void 0 : _a.amm_native_transfers_enabled);
|
|
48
|
-
if (factoryType === "factory-twocrypto" && isYBPool(pool.address)) {
|
|
48
|
+
if (factoryType === "factory-twocrypto" && (pool.isFxSwap || isYBPool(pool.address))) {
|
|
49
49
|
return ybTwocryptoPoolABI;
|
|
50
50
|
}
|
|
51
51
|
const map = {
|
package/lib/interfaces.d.ts
CHANGED
package/lib/prices-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IExtendedPoolDataFromApi, IPoolType, INetworkName, IVolumeAndAPYs } from "./interfaces";
|
|
2
|
-
export type TPricesPoolType = "main" | "crypto" | "factory" | "crvusd" | "factory_crypto" | "factory_tricrypto" | "stableswapng" | "twocryptong" | null;
|
|
2
|
+
export type TPricesPoolType = "main" | "crypto" | "factory" | "crvusd" | "factory_crypto" | "factory_tricrypto" | "stableswapng" | "twocryptong" | "fxswap" | null;
|
|
3
3
|
export declare const LEGACY_POOL_TYPES: readonly IPoolType[];
|
|
4
4
|
export declare const PRICES_POOL_TYPE_TO_LEGACY: Record<NonNullable<TPricesPoolType>, IPoolType>;
|
|
5
5
|
export interface IPricesGauge {
|
package/lib/prices-api.js
CHANGED
|
@@ -27,6 +27,7 @@ export const PRICES_POOL_TYPE_TO_LEGACY = {
|
|
|
27
27
|
factory_tricrypto: "factory-tricrypto",
|
|
28
28
|
stableswapng: "factory-stable-ng",
|
|
29
29
|
twocryptong: "factory-twocrypto",
|
|
30
|
+
fxswap: "factory-twocrypto",
|
|
30
31
|
};
|
|
31
32
|
function fetchJson(url) {
|
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -89,6 +90,7 @@ const adaptPoolFromPricesApi = (pool, gaugeAddressByPoolAddress) => {
|
|
|
89
90
|
totalSupply: ((_e = pool.lp_token_supply) !== null && _e !== void 0 ? _e : 0) * 1e18,
|
|
90
91
|
amplificationCoefficient: pool.amplification_coefficient != null ? String(pool.amplification_coefficient) : "0",
|
|
91
92
|
gaugeCrvApy: [null, null],
|
|
93
|
+
isFxSwap: pool.pool_type === "fxswap",
|
|
92
94
|
};
|
|
93
95
|
};
|
|
94
96
|
export const getPoolsFromPricesApi = (network, poolType) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -109,7 +111,7 @@ export const getPoolsFromPricesApi = (network, poolType) => __awaiter(void 0, vo
|
|
|
109
111
|
tvlAll: (_b = (_a = chainData.total) === null || _a === void 0 ? void 0 : _a.total_tvl) !== null && _b !== void 0 ? _b : 0,
|
|
110
112
|
};
|
|
111
113
|
});
|
|
112
|
-
const CRYPTO_POOL_TYPES = ["crypto", "factory_crypto", "factory_tricrypto", "twocryptong"];
|
|
114
|
+
const CRYPTO_POOL_TYPES = ["crypto", "factory_crypto", "factory_tricrypto", "twocryptong", "fxswap"];
|
|
113
115
|
export const getVolumesFromPricesApi = (network) => __awaiter(void 0, void 0, void 0, function* () {
|
|
114
116
|
const chainData = yield _getPricesChainData(network);
|
|
115
117
|
if (!(chainData === null || chainData === void 0 ? void 0 : chainData.data))
|