@curvefi/api 2.61.2 → 2.61.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.
Files changed (2) hide show
  1. package/lib/utils.js +17 -5
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -768,17 +768,21 @@ export var getGasPriceFromL2 = function () { return __awaiter(void 0, void 0, vo
768
768
  return [4 /*yield*/, getGasPrice()]; // gwei
769
769
  case 3: return [2 /*return*/, _a.sent()]; // gwei
770
770
  case 4:
771
- if (!L2Networks.includes(curve.chainId)) return [3 /*break*/, 6];
771
+ if (!(curve.chainId === 5000)) return [3 /*break*/, 6];
772
+ return [4 /*yield*/, getGasPrice()]; // gwei
773
+ case 5: return [2 /*return*/, _a.sent()]; // gwei
774
+ case 6:
775
+ if (!L2Networks.includes(curve.chainId)) return [3 /*break*/, 8];
772
776
  return [4 /*yield*/, curve.contracts[curve.constants.ALIASES.gas_oracle_blob].contract.gasPrice({ "gasPrice": "0x2000000" })];
773
- case 5:
777
+ case 7:
774
778
  gasPrice = _a.sent();
775
779
  return [2 /*return*/, Number(gasPrice)];
776
- case 6: throw Error("This method exists only for L2 networks");
780
+ case 8: throw Error("This method exists only for L2 networks");
777
781
  }
778
782
  });
779
783
  }); };
780
784
  export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void 0, function () {
781
- var baseFee, gasPrice;
785
+ var baseFee, gasPrice, gasPrice;
782
786
  return __generator(this, function (_a) {
783
787
  switch (_a.label) {
784
788
  case 0:
@@ -798,7 +802,15 @@ export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void
798
802
  return [2 /*return*/, {
799
803
  gasPrice: gasPrice,
800
804
  }];
801
- case 4: throw Error("This method exists only for L2 networks");
805
+ case 4:
806
+ if (!(curve.chainId === 5000)) return [3 /*break*/, 6];
807
+ return [4 /*yield*/, getGasPrice()];
808
+ case 5:
809
+ gasPrice = _a.sent();
810
+ return [2 /*return*/, {
811
+ gasPrice: gasPrice,
812
+ }];
813
+ case 6: throw Error("This method exists only for L2 networks");
802
814
  }
803
815
  });
804
816
  }); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.61.2",
3
+ "version": "2.61.4",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",