/** * Vendored x402 EVM client-side payment implementation. * * This replaces the `x402-fetch` and `x402` npm packages to avoid pulling in * wagmi, WalletConnect, Reown, MetaMask SDK, Solana SDK, and hundreds of MB * of transitive dependencies that are unnecessary for server-side EVM usage. * * Only EVM payment support is included (Base network), which is all this SDK needs. * The x402 protocol specification: https://www.x402.org/ * * @module */ import { type WalletClient } from "viem"; /** * Create a viem WalletClient configured for x402 payment signing. * * @param network - Network name (e.g., "base", "base-sepolia") * @param privateKey - Hex-encoded private key * @returns Configured WalletClient */ export declare function createSigner(network: string, privateKey: string): WalletClient; /** * Wrap a fetch function with x402 payment handling. * * When the wrapped fetch receives a 402 response, it automatically: * 1. Parses the payment requirements from the response * 2. Signs an EIP-3009 TransferWithAuthorization * 3. Retries the request with the signed payment in the X-PAYMENT header * * The retry calls the raw (unwrapped) fetch directly, so a second 402 * is returned to the caller as-is without infinite retry loops. * * @param fetchFn - The fetch function to wrap * @param walletClient - Wallet client for signing payments * @param maxValue - Maximum payment amount in atomic units (default: 0.1 USDC = 100000) * @returns Wrapped fetch function with x402 payment support */ export declare function wrapFetchWithPayment(fetchFn: typeof fetch, walletClient: WalletClient, maxValue?: bigint): typeof fetch; //# sourceMappingURL=x402.d.ts.map