/** External anchor state for a receipt or batch. * unanchored: exists only in gateway memory * batched_pending: included in a Merkle batch, root not yet anchored externally * anchored: Merkle root published to external log (Rekor, Solana, etc.) * critical_direct_anchor: individual receipt anchored directly (bypass batching) */ export type AnchorState = 'unanchored' | 'batched_pending' | 'anchored' | 'critical_direct_anchor'; /** Anchor metadata on a receipt */ export interface AnchorMetadata { state: AnchorState; /** Batch ID if batched_pending or anchored */ batchId?: string; /** External anchor reference (URL, transaction ID, etc.) */ anchorRef?: string; /** When the anchor was confirmed */ anchoredAt?: string; /** Which anchor backend was used */ anchorBackend?: string; } /** Auto-batch configuration */ export interface AutoBatchConfig { /** Maximum seconds between batch commits (0 = disabled) */ maxIntervalSeconds: number; /** Maximum receipts before auto-commit (0 = disabled) */ maxReceiptsPerBatch: number; /** Whether critical/irreversible actions get direct anchor */ directAnchorCritical: boolean; } export declare const DEFAULT_AUTO_BATCH_CONFIG: AutoBatchConfig; /** Create initial anchor metadata for a new receipt */ export declare function createAnchorMetadata(critical?: boolean): AnchorMetadata; /** Transition anchor state when receipt is added to a batch */ export declare function markBatched(anchor: AnchorMetadata, batchId: string): AnchorMetadata; /** Transition anchor state when batch root is externally anchored */ export declare function markAnchored(anchor: AnchorMetadata, anchorRef: string, anchorBackend: string): AnchorMetadata; /** Check if auto-batch should fire based on config and current state */ export declare function shouldAutoBatch(pendingCount: number, lastBatchTime: string | null, config?: AutoBatchConfig): { trigger: boolean; reason: 'max_receipts' | 'max_interval' | null; }; /** Check if an anchor state meets a minimum requirement */ export declare function meetsAnchorRequirement(current: AnchorState, minimum: AnchorState): boolean; /** Check if anchor state transition is valid (can only move forward) */ export declare function isValidAnchorTransition(from: AnchorState, to: AnchorState): boolean; /** Exported ordering for cross-language verification */ export declare const ANCHOR_STATE_ORDER: Record; //# sourceMappingURL=anchor-state.d.ts.map