@curvefi/api 2.3.3 → 2.4.1
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.
- package/README.md +129 -7
- package/lib/constants/abis/factory-v2/MetaFraxUSD.json +0 -176
- package/lib/constants/abis/factory-v2/MetaFraxUSDBalances.json +0 -176
- package/lib/constants/abis/fraxusdc/metaZap.json +0 -120
- package/lib/constants/pools/ethereum.js +26 -26
- package/lib/interfaces.d.ts +9 -0
- package/lib/pools/PoolTemplate.d.ts +24 -3
- package/lib/pools/PoolTemplate.js +443 -56
- package/lib/pools/poolConstructor.js +22 -18
- package/lib/utils.js +1 -0
- package/package.json +1 -1
|
@@ -72,12 +72,12 @@ var getPool = function (poolId) {
|
|
|
72
72
|
// depositBonus and depositWrappedBonus
|
|
73
73
|
if (poolDummy.isCrypto) {
|
|
74
74
|
Object.assign(Pool.prototype, depositBonusMixins_1.depositBonusCryptoMixin);
|
|
75
|
-
if (!poolDummy.isFake)
|
|
75
|
+
if (!poolDummy.isPlain && !poolDummy.isFake)
|
|
76
76
|
Object.assign(Pool.prototype, depositBonusMixins_1.depositWrappedBonusCryptoMixin);
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
79
|
Object.assign(Pool.prototype, depositBonusMixins_1.depositBonusMixin);
|
|
80
|
-
if (!poolDummy.isFake)
|
|
80
|
+
if (!poolDummy.isPlain && !poolDummy.isFake)
|
|
81
81
|
Object.assign(Pool.prototype, depositBonusMixins_1.depositWrappedBonusMixin);
|
|
82
82
|
}
|
|
83
83
|
// deposit and depositEstimateGas
|
|
@@ -87,18 +87,20 @@ var getPool = function (poolId) {
|
|
|
87
87
|
else if (poolDummy.zap && poolId !== 'susd') {
|
|
88
88
|
Object.assign(Pool.prototype, depositMixins_1.depositZapMixin);
|
|
89
89
|
}
|
|
90
|
-
else if (poolDummy.isLending || poolDummy.isCrypto) {
|
|
90
|
+
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
91
91
|
Object.assign(Pool.prototype, depositMixins_1.depositLendingOrCryptoMixin);
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
94
|
Object.assign(Pool.prototype, depositMixins_1.depositPlainMixin);
|
|
95
95
|
}
|
|
96
96
|
// depositWrapped and depositWrappedEstimateGas
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
98
|
+
if ((poolDummy.isLending || poolDummy.isCrypto) && !poolDummy.zap) {
|
|
99
|
+
Object.assign(Pool.prototype, depositWrappedMixins_1.depositWrapped3argsMixin);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
Object.assign(Pool.prototype, depositWrappedMixins_1.depositWrapped2argsMixin);
|
|
103
|
+
}
|
|
102
104
|
}
|
|
103
105
|
// withdrawExpected
|
|
104
106
|
if (poolDummy.isFake) {
|
|
@@ -107,7 +109,7 @@ var getPool = function (poolId) {
|
|
|
107
109
|
else if (poolDummy.isMeta) {
|
|
108
110
|
Object.assign(Pool.prototype, withdrawExpectedMixins_1.withdrawExpectedMetaMixin);
|
|
109
111
|
}
|
|
110
|
-
else if (poolDummy.isLending || poolDummy.isCrypto) {
|
|
112
|
+
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
111
113
|
Object.assign(Pool.prototype, withdrawExpectedMixins_1.withdrawExpectedLendingOrCryptoMixin);
|
|
112
114
|
}
|
|
113
115
|
else {
|
|
@@ -120,20 +122,22 @@ var getPool = function (poolId) {
|
|
|
120
122
|
else if (poolDummy.zap && poolId !== 'susd') {
|
|
121
123
|
Object.assign(Pool.prototype, withdrawMixins_1.withdrawZapMixin);
|
|
122
124
|
}
|
|
123
|
-
else if (poolDummy.isLending || poolDummy.isCrypto) {
|
|
125
|
+
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
124
126
|
Object.assign(Pool.prototype, withdrawMixins_1.withdrawLendingOrCryptoMixin);
|
|
125
127
|
}
|
|
126
128
|
else {
|
|
127
129
|
Object.assign(Pool.prototype, withdrawMixins_1.withdrawPlainMixin);
|
|
128
130
|
}
|
|
129
131
|
// withdrawWrapped and withdrawWrappedEstimateGas
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
133
|
+
if ((poolDummy.isLending || poolDummy.isCrypto) && !poolDummy.zap) {
|
|
134
|
+
Object.assign(Pool.prototype, withdrawWrappedMixins_1.withdrawWrapped3argsMixin);
|
|
135
|
+
Object.assign(Pool.prototype, withdrawExpectedMixins_1.withdrawWrappedExpectedMixin);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
Object.assign(Pool.prototype, withdrawWrappedMixins_1.withdrawWrapped2argsMixin);
|
|
139
|
+
Object.assign(Pool.prototype, withdrawExpectedMixins_1.withdrawWrappedExpectedMixin);
|
|
140
|
+
}
|
|
137
141
|
}
|
|
138
142
|
// withdrawImbalance and withdrawImbalanceEstimateGas
|
|
139
143
|
if (!poolDummy.isCrypto) {
|
|
@@ -179,7 +183,7 @@ var getPool = function (poolId) {
|
|
|
179
183
|
else if (poolDummy.zap) { // including susd
|
|
180
184
|
Object.assign(Pool.prototype, withdrawOneCoinMixins_1.withdrawOneCoinZapMixin);
|
|
181
185
|
}
|
|
182
|
-
else if (poolDummy.isLending || poolDummy.isCrypto) {
|
|
186
|
+
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
183
187
|
Object.assign(Pool.prototype, withdrawOneCoinMixins_1.withdrawOneCoinLendingOrCryptoMixin);
|
|
184
188
|
}
|
|
185
189
|
else {
|
package/lib/utils.js
CHANGED
|
@@ -464,6 +464,7 @@ var _getUsdRate = function (assetId) { return __awaiter(void 0, void 0, void 0,
|
|
|
464
464
|
throw Error('curve object is not initialized');
|
|
465
465
|
}
|
|
466
466
|
assetId = {
|
|
467
|
+
'CRV': 'curve-dao-token',
|
|
467
468
|
'EUR': curve_1.curve.constants.COINS.eurt,
|
|
468
469
|
'BTC': 'bitcoin',
|
|
469
470
|
'ETH': 'ethereum',
|