@curvefi/api 2.30.0 → 2.30.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 +2 -0
- package/lib/curve.js +3 -1
- package/lib/factory/deploy.d.ts +6 -6
- package/lib/factory/deploy.js +50 -48
- package/lib/factory/factory-api.js +4 -0
- package/lib/index.d.ts +6 -6
- package/lib/interfaces.d.ts +1 -0
- package/lib/pools/PoolTemplate.d.ts +1 -0
- package/lib/pools/PoolTemplate.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/curve.js
CHANGED
|
@@ -478,7 +478,7 @@ var Curve = /** @class */ (function () {
|
|
|
478
478
|
var _a;
|
|
479
479
|
if (options === void 0) { options = {}; }
|
|
480
480
|
return __awaiter(this, void 0, void 0, function () {
|
|
481
|
-
var network, _b, _c, cTokens, yTokens, ycTokens, aTokens, customAbiTokens, _d, err_1, _i, _e, pool, _f, _g, coinAddr, _h, _j, coinAddr, _k, _l, coinAddr, _minterABI, addressProviderContract, _m;
|
|
481
|
+
var network, _b, poolId, _c, cTokens, yTokens, ycTokens, aTokens, customAbiTokens, _d, err_1, _i, _e, pool, _f, _g, coinAddr, _h, _j, coinAddr, _k, _l, coinAddr, _minterABI, addressProviderContract, _m;
|
|
482
482
|
return __generator(this, function (_o) {
|
|
483
483
|
switch (_o.label) {
|
|
484
484
|
case 0:
|
|
@@ -556,6 +556,8 @@ var Curve = /** @class */ (function () {
|
|
|
556
556
|
this.constants.NETWORK_NAME = exports.NETWORK_CONSTANTS[this.chainId].NAME;
|
|
557
557
|
this.constants.ALIASES = exports.NETWORK_CONSTANTS[this.chainId].ALIASES;
|
|
558
558
|
this.constants.POOLS_DATA = exports.NETWORK_CONSTANTS[this.chainId].POOLS_DATA;
|
|
559
|
+
for (poolId in this.constants.POOLS_DATA)
|
|
560
|
+
this.constants.POOLS_DATA[poolId].in_api = true;
|
|
559
561
|
this.constants.COINS = exports.NETWORK_CONSTANTS[this.chainId].COINS;
|
|
560
562
|
this.constants.DECIMALS = (0, utils_1.extractDecimals)(this.constants.POOLS_DATA);
|
|
561
563
|
this.constants.DECIMALS[this.constants.NATIVE_TOKEN.address] = 18;
|
package/lib/factory/deploy.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
-
export declare const deployStablePlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<number>;
|
|
3
|
-
export declare const deployStablePlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<ethers.ContractTransaction>;
|
|
2
|
+
export declare const deployStablePlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<number>;
|
|
3
|
+
export declare const deployStablePlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<ethers.ContractTransaction>;
|
|
4
4
|
export declare const getDeployedStablePlainPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
5
|
-
export declare const deployStableMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<number>;
|
|
6
|
-
export declare const deployStableMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
|
|
5
|
+
export declare const deployStableMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<number>;
|
|
6
|
+
export declare const deployStableMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
|
|
7
7
|
export declare const getDeployedStableMetaPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
8
|
-
export declare const deployCryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<number>;
|
|
9
|
-
export declare const deployCryptoPool: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<ethers.ContractTransaction>;
|
|
8
|
+
export declare const deployCryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number | string, initialPrice: number | string) => Promise<number>;
|
|
9
|
+
export declare const deployCryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number | string, initialPrice: number | string) => Promise<ethers.ContractTransaction>;
|
|
10
10
|
export declare const getDeployedCryptoPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
11
11
|
export declare const deployGaugeEstimateGas: (pool: string, isCrypto: boolean) => Promise<number>;
|
|
12
12
|
export declare const deployGauge: (pool: string, isCrypto: boolean) => Promise<ethers.ContractTransaction>;
|
package/lib/factory/deploy.js
CHANGED
|
@@ -68,10 +68,10 @@ assetType, implementationIdx, estimateGas) { return __awaiter(void 0, void 0, vo
|
|
|
68
68
|
throw Error("Max symbol length = 10");
|
|
69
69
|
if (![2, 3, 4].includes(coins.length))
|
|
70
70
|
throw Error("Invalid number of coins. Must be 2, 3 or 4");
|
|
71
|
-
if (fee
|
|
72
|
-
throw Error("
|
|
73
|
-
if (fee
|
|
74
|
-
throw Error("
|
|
71
|
+
if ((0, utils_1.BN)(fee).lt(0.04))
|
|
72
|
+
throw Error("fee must be >= 0.04%. Passed fee = ".concat(fee));
|
|
73
|
+
if ((0, utils_1.BN)(fee).gt(1))
|
|
74
|
+
throw Error("fee must be <= 1%. Passed fee = ".concat(fee));
|
|
75
75
|
if (![0, 1, 2, 3].includes(assetType))
|
|
76
76
|
throw Error("Invalid assetType. Must be one of: 0 = USD, 1 = ETH, 2 = BTC, 3 = Other");
|
|
77
77
|
if (![0, 1, 2, 3].includes(implementationIdx))
|
|
@@ -137,10 +137,10 @@ implementationIdx, estimateGas) { return __awaiter(void 0, void 0, void 0, funct
|
|
|
137
137
|
throw Error("Max name length = 32");
|
|
138
138
|
if (symbol.length > 10)
|
|
139
139
|
throw Error("Max symbol length = 10");
|
|
140
|
-
if (fee
|
|
141
|
-
throw Error("
|
|
142
|
-
if (fee
|
|
143
|
-
throw Error("
|
|
140
|
+
if ((0, utils_1.BN)(fee).lt(0.04))
|
|
141
|
+
throw Error("fee must be >= 0.04%. Passed fee = ".concat(fee));
|
|
142
|
+
if ((0, utils_1.BN)(fee).gt(1))
|
|
143
|
+
throw Error("fee must be <= 1%. Passed fee = ".concat(fee));
|
|
144
144
|
if (![0, 1].includes(implementationIdx))
|
|
145
145
|
throw Error("Invalid implementationIdx. Must be one 0 or 1");
|
|
146
146
|
_A = (0, utils_1.parseUnits)(A, 0);
|
|
@@ -197,7 +197,7 @@ var _deployCryptoPool = function (name, symbol, coins, A, gamma, midFee, // %
|
|
|
197
197
|
outFee, // %
|
|
198
198
|
allowedExtraProfit, feeGamma, adjustmentStep, maHalfTime, // Seconds
|
|
199
199
|
initialPrice, estimateGas) { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
-
var _gamma, _midFee, _outFee, _allowedExtraProfit, _feeGamma, _adjustmentStep, _initialPrice, contract, gas, gasLimit;
|
|
200
|
+
var _A, _gamma, _midFee, _outFee, _allowedExtraProfit, _feeGamma, _adjustmentStep, _maHalfTime, _initialPrice, contract, gas, gasLimit;
|
|
201
201
|
return __generator(this, function (_a) {
|
|
202
202
|
switch (_a.label) {
|
|
203
203
|
case 0:
|
|
@@ -209,51 +209,53 @@ initialPrice, estimateGas) { return __awaiter(void 0, void 0, void 0, function (
|
|
|
209
209
|
throw Error("Invalid number of coins. Must be 2");
|
|
210
210
|
if (coins[1] === coins[2])
|
|
211
211
|
throw Error("Coins must be different");
|
|
212
|
-
if (A
|
|
213
|
-
throw Error("A must be >= 4000");
|
|
214
|
-
if (A
|
|
215
|
-
throw Error("A must be <= 4 * 10 ** 9");
|
|
216
|
-
if (gamma
|
|
217
|
-
throw Error("gamma must be >= 1e-8");
|
|
218
|
-
if (gamma
|
|
219
|
-
throw Error("gamma must be <= 0.02");
|
|
220
|
-
if (midFee
|
|
221
|
-
throw Error("midFee must be >= 0.005");
|
|
222
|
-
if (midFee
|
|
223
|
-
throw Error("midFee must be <= 100");
|
|
224
|
-
if (outFee
|
|
225
|
-
throw Error("outFee must be >= midFee");
|
|
226
|
-
if (outFee
|
|
227
|
-
throw Error("outFee must be <= 100");
|
|
228
|
-
if (allowedExtraProfit
|
|
229
|
-
throw Error("allowedExtraProfit must be >= 0");
|
|
230
|
-
if (allowedExtraProfit
|
|
231
|
-
throw Error("allowedExtraProfit must be <= 0.01");
|
|
232
|
-
if (feeGamma
|
|
233
|
-
throw Error("feeGamma must be >= 0");
|
|
234
|
-
if (feeGamma
|
|
235
|
-
throw Error("feeGamma must be <= 1");
|
|
236
|
-
if (adjustmentStep
|
|
237
|
-
throw Error("adjustmentStep must be >= 0");
|
|
238
|
-
if (adjustmentStep
|
|
239
|
-
throw Error("adjustmentStep must be <= 1");
|
|
240
|
-
if (maHalfTime
|
|
241
|
-
throw Error("
|
|
242
|
-
if (maHalfTime
|
|
243
|
-
throw Error("
|
|
244
|
-
if (initialPrice
|
|
245
|
-
throw Error("initialPrice must be >= 1e-12");
|
|
246
|
-
if (initialPrice
|
|
247
|
-
throw Error("initialPrice must be <= 1e12");
|
|
212
|
+
if ((0, utils_1.BN)(A).lt(4000))
|
|
213
|
+
throw Error("A must be >= 4000. Passed A = ".concat(A));
|
|
214
|
+
if ((0, utils_1.BN)(A).gt(4 * (Math.pow(10, 9))))
|
|
215
|
+
throw Error("A must be <= 4 * 10 ** 9. Passed A = ".concat(A));
|
|
216
|
+
if ((0, utils_1.BN)(gamma).lt(1e-8))
|
|
217
|
+
throw Error("gamma must be >= 1e-8. Passed gamma = ".concat(gamma));
|
|
218
|
+
if ((0, utils_1.BN)(gamma).gt(0.02))
|
|
219
|
+
throw Error("gamma must be <= 0.02. Passed gamma = ".concat(gamma));
|
|
220
|
+
if ((0, utils_1.BN)(midFee).lt(0.005))
|
|
221
|
+
throw Error("midFee must be >= 0.005. Passed midFee = ".concat(midFee));
|
|
222
|
+
if ((0, utils_1.BN)(midFee).gt(100))
|
|
223
|
+
throw Error("midFee must be <= 100. Passed midFee = ".concat(midFee));
|
|
224
|
+
if ((0, utils_1.BN)(outFee).lt((0, utils_1.BN)(midFee)))
|
|
225
|
+
throw Error("outFee must be >= midFee. Passed outFee = ".concat(outFee, " < midFee = ").concat(midFee));
|
|
226
|
+
if ((0, utils_1.BN)(outFee).gt(100))
|
|
227
|
+
throw Error("outFee must be <= 100. Passed outFee = ".concat(outFee));
|
|
228
|
+
if ((0, utils_1.BN)(allowedExtraProfit).lt(0))
|
|
229
|
+
throw Error("allowedExtraProfit must be >= 0. Passed allowedExtraProfit = ".concat(allowedExtraProfit));
|
|
230
|
+
if ((0, utils_1.BN)(allowedExtraProfit).gt(0.01))
|
|
231
|
+
throw Error("allowedExtraProfit must be <= 0.01. Passed allowedExtraProfit = ".concat(allowedExtraProfit));
|
|
232
|
+
if ((0, utils_1.BN)(feeGamma).lt(0))
|
|
233
|
+
throw Error("feeGamma must be >= 0. Passed feeGamma = ".concat(feeGamma));
|
|
234
|
+
if ((0, utils_1.BN)(feeGamma).gt(1))
|
|
235
|
+
throw Error("feeGamma must be <= 1. Passed feeGamma = ".concat(feeGamma));
|
|
236
|
+
if ((0, utils_1.BN)(adjustmentStep).lt(0))
|
|
237
|
+
throw Error("adjustmentStep must be >= 0. Passed adjustmentStep=".concat(adjustmentStep));
|
|
238
|
+
if ((0, utils_1.BN)(adjustmentStep).gt(1))
|
|
239
|
+
throw Error("adjustmentStep must be <= 1. Passed adjustmentStep=".concat(adjustmentStep));
|
|
240
|
+
if ((0, utils_1.BN)(maHalfTime).lt(0))
|
|
241
|
+
throw Error("maHalfTime must be >= 0. Passed maHalfTime=".concat(maHalfTime));
|
|
242
|
+
if ((0, utils_1.BN)(maHalfTime).gt(604800))
|
|
243
|
+
throw Error("maHalfTime must be <= 604800. Passed maHalfTime=".concat(maHalfTime));
|
|
244
|
+
if ((0, utils_1.BN)(initialPrice).lt(1e-12))
|
|
245
|
+
throw Error("initialPrice must be >= 1e-12. Passed initialPrice=".concat(initialPrice));
|
|
246
|
+
if ((0, utils_1.BN)(initialPrice).gt(1e12))
|
|
247
|
+
throw Error("initialPrice must be <= 1e12. Passed initialPrice=".concat(initialPrice));
|
|
248
|
+
_A = (0, utils_1.parseUnits)(A, 0);
|
|
248
249
|
_gamma = (0, utils_1.parseUnits)(gamma);
|
|
249
250
|
_midFee = (0, utils_1.parseUnits)(midFee, 8);
|
|
250
251
|
_outFee = (0, utils_1.parseUnits)(outFee, 8);
|
|
251
252
|
_allowedExtraProfit = (0, utils_1.parseUnits)(allowedExtraProfit);
|
|
252
253
|
_feeGamma = (0, utils_1.parseUnits)(feeGamma);
|
|
253
254
|
_adjustmentStep = (0, utils_1.parseUnits)(adjustmentStep);
|
|
255
|
+
_maHalfTime = (0, utils_1.parseUnits)(maHalfTime, 0);
|
|
254
256
|
_initialPrice = (0, utils_1.parseUnits)(initialPrice);
|
|
255
257
|
contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.crypto_factory].contract;
|
|
256
|
-
return [4 /*yield*/, contract.estimateGas.deploy_pool(name, symbol, coins,
|
|
258
|
+
return [4 /*yield*/, contract.estimateGas.deploy_pool(name, symbol, coins, _A, _gamma, _midFee, _outFee, _allowedExtraProfit, _feeGamma, _adjustmentStep, 5000000000, _maHalfTime, _initialPrice, curve_1.curve.constantOptions)];
|
|
257
259
|
case 1:
|
|
258
260
|
gas = _a.sent();
|
|
259
261
|
if (estimateGas)
|
|
@@ -262,8 +264,8 @@ initialPrice, estimateGas) { return __awaiter(void 0, void 0, void 0, function (
|
|
|
262
264
|
return [4 /*yield*/, curve_1.curve.updateFeeData()];
|
|
263
265
|
case 2:
|
|
264
266
|
_a.sent();
|
|
265
|
-
return [4 /*yield*/, contract.deploy_pool(name, symbol, coins,
|
|
266
|
-
|
|
267
|
+
return [4 /*yield*/, contract.deploy_pool(name, symbol, coins, _A, _gamma, _midFee, _outFee, _allowedExtraProfit, _feeGamma, _adjustmentStep, 5000000000, // 50%
|
|
268
|
+
_maHalfTime, _initialPrice, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit }))];
|
|
267
269
|
case 3: return [2 /*return*/, _a.sent()];
|
|
268
270
|
}
|
|
269
271
|
});
|
|
@@ -221,6 +221,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
221
221
|
swap_abi: factory_crypto_pool_2_json_1.default,
|
|
222
222
|
gauge_abi: _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default,
|
|
223
223
|
deposit_abi: basePoolZap.ABI,
|
|
224
|
+
in_api: true,
|
|
224
225
|
};
|
|
225
226
|
}
|
|
226
227
|
else {
|
|
@@ -243,6 +244,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
243
244
|
wrapped_decimals: coinDecimals,
|
|
244
245
|
swap_abi: factory_crypto_pool_2_json_1.default,
|
|
245
246
|
gauge_abi: _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default,
|
|
247
|
+
in_api: true,
|
|
246
248
|
};
|
|
247
249
|
}
|
|
248
250
|
}
|
|
@@ -285,6 +287,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
285
287
|
swap_abi: implementationABIDict[pool.implementationAddress],
|
|
286
288
|
gauge_abi: _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default,
|
|
287
289
|
deposit_abi: basePoolZap.ABI,
|
|
290
|
+
in_api: true,
|
|
288
291
|
};
|
|
289
292
|
}
|
|
290
293
|
else {
|
|
@@ -308,6 +311,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
308
311
|
wrapped_decimals: coinDecimals,
|
|
309
312
|
swap_abi: implementationABIDict[pool.implementationAddress],
|
|
310
313
|
gauge_abi: _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default,
|
|
314
|
+
in_api: true,
|
|
311
315
|
};
|
|
312
316
|
}
|
|
313
317
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -58,16 +58,16 @@ declare const curve: {
|
|
|
58
58
|
fetchPools: (useApi?: boolean) => Promise<void>;
|
|
59
59
|
fetchNewPools: () => Promise<string[]>;
|
|
60
60
|
getPoolList: () => string[];
|
|
61
|
-
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<ethers.ContractTransaction>;
|
|
62
|
-
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
|
|
61
|
+
deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<ethers.ContractTransaction>;
|
|
62
|
+
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
|
|
63
63
|
deployGauge: (poolAddress: string) => Promise<ethers.ContractTransaction>;
|
|
64
64
|
getDeployedPlainPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
65
65
|
getDeployedMetaPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
66
66
|
getDeployedGaugeAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
67
67
|
fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
|
|
68
68
|
estimateGas: {
|
|
69
|
-
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<number>;
|
|
70
|
-
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<number>;
|
|
69
|
+
deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<number>;
|
|
70
|
+
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, implementationIdx: 0 | 1) => Promise<number>;
|
|
71
71
|
deployGauge: (poolAddress: string) => Promise<number>;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
@@ -75,14 +75,14 @@ declare const curve: {
|
|
|
75
75
|
fetchPools: (useApi?: boolean) => Promise<void>;
|
|
76
76
|
fetchNewPools: () => Promise<string[]>;
|
|
77
77
|
getPoolList: () => string[];
|
|
78
|
-
deployPool: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<ethers.ContractTransaction>;
|
|
78
|
+
deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: string | number, initialPrice: string | number) => Promise<ethers.ContractTransaction>;
|
|
79
79
|
deployGauge: (poolAddress: string) => Promise<ethers.ContractTransaction>;
|
|
80
80
|
getDeployed: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
81
81
|
getDeployedPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
82
82
|
getDeployedGaugeAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
83
83
|
fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
|
|
84
84
|
estimateGas: {
|
|
85
|
-
deployPool: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<number>;
|
|
85
|
+
deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: string | number, initialPrice: string | number) => Promise<number>;
|
|
86
86
|
deployGauge: (poolAddress: string) => Promise<number>;
|
|
87
87
|
};
|
|
88
88
|
};
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class PoolTemplate {
|
|
|
27
27
|
underlyingDecimals: number[];
|
|
28
28
|
wrappedDecimals: number[];
|
|
29
29
|
useLending: boolean[];
|
|
30
|
+
inApi: boolean;
|
|
30
31
|
estimateGas: {
|
|
31
32
|
depositApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
32
33
|
deposit: (amounts: (number | string)[]) => Promise<number>;
|
|
@@ -73,6 +73,7 @@ var YEAR = 365 * DAY;
|
|
|
73
73
|
var PoolTemplate = /** @class */ (function () {
|
|
74
74
|
function PoolTemplate(id) {
|
|
75
75
|
var _this = this;
|
|
76
|
+
var _c;
|
|
76
77
|
this.statsParameters = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
77
78
|
var multicallContract, lpMulticallContract, calls, i, additionalCalls, _virtualPrice, _fee, _prices, _adminFee, _A, _lpTokenSupply, _gamma, e_1, _c, virtualPrice, fee, adminFee, A, lpTokenSupply, gamma, priceOracle, priceScale, prices, i, A_PRECISION, _d, _future_A, _initial_A, _future_A_time, _initial_A_time, _e, future_A, initial_A, future_A_time, initial_A_time;
|
|
78
79
|
var _f, _g, _h;
|
|
@@ -1140,6 +1141,7 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
1140
1141
|
this.underlyingDecimals = poolData.underlying_decimals;
|
|
1141
1142
|
this.wrappedDecimals = poolData.wrapped_decimals;
|
|
1142
1143
|
this.useLending = poolData.use_lending || poolData.underlying_coin_addresses.map(function () { return false; });
|
|
1144
|
+
this.inApi = (_c = poolData.in_api) !== null && _c !== void 0 ? _c : false;
|
|
1143
1145
|
this.estimateGas = {
|
|
1144
1146
|
depositApprove: this.depositApproveEstimateGas.bind(this),
|
|
1145
1147
|
deposit: this.depositEstimateGas.bind(this),
|