/** * Opacus Main Client * Complete SDK implementation for agent communication */ import { OpacusConfig, OpacusFrame, AgentIdentity, DACConfig } from './types'; import { OpacusPaymentManager } from './payment/x402'; export declare class OpacusClient { private config; private identity?; private transport?; private security; private chainClient; private dacManager?; private paymentManager?; private relayXPub?; private messageHandlers; private seq; constructor(config: OpacusConfig); /** * Initialize client with new or existing identity */ init(existingIdentity?: string): Promise; /** * Initialize contracts */ initContracts(addresses: { dacRegistry: string; agentRegistry: string; dataStream: string; escrow: string; }): Promise; /** * Connect to relay server */ connect(): Promise; /** * Handle incoming frames */ private handleFrame; /** * Register message handler */ onMessage(type: string | '*', handler: (frame: OpacusFrame) => void): void; /** * Send message to specific agent */ sendMessage(to: string, payload: any, peerXPub?: Uint8Array): Promise; /** * Send stream data to channel */ sendStream(channelId: string, data: any): Promise; /** * Create new DAC */ createDAC(config: DACConfig): Promise; /** * Subscribe to data channel */ subscribeToChannel(channelId: string): Promise; /** * Unsubscribe from data channel */ unsubscribeFromChannel(channelId: string): Promise; /** * Register agent on-chain */ registerOnChain(metadata: object): Promise; /** * Get identity */ getIdentity(): AgentIdentity | undefined; /** * Export identity (be careful with private keys!) */ exportIdentity(): string; /** * Check connection status */ isConnected(): boolean; /** * Get balance */ getBalance(): Promise; /** * Send micro-payment (as low as 0.00001 A0GI) */ sendMicroPayment(to: string, amountInA0GI: string): Promise<{ txHash: string; from: string; to: string; amount: string; gasUsed: bigint; effectiveCost: string; }>; /** * Estimate micro-payment cost */ estimateMicroPaymentCost(amountInA0GI: string): Promise<{ transferAmount: string; estimatedGas: bigint; estimatedGasCost: string; totalCost: string; }>; /** * Send batch micro-payments */ sendBatchMicroPayments(payments: Array<{ to: string; amount: string; }>): Promise<{ txHash: string; totalAmount: string; recipients: number; gasUsed: bigint; }>; /** * Get network info */ getNetworkInfo(): import("./types").ChainInfo; /** * Initialize OpacusPay payment system with USDC */ initPayments(usdcAddress: string): Promise; /** * Make paid HTTP request with OpacusPay USDC micropayments */ paidRequest(url: string, options: { method?: string; headers?: Record; body?: any; payment: { to: string; amount: string; }; }): Promise<{ response: Response; receipt: import("./types").PaymentReceipt; cost: string; }>; /** * Get USDC balance */ getUSDCBalance(address?: string): Promise; /** * Get payment manager (for advanced use) */ getPaymentManager(): OpacusPaymentManager | undefined; /** * Disconnect from relay */ disconnect(): Promise; } //# sourceMappingURL=client.d.ts.map