import type { RequestHandler } from "express"; import { type TollgateConfig } from "./config.js"; export interface X402TollgateOptions { /** Seller receive wallet (EOA). Required — validated with EIP-55 / isAddress. */ seller: string; /** Operator feeCollector (default: fixed Plan A address from env / OPERATOR_FEE_COLLECTOR). */ feeCollector?: string; /** * Fee-free threshold in USDC atomic units (6 decimals). * Default 10_000_000 ($10). Single payment strictly below → payTo = seller. */ feeFreeBelowUsdc?: bigint | number | string; /** FeeSplitterFactory address (required for payments ≥ threshold). */ factoryAddress?: string; /** Basis points for FeeSplitter (default 10 = 0.1%). */ feeBps?: number; /** Override process.env when building TollgateConfig. */ env?: NodeJS.ProcessEnv; /** * Path prefix gated by this middleware (default `""` so `app.use('/v1', …)` * charges every path under the mount). */ gatedPrefix?: string; } /** * Permissionless seller Express middleware. * * @example * ```ts * import { x402Tollgate } from "x402-micro-tollgate"; * app.use("/v1", await x402Tollgate({ seller: process.env.SELLER! })); * ``` * * payTo rules (x402 `exact` + EIP-3009 → credits `payTo` only; no same-tx split): * - amount < $10 USDC → seller EOA (0 protocol fee) * - amount ≥ $10 → CREATE2 FeeSplitter; call `release()` later (99.9% / 0.1%) * * Invalid `seller` throws at init (hard fail). Does not enable KEEPER. */ export declare function x402Tollgate(options: X402TollgateOptions): Promise; /** Build TollgateConfig for a permissionless seller (sync; for tests / custom wiring). */ export declare function loadSellerConfig(options: X402TollgateOptions): TollgateConfig;