import type { Address, ClientMiddlewareConfig, ClientMiddlewareFn, EntryPointVersion, Multiplier, UserOperationRequest } from "@alchemy/aa-core"; import { type Hex } from "viem"; import type { ClientWithAlchemyMethods } from "../client/types"; /** * overrides value for [`alchemy_requestGasAndPaymasterData`](https://docs.alchemy.com/reference/alchemy-requestgasandpaymasteranddata) * * @template {EntryPointVersion} TEntryPointVersion entry point version type */ export type RequestGasAndPaymasterAndDataOverrides = Partial<{ maxFeePerGas: UserOperationRequest["maxFeePerGas"] | Multiplier; maxPriorityFeePerGas: UserOperationRequest["maxPriorityFeePerGas"] | Multiplier; callGasLimit: UserOperationRequest["callGasLimit"] | Multiplier; verificationGasLimit: UserOperationRequest["verificationGasLimit"] | Multiplier; preVerificationGas: UserOperationRequest["preVerificationGas"] | Multiplier; } & TEntryPointVersion extends "0.7.0" ? { paymasterVerificationGasLimit: UserOperationRequest<"0.7.0">["paymasterVerificationGasLimit"] | Multiplier; paymasterPostOpGasLimit: UserOperationRequest<"0.7.0">["paymasterPostOpGasLimit"] | Multiplier; } : {}>; /** * [`alchemy-requestpaymasteranddata`](https://docs.alchemy.com/reference/alchemy-requestpaymasteranddata) * response type * * @template {EntryPointVersion} TEntryPointVersion entry point version type */ export type RequestPaymasterAndDataResponse = TEntryPointVersion extends "0.6.0" ? { paymasterAndData: UserOperationRequest<"0.6.0">["paymasterAndData"]; } : TEntryPointVersion extends "0.7.0" ? Pick, "paymaster" | "paymasterData"> : {}; /** * [`alchemy_requestGasAndPaymasterData`](https://docs.alchemy.com/reference/alchemy-requestgasandpaymasteranddata) * response type * * @template {EntryPointVersion} TEntryPointVersion entry point version type */ export type RequestGasAndPaymasterAndDataResponse = Pick & RequestPaymasterAndDataResponse; /** * Alchemy gas manager configuration with gas policy id and optional gas estimation options * * To create a Gas Manager Policy, go to the [gas manager](https://dashboard.alchemy.com/gas-manager?a=embedded-accounts-get-started) * page of the Alchemy dashboard and click the “Create new policy” button. */ export interface AlchemyGasManagerConfig { /** * the policy id of the gas manager you want to use. * */ policyId: string; /** * optional option configurable for the gas estimation portion of the Alchemy gas manager * */ gasEstimationOptions?: AlchemyGasEstimationOptions; /** * paymaster address to use for the gas estimation. * If not provided, the default paymaster address for the chain will be used. * */ paymasterAddress?: Address; /** * dummy paymaster data to use for the gas estimation. * */ dummyData?: Hex; } /** * Alchemy gas manager configuration option configurable for the gas estimation portion of the Alchemy gas manager * */ export interface AlchemyGasEstimationOptions { /** * disable gas estimation and fallback to the default gas estimation. * */ disableGasEstimation: boolean; /** * optional fallback gas estimator to use when gas estimation is disabled. * */ fallbackGasEstimator?: ClientMiddlewareFn; /** * optional fallback fee estimator to use when gas estimation is disabled. * */ fallbackFeeDataGetter?: ClientMiddlewareFn; } /** * Alchemy gas manager middleware used as the paymaster middleware overrides param to the client middleware config * * @template {ClientWithAlchemyMethods} C * @param client client with alchemy methods * @param config alchemy gas manager configuration * @returns the gas estimator, fee estimator, and paymasterAndData middleware for Alchemy gas manager */ export declare function alchemyGasManagerMiddleware(client: C, config: AlchemyGasManagerConfig): Pick; //# sourceMappingURL=gasManager.d.ts.map