import { b as AllocationSummary } from '../allocations-CEPeZr6T.js'; import 'polkadot-api'; import '@parity/product-sdk-terminal'; /** * login — QR/mobile sign-in command. * * Flow: * 1. connect() → existing session (already logged in) OR QR code * 2. Print QR → user scans on phone * 3. waitForLogin() → phone approves → paired * 4. requestResourceAllocation(DEFAULT_RESOURCES) — one batched claim for all three deploy * allowances (BulletInAllowance, StatementStoreAllowance, SmartContractAllowance). Triggers * a single wallet prompt; granted key material is cached by product-sdk-terminal so later * deploys find it without re-prompting. Non-fatal: Rejected/NotAvailable → log + continue. * 5. createSlotAccountSigner(BULLETIN_RESOURCE) — reads the now-cached Bulletin slot from the * terminal cache written in step 4 (pure cache-hit, no phone prompt). Falls back to * getBulletinSigner() only on a rare cache miss. * 6. Print summarizeLogin() + slot address on success; map AllowanceError.reason → message on failure * 7. Destroy adapters and exit */ /** * Map an AllowanceError.reason to a user-facing message. * * - NoSession: the paired session was not found (should not happen right after login) * - Rejected: the user dismissed the wallet prompt * - NotAvailable: the wallet has no allocation for this product (re-pair needed) * - UnexpectedResponse: protocol-level error in the wire exchange */ declare function allocationErrorMessage(reason: string): string; /** * Soft-warning message shown when the post-sign-in allowance pre-warm steps fail. * The user IS already signed in; this is non-fatal. * Pure function, unit-testable. */ declare function allocationFailedMessage(reason: string): string; /** * Format the up-front batched allocation result as a human-readable log line. * Pure function, unit-testable. * * Granted resources are logged with ✓; rejected/unavailable are logged as warnings. * Non-fatal: callers should log the message but NEVER process.exit on a non-empty * rejected or unavailable list — deploys can still fall back. */ declare function formatAllocationSummary(summary: AllocationSummary): string; /** * Race `promise` against a timeout, clearing the timer once either side settles. * * CRITICAL: `Promise.race` does not cancel the loser, and `setTimeout` fires on * wall-clock from creation. A bare `race([p, timeoutPromise])` leaves the timer * armed after `p` wins — it then rejects an un-awaited promise later, surfacing as * an `unhandledRejection`. In login that rejection ("…timed out…") is NOT a benign * teardown string, so bin's `unhandledRejection` guard treats it as fatal → exit 1 * AFTER a successful login (the on-chain authorization wait can push total elapsed * past the 60s window). `clearTimeout` in `finally` closes that window. */ declare function withTimeout(promise: PromiseLike, ms: number, message: string): Promise; /** * Format a post-login summary. Pure function, unit-testable. * * @param address SS58 product address (the identity signing on-chain) * @param slotAddress SS58 slot account address for Bulletin storage, or null if not obtained */ declare function summarizeLogin(address: string, slotAddress: string | null): string; /** * Produce the on-chain authorization result message shown after the active-wait completes. * Pure function — unit-testable without a real WS connection. * * - authorized = true → ✓ success message with expiration block (exit-0, show summarizeLogin). * - authorized = false → soft-warning: active wait timed out before the authorization landed. * Login is still valid — the slot is deterministic and often already authorized; the deploy * path re-probes before use and falls back to the pool if still absent. isWarning=true so * callers know it's a non-fatal outcome. The timeout bound (timeoutSeconds) is embedded in * the message so users understand the ceiling that was used. */ declare function bulletinAuthSummary(authorized: boolean, expiration?: number, timeoutSeconds?: number): { message: string; isWarning: boolean; }; interface LoginOptions { suri?: string; } /** * Run the login command. Prints the QR code to stdout and waits for mobile approval. */ declare function runLogin(envId: string, _opts?: LoginOptions): Promise; export { type LoginOptions, allocationErrorMessage, allocationFailedMessage, bulletinAuthSummary, formatAllocationSummary, runLogin, summarizeLogin, withTimeout };