| |
| |
| |
|
|
| export interface SolvoxAPI { |
| wallet: { |
| create: () => Promise<{ success: boolean; publicKey?: string; error?: string }>; |
| import: (mnemonic: string) => Promise<{ success: boolean; publicKey?: string; error?: string }>; |
| getPublicKey: () => Promise<string | null>; |
| getBalance: () => Promise<{ success: boolean; sol?: number; usdt?: number; error?: string }>; |
| sendSOL: (to: string, amount: number) => Promise<{ success: boolean; signature?: string; explorer?: string; error?: string }>; |
| sendUSDT: (to: string, amount: number) => Promise<{ success: boolean; signature?: string; explorer?: string; error?: string }>; |
| getHistory: (limit?: number) => Promise<{ success: boolean; history?: any[]; error?: string }>; |
| isUnlocked: () => Promise<boolean>; |
| lock: () => Promise<{ success: boolean }>; |
| exists: () => Promise<boolean>; |
| }; |
| auth: { |
| biometric: (reason?: string) => Promise<{ success: boolean; error?: string }>; |
| unlock: (pin: string) => Promise<{ success: boolean; error?: string; remainingAttempts?: number }>; |
| setPin: (pin: string) => Promise<{ success: boolean; error?: string }>; |
| biometricAvailable: () => Promise<boolean>; |
| }; |
| security: { |
| getSettings: () => Promise<any>; |
| updateSettings: (settings: any) => Promise<{ success: boolean }>; |
| addWhitelist: (address: string, label: string) => Promise<{ success: boolean; error?: string }>; |
| removeWhitelist: (address: string) => Promise<{ success: boolean }>; |
| getWhitelist: () => Promise<any[]>; |
| getAnomalies: () => Promise<any[]>; |
| }; |
| ai: { |
| initialize: () => Promise<{ success: boolean; error?: string }>; |
| chat: (message: string) => Promise<{ success: boolean; response?: string; actions?: any[]; pipelineSteps?: any[]; pendingTransaction?: any; requiresConfirmation?: boolean; toolResults?: any; error?: string }>; |
| processVoice: (audioData: ArrayBuffer) => Promise<{ success: boolean; transcription?: string; agentResult?: any; pipelineSteps?: any[]; responseAudio?: ArrayBuffer; toolResults?: any; error?: string }>; |
| executeConfirmed: (tx: { token: string; amount: number; to: string }) => Promise<{ success: boolean; signature?: string; explorer?: string; risk?: any; error?: string }>; |
| ocrPayment: (imageData: ArrayBuffer) => Promise<{ success: boolean; rawText?: string; extractedData?: any; pipelineSteps?: any[]; error?: string }>; |
| assessRisk: (tx: { amount: number; token: string; to: string }) => Promise<{ success: boolean; risk?: any; error?: string }>; |
| resolveContact: (query: string) => Promise<{ success: boolean; contact?: { address: string; name: string; confidence: number } | null; error?: string }>; |
| addContact: (contact: { name: string; address: string; notes?: string; txCount: number }) => Promise<{ success: boolean; error?: string }>; |
| getContacts: () => Promise<Array<{ name: string; address: string; notes?: string; txCount: number }>>; |
| speak: (text: string) => Promise<{ success: boolean; audio?: ArrayBuffer; error?: string }>; |
| translate: (text: string, from: string, to: string) => Promise<{ success: boolean; translated?: string; error?: string }>; |
| getStatus: () => Promise<any>; |
| }; |
| rag: { |
| search: (query: string, category?: string) => Promise<{ success: boolean; results?: any[]; error?: string }>; |
| index: (text: string, metadata: any) => Promise<{ success: boolean; error?: string }>; |
| }; |
| on: { |
| locked: (callback: () => void) => () => void; |
| balanceUpdate: (callback: (data: any) => void) => () => void; |
| aiStatus: (callback: (data: any) => void) => () => void; |
| transactionAlert: (callback: (data: any) => void) => () => void; |
| }; |
| } |
|
|
| declare global { |
| interface Window { |
| solvox: SolvoxAPI; |
| } |
| } |
|
|