import { z } from 'zod'; import { N as Network } from './network-N01ZIAhA.js'; import { E as EvmSigner } from './wallet-h2_C4cJt.js'; import { a as PaymentPayload, P as PaymentRequirements, G as VerifyResponse, S as SettleResponse, T as SupportedPaymentKindsResponse, J as ListDiscoveryResourcesRequest, M as ListDiscoveryResourcesResponse, w as HTTPRequestStructure } from './x402Specs-DDvn2leQ.js'; declare const moneySchema: z.ZodPipeline, z.ZodNumber]>, z.ZodNumber>; type Money = z.input; type Resource = `${string}://${string}`; type CreateHeaders = () => Promise<{ verify: Record; settle: Record; supported: Record; list?: Record; }>; /** * Creates a facilitator client for interacting with the X402 payment facilitator service * * @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used. * @returns An object containing verify and settle functions for interacting with the facilitator */ declare function useFacilitator(facilitator?: FacilitatorConfig): { verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise; settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise; supported: () => Promise; list: (config?: ListDiscoveryResourcesRequest) => Promise; }; declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise; declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise; declare const supported: () => Promise; declare const list: (config?: ListDiscoveryResourcesRequest) => Promise; type FacilitatorConfig = { url: Resource; createAuthHeaders?: CreateHeaders; }; type PaywallConfig = { cdpClientKey?: string; appName?: string; appLogo?: string; sessionTokenEndpoint?: string; }; /** * Simplified JSON Schema type (compatible with JSON Schema Draft 7) */ type JSONSchema = { [key: string]: unknown; type?: string | string[]; properties?: Record; items?: JSONSchema | JSONSchema[]; required?: string[]; enum?: unknown[]; const?: unknown; description?: string; default?: unknown; }; /** * Metadata for discovery catalog (Bazaar) */ type DiscoveryMetadata = { [key: string]: unknown; name?: string; description?: string; category?: string; tags?: string[]; documentation?: string; logo?: string; provider?: string; }; /** * Schema definition for discovery input/output */ type DiscoverySchemaDefinition = { example?: unknown; schema?: JSONSchema; }; type PaymentMiddlewareConfig = { description?: string; mimeType?: string; maxTimeoutSeconds?: number; inputSchema?: Omit; outputSchema?: object; discoverable?: boolean; customPaywallHtml?: string; resource?: Resource; signatureType?: "authorization" | "permit"; /** * Discovery input schema for Bazaar catalog (example + JSON schema). * Use declareDiscoveryExtension() from "@b3dotfun/anyspend-x402/extensions" for convenience. */ discoveryInput?: DiscoverySchemaDefinition; /** * Discovery output schema for Bazaar catalog (example + JSON schema). * Use declareDiscoveryExtension() from "@b3dotfun/anyspend-x402/extensions" for convenience. */ discoveryOutput?: DiscoverySchemaDefinition; /** * Metadata for the Bazaar discovery catalog. * Use declareDiscoveryExtension() from "@b3dotfun/anyspend-x402/extensions" for convenience. */ discoveryMetadata?: DiscoveryMetadata; errorMessages?: { paymentRequired?: string; invalidPayment?: string; noMatchingRequirements?: string; verificationFailed?: string; settlementFailed?: string; }; }; interface ERC20TokenAmount { amount: string; asset: { address: `0x${string}`; decimals: number; eip712: { name: string; version: string; }; }; } interface SPLTokenAmount { amount: string; asset: { address: string; decimals: number; }; } type Price = Money | ERC20TokenAmount | SPLTokenAmount; interface RouteConfig { price: Price; network: Network; config?: PaymentMiddlewareConfig; } type RoutesConfig = Record; interface RoutePattern { verb: string; pattern: RegExp; config: RouteConfig; } type Wallet = EvmSigner; export { type CreateHeaders as C, type DiscoveryMetadata as D, type ERC20TokenAmount as E, type FacilitatorConfig as F, type JSONSchema as J, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type DiscoverySchemaDefinition as d, type PaymentMiddlewareConfig as e, type RouteConfig as f, supported as g, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };