/** * Error utilities and common JSON-RPC error codes used by the MCP paywall. */ export declare const ERROR_CODES: { readonly Misconfiguration: -32002; readonly PaymentRequired: -32003; }; export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES]; /** * Create a JSON-RPC-like error object preserving numeric code and message. * Returns an Error instance augmented with a numeric `code` and optional `data`. */ export declare function createRpcError(code: ErrorCode, message: string, data?: any): Error & { code: number; data?: any; }; /** * Raised by the paywall when payment is required (x402 v2 MCP transport). * * Carries the spec-shaped `PaymentRequired` object so the tool paywall wrapper * can surface it *in band* as a `CallToolResult({ isError: true, ... })`. Also * exposes a JSON-RPC `code` so that non-tool paths (resources / prompts), which * cannot return a tool-result error, still degrade to a JSON-RPC error when the * exception propagates. Note: the MCP SDK's low-level catch-all only forwards * the error message (not `code`) to the wire for those paths. */ export declare class PaymentRequiredError extends Error { paymentRequired: Record; code: number; constructor(paymentRequired: Record, message?: string); } /** * Raised when settlement fails AFTER the tool has already executed. * * Same in-band shape as {@link PaymentRequiredError}; the tool paywall wrapper * suppresses the already-computed tool content and returns only the payment * error, per the x402 v2 MCP transport spec ("do not return the tool's content * if settlement fails"). */ export declare class SettlementFailedError extends PaymentRequiredError { constructor(paymentRequired: Record, message?: string); } //# sourceMappingURL=errors.d.ts.map