export declare function symbolMatch(candidate: string, target: string): boolean; export declare function formatUsd(value: string | number): string; export declare function formatPnl(value: string | number): string; export declare function formatPercent(value: string | number): string; export declare function makeTable(head: string[], rows: string[][]): string; /** Render a sparkline from numeric values. Returns unicode bar chart string. */ export declare function sparkline(values: number[], width?: number): string; export declare function printJson(data: unknown): void; export declare function errorAndExit(msg: string): never; /** Standard JSON response envelope */ export interface ApiResponse { ok: boolean; data?: T; error?: { code: string; message: string; status?: number; retryable?: boolean; retryAfterMs?: number; /** Actionable hint for automated callers (Codex v0.12.12 final QA #2). */ remediation?: string; details?: Record; }; meta?: { exchange?: string; timestamp: string; duration_ms?: number; }; } /** Wrap successful result in standard envelope */ export declare function jsonOk(data: T, meta?: Partial): ApiResponse; /** Wrap error in standard envelope */ export declare function jsonError(code: string, message: string, meta?: Partial & { status?: number; retryable?: boolean; retryAfterMs?: number; details?: Record; remediation?: string; }): ApiResponse; /** Execute a command action with structured error handling. * In JSON mode, errors are returned as JSON instead of crashing. * * PerpError-typed throws are preserved end-to-end: their `code`, * `remediation`, and other StructuredError fields surface in the JSON * envelope's `error` block so machine consumers (agents / MCP / automation) * receive actionable hints. Codex v0.12.12 final QA #2. */ export declare function withJsonErrors(isJson: boolean, fn: () => Promise, exchange?: string): Promise; /** * Log each rejected outcome from Promise.allSettled to stderr with a * per-source label. SSOT rule #2 helper: turn a quiet rejection inside a * multi-DEX comparison into an explicit one-line failure on stderr. * * @param settled Outcomes from Promise.allSettled. * @param labels Source label per index (e.g. ["pacifica", "hyperliquid", ...]). * @param prefix Bracketed prefix prepended to each line (e.g. "arb-auto"). */ export declare function logSettledRejections(settled: PromiseSettledResult[], labels: string[], prefix: string): void;