File size: 3,814 Bytes
945e815
9ff7e0c
945e815
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ff7e0c
 
 
 
 
 
 
 
945e815
 
 
 
 
9ff7e0c
 
945e815
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
 * SolVox Type Definitions — matches preload.ts exactly
 */

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;
  }
}