import { GetContractResponse } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/contract_service.js"; import { CreatedEvent, Event, ExercisedEvent } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/event.js"; import { ActiveContract } from "../../transports/grpc/generated/canton/com/daml/ledger/api/v2/state_service.js"; import type { ContractResult, ExerciseResult } from "../../query/model-types.js"; import type { DamlTypeIdentity, DamlValueSource } from "./daml-type-descriptor.js"; export type DamlJsonEventRecord = Readonly>; export type DamlCreatedEventSource = CreatedEvent | GetContractResponse | ActiveContract | ContractResult | Event | DamlJsonEventRecord; export type DamlExercisedEventSource = ExercisedEvent | ExerciseResult | Event | DamlJsonEventRecord; export type DamlCreatedEventMetadata = { readonly templateId: DamlTypeIdentity; /** The template's package NAME — the stable identity across smart-contract-upgrade versions. */ readonly packageName?: string; readonly offset?: string; readonly nodeId?: number; readonly witnessParties?: readonly string[]; readonly signatories?: readonly string[]; readonly observers?: readonly string[]; /** Canonical UTC ISO-8601 timestamp. */ readonly createdAt?: string; }; export type DamlExercisedEventMetadata = { readonly templateId: DamlTypeIdentity; /** The template's package NAME — the stable identity across smart-contract-upgrade versions. */ readonly packageName?: string; readonly offset?: string; readonly nodeId?: number; readonly actingParties?: readonly string[]; readonly witnessParties?: readonly string[]; readonly lastDescendantNodeId?: number; }; export type DamlNormalizedCreatedEvent = { readonly kind: "created"; readonly contractId: string; readonly payload: DamlValueSource; readonly metadata: DamlCreatedEventMetadata; }; export type DamlNormalizedExercisedEvent = { readonly kind: "exercised"; readonly contractId: string; readonly choice: string; readonly argument: DamlValueSource; readonly result: DamlValueSource; readonly consuming: boolean; readonly metadata: DamlExercisedEventMetadata; }; /** Recognizes Ledger API and PQS event sources as immutable DAML event shapes. */ export declare class DamlEventSourceNormalizer { private constructor(); /** Recognizes a Ledger API create event, contract response/wrapper, or PQS/JSON contract record. */ static normalizeCreated(source: DamlCreatedEventSource): DamlNormalizedCreatedEvent; /** Recognizes a Ledger API exercise event or a PQS/JSON exercise record. */ static normalizeExercised(source: DamlExercisedEventSource): DamlNormalizedExercisedEvent; }