import { BigNumber } from '@ethersproject/bignumber'; import { ChainId, Token } from '@synthra-swap/sdk/core'; export { STABLECOIN_NATIVE_GAS_CHAINS } from '@synthra-swap/sdk/core'; import { Pool } from '@synthra-swap/sdk/v3'; import { ProviderConfig } from '../../../providers/provider'; import { ArbitrumGasData, IL2GasDataProvider, OptimismGasData } from '../../../providers/v3/gas-data-provider'; import { CurrencyAmount } from '../../../util/amounts'; import { RouteWithValidQuote, V3RouteWithValidQuote } from '../entities/route-with-valid-quote'; export declare const usdGasTokensByChain: { [chainId in ChainId]?: Token[]; }; export declare type L1ToL2GasCosts = { gasUsedL1: BigNumber; gasCostL1USD: CurrencyAmount; gasCostL1QuoteToken: CurrencyAmount; }; export declare type BuildOnChainGasModelFactoryType = { chainId: ChainId; gasPriceWei: BigNumber; pools: LiquidityCalculationPools; amountToken: Token; quoteToken: Token; l2GasDataProvider?: IL2GasDataProvider | IL2GasDataProvider; providerConfig?: ProviderConfig; }; export declare type LiquidityCalculationPools = { usdPool: Pool | null; nativeQuoteTokenV3Pool: Pool | null; nativeAmountTokenV3Pool: Pool | null; }; /** * Contains functions for generating gas estimates for given routes. * * We generally compute gas estimates off-chain because * 1/ Calling eth_estimateGas for a swaps requires the caller to have * the full balance token being swapped, and approvals. * 2/ Tracking gas used using a wrapper contract is not accurate with Multicall * due to EIP-2929 * 3/ Fetching supporting liquidity once keeps per-route estimation cheap. * * Generally these models should be optimized to return quickly by performing any * long running operations (like fetching external data) outside of the functions defined. * This is because the functions in the model are called once for every route and every * amount that is considered in the algorithm so it is important to minimize the number of * long running operations. */ export declare type IGasModel = { estimateGasCost(routeWithValidQuote: TRouteWithValidQuote): { gasEstimate: BigNumber; gasCostInToken: CurrencyAmount; gasCostInUSD: CurrencyAmount; }; calculateL1GasFees?(routes: TRouteWithValidQuote[]): Promise; }; /** * Factory for building gas models that can be used with V3 routes to generate * gas estimates. * * Factory model is used so that any supporting data can be fetched once and * returned as part of the model. * * @export * @abstract * @class IOnChainGasModelFactory */ export declare abstract class IOnChainGasModelFactory { abstract buildGasModel({ chainId, gasPriceWei, pools: LiquidityCalculationPools, amountToken, quoteToken, l2GasDataProvider, }: BuildOnChainGasModelFactoryType): Promise>; }