import type { BlockNumber, BlockViewer, CachingContext, XL1BlockNumber } from '@xyo-network/xl1-protocol/protocol-lib';
/** Default terminal fallback: the eth block at which the xl1 mainnet chain started running (first external staking - 1) */
export declare const EXTERNAL_TIME_GENESIS_FALLBACK = 23372716;
/**
 * Default maximum number of neighboring blocks scanned in each direction for a
 * time anchor. Must exceed the widest plausible time-witness outage: a
 * boundary deeper inside an unanchored stretch than this window falls back to
 * the genesis constant and its step's rewards strand at zero (the observed
 * mainnet outage was ~21k blocks). The cost is only paid inside real gaps —
 * anchored boundaries never scan — and a full window is ~2,000 chunked
 * round trips, once, after which the per-block cache absorbs re-scans.
 */
export declare const EXTERNAL_TIME_MAX_SCAN_BLOCKS = 100000;
/** Direction to prefer when scanning neighboring blocks for a time anchor */
export type ExternalTimeScanDirection = 'backward' | 'forward';
/** Options controlling how external time is resolved when a block's TimePayload lacks it */
export interface ExternalTimeAnchorOptions {
    /** Terminal fallback when no block in either scan window carries the external time */
    externalGenesisTime?: number;
    /** Maximum number of neighboring blocks scanned in each direction for a time anchor */
    maxScanBlocks?: number;
}
/**
 * Resolves the external (e.g. eth) block number for an XL1 block from its
 * TimePayload. When the payload lacks the external time (the time witness was
 * not reporting it), scans neighboring blocks for the nearest anchor —
 * preferring `direction` — so historical gaps resolve from surrounding data.
 * Falls back to `externalGenesisTime` only when no anchor exists in either
 * scan window. Results are only cached when they can never change as the
 * chain grows, so gaps still open at the head heal on recomputation.
 */
export declare function externalBlockNumberFromXL1BlockNumber(context: CachingContext, blockViewer: BlockViewer, xl1BlockNumber: XL1BlockNumber, externalTimeName: 'ethereum' | 'epoch', direction?: ExternalTimeScanDirection, options?: ExternalTimeAnchorOptions): Promise<BlockNumber>;
//# sourceMappingURL=externalBlockNumberFromXl1BlockNumber.d.ts.map