/** Pure: deterministic absolute path for the keystore file. */ export declare function lighterKeystorePath(accountIndex: number, slot: number): string; /** * Encrypt a 40-byte Lighter L2 private key (hex) and write it to * `~/.perp/lighter-agents/-.json` with mode 0600. * * Returns the absolute path of the written file. */ export declare function saveLighterKey(accountIndex: number, slot: number, privateKeyHex: string, passphrase: string): string; /** * Read + decrypt a stored Lighter L2 private key. Returns the hex string * without `0x` prefix. * * Throws (no fallback): * - LIGHTER_KEYSTORE_NOT_FOUND if the file is missing * - LIGHTER_KEYSTORE_DECRYPT_FAILED if the passphrase is wrong / file corrupt */ export declare function loadLighterKey(accountIndex: number, slot: number, passphrase: string): string; /** * Idempotent delete. Returns true if a file was removed, false if absent. */ export declare function deleteLighterKey(accountIndex: number, slot: number): boolean; /** * One-time bridge from legacy env-based storage to the keystore. * * Triggered on a single, narrow condition: env has `LIGHTER_API_KEY` AND the * target keystore file does not yet exist. After successful save, clears the * three legacy env entries from `~/.perp/.env` so they cannot be re-read. * * NOT a fallback (SSOT Rule #2): runs at most once per install (post-clear, the * trigger condition is permanently false). Single-direction (env → keystore); * never reads from keystore back to env. */ export declare function migrateFromEnvIfPresent(): void;