@curvefi/api 2.51.3 → 2.52.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.
package/README.md CHANGED
@@ -1590,6 +1590,65 @@ import curve from "@curvefi/api";
1590
1590
  })()
1591
1591
  ```
1592
1592
 
1593
+ ### Deploy stable-ng plain pool
1594
+
1595
+ ```ts
1596
+ import curve from "@curvefi/api";
1597
+
1598
+ (async () => {
1599
+ await curve.init('JsonRpc', {}, { gasPrice: 0 });
1600
+
1601
+ const coins = [
1602
+ "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", // stETH
1603
+ "0xac3e018457b222d93114458476f3e3416abbe38f", // sfrxETH
1604
+ ];
1605
+
1606
+ //0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
1607
+ const assetTypes = [2, 1] as Array<0 | 1 | 2 | 3>;
1608
+
1609
+ const oracleAddresses = [
1610
+ '0x0000000000000000000000000000000000000000',
1611
+ '0xac3e018457b222d93114458476f3e3416abbe38f',
1612
+ ];
1613
+
1614
+ const methodNames = [
1615
+ '',
1616
+ 'pricePerShare',
1617
+ ];
1618
+ // OR
1619
+ //const methodNames = [
1620
+ // '0x00000000',
1621
+ // 'pricePerShare',
1622
+ //];
1623
+
1624
+
1625
+ // Deploy pool
1626
+
1627
+ const deployPoolTx = await curve.stableNgFactory.deployPlainPool('Test pool', 'test', coins, 5, 0.05, 5, assetTypes, 0, 600, oracleAddresses, methodNames);
1628
+ // {
1629
+ // accessList:null
1630
+ // blockHash: "0x981c86a28d1e4a675dae3e14868d62683c02c7906082ba78f5304a45cfd55c38"
1631
+ // blockNumber: 18628729
1632
+ // chainId: 1n
1633
+ // data: "0x5bcd3d83000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000004c4b40000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000002580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000095465737420706f6f6c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000474657374000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d8a452bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f"
1634
+ // from: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
1635
+ // gasLimit: 7046085n
1636
+ // gasPrice: 0n
1637
+ // hash: "0xcbd866d6c4c6294b33d5797bdbf5666aad99a4f7fd461f472aeb95121929242b"
1638
+ // index: undefined
1639
+ // maxFeePerGas: null
1640
+ // maxPriorityFeePerGas: null
1641
+ // nonce: 565
1642
+ // to: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf"
1643
+ // type: 0
1644
+ // value: 0n
1645
+ // }
1646
+
1647
+ const poolAddress = await curve.stableNgFactory.getDeployedPlainPoolAddress(deployPoolTx);
1648
+ // 0x0816bc9ced716008c88bb8940c297e9c9167755e
1649
+ })()
1650
+ ```
1651
+
1593
1652
  ### Deploy stable meta pool
1594
1653
 
1595
1654
  ```ts
@@ -1650,6 +1709,45 @@ import curve from "@curvefi/api";
1650
1709
  })()
1651
1710
  ```
1652
1711
 
1712
+ ### Deploy stable-ng meta pool
1713
+
1714
+ ```ts
1715
+ import curve from "@curvefi/api";
1716
+
1717
+ (async () => {
1718
+ await curve.init('JsonRpc', {}, { gasPrice: 0 });
1719
+
1720
+ const basePool = "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7"; // 3pool address
1721
+ const coin = "0xac3e018457b222d93114458476f3e3416abbe38f"; // sfrxETH
1722
+ const oracleAddress = '0xac3e018457b222d93114458476f3e3416abbe38f';
1723
+ const methodName = 'pricePerShare';
1724
+
1725
+ // Deploy pool
1726
+
1727
+ const deployPoolTx = curve.stableNgFactory.deployMetaPool(basePool, 'Test pool', 'test', coin, 5, 0.05, 5, 600, 1, 0, methodName, oracleAddress);
1728
+ // OR const deployPoolTx = curve.stableNgFactory.deployMetaPool(basePool, 'Test pool', 'test',coin, 5, 0.05, 5, 600, 1);
1729
+ // {
1730
+ // accessList: null
1731
+ // blockHash: "0xff6f39ee2dae6940d8a061925bd67d9e1e85947f85a7d65c1eef81abdbba023d"
1732
+ // blockNumber: 18628730
1733
+ // chainId: 1n
1734
+ // data: "0xdf8c5d73000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000004c4b400000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d8a452bc00000000000000000000000000000000000000000000000000000000000000000000000000000000ac3e018457b222d93114458476f3e3416abbe38f00000000000000000000000000000000000000000000000000000000000000095465737420706f6f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000"
1735
+ // from: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
1736
+ // gasLimit: 7215295n
1737
+ // gasPrice: 0n
1738
+ // hash: "0xdada197e9264ea5697216e68eaae8304f45d490a10e230023bbb32568df622f5"
1739
+ // index: undefined
1740
+ // maxFeePerGas: null
1741
+ // maxPriorityFeePerGas: null
1742
+ // nonce: 566
1743
+ // to: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf"
1744
+ // type: 0
1745
+ // value: 0n
1746
+ // }
1747
+ const poolAddress = await curve.factory.getDeployedMetaPoolAddress(deployPoolTx);
1748
+ // 0xd3797c5da2cf2db453b995fb8f7a9199f4106ad9
1749
+ ```
1750
+
1653
1751
  ### Deploy crypto pool
1654
1752
 
1655
1753
  ```ts
package/lib/curve.d.ts CHANGED
@@ -86,6 +86,7 @@ declare class Curve implements ICurve {
86
86
  fetchTricryptoFactoryPools: (useApi?: boolean) => Promise<void>;
87
87
  fetchStableNgFactoryPools: (useApi?: boolean) => Promise<void>;
88
88
  fetchNewFactoryPools: () => Promise<string[]>;
89
+ fetchNewStableNgFactoryPools: () => Promise<string[]>;
89
90
  fetchNewCryptoFactoryPools: () => Promise<string[]>;
90
91
  fetchNewTricryptoFactoryPools: () => Promise<string[]>;
91
92
  fetchRecentlyDeployedFactoryPool: (poolAddress: string) => Promise<string>;
package/lib/curve.js CHANGED
@@ -630,6 +630,23 @@ var Curve = /** @class */ (function () {
630
630
  }
631
631
  });
632
632
  }); };
633
+ this.fetchNewStableNgFactoryPools = function () { return __awaiter(_this, void 0, void 0, function () {
634
+ var currentPoolIds, lastPoolIdx, poolData, _a;
635
+ return __generator(this, function (_b) {
636
+ switch (_b.label) {
637
+ case 0:
638
+ currentPoolIds = Object.keys(this.constants.STABLE_NG_FACTORY_POOLS_DATA);
639
+ lastPoolIdx = currentPoolIds.length === 0 ? -1 : Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
640
+ _a = lowerCasePoolDataAddresses;
641
+ return [4 /*yield*/, getFactoryPoolData.call(this, lastPoolIdx + 1)];
642
+ case 1:
643
+ poolData = _a.apply(void 0, [_b.sent()]);
644
+ this.constants.STABLE_NG_FACTORY_POOLS_DATA = __assign(__assign({}, this.constants.FACTORY_POOLS_DATA), poolData);
645
+ this._updateDecimalsAndGauges(this.constants.STABLE_NG_FACTORY_POOLS_DATA);
646
+ return [2 /*return*/, Object.keys(poolData)];
647
+ }
648
+ });
649
+ }); };
633
650
  this.fetchNewCryptoFactoryPools = function () { return __awaiter(_this, void 0, void 0, function () {
634
651
  var currentPoolIds, lastPoolIdx, poolData, _a;
635
652
  return __generator(this, function (_b) {
@@ -1,12 +1,16 @@
1
1
  import { ethers } from "ethers";
2
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 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<number>;
3
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 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
4
+ export declare const deployStableNgPlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<number>;
5
+ export declare const deployStableNgPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<ethers.ContractTransactionResponse>;
4
6
  export declare const getDeployedStablePlainPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
5
7
  export declare const _setOracle: (poolAddress: string, oracleAddress: string, methodName: string, estimateGas: boolean) => Promise<ethers.ContractTransactionResponse | number>;
6
8
  export declare const setOracleEstimateGas: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<number>;
7
9
  export declare const setOracle: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
8
10
  export declare const deployStableMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<number>;
9
11
  export declare const deployStableMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<ethers.ContractTransactionResponse>;
12
+ export declare const deployStableNgMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetType: 0 | 1 | 2 | 3, emaTime: number, implementationIdx: 0, methodName: string, oracleAddress: string) => Promise<number>;
13
+ export declare const deployStableNgMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, offpegFeeMultiplier: number | string, emaTime: number, implementationIdx: 0, assetType: 0 | 1 | 2 | 3, methodName: string, oracleAddress: string) => Promise<ethers.ContractTransactionResponse>;
10
14
  export declare const getDeployedStableMetaPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
11
15
  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, initialPrice: number | string) => Promise<number>;
12
16
  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, initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
@@ -155,6 +155,108 @@ oracleAddress, methodName) {
155
155
  });
156
156
  });
157
157
  };
158
+ var _deployStableNgPlainPool = function (name, symbol, coins, A, fee, // %
159
+ offpegFeeMultiplier, assetTypes, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
160
+ implementationIdx, emaTime, // seconds
161
+ oracleAddresses, methodNames, estimateGas) {
162
+ if (emaTime === void 0) { emaTime = 600; }
163
+ return __awaiter(void 0, void 0, void 0, function () {
164
+ var _oracleAddresses, _methodNames, _A, _fee, _coins, contractAddress, contract, methodIds, args, gas, gasLimit;
165
+ var _a;
166
+ return __generator(this, function (_b) {
167
+ switch (_b.label) {
168
+ case 0:
169
+ if (name.length > 32)
170
+ throw Error("Max name length = 32");
171
+ if (symbol.length > 10)
172
+ throw Error("Max symbol length = 10");
173
+ if (coins.length < 1)
174
+ throw Error("Invalid number of coins. Must be more than 1");
175
+ if (coins.length > 9)
176
+ throw Error("Invalid number of coins. Must be less than 9");
177
+ if (BN(fee).lt(0.04))
178
+ throw Error("fee must be >= 0.04%. Passed fee = ".concat(fee));
179
+ if (BN(fee).gt(1))
180
+ throw Error("fee must be <= 1%. Passed fee = ".concat(fee));
181
+ if (oracleAddresses.length === 0) {
182
+ _oracleAddresses = new Array(coins.length).fill(curve.constants.ZERO_ADDRESS);
183
+ }
184
+ else {
185
+ _oracleAddresses = oracleAddresses;
186
+ }
187
+ if (methodNames.length === 0) {
188
+ _methodNames = new Array(coins.length).fill("0x00000000");
189
+ }
190
+ else {
191
+ _methodNames = methodNames;
192
+ }
193
+ if (coins.length !== assetTypes.length)
194
+ throw Error("Invalid length of assetTypes. Must be same coins length");
195
+ if (coins.length !== _oracleAddresses.length)
196
+ throw Error("Invalid length of oracleAddresses. Must be same coins length");
197
+ if (coins.length !== _methodNames.length)
198
+ throw Error("Invalid length of methodNames. Must be same coins length");
199
+ assetTypes.forEach(function (item, index) {
200
+ if (![0, 1, 2, 3].includes(item))
201
+ throw Error("Invalid assetType. Must be one of: 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626 for assetTypes[".concat(index, "]"));
202
+ });
203
+ if (![0].includes(implementationIdx))
204
+ throw Error("Invalid implementationIdx. Must be 0");
205
+ if (emaTime <= 0)
206
+ throw Error("emaTime must be > 0. Passed emaTime = ".concat(emaTime));
207
+ _A = parseUnits(A, 0);
208
+ _fee = parseUnits(fee, 8);
209
+ _coins = coins;
210
+ contractAddress = curve.constants.ALIASES.stable_ng_factory;
211
+ contract = curve.contracts[contractAddress].contract;
212
+ methodIds = [];
213
+ _methodNames.forEach(function (item) {
214
+ if (item === '0x00000000' || item === '') {
215
+ methodIds.push('0x00000000');
216
+ }
217
+ else {
218
+ methodIds.push(ethers.id(item).substring(0, 10));
219
+ }
220
+ });
221
+ args = [name, symbol, _coins, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetTypes, methodIds, _oracleAddresses];
222
+ console.log(args);
223
+ return [4 /*yield*/, (_a = contract.deploy_plain_pool).estimateGas.apply(_a, __spreadArray(__spreadArray([], args, false), [curve.constantOptions], false))];
224
+ case 1:
225
+ gas = _b.sent();
226
+ if (estimateGas)
227
+ return [2 /*return*/, smartNumber(gas)];
228
+ gasLimit = mulBy1_3(DIGas(gas));
229
+ return [4 /*yield*/, curve.updateFeeData()];
230
+ case 2:
231
+ _b.sent();
232
+ return [4 /*yield*/, contract.deploy_plain_pool.apply(contract, __spreadArray(__spreadArray([], args, false), [__assign(__assign({}, curve.options), { gasLimit: gasLimit })], false))];
233
+ case 3: return [2 /*return*/, _b.sent()];
234
+ }
235
+ });
236
+ });
237
+ };
238
+ export var deployStableNgPlainPoolEstimateGas = function (name, symbol, coins, A, fee, // %
239
+ offpegFeeMultiplier, assetTypes, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
240
+ implementationIdx, emaTime, // seconds
241
+ oracleAddresses, methodNames) { return __awaiter(void 0, void 0, void 0, function () {
242
+ return __generator(this, function (_a) {
243
+ switch (_a.label) {
244
+ case 0: return [4 /*yield*/, _deployStableNgPlainPool(name, symbol, coins, A, fee, offpegFeeMultiplier, assetTypes, implementationIdx, emaTime, oracleAddresses, methodNames, true)];
245
+ case 1: return [2 /*return*/, _a.sent()];
246
+ }
247
+ });
248
+ }); };
249
+ export var deployStableNgPlainPool = function (name, symbol, coins, A, fee, // %
250
+ offpegFeeMultiplier, assetTypes, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
251
+ implementationIdx, emaTime, // seconds
252
+ oracleAddresses, methodNames) { return __awaiter(void 0, void 0, void 0, function () {
253
+ return __generator(this, function (_a) {
254
+ switch (_a.label) {
255
+ case 0: return [4 /*yield*/, _deployStableNgPlainPool(name, symbol, coins, A, fee, offpegFeeMultiplier, assetTypes, implementationIdx, emaTime, oracleAddresses, methodNames, false)];
256
+ case 1: return [2 /*return*/, _a.sent()];
257
+ }
258
+ });
259
+ }); };
158
260
  export var getDeployedStablePlainPoolAddress = function (tx) { return __awaiter(void 0, void 0, void 0, function () {
159
261
  var txInfo;
160
262
  return __generator(this, function (_a) {
@@ -266,6 +368,70 @@ implementationIdx) { return __awaiter(void 0, void 0, void 0, function () {
266
368
  }
267
369
  });
268
370
  }); };
371
+ var _deployStableNgMetaPool = function (basePool, name, symbol, coin, A, fee, // %
372
+ offpegFeeMultiplier, assetType, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
373
+ emaTime, // seconds
374
+ implementationIdx, methodName, oracleAddress, estimateGas) {
375
+ if (emaTime === void 0) { emaTime = 600; }
376
+ if (implementationIdx === void 0) { implementationIdx = 0; }
377
+ if (methodName === void 0) { methodName = "0x00000000"; }
378
+ if (oracleAddress === void 0) { oracleAddress = curve.constants.ZERO_ADDRESS; }
379
+ return __awaiter(void 0, void 0, void 0, function () {
380
+ var _A, _fee, methodId, contract, gas, gasLimit;
381
+ return __generator(this, function (_a) {
382
+ switch (_a.label) {
383
+ case 0:
384
+ if (name.length > 32)
385
+ throw Error("Max name length = 32");
386
+ if (symbol.length > 10)
387
+ throw Error("Max symbol length = 10");
388
+ if (BN(fee).lt(0.04))
389
+ throw Error("fee must be >= 0.04%. Passed fee = ".concat(fee));
390
+ if (BN(fee).gt(1))
391
+ throw Error("fee must be <= 1%. Passed fee = ".concat(fee));
392
+ if (![0, 1].includes(implementationIdx))
393
+ throw Error("Invalid implementationIdx. Must be one 0 or 1");
394
+ _A = parseUnits(A, 0);
395
+ _fee = parseUnits(fee, 8);
396
+ methodId = methodName === "0x00000000" ? "0x00000000" : ethers.id(methodName).substring(0, 10);
397
+ contract = curve.contracts[curve.constants.ALIASES.stable_ng_factory].contract;
398
+ return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
399
+ case 1:
400
+ gas = _a.sent();
401
+ if (estimateGas)
402
+ return [2 /*return*/, smartNumber(gas)];
403
+ gasLimit = mulBy1_3(DIGas(gas));
404
+ return [4 /*yield*/, curve.updateFeeData()];
405
+ case 2:
406
+ _a.sent();
407
+ return [4 /*yield*/, contract.deploy_metapool(basePool, name, symbol, coin, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, __assign(__assign({}, curve.options), { gasLimit: gasLimit }))];
408
+ case 3: return [2 /*return*/, _a.sent()];
409
+ }
410
+ });
411
+ });
412
+ };
413
+ export var deployStableNgMetaPoolEstimateGas = function (basePool, name, symbol, coin, A, fee, // %
414
+ offpegFeeMultiplier, assetType, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
415
+ emaTime, // seconds
416
+ implementationIdx, methodName, oracleAddress) { return __awaiter(void 0, void 0, void 0, function () {
417
+ return __generator(this, function (_a) {
418
+ switch (_a.label) {
419
+ case 0: return [4 /*yield*/, _deployStableNgMetaPool(basePool, name, symbol, coin, A, fee, offpegFeeMultiplier, assetType, emaTime, implementationIdx, methodName, oracleAddress, true)];
420
+ case 1: return [2 /*return*/, _a.sent()];
421
+ }
422
+ });
423
+ }); };
424
+ export var deployStableNgMetaPool = function (basePool, name, symbol, coin, A, fee, // %
425
+ offpegFeeMultiplier, emaTime, // seconds
426
+ implementationIdx, assetType, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
427
+ methodName, oracleAddress) { return __awaiter(void 0, void 0, void 0, function () {
428
+ return __generator(this, function (_a) {
429
+ switch (_a.label) {
430
+ case 0: return [4 /*yield*/, _deployStableNgMetaPool(basePool, name, symbol, coin, A, fee, offpegFeeMultiplier, assetType, emaTime, implementationIdx, methodName, oracleAddress, false)];
431
+ case 1: return [2 /*return*/, _a.sent()];
432
+ }
433
+ });
434
+ }); };
269
435
  export var getDeployedStableMetaPoolAddress = function (tx) { return __awaiter(void 0, void 0, void 0, function () {
270
436
  var txInfo, i, basePoolId, basePool;
271
437
  return __generator(this, function (_a) {
package/lib/index.d.ts CHANGED
@@ -95,7 +95,16 @@ declare const curve: {
95
95
  };
96
96
  stableNgFactory: {
97
97
  fetchPools: (useApi?: boolean) => Promise<void>;
98
+ fetchNewPools: () => Promise<string[]>;
98
99
  getPoolList: () => string[];
100
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetTypes: (0 | 1 | 2 | 3)[], implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<ethers.ContractTransactionResponse>;
101
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, offpegFeeMultiplier: string | number, emaTime: number, implementationIdx: 0, assetType: 0 | 1 | 2 | 3, methodName: string, oracleAddress: string) => Promise<ethers.ContractTransactionResponse>;
102
+ getDeployedPlainPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
103
+ getDeployedMetaPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
104
+ estimateGas: {
105
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetTypes: (0 | 1 | 2 | 3)[], implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<number>;
106
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetType: 0 | 1 | 2 | 3, emaTime: number, implementationIdx: 0, methodName: string, oracleAddress: string) => Promise<number>;
107
+ };
99
108
  };
100
109
  cryptoFactory: {
101
110
  fetchPools: (useApi?: boolean) => Promise<void>;
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ import { getBestRouteAndOutput, getArgs, swapExpected, swapRequired, swapPriceIm
40
40
  import { curve as _curve } from "./curve.js";
41
41
  import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlockTime, createLockEstimateGas, createLock, isApproved, approveEstimateGas, approve, increaseAmountEstimateGas, increaseAmount, increaseUnlockTimeEstimateGas, increaseUnlockTime, withdrawLockedCrvEstimateGas, withdrawLockedCrv, claimableFees, claimFeesEstimateGas, claimFees, lastEthBlock, getAnycallBalance, topUpAnycall, topUpAnycallEstimateGas, lastBlockSent, blockToSend, sendBlockhash, sendBlockhashEstimateGas, submitProof, submitProofEstimateGas, } from "./boosting.js";
42
42
  import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, getUsdRate, getGasPriceFromL1, getGasPriceFromL2, getTVL, getCoinsData, getVolume, hasDepositAndStake, hasRouter, } from "./utils.js";
43
- import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, getDeployedGaugeMirrorAddressByTx, } from './factory/deploy.js';
43
+ import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, getDeployedGaugeMirrorAddressByTx, deployStableNgPlainPool, deployStableNgPlainPoolEstimateGas, deployStableNgMetaPool, deployStableNgMetaPoolEstimateGas, } from './factory/deploy.js';
44
44
  function init(providerType, providerSettings, options) {
45
45
  if (options === void 0) { options = {}; }
46
46
  return __awaiter(this, void 0, void 0, function () {
@@ -135,7 +135,16 @@ var curve = {
135
135
  },
136
136
  stableNgFactory: {
137
137
  fetchPools: _curve.fetchStableNgFactoryPools,
138
+ fetchNewPools: _curve.fetchNewStableNgFactoryPools,
138
139
  getPoolList: _curve.getStableNgFactoryPoolList,
140
+ deployPlainPool: deployStableNgPlainPool,
141
+ deployMetaPool: deployStableNgMetaPool,
142
+ getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
143
+ getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
144
+ estimateGas: {
145
+ deployPlainPool: deployStableNgPlainPoolEstimateGas,
146
+ deployMetaPool: deployStableNgMetaPoolEstimateGas,
147
+ },
139
148
  },
140
149
  cryptoFactory: {
141
150
  fetchPools: _curve.fetchCryptoFactoryPools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.51.3",
3
+ "version": "2.52.0",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",