@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.
- package/lib/utils.js +17 -5
- 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 (!
|
|
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
|
|
777
|
+
case 7:
|
|
774
778
|
gasPrice = _a.sent();
|
|
775
779
|
return [2 /*return*/, Number(gasPrice)];
|
|
776
|
-
case
|
|
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:
|
|
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
|
}); };
|