/** * @pwngh/economy-lab * * Copyright (c) Preston Neal * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ export { verifyArchiveHeads } from '../chain.js'; import type { ArchiveSink, CallOptions, Store } from '../ports.js'; import type { WorkerCtx } from '../contract.js'; export interface ArchiveSweepInput { /** The cold store pages are copied into before any delete. */ sink: ArchiveSink; /** * Only history sealed by a checkpoint at least this old moves. Must exceed every refund and * dispute window the deployment honors: archived history reads as absent, and money paths * that need it reject rather than move. */ checkpointOlderThanMs: number; /** Postings per page (one sink put + one prune transaction each). */ limit: number; now: number; } export interface ArchiveSummary { /** Postings moved this run. */ moved: number; /** The watermark after this run; null when nothing has ever been archived. */ throughSeq: number | null; /** True when the run consumed the whole eligible prefix. */ finished: boolean; /** Set when the store lacks the archival surfaces. */ skipped?: true; /** The stated fact behind a skipped or early-stopped run. */ reason?: string; } /** * One archival run: verify, copy, delete, in pages, resumable. Returns a summary of what moved * and why it stopped; refuses loudly (CHAIN_BROKEN) rather than move anything unverified. */ export declare function archiveSealedPrefix(store: Store, ctx: WorkerCtx, input: ArchiveSweepInput, options?: CallOptions): Promise;