import { Request, Response, NextFunction } from 'express'; import { Address } from 'viem'; import { Address as Address$1 } from '@solana/kit'; export { Address as SolanaAddress } from '@solana/kit'; import { RoutesConfig, FacilitatorConfig, PaywallConfig } from 'x402/types'; export { Money, Network, PaymentMiddlewareConfig, Resource, RouteConfig, RoutesConfig } from 'x402/types'; /** * Creates a payment middleware factory for Express * * @param payTo - The address to receive payments * @param routes - Configuration for protected routes and their payment requirements * @param facilitator - Optional configuration for the payment facilitator service * @param paywall - Optional configuration for the default paywall * @returns An Express middleware handler * * @example * ```typescript * // Simple configuration - All endpoints are protected by $0.01 of USDC on base-sepolia * app.use(paymentMiddleware( * '0x123...', // payTo address * { * price: '$0.01', // USDC amount in dollars * network: 'base-sepolia' * }, * // Optional facilitator configuration. Defaults to x402.org/facilitator for testnet usage * )); * * // Advanced configuration - Endpoint-specific payment requirements & custom facilitator * app.use(paymentMiddleware('0x123...', // payTo: The address to receive payments* { * { * '/weather/*': { * price: '$0.001', // USDC amount in dollars * network: 'base', * config: { * description: 'Access to weather data' * } * } * }, * { * url: 'https://facilitator.example.com', * createAuthHeaders: async () => ({ * verify: { "Authorization": "Bearer token" }, * settle: { "Authorization": "Bearer token" } * }) * }, * { * cdpClientKey: 'your-cdp-client-key', * appLogo: '/images/logo.svg', * appName: 'My App', * } * )); * ``` */ declare function paymentMiddleware(payTo: Address | Address$1, routes: RoutesConfig, facilitator?: FacilitatorConfig, paywall?: PaywallConfig): (req: Request, res: Response, next: NextFunction) => Promise; export { paymentMiddleware };