import type { GetPaymasterDataParameters, GetPaymasterDataReturnType, GetPaymasterStubDataParameters, GetPaymasterStubDataReturnType } from 'viem/account-abstraction'; /** Client-side sponsorship policy configuration. * Defense-in-depth layer on top of the paymaster's own server-side policies. * All checks are enforced before calling the paymaster RPC. */ export interface PaymasterPolicy { /** Only sponsor UserOps from these smart account addresses. * When empty/undefined, sponsors all accounts. */ allowedAccounts?: `0x${string}`[]; /** Maximum number of sponsored UserOps per account per day (anti-Sybil). * 0 or undefined = no limit. */ maxSponsoredPerDay?: number; /** Maximum gas cost (in wei) to sponsor per UserOp. * UserOps exceeding this cost fall back to self-paid. */ maxGasCostWei?: bigint; } /** Paymaster middleware shape expected by createSmartAccountClient */ export interface PaymasterMiddleware { getPaymasterData: (parameters: GetPaymasterDataParameters) => Promise; getPaymasterStubData: (parameters: GetPaymasterStubDataParameters) => Promise; } /** Check if the policy allows sponsoring this UserOp. * Returns a reason string if denied, undefined if allowed. */ export declare function checkPolicy(policy: PaymasterPolicy | undefined, params: GetPaymasterDataParameters): string | undefined; /** Create a paymaster middleware that wraps a PimlicoClient with graceful fallback * and optional policy enforcement. * * When the paymaster is unreachable or rejects the UserOp, the middleware returns * empty paymaster data so the UserOp falls back to self-paid gas. * * @param paymasterUrl - URL for the paymaster RPC endpoint * @param policy - Optional sponsorship policy for client-side filtering * @returns PaymasterMiddleware compatible with permissionless's createSmartAccountClient */ export declare function createPaymasterMiddleware(paymasterUrl: string, policy?: PaymasterPolicy): PaymasterMiddleware; //# sourceMappingURL=paymaster.d.ts.map