From e659944e77f546a9016a08c2e24024318f2a33d5 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 15 May 2024 19:35:40 +0400 Subject: [PATCH] fix: add setCustomFeeData to init --- package.json | 2 +- src/curve.ts | 7 ++++++- src/utils.ts | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0f003c2f..9e89ed3a 100644 --- a/package.json +++ b/package.json @@ -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" } diff --git a/src/curve.ts b/src/curve.ts index 343fb6d2..66db650c 100644 --- a/src/curve.ts +++ b/src/curve.ts @@ -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): Promise => { const gaugeData = await _getAllGauges(); @@ -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})) { diff --git a/src/utils.ts b/src/utils.ts index 739350bd..79823328 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -596,8 +596,6 @@ export const getGasInfoForL2 = async (): Promise> return { gasPrice, - maxFeePerGas: null, - maxPriorityFeePerGas: null, } } else { throw Error("This method exists only for L2 networks");