@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 CHANGED
@@ -30,7 +30,7 @@ declare class Curve implements ICurve {
30
30
  maxPriorityFeePerGas?: number;
31
31
  };
32
32
  constantOptions: {
33
- gasLimit: number;
33
+ gasLimit?: number;
34
34
  };
35
35
  options: {
36
36
  gasPrice?: number | bigint;
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 = { gasLimit: 9000000 };
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
  }
@@ -64,7 +64,7 @@ export interface ICurve {
64
64
  maxPriorityFeePerGas?: number;
65
65
  };
66
66
  constantOptions: {
67
- gasLimit: number;
67
+ gasLimit?: number;
68
68
  };
69
69
  options: {
70
70
  gasPrice?: number | bigint;
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, 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*/, getGasPrice()];
807
+ return [4 /*yield*/, getBaseFeeByLastBlock()];
808
808
  case 5:
809
- gasPrice = _a.sent();
809
+ baseFee = _a.sent();
810
810
  return [2 /*return*/, {
811
- gasPrice: gasPrice,
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.61.4",
3
+ "version": "2.61.6",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",