Skip to content

Commit

Permalink
Merge pull request #255 from curvefi/fix/fixed-getGasPriceFromL2
Browse files Browse the repository at this point in the history
fix: fixed getGasPriceFromL2
  • Loading branch information
fedorovdg authored Jan 16, 2024
2 parents f675134 + dd814ee commit af3945d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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.53.11",
"version": "2.53.12",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,6 @@ export const getUsdRate = async (coin: string): Promise<number> => {
}

export const getGasPriceFromL1 = async (): Promise<number> => {
if(curve.chainId === 42161) {
return 0.1 * 1e9; // constant 0.1 gwei
}
if(L2Networks.includes(curve.chainId)) {
const gasPrice = await curve.contracts[curve.constants.ALIASES.gas_oracle].contract.l1BaseFee();
return Number(gasPrice) + 1e9; // + 1 gwei
Expand All @@ -517,6 +514,9 @@ export const getGasPriceFromL1 = async (): Promise<number> => {
}

export const getGasPriceFromL2 = async (): Promise<number> => {
if(curve.chainId === 42161) {
return 0.1 * 1e9; // constant 0.1 gwei
}
if(L2Networks.includes(curve.chainId)) {
const gasPrice = await curve.contracts[curve.constants.ALIASES.gas_oracle].contract.gasPrice();
return Number(gasPrice);
Expand Down

0 comments on commit af3945d

Please sign in to comment.