import type { FetchLike, Tool } from '@modelcontextprotocol/client'; import { type SignerWallet, type PaymentRequiredAccept, type SchemePreference } from './signer.js'; export declare const MCP_PAYMENT_RESPONSE_META_KEY = "x402/payment-response"; export interface X402PaymentCache { signature: string | null; paymentRequiredTools?: Set; lastSettlement?: { toolName: string; receipt: Record; }; } export declare function recordPaymentRequiredTool(cache: X402PaymentCache, toolName: string): void; export declare function withSettlementReceipt(result: T, cache: X402PaymentCache, toolName: string): T; export interface X402FetchMiddlewareOptions { wallet: SignerWallet; getToolByName?: (name: string) => Tool | undefined; paymentCache: X402PaymentCache; schemePreference?: SchemePreference; } export declare function createX402FetchMiddleware(baseFetch: FetchLike, options: X402FetchMiddlewareOptions): FetchLike; export declare function extractAcceptFromPaymentRequired(data: unknown, schemePreference?: SchemePreference): { accept: PaymentRequiredAccept; resource?: { url?: string; description?: string; mimeType?: string; }; } | undefined; export declare function extractPaymentRequiredFromResult(result: unknown): Record | undefined; //# sourceMappingURL=fetch-middleware.d.ts.map