import type { AztecNode } from '@aztec/aztec.js/node'; import { TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet'; import type { ChainInfo } from '@aztec/entrypoints/interfaces'; import type { ContractNameResolver } from '@aztec/pxe/client/lazy'; import { type FunctionCall } from '@aztec/stdlib/abi'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { GasSettings } from '@aztec/stdlib/gas'; import { type BlockHeader, type ExecutionPayload, TxSimulationResult } from '@aztec/stdlib/tx'; /** * Splits an execution payload into a leading prefix of public static calls * (eligible for direct node simulation) and the remaining calls. * * Only a leading run of public static calls is eligible for optimization. * Any non-public-static call may enqueue public state mutations * (e.g. private calls can enqueue public calls), so all calls that follow * must go through the normal simulation path to see the correct state. * */ export declare function extractOptimizablePublicStaticCalls(payload: ExecutionPayload): { /** Leading public static calls eligible for direct node simulation. */ optimizableCalls: FunctionCall[]; /** All remaining calls. */ remainingCalls: FunctionCall[]; }; /** * Simulates public static calls by splitting them into batches of MAX_ENQUEUED_CALLS_PER_CALL * and sending each batch directly to the node. * * @param node - The Aztec node to simulate on. * @param publicStaticCalls - Array of public static function calls to optimize. * @param from - The account address making the calls. * @param chainInfo - Chain information (chainId and version). * @param gasSettings - Gas settings for the transaction. * @param blockHeader - Block header to use as anchor. * @param skipFeeEnforcement - Whether to skip fee enforcement during simulation. * @returns Array of TxSimulationResult, one per batch. */ export declare function simulateViaNode(node: AztecNode, publicStaticCalls: FunctionCall[], from: AztecAddress, chainInfo: ChainInfo, gasSettings: GasSettings, blockHeader: BlockHeader, skipFeeEnforcement: boolean | undefined, getContractName: ContractNameResolver): Promise; /** * Merges simulation results from the optimized (public static) and normal paths. * Since optimized calls are always a leading prefix, return values are simply * concatenated: optimized first, then normal. * Stats are taken from the normal result only (the optimized path doesn't produce them). * * @param optimizedResults - Results from optimized public static call batches. * @param normalResult - Result from normal simulation (null if all calls were optimized). * @returns A single TxSimulationResult with return values in original call order. */ export declare function buildMergedSimulationResult(optimizedResults: TxSimulationResult[], normalResult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