import { type Address, type ChainType, type PackedUserOperation, type UserOperation, type UserOperationV06 } from "../types/index.js"; import { type Chain, ContractFunctionRevertedError, EstimateGasExecutionError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, type PublicClient, type Transport } from "viem"; import type { GasPriceManager } from "./gasPriceManager.js"; export interface GasOverheads { /** * fixed overhead for entire handleOp bundle. */ fixed: number; /** * per userOp overhead, added on top of the above fixed per-bundle. */ perUserOp: number; /** * overhead for userOp word (32 bytes) block */ perUserOpWord: number; /** * zero byte cost, for calldata gas cost calculations */ zeroByte: number; /** * non-zero byte cost, for calldata gas cost calculations */ nonZeroByte: number; /** * expected bundle size, to split per-bundle overhead between all ops. */ bundleSize: number; /** * expected length of the userOp signature. */ sigSize: number; } export declare const DefaultGasOverheads: GasOverheads; /** * pack the userOperation * @param op * "false" to pack entire UserOp, for calculating the calldata cost of putting it on-chain. */ export declare function packUserOpV06(op: UserOperationV06): `0x${string}`; export declare function removeZeroBytesFromUserOp(userOpearation: T): T extends UserOperationV06 ? UserOperationV06 : PackedUserOperation; export declare function packUserOpV07(op: PackedUserOperation): `0x${string}`; export declare function calcPreVerificationGas(publicClient: PublicClient, userOperation: UserOperation, entryPoint: Address, chainId: number, chainType: ChainType, gasPriceManager: GasPriceManager, validate: boolean, // when calculating preVerificationGas for validation overheads?: GasOverheads): Promise; export declare function calcVerificationGasAndCallGasLimit(userOperation: UserOperation, executionResult: { preOpGas: bigint; paid: bigint; }, chainId: number, callDataResult?: { gasUsed: bigint; }): { verificationGasLimit: bigint; callGasLimit: bigint; }; /** * calculate the preVerificationGas of the given UserOperation * preVerificationGas (by definition) is the cost overhead that can't be calculated on-chain. * it is based on parameters that are defined by the Ethereum protocol for external transactions. * @param userOp filled userOp to calculate. The only possible missing fields can be the signature and preVerificationGas itself * @param overheads gas overheads to use, to override the default values */ export declare function calcDefaultPreVerificationGas(userOperation: UserOperation, overheads?: Partial): bigint; export declare function calcOptimismPreVerificationGas(publicClient: PublicClient, op: UserOperation, entryPoint: Address, staticFee: bigint, gasPriceManager: GasPriceManager, verify?: boolean): Promise; export declare function calcArbitrumPreVerificationGas(publicClient: PublicClient, op: UserOperation, entryPoint: Address, staticFee: bigint): Promise; export declare function parseViemError(err: unknown): NonceTooLowError | FeeCapTooLowError | InsufficientFundsError | IntrinsicGasTooLowError | ContractFunctionRevertedError | EstimateGasExecutionError | undefined; //# sourceMappingURL=validation.d.ts.map