import { z } from "zod/v4"; //#region src/model/compare.schema.d.ts /** * How close two numeric values may be before a disagreement counts as real. * * The compare scripts pick a formula from this union; the schemas only name * which formula a field uses. * * - `"amount"` — accrual lag on an {@link Amount.value} / {@link TokenAmount.value}. * - `"bps"` — truncation vs rounding on a basis-point rate, ±1. * - `"float"` — relative float drift within 0.1% (leverage). * - `"usd"` — price-derived {@link Amount.valueUsd} / {@link TokenAmount.valueUsd}. **/ export type CompareTolerance = "amount" | "bps" | "float" | "usd"; /** * A numeric field whose two sources may drift within {@link tolerance}. **/ export interface ToleranceCompareTag { tolerance: CompareTolerance; } /** * Compare metadata a schema field may carry. * * - `"offchainOnly"` / `"onchainOnly"` — the other source typically leaves * the field empty, so a disagreement is expected. * - `"backendPreferred"` — both sources fill the field, but both-mode merge * overlays the backend value, so a disagreement is expected. * - {@link ToleranceCompareTag} — a numeric disagreement within the named * formula is expected snapshot noise. **/ export type CompareTag = "offchainOnly" | "onchainOnly" | "backendPreferred" | ToleranceCompareTag; /** * Marks a field that only the backend fills. **/ export declare function offchainOnly(schema: S): S; /** * Marks a field that only the chain fills. **/ export declare function onchainOnly(schema: S): S; /** * Marks a field whose backend value both-mode merge overlays onto the chain * row, so a source disagreement is expected. **/ export declare function backendPreferred(schema: S): S; /** * Marks a numeric field whose two sources may drift within {@link kind}. **/ export declare function tolerance(schema: S, kind: CompareTolerance): S; /** * The compare tag registered on a schema, if any. **/ export declare function compareTagOf(schema: z.ZodType): CompareTag | undefined; //#endregion