/** * Recovery flow: restore all facts from a BIP-39 mnemonic via the subgraph. * * This is the core UX promise: a user on a new device pastes their 12-word * mnemonic, and all their facts are recovered from the blockchain. * * Flow: * 1. Derive keys from mnemonic (encryption key, auth key, Smart Account address) * 2. Query subgraph for all facts belonging to that Smart Account * 3. Decrypt each fact's encrypted blob * 4. Sort by importance, populate hot cache with top 30 * 5. Return all decrypted facts */ export interface RestoredFact { id: string; text: string; type?: string; importance?: number; decayScore: number; sequenceId?: string; blockNumber?: string; } export interface RestoreResult { totalFacts: number; restoredFacts: RestoredFact[]; failedDecryptions: number; hotCachePopulated: boolean; smartAccountAddress: string; } export interface RestoreOptions { subgraphEndpoint: string; cachePath: string; /** * Function to derive keys from mnemonic. Injected to avoid importing * the crypto module directly (keeps this module testable with mocks). */ deriveKeys: (mnemonic: string) => { encryptionKeyHex: string; smartAccountAddress: string; }; /** * Function to decrypt a hex blob using the encryption key. * Returns the decrypted JSON string. */ decrypt: (hexBlob: string, keyHex: string) => string; } /** * Restore all facts from a BIP-39 mnemonic via the subgraph. */ export declare function restoreFromMnemonic(mnemonic: string, options: RestoreOptions): Promise; //# sourceMappingURL=restore.d.ts.map