import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
import type { IBinaryWriter } from '@protobuf-ts/runtime';
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
import type { IBinaryReader } from '@protobuf-ts/runtime';
import type { PartialMessage } from '@protobuf-ts/runtime';
import { MessageType } from '@protobuf-ts/runtime';
import { Identifier } from './value.js';
/**
 * The union of a set of template filters, interface filters, or a wildcard.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Filters
 */
export interface Filters {
    /**
     * Every filter in the cumulative list expands the scope of the resulting stream. Each interface,
     * template or wildcard filter means additional events that will match the query.
     * The impact of include_interface_view and include_created_event_blob fields in the filters will
     * also be accumulated.
     * At least one cumulative filter MUST be specified.
     * A template or an interface SHOULD NOT appear twice in the accumulative field.
     * A wildcard filter SHOULD NOT be defined more than once in the accumulative field.
     * Optional
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.CumulativeFilter cumulative = 1
     */
    cumulative: CumulativeFilter[];
}
/**
 * A filter that matches all contracts that are either an instance of one of
 * the ``template_filters`` or that match one of the ``interface_filters``.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.CumulativeFilter
 */
export interface CumulativeFilter {
    /**
     * @generated from protobuf oneof: identifier_filter
     */
    identifierFilter: {
        oneofKind: 'wildcardFilter';
        /**
         * A wildcard filter that matches all templates
         * Optional
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.WildcardFilter wildcard_filter = 1
         */
        wildcardFilter: WildcardFilter;
    } | {
        oneofKind: 'interfaceFilter';
        /**
         * Include an ``InterfaceView`` for every ``InterfaceFilter`` matching a contract.
         * The ``InterfaceFilter`` instances MUST each use a unique ``interface_id``.
         * Optional
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.InterfaceFilter interface_filter = 2
         */
        interfaceFilter: InterfaceFilter;
    } | {
        oneofKind: 'templateFilter';
        /**
         * A template for which the data will be included in the
         * ``create_arguments`` of a matching ``CreatedEvent``.
         * If a contract is simultaneously selected by a template filter and one or more interface filters,
         * the corresponding ``include_created_event_blob`` are consolidated using an OR operation.
         * Optional
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.TemplateFilter template_filter = 3
         */
        templateFilter: TemplateFilter;
    } | {
        oneofKind: undefined;
    };
}
/**
 * This filter matches all templates.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.WildcardFilter
 */
export interface WildcardFilter {
    /**
     * Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
     * Use this to access the contract create event payload in your API client
     * for submitting it as a disclosed contract with future commands.
     * Optional
     *
     * @generated from protobuf field: bool include_created_event_blob = 1
     */
    includeCreatedEventBlob: boolean;
}
/**
 * This filter matches contracts that implement a specific interface.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.InterfaceFilter
 */
export interface InterfaceFilter {
    /**
     * The interface that a matching contract must implement.
     * The ``interface_id`` needs to be valid: corresponding interface should be defined in
     * one of the available packages at the time of the query.
     * Both package-name and package-id reference formats for the identifier are supported.
     * Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4.
     *
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier interface_id = 1
     */
    interfaceId?: Identifier;
    /**
     * Whether to include the interface view on the contract in the returned ``CreatedEvent``.
     * Use this to access contract data in a uniform manner in your API client.
     * Optional
     *
     * @generated from protobuf field: bool include_interface_view = 2
     */
    includeInterfaceView: boolean;
    /**
     * Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
     * Use this to access the contract create event payload in your API client
     * for submitting it as a disclosed contract with future commands.
     * Optional
     *
     * @generated from protobuf field: bool include_created_event_blob = 3
     */
    includeCreatedEventBlob: boolean;
}
/**
 * This filter matches contracts of a specific template.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.TemplateFilter
 */
export interface TemplateFilter {
    /**
     * A template for which the payload should be included in the response.
     * The ``template_id`` needs to be valid: corresponding template should be defined in
     * one of the available packages at the time of the query.
     * Both package-name and package-id reference formats for the identifier are supported.
     * Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4.
     *
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier template_id = 1
     */
    templateId?: Identifier;
    /**
     * Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
     * Use this to access the contract event payload in your API client
     * for submitting it as a disclosed contract with future commands.
     * Optional
     *
     * @generated from protobuf field: bool include_created_event_blob = 2
     */
    includeCreatedEventBlob: boolean;
}
/**
 * Provided for backwards compatibility, it will be removed in the Canton version 3.4.0.
 * Used both for filtering create and archive events as well as for filtering transaction trees.
 *
 * @deprecated
 * @generated from protobuf message com.daml.ledger.api.v2.TransactionFilter
 */
export interface TransactionFilter {
    /**
     * Each key must be a valid PartyIdString (as described in ``value.proto``).
     * The interpretation of the filter depends on the transaction-shape being filtered:
     *
     * 1. For **transaction trees** (used in GetUpdateTreesResponse for backwards compatibility) all party keys used as
     *    wildcard filters, and all subtrees whose root has one of the listed parties as an informee are returned.
     *    If there are ``CumulativeFilter``s, those will control returned ``CreatedEvent`` fields where applicable, but will
     *    not be used for template/interface filtering.
     * 2. For **ledger-effects** create and exercise events are returned, for which the witnesses include at least one of
     *    the listed parties and match the per-party filter.
     * 3. For **transaction and active-contract-set streams** create and archive events are returned for all contracts whose
     *    stakeholders include at least one of the listed parties and match the per-party filter.
     *
     * Required
     *
     * @generated from protobuf field: map<string, com.daml.ledger.api.v2.Filters> filters_by_party = 1
     */
    filtersByParty: {
        [key: string]: Filters;
    };
    /**
     * Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same
     * with the per-party filter as described above.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Filters filters_for_any_party = 2
     */
    filtersForAnyParty?: Filters;
}
/**
 * A format for events which defines both which events should be included
 * and what data should be computed and included for them.
 *
 * Note that some of the filtering behavior depends on the `TransactionShape`,
 * which is expected to be specified alongside usages of `EventFormat`.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.EventFormat
 */
export interface EventFormat {
    /**
     * Each key must be a valid PartyIdString (as described in ``value.proto``).
     * The interpretation of the filter depends on the transaction-shape being filtered:
     *
     * 1. For **ledger-effects** create and exercise events are returned, for which the witnesses include at least one of
     *    the listed parties and match the per-party filter.
     * 2. For **transaction and active-contract-set streams** create and archive events are returned for all contracts whose
     *    stakeholders include at least one of the listed parties and match the per-party filter.
     *
     * Optional
     *
     * @generated from protobuf field: map<string, com.daml.ledger.api.v2.Filters> filters_by_party = 1
     */
    filtersByParty: {
        [key: string]: Filters;
    };
    /**
     * Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same
     * with the per-party filter as described above.
     * Optional
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Filters filters_for_any_party = 2
     */
    filtersForAnyParty?: Filters;
    /**
     * If enabled, values served over the API will contain more information than strictly necessary to interpret the data.
     * In particular, setting the verbose flag to true triggers the ledger to include labels for record fields.
     * Optional
     *
     * @generated from protobuf field: bool verbose = 3
     */
    verbose: boolean;
}
/**
 * A format that specifies what events to include in Daml transactions
 * and what data to compute and include for them.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.TransactionFormat
 */
export interface TransactionFormat {
    /**
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.EventFormat event_format = 1
     */
    eventFormat?: EventFormat;
    /**
     * What transaction shape to use for interpreting the filters of the event format.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.TransactionShape transaction_shape = 2
     */
    transactionShape: TransactionShape;
}
/**
 * A format specifying which topology transactions to include and how to render them.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.TopologyFormat
 */
export interface TopologyFormat {
    /**
     * Include participant authorization topology events in streams.
     * Optional, if unset no participant authorization topology events are emitted in the stream.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.ParticipantAuthorizationTopologyFormat include_participant_authorization_events = 1
     */
    includeParticipantAuthorizationEvents?: ParticipantAuthorizationTopologyFormat;
}
/**
 * A format specifying which participant authorization topology transactions to include and how to render them.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.ParticipantAuthorizationTopologyFormat
 */
export interface ParticipantAuthorizationTopologyFormat {
    /**
     * List of parties for which the topology transactions should be sent.
     * Empty means: for all parties.
     *
     * @generated from protobuf field: repeated string parties = 1
     */
    parties: string[];
}
/**
 * A format specifying what updates to include and how to render them.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.UpdateFormat
 */
export interface UpdateFormat {
    /**
     * Include Daml transactions in streams.
     * Optional, if unset, no transactions are emitted in the stream.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.TransactionFormat include_transactions = 1
     */
    includeTransactions?: TransactionFormat;
    /**
     * Include (un)assignments in the stream.
     * The events in the result take the shape TRANSACTION_SHAPE_ACS_DELTA.
     * Optional, if unset, no (un)assignments are emitted in the stream.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.EventFormat include_reassignments = 2
     */
    includeReassignments?: EventFormat;
    /**
     * Include topology events in streams.
     * Optional, if unset no topology events are emitted in the stream.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.TopologyFormat include_topology_events = 3
     */
    includeTopologyEvents?: TopologyFormat;
}
/**
 * Event shape for Transactions.
 * Shapes are exclusive and only one of them can be defined in queries.
 *
 * @generated from protobuf enum com.daml.ledger.api.v2.TransactionShape
 */
export declare enum TransactionShape {
    /**
     * Following official proto3 convention, not intended for actual use.
     *
     * @generated from protobuf enum value: TRANSACTION_SHAPE_UNSPECIFIED = 0;
     */
    UNSPECIFIED = 0,
    /**
     * Transaction shape that is sufficient to maintain an accurate ACS view.
     * The field witness_parties in events are populated as stakeholders, transaction filter will apply accordingly.
     * This translates to create and archive events.
     *
     * @generated from protobuf enum value: TRANSACTION_SHAPE_ACS_DELTA = 1;
     */
    ACS_DELTA = 1,
    /**
     * Transaction shape that allows maintaining an ACS and also conveys detailed information about
     * all exercises.
     * The field witness_parties in events are populated as cumulative informees, transaction filter will apply accordingly.
     * This translates to create, consuming exercise and non-consuming exercise.
     *
     * @generated from protobuf enum value: TRANSACTION_SHAPE_LEDGER_EFFECTS = 2;
     */
    LEDGER_EFFECTS = 2
}
declare class Filters$Type extends MessageType<Filters> {
    constructor();
    create(value?: PartialMessage<Filters>): Filters;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Filters): Filters;
    internalBinaryWrite(message: Filters, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Filters
 */
export declare const Filters: Filters$Type;
declare class CumulativeFilter$Type extends MessageType<CumulativeFilter> {
    constructor();
    create(value?: PartialMessage<CumulativeFilter>): CumulativeFilter;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CumulativeFilter): CumulativeFilter;
    internalBinaryWrite(message: CumulativeFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.CumulativeFilter
 */
export declare const CumulativeFilter: CumulativeFilter$Type;
declare class WildcardFilter$Type extends MessageType<WildcardFilter> {
    constructor();
    create(value?: PartialMessage<WildcardFilter>): WildcardFilter;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WildcardFilter): WildcardFilter;
    internalBinaryWrite(message: WildcardFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.WildcardFilter
 */
export declare const WildcardFilter: WildcardFilter$Type;
declare class InterfaceFilter$Type extends MessageType<InterfaceFilter> {
    constructor();
    create(value?: PartialMessage<InterfaceFilter>): InterfaceFilter;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InterfaceFilter): InterfaceFilter;
    internalBinaryWrite(message: InterfaceFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.InterfaceFilter
 */
export declare const InterfaceFilter: InterfaceFilter$Type;
declare class TemplateFilter$Type extends MessageType<TemplateFilter> {
    constructor();
    create(value?: PartialMessage<TemplateFilter>): TemplateFilter;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateFilter): TemplateFilter;
    internalBinaryWrite(message: TemplateFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TemplateFilter
 */
export declare const TemplateFilter: TemplateFilter$Type;
declare class TransactionFilter$Type extends MessageType<TransactionFilter> {
    constructor();
    create(value?: PartialMessage<TransactionFilter>): TransactionFilter;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransactionFilter): TransactionFilter;
    private binaryReadMap1;
    internalBinaryWrite(message: TransactionFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @deprecated
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TransactionFilter
 */
export declare const TransactionFilter: TransactionFilter$Type;
declare class EventFormat$Type extends MessageType<EventFormat> {
    constructor();
    create(value?: PartialMessage<EventFormat>): EventFormat;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventFormat): EventFormat;
    private binaryReadMap1;
    internalBinaryWrite(message: EventFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.EventFormat
 */
export declare const EventFormat: EventFormat$Type;
declare class TransactionFormat$Type extends MessageType<TransactionFormat> {
    constructor();
    create(value?: PartialMessage<TransactionFormat>): TransactionFormat;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransactionFormat): TransactionFormat;
    internalBinaryWrite(message: TransactionFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TransactionFormat
 */
export declare const TransactionFormat: TransactionFormat$Type;
declare class TopologyFormat$Type extends MessageType<TopologyFormat> {
    constructor();
    create(value?: PartialMessage<TopologyFormat>): TopologyFormat;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TopologyFormat): TopologyFormat;
    internalBinaryWrite(message: TopologyFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TopologyFormat
 */
export declare const TopologyFormat: TopologyFormat$Type;
declare class ParticipantAuthorizationTopologyFormat$Type extends MessageType<ParticipantAuthorizationTopologyFormat> {
    constructor();
    create(value?: PartialMessage<ParticipantAuthorizationTopologyFormat>): ParticipantAuthorizationTopologyFormat;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ParticipantAuthorizationTopologyFormat): ParticipantAuthorizationTopologyFormat;
    internalBinaryWrite(message: ParticipantAuthorizationTopologyFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.ParticipantAuthorizationTopologyFormat
 */
export declare const ParticipantAuthorizationTopologyFormat: ParticipantAuthorizationTopologyFormat$Type;
declare class UpdateFormat$Type extends MessageType<UpdateFormat> {
    constructor();
    create(value?: PartialMessage<UpdateFormat>): UpdateFormat;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFormat): UpdateFormat;
    internalBinaryWrite(message: UpdateFormat, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.UpdateFormat
 */
export declare const UpdateFormat: UpdateFormat$Type;
export {};
//# sourceMappingURL=transaction_filter.d.ts.map