Skip to content

Commit

Permalink
Merge pull request #371 from curvefi/fix/fixed-getBasePools-mantle
Browse files Browse the repository at this point in the history
fix: fixed updateFeeData
  • Loading branch information
fedorovdg authored Jul 11, 2024
2 parents 0de9e70 + 994e048 commit 8dc208b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.61.5",
"version": "2.61.6",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
4 changes: 2 additions & 2 deletions src/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,10 +1085,10 @@ class Curve implements ICurve {
} else {
delete this.options.gasPrice;

this.options.maxFeePerGas = this.feeData.maxFeePerGas !== undefined ?
this.options.maxFeePerGas = (this.feeData.maxFeePerGas !== undefined && this.feeData.maxFeePerGas !== null) ?
this.parseUnits(this.feeData.maxFeePerGas.toString(), "gwei") :
feeData.maxFeePerGas;
this.options.maxPriorityFeePerGas = this.feeData.maxPriorityFeePerGas !== undefined ?
this.options.maxPriorityFeePerGas = (this.feeData.maxPriorityFeePerGas !== undefined && this.feeData.maxPriorityFeePerGas !== null) ?
this.parseUnits(this.feeData.maxPriorityFeePerGas.toString(), "gwei") :
feeData.maxPriorityFeePerGas;
}
Expand Down
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,11 @@ export const getGasInfoForL2 = async (): Promise<Record<string, number | null>>
gasPrice,
}
} else if(curve.chainId === 5000) {
const gasPrice = await getGasPrice()
const baseFee = await getBaseFeeByLastBlock()

return {
gasPrice,
maxFeePerGas: Number(((baseFee * 1.1) + 0.01).toFixed(2)),
maxPriorityFeePerGas: 0.01,
}
} else {
throw Error("This method exists only for L2 networks");
Expand Down

0 comments on commit 8dc208b

Please sign in to comment.