@curvefi/api 2.61.4 → 2.61.6
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/curve.d.ts +1 -1
- package/lib/curve.js +3 -3
- package/lib/interfaces.d.ts +1 -1
- package/lib/utils.js +5 -4
- package/package.json +1 -1
package/lib/curve.d.ts
CHANGED
package/lib/curve.js
CHANGED
|
@@ -1046,7 +1046,7 @@ var Curve = /** @class */ (function () {
|
|
|
1046
1046
|
], cTokens = _d[0], yTokens = _d[1], ycTokens = _d[2], aTokens = _d[3];
|
|
1047
1047
|
customAbiTokens = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], cTokens, true), yTokens, true), ycTokens, true), aTokens, true);
|
|
1048
1048
|
if (this.chainId === 5000) {
|
|
1049
|
-
this.constantOptions = {
|
|
1049
|
+
this.constantOptions = {};
|
|
1050
1050
|
}
|
|
1051
1051
|
this.multicallProvider = new MulticallProvider(this.chainId, this.provider);
|
|
1052
1052
|
if (!this.signer) return [3 /*break*/, 15];
|
|
@@ -1296,10 +1296,10 @@ var Curve = /** @class */ (function () {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
else {
|
|
1298
1298
|
delete this.options.gasPrice;
|
|
1299
|
-
this.options.maxFeePerGas = this.feeData.maxFeePerGas !== undefined ?
|
|
1299
|
+
this.options.maxFeePerGas = (this.feeData.maxFeePerGas !== undefined && this.feeData.maxFeePerGas !== null) ?
|
|
1300
1300
|
this.parseUnits(this.feeData.maxFeePerGas.toString(), "gwei") :
|
|
1301
1301
|
feeData.maxFeePerGas;
|
|
1302
|
-
this.options.maxPriorityFeePerGas = this.feeData.maxPriorityFeePerGas !== undefined ?
|
|
1302
|
+
this.options.maxPriorityFeePerGas = (this.feeData.maxPriorityFeePerGas !== undefined && this.feeData.maxPriorityFeePerGas !== null) ?
|
|
1303
1303
|
this.parseUnits(this.feeData.maxPriorityFeePerGas.toString(), "gwei") :
|
|
1304
1304
|
feeData.maxPriorityFeePerGas;
|
|
1305
1305
|
}
|
package/lib/interfaces.d.ts
CHANGED
package/lib/utils.js
CHANGED
|
@@ -782,7 +782,7 @@ export var getGasPriceFromL2 = function () { return __awaiter(void 0, void 0, vo
|
|
|
782
782
|
});
|
|
783
783
|
}); };
|
|
784
784
|
export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
785
|
-
var baseFee, gasPrice,
|
|
785
|
+
var baseFee, gasPrice, baseFee;
|
|
786
786
|
return __generator(this, function (_a) {
|
|
787
787
|
switch (_a.label) {
|
|
788
788
|
case 0:
|
|
@@ -804,11 +804,12 @@ export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void
|
|
|
804
804
|
}];
|
|
805
805
|
case 4:
|
|
806
806
|
if (!(curve.chainId === 5000)) return [3 /*break*/, 6];
|
|
807
|
-
return [4 /*yield*/,
|
|
807
|
+
return [4 /*yield*/, getBaseFeeByLastBlock()];
|
|
808
808
|
case 5:
|
|
809
|
-
|
|
809
|
+
baseFee = _a.sent();
|
|
810
810
|
return [2 /*return*/, {
|
|
811
|
-
|
|
811
|
+
maxFeePerGas: Number(((baseFee * 1.1) + 0.01).toFixed(2)),
|
|
812
|
+
maxPriorityFeePerGas: 0.01,
|
|
812
813
|
}];
|
|
813
814
|
case 6: throw Error("This method exists only for L2 networks");
|
|
814
815
|
}
|