import { ACEvent, ACSState, PaginatedACSState } from '../../types'; import { AbstractLedgerProvider } from '@canton-network/core-provider-ledger'; import { LedgerCommonSchemas } from '@canton-network/core-ledger-client-types'; import pino from 'pino'; import { ResolvedAcsOptions, AcsService, PaginatedResolvedAcsOptions } from '../../service'; export declare const logger: pino.Logger; /** * Checks if an event represents a contract creation. * Used to distinguish between created and archived events when processing cache updates. */ export declare function isCreatedEvent(event: ACEvent): event is ACEvent & { archived: false; event: LedgerCommonSchemas['CreatedEvent']; }; export type BaseCache = { State: Paginated extends true ? PaginatedACSState : ACSState; Options: Paginated extends true ? PaginatedResolvedAcsOptions : ResolvedAcsOptions; ReturnValue: ReturnType; }; export declare abstract class BaseACSCache { protected readonly ledger: AbstractLedgerProvider; protected abstract readonly state: BaseCache['State']; protected readonly service: AcsService; constructor(ledger: AbstractLedgerProvider); /** * Updates the cache to include ledger changes up to the specified offset. * Fetches and applies incremental updates from the ledger, initializing the cache if needed. * Automatically prunes old events when the update buffer exceeds configured thresholds (when not in pagination mode). */ abstract update(options: BaseCache['Options']): Promise; /** * Calculates the active contract set at a specific ledger offset. * Applies cached updates to the initial snapshot and filters out archived contracts. * Throws an error if the cache is not initialized or the requested offset is too old. */ abstract calculateAt(offset: number): LedgerCommonSchemas['JsGetActiveContractsResponse'][]; } //# sourceMappingURL=base.d.ts.map