/** * Shared AgentPay x402 client. * * x402_pay and x402_session_start used to each construct createX402Client * with a copy of the same onBeforePayment guards. One factory owns: * - payable payTo / parsable amount * - max_payment_eth in the selected asset's base units * - SpendingPolicy reserve on approve, commit on payment, release if unused */ import { createX402Client, type X402TransactionLog } from 'agentwallet-sdk'; import type { AgentWalletInstance } from './client.js'; export type AgentPayX402Kind = 'payment' | 'session'; export interface AgentPayX402ClientOptions { chainId: number; maxPaymentEth?: string; kind?: AgentPayX402Kind; onPaymentComplete?: (log: X402TransactionLog) => void; } export interface AgentPayX402Client { client: ReturnType; releaseUnusedReservation: () => void; lockUnusedReservation: () => void; /** * Drop a hold that never reached onPaymentComplete. * Definite pre-broadcast failures release so the cap can be retried. * Any other error may be post-broadcast — lock, never auto-unlock. */ disposeUnusedReservation: (_error?: unknown) => void; } /** * Create the shared x402 client used by paid fetch and session start. */ export declare function createAgentPayX402Client(wallet: AgentWalletInstance, options: AgentPayX402ClientOptions): AgentPayX402Client; //# sourceMappingURL=x402-client.d.ts.map