From d3e6c6cb26249e8f48b7b8e427308f3cdb324aa8 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Wed, 7 Feb 2024 18:11:06 +0200 Subject: [PATCH] revert gas price provider changes --- .../routing/clientSideSmartOrderRouter.ts | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/lib/hooks/routing/clientSideSmartOrderRouter.ts b/src/lib/hooks/routing/clientSideSmartOrderRouter.ts index 4088dec0db4..b3af1e270bd 100644 --- a/src/lib/hooks/routing/clientSideSmartOrderRouter.ts +++ b/src/lib/hooks/routing/clientSideSmartOrderRouter.ts @@ -1,15 +1,10 @@ -import { BigNumber } from '@ethersproject/bignumber' import type { Web3Provider } from '@ethersproject/providers' -import { JsonRpcProvider } from '@ethersproject/providers' import { BigintIsh, ChainId, CurrencyAmount, Token, TradeType } from '@uniswap/sdk-core' // This file is lazy-loaded, so the import of smart-order-router is intentional. // eslint-disable-next-line @typescript-eslint/no-restricted-imports import { AlphaRouter, AlphaRouterConfig, - EIP1559GasPriceProvider, - LegacyGasPriceProvider, - OnChainGasPriceProvider, OnChainQuoteProvider, UniswapMulticallProvider, } from '@uniswap/smart-order-router' @@ -25,10 +20,6 @@ const tokenValidatorProvider = { validateTokens: async () => ({ getValidationByToken: () => undefined }), } -class fixedPriceProvider extends EIP1559GasPriceProvider { - getGasPrice = async () => ({ gasPriceWei: BigNumber.from(1000000000) }) -} - type RouterAndProvider = { router: AlphaRouter; provider: AppStaticJsonRpcProvider | Web3Provider } let cachedProviderRouter: { chainId: number; routerProvider: RouterAndProvider } | undefined = undefined const routers = new Map() @@ -68,11 +59,6 @@ export function getRouter(chainId: ChainId, web3Provider: Web3Provider | undefin multicallChunk: 6, } ) - const gasPriceProvider = new OnChainGasPriceProvider( - chainId, - new fixedPriceProvider(web3Provider as JsonRpcProvider, 0, 0), - new LegacyGasPriceProvider(web3Provider as JsonRpcProvider) - ) cachedProviderRouter = { chainId, routerProvider: { @@ -82,7 +68,6 @@ export function getRouter(chainId: ChainId, web3Provider: Web3Provider | undefin multicall2Provider, onChainQuoteProvider, tokenValidatorProvider, - gasPriceProvider, }), provider: web3Provider, }, @@ -95,13 +80,8 @@ export function getRouter(chainId: ChainId, web3Provider: Web3Provider | undefin const supportedChainId = asSupportedChain(chainId) if (supportedChainId) { const provider = RPC_PROVIDERS[supportedChainId] - const gasPriceProvider = new OnChainGasPriceProvider( - chainId, - new fixedPriceProvider(provider as JsonRpcProvider, 0, 0), - new LegacyGasPriceProvider(provider as JsonRpcProvider) - ) const routerProvider = { - router: new AlphaRouter({ chainId, provider, tokenValidatorProvider, gasPriceProvider }), + router: new AlphaRouter({ chainId, provider, tokenValidatorProvider }), provider, } routers.set(chainId, routerProvider)