import type { Hash } from '@ariestools/sdk';
import type { Payload, ReadArchivist, WithHashMeta } from '@xyo-network/sdk';
import type { BlockContextRead, BlockRate, BlocksStepSummary, BlockViewer, ChainContextRead, ChainId, FinalizationViewer, MapType, SignedHydratedBlockWithHashMeta, SignedHydratedBlockWithStorageMeta, SingleTimeConfig, TimeDurations, XL1BlockNumber, XL1BlockRange } from '@xyo-network/xl1-protocol/protocol-lib';
import { LruCacheMap } from '../../../driver-memory/index.js';
import type { ArchivistConnectionBinding } from '../../Archivists/index.js';
import type { CreatableProviderParams } from '../../CreatableProvider/index.js';
import { AbstractCreatableProvider } from '../../CreatableProvider/index.js';
import type { ChainStoreRead } from '../../model/index.js';
import { HydratedCache } from '../../utils/index.js';
/** Parameters for SimpleBlockViewer. */
export interface SimpleBlockViewerParams extends CreatableProviderParams {
    /**
     * Optional backing store for cached per-step block summaries used by `blocksByStep`. Omit to use
     * an in-memory LRU; inject a persistent (large-object capable) map for production.
     */
    blocksSummaryMap?: MapType<string, BlocksStepSummary>;
    /** Connection the chain store self-provisions from when finalizedArchivist is not injected. */
    connection?: ArchivistConnectionBinding;
    finalizedArchivist?: ReadArchivist;
    headPollIntervalMs?: number;
}
/** SimpleBlockViewer implementation. */
export declare class SimpleBlockViewer extends AbstractCreatableProvider<SimpleBlockViewerParams, BlockViewer['eventData']> implements BlockViewer {
    static readonly connectionTypes: readonly ["lmdb", "mongo", "memory"];
    static readonly defaultMoniker: "BlockViewer";
    static readonly dependencies: "FinalizationViewer"[];
    static readonly monikers: "BlockViewer"[];
    static readonly surface: "node";
    moniker: "BlockViewer";
    protected _store?: ChainStoreRead;
    protected finalizationViewer: FinalizationViewer;
    protected payloadCache: LruCacheMap<import("@ariestools/sdk").BrandedHash, WithHashMeta<Payload>, () => void>;
    protected signedHydratedBlockWithHashMetaCache: LruCacheMap<import("@ariestools/sdk").BrandedHash, [{
        schema: "network.xyo.boundwitness" & {
            readonly __schema: true;
        };
        addresses: (import("@xyo-network/sdk").XyoQuantAddress | (Lowercase<string> & {
            readonly __hex: true;
        } & {
            readonly __address: true;
        }))[];
        payload_hashes: import("@ariestools/sdk").BrandedHash[];
        payload_schemas: import("@xyo-network/sdk").BrandedSchema<string>[];
        previous_hashes: (import("@ariestools/sdk").BrandedHash | null)[];
        $signatures: import("@ariestools/sdk").BrandedHex[];
        block: XL1BlockNumber;
        chain: import("@ariestools/sdk").BrandedHex;
        previous: import("@ariestools/sdk").BrandedHash | null;
        $epoch: number;
        _hash: import("@ariestools/sdk").BrandedHash;
        _dataHash: import("@ariestools/sdk").BrandedHash;
        $destination?: import("@xyo-network/sdk").XyoQuantAddress | (Lowercase<string> & {
            readonly __hex: true;
        } & {
            readonly __address: true;
        }) | undefined;
        $sourceQuery?: import("@ariestools/sdk").BrandedHash | undefined;
        protocol?: number | undefined;
        step_hashes?: import("@ariestools/sdk").BrandedHash[] | undefined;
    }, {
        [x: string]: unknown;
        schema: import("@xyo-network/sdk").BrandedSchema<string>;
        _hash: import("@ariestools/sdk").BrandedHash;
        _dataHash: import("@ariestools/sdk").BrandedHash;
    }[]], () => void>;
    private _blockStepSemaphores;
    private _blocksSummaryMap?;
    private _headPollHash?;
    private _headPollInProgress;
    private _headPollTimer;
    private _signedHydratedBlockCache;
    get finalizedArchivist(): ReadArchivist;
    protected get blocksSummaryMap(): MapType<string, BlocksStepSummary>;
    protected get headPollIntervalMs(): number | undefined;
    protected get hydratedBlockCache(): HydratedCache<SignedHydratedBlockWithStorageMeta>;
    protected get store(): ChainStoreRead;
    static paramsHandler(params: Partial<SimpleBlockViewerParams>): Promise<{
        blocksSummaryMap: MapType<string, BlocksStepSummary> | undefined;
        finalizedArchivist: ReadArchivist<Payload, import("@ariestools/sdk").BrandedHash, import("@xyo-network/sdk").Sequence>;
        headPollIntervalMs: number | undefined;
        context: import('../../model/CreatableProviderContext.zod.js').CreatableProviderContextType;
        name?: import("@ariestools/sdk").CreatableName;
        statusReporter?: import("@ariestools/sdk").CreatableStatusReporter<void> | undefined;
        logger?: import("@ariestools/sdk").Logger;
        meterProvider?: import("@opentelemetry/api").MeterProvider;
        traceProvider?: import("@opentelemetry/api").TracerProvider;
    }>;
    blockByHash(hash: Hash): Promise<SignedHydratedBlockWithHashMeta | null>;
    blockByNumber(blockNumber: XL1BlockNumber): Promise<SignedHydratedBlockWithHashMeta | null>;
    blocksByHash(hash: Hash, limit?: number): Promise<SignedHydratedBlockWithHashMeta[]>;
    blocksByNumber(blockNumber: XL1BlockNumber, limit?: number): Promise<SignedHydratedBlockWithHashMeta[]>;
    blocksByStep(stepLevel: number, stepIndex: number): Promise<SignedHydratedBlockWithHashMeta[]>;
    chainId(): Promise<ChainId>;
    chainId(blockNumber: XL1BlockNumber): Promise<ChainId>;
    chainId(blockNumber: 'latest'): Promise<ChainId>;
    createHandler(): Promise<void>;
    currentBlock(): Promise<SignedHydratedBlockWithHashMeta>;
    currentBlockHash(): Promise<Hash>;
    currentBlockNumber(): Promise<XL1BlockNumber>;
    payloadByHash(hash: Hash): Promise<WithHashMeta<Payload> | null>;
    payloadsByHash(hashes: Hash[]): Promise<WithHashMeta<Payload>[]>;
    rate(range: XL1BlockRange, timeUnit?: keyof TimeDurations): Promise<BlockRate>;
    stepSizeRate(start: XL1BlockNumber, stepIndex: number, count?: number, timeUnit?: keyof TimeDurations): Promise<BlockRate>;
    timeDurationRate(timeConfig: SingleTimeConfig, startBlockNumber?: XL1BlockNumber, timeUnit?: keyof TimeDurations, toleranceMs?: number, maxAttempts?: number): Promise<BlockRate>;
    protected getBlockContextRead(): BlockContextRead;
    protected getChainContextRead(): Promise<ChainContextRead>;
    protected startHandler(): Promise<void>;
    protected stopHandler(): Promise<void>;
    private blockByNumberWithContext;
    private pollHead;
    private startHeadPolling;
    private stopHeadPolling;
}
//# sourceMappingURL=SimpleBlockViewer.d.ts.map