import { GetContractRequest, type GetContractResponse } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/contract_service.js"; import { GetEventsByContractIdRequest, type GetEventsByContractIdResponse } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/event_query_service.js"; import { ReplayEntrypoint } from "./replay-entrypoint.js"; interface IReplayContractService { getContractAsync(request: GetContractRequest): Promise; } interface IReplayEventQueryService { getEventsByContractIdAsync(request: GetEventsByContractIdRequest): Promise; } interface IReplayIdentifier { packageId?: string; moduleName?: string; entityName?: string; } interface IReplayCreatedEvent { contractId?: string; templateId?: IReplayIdentifier; createArguments?: unknown; } interface IReplayExercisedEvent { contractId?: string; templateId?: IReplayIdentifier; choice?: string; choiceArgument?: unknown; } interface IReplayArchivedEvent { contractId?: string; templateId?: IReplayIdentifier; } interface IReplayTransactionEvent { event?: { oneofKind?: string; created?: IReplayCreatedEvent; exercised?: IReplayExercisedEvent; archived?: IReplayArchivedEvent; }; } export interface IReplayTransactionSnapshot { readonly kind: "transaction"; readonly offset: string; readonly updateId?: string; readonly actAs?: readonly string[]; readonly readAs?: readonly string[]; readonly events: readonly IReplayTransactionEvent[]; readonly entrypoint: ReplayEntrypoint; } export interface IHydratedReplayHistoryEntry { readonly contractId?: string; readonly templateId?: IReplayIdentifier; readonly payload?: unknown; readonly rawEvent?: unknown; } export interface IHydratedReplayContract { readonly contractId: string; readonly templateId?: IReplayIdentifier; readonly payload: unknown; readonly rawCreatedEvent?: unknown; readonly synchronizerId?: string; readonly history: { readonly created?: IHydratedReplayHistoryEntry; readonly archived?: IHydratedReplayHistoryEntry; }; } export interface ILedgerReplayEnvironment { readonly kind: "transaction"; readonly offset: string; readonly updateId?: string; readonly actAs: readonly string[]; readonly readAs: readonly string[]; readonly entrypoint: ReplayEntrypoint; readonly contracts: ReadonlyMap; readonly packageIds: readonly string[]; } export declare class LedgerReplayEnvironmentBuilder { private readonly dependencies; constructor(dependencies: { contractService: IReplayContractService; eventQueryService: IReplayEventQueryService; queryingParties?: readonly string[]; }); buildOrThrowAsync(snapshot: IReplayTransactionSnapshot): Promise; private getVisibleCreatedContracts; private getRequiredContractIds; private addReferencedContractIds; private hydrateContractOrThrowAsync; private getQueryingParties; private addPackageId; private asCreatedEvent; private asArchivedEvent; private readObjectProperty; private readObjectString; } export {};