/** * @fileoverview Recursive Pact JSON-boundary type unwrapping. * * Chainweb Pact API returns PactValue-encoded JSON. Without explicit * unwrapping, these objects leak into consumer logic as * `{"int": 5}` instead of `5` * `{"decimal": "3.14"}` instead of `"3.14"` (we keep as string for precision) * `{"time": "..."}` instead of `"..."` (ISO string) * causing the `{int:N} === N` false-negative pattern documented in * CARRY-FORWARD-FINDINGS and user memory. * * Rules: * - `{int: N}` where N is a number OR numeric string → number (bigint-safe * up to 2^53-1; larger values are returned as string to preserve precision) * - `{decimal: "N.M"}` → string (preserve precision) * - `{decimal: N}` → N (Pact sometimes emits whole decimals as plain numbers * — pass through; no reason to coerce) * - `{time: "..."}` → string * - `null`/`undefined` → preserved verbatim (do NOT coerce nonexistent * fields to NaN — silent false-positive source) * - Arrays: unwrap each element. * - Objects with ONLY a single recognized sentinel key are unwrapped; * regular multi-field objects are recursed into. */ export type PactValue = null | string | number | boolean | PactValue[] | { [k: string]: PactValue; }; /** * Recursively unwrap a Pact JSON value tree. * * Never throws. Always returns a fully plain JS value (no sentinel wrappers * remain at any depth). */ export declare function unwrapPactValue(input: unknown): PactValue; //# sourceMappingURL=unwrap.d.ts.map