/** * Wallet & keypair management for the Leviathan. * * Port of automaton-main/src/identity/wallet.ts, adapted for Solana keypairs. * * The Leviathan's keypair IS its identity. Sealed at spawn time, never logged * in plaintext, persisted to ~/.openclawd/keystore.json with file-mode 0600. */ import { Keypair, PublicKey } from '@solana/web3.js'; declare const SHELL_DIR: string; declare const KEYSTORE_PATH: string; /** Generate a new keypair and seal it to the keystore. Throws if a keystore already exists. */ export declare function spawnKeypair(): Keypair; /** Load the existing keypair. Returns null if no keystore exists. */ export declare function loadKeypair(): Keypair | null; /** Hard-fail load — for runtime paths that require an identity. */ export declare function requireKeypair(): Keypair; /** Return the leviathan's pubkey as a base58 string. */ export declare function getPubkey(): string | null; /** Convenience: return the keystore metadata (pubkey, spawn time). */ export declare function readKeystoreMetadata(): { pubkey: string; spawnedAt: number; } | null; /** Returns true if a keypair exists on disk. */ export declare function hasKeystore(): boolean; /** Export the secret key as base58 — for `openclawd export-key`. Treat with care. */ export declare function exportSecretBase58(): string; /** Sanity check the keypair file is mode 0600. Refuse to use it otherwise. */ export declare function assertKeystorePermissions(): void; export { KEYSTORE_PATH, SHELL_DIR }; export declare const _internals: { PublicKey: typeof PublicKey; };