/** * Opacus Payment Protocol (OpacusPay) * HTTP request/response with USDC micropayments * * Features: * - USDC stablecoin (no volatility) * - Micropayments from 0.00001 USDC * - 0G chain (low-cost) * - Encrypted requests (privacy) */ import { PaymentRequest, PaymentReceipt, ServiceEndpoint } from '../types'; import { OGChainClient } from '../chain/0g'; import { SecurityManager } from '../crypto/security'; export declare class OpacusPaymentManager { private chainClient; private security; private usdcAddress?; private usdcContract?; private receipts; private endpoints; constructor(chainClient: OGChainClient, security: SecurityManager, usdcAddress?: string | undefined); /** * Initialize USDC contract */ init(usdcAddress: string): Promise; /** * Create payment request for HTTP service * Similar to x402 but with USDC */ createPaymentRequest(from: string, to: string, amountUSDC: string, memo?: string, expiresIn?: number): PaymentRequest; /** * Pay for HTTP request (x402-style) * Returns receipt that can be included in HTTP header */ payForRequest(request: PaymentRequest): Promise; /** * Make paid HTTP request (x402-style) */ request(url: string, options: { method?: string; headers?: Record; body?: any; payment: { to: string; amount: string; }; }): Promise<{ response: Response; receipt: PaymentReceipt; cost: string; }>; /** * Verify payment receipt (server-side) */ verifyPayment(receipt: PaymentReceipt): Promise; /** * Get USDC balance */ getBalance(address?: string): Promise; /** * Register service endpoint */ registerEndpoint(endpoint: ServiceEndpoint): void; /** * Get endpoint pricing */ getEndpoint(id: string): ServiceEndpoint | undefined; /** * Calculate cost for request */ calculateRequestCost(endpoint: ServiceEndpoint, dataSize: number, duration?: number): string; /** * Get payment receipt */ getReceipt(requestId: string): PaymentReceipt | undefined; /** * Get all receipts */ getAllReceipts(): PaymentReceipt[]; /** * Express middleware for HTTP servers (x402-style) */ createMiddleware(): (req: any, res: any, next: any) => Promise; } //# sourceMappingURL=x402.d.ts.map