/** * PayGate Client * Client for interacting with PayGate x402 payment protocol */ import { Keypair } from '@solana/web3.js'; import { PayGateClientConfig, PaymentCurrency, Product, PaymentRequirements, PricingResponse, VerifyResponse, PurchaseOptions, PurchaseResult, ContentResult, PurchaseHistoryResponse } from './types'; /** * Error class for PayGate-specific errors */ export declare class PayGateError extends Error { readonly statusCode: number | undefined; readonly code: string | undefined; constructor(message: string, statusCode?: number, code?: string); } /** * PayGate client for purchasing and retrieving x402-protected content */ export declare class PayGateClient { private baseUrl; private wallet; private defaultCurrency; private timeout; private http; private settlementAgent; private logger; constructor(config: PayGateClientConfig); /** * Initialize the client with a wallet for signing payments * @param wallet Optional wallet keypair (loads from env if not provided) */ init(wallet?: Keypair): Promise; /** * Fetch product information * @param productId The product ID * @returns Product information */ fetchProduct(productId: string): Promise; /** * Get full payment requirements from x402 402 response * @param productId The product ID * @returns Payment requirements */ getPaymentRequirements(productId: string): Promise; /** * Get pricing options for a product (USDC/ATHR) * @param productId The product ID * @returns Pricing options */ getPricing(productId: string): Promise; /** * Verify payment details before purchase * @param productId The product ID * @param amount The payment amount * @param currency The payment currency * @returns Verification result */ verify(productId: string, amount: string, currency?: PaymentCurrency): Promise; /** * Purchase a product using the x402 flow * @param productId The product ID * @param options Purchase options * @returns Purchase result with transaction hash and delivery URL */ purchase(productId: string, options?: PurchaseOptions): Promise; /** * Get content for a purchased product * @param productId The product ID * @returns Content delivery result */ getContent(productId: string): Promise; /** * Get purchase history for the current wallet * @returns Purchase history */ getPurchaseHistory(): Promise; /** * Check if the current wallet has already purchased a product * @param productId The product ID * @returns True if already purchased */ hasPurchased(productId: string): Promise; /** * Get the current wallet public key * @returns Wallet public key as base58 string, or undefined if not initialized */ getWalletAddress(): string | undefined; /** * Handle and log errors consistently */ private handleError; } //# sourceMappingURL=PayGateClient.d.ts.map