import type { Hex } from '@metamask/utils'; import BN from 'bn.js'; import type { TransactionControllerMessenger } from '../TransactionController.js'; import type { Layer1GasFeeFlow, Layer1GasFeeFlowRequest, Layer1GasFeeFlowResponse, TransactionMeta } from '../types.js'; /** * Layer 1 gas fee flow that obtains gas fee estimate using an oracle smart contract. */ export declare abstract class OracleLayer1GasFeeFlow implements Layer1GasFeeFlow { #private; /** * Resolves the oracle address for the given chain. Subclasses can override * this method to provide chain-specific oracle addresses. By default, this * returns the standard OP Stack gas price oracle address. * * @param _chainId - The chain ID to resolve the oracle address for. * @returns The oracle address for the given chain. */ protected getOracleAddressForChain(_chainId: Hex): Hex; /** * Whether to sign the transaction with a dummy key prior to calling the * oracle contract. Some oracle contracts require a signed payload even for * read-only methods. * * Subclasses can override to enable signing when needed. Defaults to false. * * @returns Whether the transaction should be signed prior to the oracle call. */ protected shouldSignTransaction(): boolean; abstract matchesTransaction({ transactionMeta, messenger, }: { transactionMeta: TransactionMeta; messenger: TransactionControllerMessenger; }): Promise; /** * Transforms the raw oracle L1 fee before it is combined with the operator * fee. Subclasses can override this to apply chain-specific conversions * (e.g. currency conversion via an on-chain exchange rate). * * Defaults to returning the fee unchanged. * * @param oracleFee - The raw L1 fee returned by the oracle contract. * @param _request - The original fee flow request (messenger + transaction). * @returns The transformed fee. */ protected transformOracleFee(oracleFee: BN, _request: Layer1GasFeeFlowRequest): Promise; getLayer1Fee(request: Layer1GasFeeFlowRequest): Promise; /** * Returns the gas value to pass to the operator-fee oracle, or undefined * to skip the operator-fee call entirely. Defaults to the simulated * `gasUsed` on the transaction. Subclasses can override to supply a * fallback (e.g. estimated gas limit) when `gasUsed` is unavailable. * * @param transactionMeta - The transaction metadata. * @returns The gas value, or undefined to skip the operator-fee call. */ protected getOperatorFeeGas(transactionMeta: TransactionMeta): string | undefined; } //# sourceMappingURL=OracleLayer1GasFeeFlow.d.ts.map