import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider"; import { PopulatedTransaction, providers } from "ethers"; import { Deposit } from "../../interfaces"; import { SpokePool } from "../../typechain"; import { BigNumberish, TransactionCostEstimate, BigNumber } from "../../utils"; import { Logger, QueryInterface } from "../relayFeeCalculator"; import { Transport } from "viem"; type Provider = providers.Provider; type OptimismProvider = L2Provider; type SymbolMappingType = Record; decimals: number; }>; /** * A unified QueryBase for querying gas costs, token prices, and decimals of various tokens * on a blockchain. */ export declare class QueryBase implements QueryInterface { readonly provider: Provider | OptimismProvider; readonly symbolMapping: SymbolMappingType; readonly spokePoolAddress: string; readonly simulatedRelayerAddress: string; readonly logger: Logger; readonly coingeckoProApiKey?: string | undefined; readonly fixedGasPrice?: BigNumberish | undefined; readonly coingeckoBaseCurrency: string; readonly spokePool: SpokePool; /** * Instantiates a QueryBase instance * @param provider A valid Ethers.js provider * @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics * @param spokePoolAddress The valid address of the Spoke Pool deployment * @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC * @param logger A logging utility to report logs * @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account * @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain * @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing */ constructor(provider: Provider | OptimismProvider, symbolMapping: SymbolMappingType, spokePoolAddress: string, simulatedRelayerAddress: string, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string); /** * Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool. * @param deposit V3 deposit instance. * @param relayerAddress Relayer address to simulate with. * @param options * @param options.gasPrice Optional gas price to use for the simulation. * @param options.gasUnits Optional gas units to use for the simulation. * @param options.transport Optional transport object for custom gas price retrieval. * @returns The gas estimate for this function call (multiplied with the optional buffer). */ getGasCosts(deposit: Deposit, relayer?: string, options?: Partial<{ gasPrice: BigNumberish; gasUnits: BigNumberish; baseFeeMultiplier: BigNumber; priorityFeeMultiplier: BigNumber; opStackL1GasCostMultiplier: BigNumber; transport: Transport; }>): Promise; /** * @notice Return ethers.PopulatedTransaction for a fill based on input deposit args * @param deposit * @param relayer Sender of PopulatedTransaction * @returns PopulatedTransaction */ getUnsignedTxFromDeposit(deposit: Deposit, relayer?: string): Promise; /** * @notice Return the gas cost of a simulated transaction * @param deposit * @param relayer Sender of PopulatedTransaction * @returns Estimated gas cost based on ethers.VoidSigner's gas estimation */ getNativeGasCost(deposit: Deposit, relayer?: string): Promise; /** * @notice Return L1 data fee for OP stack L2 transaction, which is based on L2 calldata. * @dev https://docs.optimism.io/stack/transactions/fees#l1-data-fee * @param unsignedTx L2 transaction that you want L1 data fee for * @param relayer Sender of unsignedTx * @param options Specify gas units to avoid additional gas estimation call and multiplier for L1 data fee * @returns BigNumber L1 data fee in gas units */ getOpStackL1DataFee(unsignedTx: PopulatedTransaction, relayer: string | undefined, options: Partial<{ opStackL2GasUnits: BigNumberish; opStackL1DataFeeMultiplier: BigNumber; }>): Promise; /** * Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain. * @param unsignedTx The unsigned transaction that this function will estimate. * @param senderAddress The address that the transaction will be submitted from. * @param provider A valid ethers provider - will be used to reason the gas price. * @param options * @param options.gasPrice A manually provided gas price - if set, this function will not resolve the current gas price. * @param options.gasUnits A manually provided gas units - if set, this function will not estimate the gas units. * @param options.transport A custom transport object for custom gas price retrieval. * @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits). */ estimateGas(unsignedTx: PopulatedTransaction, senderAddress: string, provider: providers.Provider | L2Provider, options?: Partial<{ gasPrice: BigNumberish; gasUnits: BigNumberish; baseFeeMultiplier: BigNumber; priorityFeeMultiplier: BigNumber; opStackL1GasCostMultiplier: BigNumber; transport: Transport; }>): Promise; /** * Retrieves the current price of a token * @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list) * @returns The resolved token price within the specified coingeckoBaseCurrency */ getTokenPrice(tokenSymbol: string): Promise; /** * Resolves the number of decimal places a token can have * @param tokenSymbol A valid Across-Enabled Token ID * @returns The number of decimals of precision for the corresponding tokenSymbol */ getTokenDecimals(tokenSymbol: string): number; } export {}; //# sourceMappingURL=baseQuery.d.ts.map