import { StateServiceClient } from "../../services/state/state-service-client.js"; import { UpdateServiceClient } from "../../services/update/update-service-client.js"; import { type GetActiveContractsResponse as GetActiveContractsResponseType } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/state_service.js"; import { type GetUpdateResponse as GetUpdateResponseType } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/update_service.js"; import { type GrpcQueryTemplateRef } from "../../transports/grpc/mappers/contracts-mapper.js"; type StateSnapshotReader = Pick; type UpdateSnapshotReader = Pick; export interface GrpcHistorySnapshot { readonly endInclusive: string; readonly updates: readonly GetUpdateResponseType[]; } export interface GrpcActiveContractSnapshot { readonly activeAtOffset: string; readonly activeContracts: readonly GetActiveContractsResponseType[]; } export interface GrpcQuerySnapshotReaderOptions { readonly maxHistoryPages?: number; readonly maxHistoryUpdates?: number; readonly maxActiveContractPages?: number; readonly maxActiveContracts?: number; /** Per-request page size for history reads; omitted means the participant's default. */ readonly historyPageSize?: number; /** Per-request page size for ACS reads; omitted means the participant's default. */ readonly activeContractPageSize?: number; /** * Opt-in: retain the last replayed history window in memory and only fetch offsets past it on later * reads. Off by default because the retained window lives for this reader's lifetime — its RAM cost is * the full materialized history, bounded only by maxHistoryUpdates. */ readonly incrementalHistory?: boolean; } export declare class GrpcQuerySnapshotReader { private readonly stateService; private readonly updateService; private readonly options; private historyCache; constructor(stateService: StateSnapshotReader, updateService: UpdateSnapshotReader, options?: GrpcQuerySnapshotReaderOptions); /** Whether an incremental history window is already held, meaning the next read only fetches new offsets. */ get hasHistoryCache(): boolean; readCurrentHistoryAsync(): Promise; readHistoryAsync(endInclusive: string): Promise; private readHistoryRangeAsync; readActiveContractsAsync(activeAtOffset: string, parties?: readonly string[], templateRefs?: readonly GrpcQueryTemplateRef[]): Promise; private historyError; private activeError; } export declare function isCanonicalGrpcOffset(value: unknown): value is string; export {};