Skip to content

Commit

Permalink
fix: add setCustomFeeData to init
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorovdg committed May 15, 2024
1 parent 5f5d19a commit e659944
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"axios": "^0.21.1",
"bignumber.js": "^9.0.1",
"ethcall": "6.0.5",
"ethcall": "6.0.6",
"ethers": "^6.11.0",
"memoizee": "^0.4.15"
}
Expand Down
7 changes: 6 additions & 1 deletion src/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./co
import { _getAllGauges, _getHiddenPools } from "./external-api.js";
import { L2Networks } from "./constants/L2Networks.js";
import { getTwocryptoFactoryPoolData } from "./factory/factory-twocrypto.js";
import { memoizedContract, memoizedMulticallContract } from "./utils.js";
import {getGasInfoForL2, memoizedContract, memoizedMulticallContract} from "./utils.js";

const _killGauges = async (poolsData: IDict<IPoolData>): Promise<void> => {
const gaugeData = await _getAllGauges();
Expand Down Expand Up @@ -578,6 +578,11 @@ class Curve implements ICurve {
}

this.feeData = { gasPrice: options.gasPrice, maxFeePerGas: options.maxFeePerGas, maxPriorityFeePerGas: options.maxPriorityFeePerGas };

if(this.chainId === 196) {
this.setCustomFeeData(await getGasInfoForL2())
}

await this.updateFeeData();

for (const pool of Object.values({...this.constants.POOLS_DATA, ...this.constants.LLAMMAS_DATA})) {
Expand Down
2 changes: 0 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,6 @@ export const getGasInfoForL2 = async (): Promise<Record<string, number | null>>

return {
gasPrice,
maxFeePerGas: null,
maxPriorityFeePerGas: null,
}
} else {
throw Error("This method exists only for L2 networks");
Expand Down

0 comments on commit e659944

Please sign in to comment.