/** * 0G SDK Client * * Unified client for 0G Compute and Storage SDKs. * Handles wallet initialization and provides typed interfaces. */ import { ethers } from 'ethers'; import { Indexer } from '@0glabs/0g-ts-sdk'; export interface ServiceInfo { provider: string; serviceType: string; url: string; inputPrice: bigint; outputPrice: bigint; updatedAt: bigint; model: string; verifiability: string; } export interface ChatMessage { role: 'system' | 'user' | 'assistant'; content: string; } export interface ChatResponse { id: string; content: string; model: string; provider: string; inputTokens: number; outputTokens: number; } export interface LedgerInfo { totalBalance: bigint; inferenceBalance: bigint; fineTuningBalance: bigint; } /** * Get or create the compute broker */ export declare function getComputeBroker(): Promise; /** * Get or create the storage indexer */ export declare function getStorageIndexer(): Indexer; /** * Get wallet and provider for chain operations */ export declare function getWallet(): { wallet: ethers.Wallet; provider: ethers.JsonRpcProvider; network: { readonly rpc: "https://evmrpc-testnet.0g.ai"; readonly storageIndexer: "https://indexer-storage-testnet-turbo.0g.ai"; readonly flowContract: "0xb8F03061969da6Ad38f0a4a9f8a86bE71dA3c8E7"; readonly chainId: 16600; } | { readonly rpc: "https://evmrpc.0g.ai"; readonly storageIndexer: "https://indexer-storage.0g.ai"; readonly flowContract: "0x..."; readonly chainId: 16601; }; }; /** * List available AI services on 0G Compute */ export declare function listServices(): Promise; /** * Get ledger/balance info */ export declare function getLedger(): Promise; /** * Add funds to ledger */ export declare function addFunds(amount: number): Promise; /** * Acknowledge a provider's signer (required before first use) */ export declare function acknowledgeProvider(providerAddress: string): Promise; /** * Run chat inference on 0G Compute */ export declare function chatInference(providerAddress: string, messages: ChatMessage[], options?: { temperature?: number; maxTokens?: number; }): Promise; /** * Stream chat inference */ export declare function streamChatInference(providerAddress: string, messages: ChatMessage[], options?: { temperature?: number; maxTokens?: number; }): AsyncGenerator<{ type: 'content' | 'done'; content?: string; id?: string; }>; /** * Upload a file to 0G Storage */ export declare function uploadFile(filePath: string): Promise<{ rootHash: string; txHash: string; }>; /** * Download a file from 0G Storage */ export declare function downloadFile(rootHash: string, outputPath: string, withProof?: boolean): Promise; /** * Get file info from 0G Storage */ export declare function getFileInfo(rootHash: string): Promise; /** * Select storage nodes */ export declare function selectNodes(count?: number): Promise; /** * Get wallet balance */ export declare function getBalance(address?: string): Promise<{ balance: bigint; formatted: string; }>; /** * Get transaction details */ export declare function getTransaction(txHash: string): Promise<{ tx: ethers.TransactionResponse | null; receipt: ethers.TransactionReceipt | null; }>; /** * Check if SDK is properly configured */ export declare function isConfigured(): { compute: boolean; storage: boolean; chain: boolean; }; //# sourceMappingURL=client.d.ts.map