/** * Named-wallet profile storage. * * A "wallet" is a whole config directory. The reserved `default` wallet lives * at the base config dir (zero migration for existing installs); every named * wallet lives under `{base}/profiles//` with its own `allowance.json`, * `projects.json`, and this module's non-secret `meta.json`. * * Two levels of active state, mirroring the wallet → project model: * - base `{base}/config.json` `active_wallet` — which wallet is the default * - per-wallet `projects.json` `active_project_id` — which project within it * * All writes are atomic (temp-file + rename) and owner-only (0600 files, * 0700 dirs). `meta.json` holds only public/display data (no private key), so * listing and name display never need to load key material. */ export interface BaseConfig { active_wallet?: string; } export interface ProfileMeta { name: string; address?: string; /** Cached server-side display label; null when unknown/unset. */ label?: string | null; rail?: "x402" | "mpp"; created?: string; } export declare function readBaseConfig(): BaseConfig; export declare function writeBaseConfig(cfg: BaseConfig): void; /** * The globally-selected default wallet (set via `wallets use`), or the * reserved `default` when unset/invalid. This is precedence rung 4 — below the * flag, env var, and per-directory binding. */ export declare function getDefaultWallet(): string; export declare function setDefaultWallet(name: string): void; /** Absolute directory for a wallet. `default` → base dir; named → profiles/. */ export declare function profileDir(name: string): string; /** Create (if needed) a wallet's directory with owner-only (0700) perms. */ export declare function ensureProfileDir(name: string): string; export declare function readMeta(name: string): ProfileMeta | null; export declare function writeMeta(name: string, meta: ProfileMeta): void; /** True when a wallet's `allowance.json` exists on disk. */ export declare function profileExists(name: string): boolean; /** * All wallet names on disk: `default` (only if a root allowance.json exists) * plus every valid directory under `profiles/`. */ export declare function listProfileNames(): string[]; /** Delete a named wallet's directory. Refuses to remove the reserved default. */ export declare function removeProfile(name: string): void; /** * Move a wallet to a new name. Renaming `default` migrates the root-level * credential files into `profiles//` (so a named wallet is always a * directory). Does NOT update the `active_wallet` pointer — the caller owns * that orchestration. Throws if the destination already exists or the source * is missing. */ export declare function renameProfile(oldName: string, newName: string): void; //# sourceMappingURL=profiles.d.ts.map