import type { NetworkClientId } from '@metamask/network-controller'; import type { Hex } from '@metamask/utils'; import type { TransactionControllerMessenger } from '../TransactionController.js'; import type { BatchTransactionParams, GetSimulationConfig, IsAtomicBatchSupportedRequest, IsAtomicBatchSupportedResult, Revert, TransactionBatchSingleRequest, TransactionMeta, TransactionParams } from '../types.js'; export type UpdateGasRequest = { isCustomNetwork: boolean; isSimulationEnabled: boolean; getSimulationConfig: GetSimulationConfig; messenger: TransactionControllerMessenger; txMeta: TransactionMeta; }; export type EstimateGasBatchResult = { gasLimits: number[]; requiresAuthorizationList?: true; totalGasLimit: number; }; export declare const log: import("debug").Debugger; export declare const DEFAULT_GAS_MULTIPLIER = 1.5; export declare const MAX_GAS_BLOCK_PERCENT = 90; export declare const INTRINSIC_GAS = 21000; export declare const DUMMY_AUTHORIZATION_SIGNATURE = "0x1111111111111111111111111111111111111111111111111111111111111111"; /** * Populate the gas properties of the provided transaction meta. * * @param request - The request object including the necessary parameters. */ export declare function updateGas(request: UpdateGasRequest): Promise; /** * Estimate the gas for the provided transaction parameters. * If the gas estimate fails, the fallback value is returned. * * @param options - The options object. * @param options.ignoreDelegationSignatures - Ignore signature errors if submitting delegations to the DelegationManager. * @param options.isSimulationEnabled - Whether the simulation is enabled. * @param options.getSimulationConfig - The function to get the simulation configuration. * @param options.messenger - The messenger instance for communication. * @param options.networkClientId - The network client ID. * @param options.txParams - The transaction parameters. * @returns The estimated gas and related info. */ export declare function estimateGas({ ignoreDelegationSignatures, isSimulationEnabled, getSimulationConfig, messenger, networkClientId, txParams, }: { ignoreDelegationSignatures?: boolean; isSimulationEnabled: boolean; getSimulationConfig: GetSimulationConfig; messenger: TransactionControllerMessenger; networkClientId: NetworkClientId; txParams: TransactionParams; }): Promise<{ blockGasLimit: string; estimatedGas: string; gasRevert?: Revert; isUpgradeWithData: boolean; simulationFails: TransactionMeta['simulationFails']; }>; /** * Sum caller-provided gas limits across a batch. * * If every transaction in the batch already has a `gas` value, returns the * parsed per-tx limits and their sum. Otherwise returns `undefined`. * * Used by `estimateGasBatch`: * - non-7702 path: short-circuits simulation entirely when present. * - EIP-7702 path: used as a fallback when simulation fails — required for * callers that submit batches whose individual sub-calls cannot be simulated * standalone (e.g. predict-withdraw, where the batch's first sub-call * provides source-token balance to subsequent sub-calls). When 7702 * simulation succeeds it is preferred since the bundled call has no per-tx * intrinsic gas cost and produces a tighter estimate. * * @param transactions - Batch transactions to inspect. * @returns Parsed gas limits and total when every transaction has gas; otherwise `undefined`. */ export declare function getProvidedBatchGasLimits(transactions: BatchTransactionParams[]): { gasLimits: number[]; totalGasLimit: number; } | undefined; export declare function estimateGasBatch({ from, getSimulationConfig, isAtomicBatchSupported, messenger, networkClientId, transactions, }: { from: Hex; getSimulationConfig: GetSimulationConfig; isAtomicBatchSupported: (request: IsAtomicBatchSupportedRequest) => Promise; messenger: TransactionControllerMessenger; networkClientId: NetworkClientId; transactions: BatchTransactionParams[]; }): Promise; /** * Add a buffer to the provided estimated gas. * The buffer is calculated based on the block gas limit and a multiplier. * * @param estimatedGas - The estimated gas. * @param blockGasLimit - The block gas limit. * @param multiplier - The multiplier to apply to the estimated gas. * @returns The gas with the buffer applied. */ export declare function addGasBuffer(estimatedGas: string, blockGasLimit: string, multiplier: number): string; /** * Simulate the required gas for a batch of transactions using the simulation API. * * @param options - The options object. * @param options.chainId - The chain ID of the transactions. * @param options.from - The address of the sender. * @param options.getSimulationConfig - The function to get the simulation configuration. * @param options.transactions - The array of transactions within a batch request. * @returns An object containing the transactions with their gas limits and the total gas limit. */ export declare function simulateGasBatch({ chainId, from, getSimulationConfig, transactions, }: { chainId: Hex; from: Hex; getSimulationConfig: GetSimulationConfig; transactions: TransactionBatchSingleRequest[]; }): Promise<{ totalGasLimit: Hex; gasLimits: Hex[]; }>; //# sourceMappingURL=gas.d.ts.map