@curvefi/api 2.52.3 → 2.52.5

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
@@ -1646,6 +1646,36 @@ import curve from "@curvefi/api";
1646
1646
 
1647
1647
  const poolAddress = await curve.stableNgFactory.getDeployedPlainPoolAddress(deployPoolTx);
1648
1648
  // 0x0816bc9ced716008c88bb8940c297e9c9167755e
1649
+
1650
+ // Deploy gauge
1651
+
1652
+ const deployGaugeTx = await curve.stableNgFactory.deployGauge(poolAddress);
1653
+ // {
1654
+ // hash: '0x8bb0eb63430e6c522c30922a833fee263816ebc0f30367d53ecfe52e17b7c3a0',
1655
+ // type: 0,
1656
+ // accessList: null,
1657
+ // ...
1658
+ // }
1659
+ const gaugeAddress = await curve.stableNgFactory.getDeployedGaugeAddress(deployGaugeTx);
1660
+ // 0x1400e08f1d9f5bc90ae19acd4bf81beabc9e79de
1661
+
1662
+ //For sidechain
1663
+ const salt = '15'
1664
+ //salt - unical random string
1665
+ const deployGaugeSidechain = await curve.stableNgFactory.deployGaugeSidechain(poolAddress, salt);
1666
+ // ContractTransactionResponse {
1667
+ // provider: JsonRpcProvider {},
1668
+ // blockNumber: 17393463,
1669
+ // blockHash: '0x7f393493d7eb30b39aeef3118b51925426946eb83b72b18946f0da8c7bec40a0',
1670
+ // ...
1671
+ // }
1672
+ const gaugeSidechainAddress = await curve.stableNgFactory.getDeployedGaugeAddress(deployGaugeSidechain);
1673
+ // 0x60d3d7ebbc44dc810a743703184f062d00e6db7e
1674
+ //After that should be deployed mirror gauge on mainnet with same salt
1675
+ //const gaugeMirrorTx = await curve.stableNgFactory.deployGaugeMirror(sidechainId, salt);
1676
+ //const deployedGaugeMirrorAddress = await curve.stableNgFactory.getDeployedGaugeMirrorAddressByTx(gaugeMirrorTx);
1677
+ //OR
1678
+ //const deployedGaugeMirrorAddress = await curve.stableNgFactory.getDeployedGaugeMirrorAddress(sidechainId);
1649
1679
  })()
1650
1680
  ```
1651
1681
 
@@ -1746,6 +1776,37 @@ import curve from "@curvefi/api";
1746
1776
  // }
1747
1777
  const poolAddress = await curve.factory.getDeployedMetaPoolAddress(deployPoolTx);
1748
1778
  // 0xd3797c5da2cf2db453b995fb8f7a9199f4106ad9
1779
+
1780
+ // Deploy gauge
1781
+
1782
+ const deployGaugeTx = await curve.stableNgFactory.deployGauge(poolAddress);
1783
+ // {
1784
+ // hash: '0x37a53a08d6c71095de8c25bcd4a01b39beec35990f77c7b98355bd064511541f',
1785
+ // type: 0,
1786
+ // accessList: null,
1787
+ // ...
1788
+ // }
1789
+
1790
+ const gaugeAddress = await curve.stableNgFactory.getDeployedGaugeAddress(deployGaugeTx);
1791
+ // 0x326290a1b0004eee78fa6ed4f1d8f4b2523ab669
1792
+
1793
+ //For sidechain
1794
+ const salt = '15'
1795
+ //salt - unical random string
1796
+ const deployGaugeSidechain = await curve.stableNgFactory.deployGaugeSidechain(poolAddress, salt);
1797
+ // ContractTransactionResponse {
1798
+ // provider: JsonRpcProvider {},
1799
+ // blockNumber: 17393463,
1800
+ // blockHash: '0x7f393493d7eb30b39aeef3118b51925426946eb83b72b18946f0da8c7bec40a0',
1801
+ // ...
1802
+ // }
1803
+ const gaugeSidechainAddress = await curve.stableNgFactory.getDeployedGaugeAddress(deployGaugeSidechain);
1804
+ // 0x60d3d7ebbc44dc810a743703184f062d00e6db7e
1805
+ //After that should be deployed mirror gauge on mainnet with same salt
1806
+ //const gaugeMirrorTx = await curve.stableNgFactory.deployGaugeMirror(sidechainId, salt);
1807
+ //const deployedGaugeMirrorAddress = await curve.stableNgFactory.getDeployedGaugeMirrorAddressByTx(gaugeMirrorTx);
1808
+ //OR
1809
+ //const deployedGaugeMirrorAddress = await curve.stableNgFactory.getDeployedGaugeMirrorAddress(sidechainId);
1749
1810
  ```
1750
1811
 
1751
1812
  ### Deploy crypto pool
package/lib/curve.js CHANGED
@@ -581,7 +581,7 @@ var Curve = /** @class */ (function () {
581
581
  return __generator(this, function (_f) {
582
582
  switch (_f.label) {
583
583
  case 0:
584
- if (![1, 56, 8453, 42161].includes(this.chainId))
584
+ if (this.chainId === 1313161554)
585
585
  return [2 /*return*/];
586
586
  if (!useApi) return [3 /*break*/, 2];
587
587
  _a = this.constants;
@@ -375,7 +375,7 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
375
375
  if (methodName === void 0) { methodName = "0x00000000"; }
376
376
  if (oracleAddress === void 0) { oracleAddress = curve.constants.ZERO_ADDRESS; }
377
377
  return __awaiter(void 0, void 0, void 0, function () {
378
- var _A, _fee, methodId, contract, gas, gasLimit;
378
+ var _A, _fee, _offpegFeeMultiplier, methodId, contract, gas, gasLimit;
379
379
  return __generator(this, function (_a) {
380
380
  switch (_a.label) {
381
381
  case 0:
@@ -391,9 +391,10 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
391
391
  throw Error("Invalid implementationIdx. Must be one 0 or 1");
392
392
  _A = parseUnits(A, 0);
393
393
  _fee = parseUnits(fee, 8);
394
+ _offpegFeeMultiplier = parseUnits(offpegFeeMultiplier, 10);
394
395
  methodId = methodName === "0x00000000" ? "0x00000000" : ethers.id(methodName).substring(0, 10);
395
396
  contract = curve.contracts[curve.constants.ALIASES.stable_ng_factory].contract;
396
- return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
397
+ return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, _offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
397
398
  case 1:
398
399
  gas = _a.sent();
399
400
  if (estimateGas)
package/lib/index.d.ts CHANGED
@@ -99,8 +99,14 @@ declare const curve: {
99
99
  getPoolList: () => string[];
100
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
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
+ deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
103
+ deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
104
+ deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
102
105
  getDeployedPlainPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
103
106
  getDeployedMetaPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
107
+ getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
108
+ getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
109
+ getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
104
110
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
105
111
  estimateGas: {
106
112
  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>;
package/lib/index.js CHANGED
@@ -139,8 +139,20 @@ var curve = {
139
139
  getPoolList: _curve.getStableNgFactoryPoolList,
140
140
  deployPlainPool: deployStableNgPlainPool,
141
141
  deployMetaPool: deployStableNgMetaPool,
142
+ deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
143
+ return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.stable_ng_factory)];
144
+ }); }); },
145
+ deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
146
+ return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
147
+ }); }); },
148
+ deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
149
+ return [2 /*return*/, deployGaugeMirror(chainId, salt)];
150
+ }); }); },
142
151
  getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
143
152
  getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
153
+ getDeployedGaugeAddress: getDeployedGaugeAddress,
154
+ getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
155
+ getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
144
156
  fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedStableNgFactoryPool,
145
157
  estimateGas: {
146
158
  deployPlainPool: deployStableNgPlainPoolEstimateGas,
@@ -1408,7 +1408,7 @@ var PoolTemplate = /** @class */ (function () {
1408
1408
  switch (_f.label) {
1409
1409
  case 0:
1410
1410
  amountsBN = amounts.map(BN);
1411
- if (!(this.isCrypto || this.id === 'wsteth')) return [3 /*break*/, 2];
1411
+ if (!(this.isCrypto || this.id === 'wsteth' || this.id === 'factory-crvusd-24')) return [3 /*break*/, 2];
1412
1412
  return [4 /*yield*/, this._underlyingPrices()];
1413
1413
  case 1:
1414
1414
  _c = _f.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.52.3",
3
+ "version": "2.52.5",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",