/** * pop init — interactive human onboarding. * * Walks a first-time user through the four things every write command needs: * 1. a chain (from the POP-deployed set), * 2. a signing key (generate a fresh wallet, import an existing one, or skip * and set POP_PRIVATE_KEY out-of-band), * 3. an optional default org, and * 4. a persisted .env (./.env by default, or ~/.pop/.env with --global). * * TTY vs non-TTY: * - Interactive (isInteractive()): prompts for each of the above, prints a * summary, asks to confirm, then writes the file. * - Non-interactive: NEVER prompts. Requires --chain plus a key source * (--generate-key or POP_PRIVATE_KEY in the environment); anything less is * a USAGE error telling the caller exactly what to pass. * * Safety: the key lands in a plaintext file. We chmod it 0600 automatically, * say so, and remind the user not to commit it. An existing target file is * never clobbered without --force. */ import type { Argv, ArgumentsCamelCase } from 'yargs'; interface InitArgs { chain?: number; org?: string; 'generate-key'?: boolean; global?: boolean; force?: boolean; /** Hidden test override: write to this exact path instead of ./.env | ~/.pop/.env. */ file?: string; json?: boolean; } /** Resolve the env file we will write, honoring --file (test) then --global. */ export declare function resolveTargetFile(argv: { file?: string; global?: boolean; }): string; /** * Validate an imported private key by constructing a Wallet; returns the * normalized 0x key. Throws (from ethers) on anything that isn't a valid * 32-byte key. Exported for tests + reuse. */ export declare function validatePrivateKey(raw: string): string; export declare const initHandler: { builder: (yargs: Argv) => Argv<{ chain: number | undefined; } & { org: string | undefined; } & { "generate-key": boolean; } & { global: boolean; } & { force: boolean; } & { file: string | undefined; }>; handler: (argv: ArgumentsCamelCase) => Promise; }; export {};