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 { Timestamp } from '../../../../../google/protobuf/timestamp.js';
import { Duration } from '../../../../../google/protobuf/duration.js';
import { Value } from './value.js';
import { Record } from './value.js';
import { Identifier } from './value.js';
/**
 * A command can either create a new contract or exercise a choice on an existing contract.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Command
 */
export interface Command {
    /**
     * @generated from protobuf oneof: command
     */
    command: {
        oneofKind: 'create';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.CreateCommand create = 1
         */
        create: CreateCommand;
    } | {
        oneofKind: 'exercise';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.ExerciseCommand exercise = 2
         */
        exercise: ExerciseCommand;
    } | {
        oneofKind: 'exerciseByKey';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.ExerciseByKeyCommand exercise_by_key = 4
         */
        exerciseByKey: ExerciseByKeyCommand;
    } | {
        oneofKind: 'createAndExercise';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.CreateAndExerciseCommand create_and_exercise = 3
         */
        createAndExercise: CreateAndExerciseCommand;
    } | {
        oneofKind: undefined;
    };
}
/**
 * Create a new contract instance based on a template.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.CreateCommand
 */
export interface CreateCommand {
    /**
     * The template of contract the client wants to create.
     * Both package-name and package-id reference identifier formats for the template-id 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;
    /**
     * The arguments required for creating a contract from this template.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Record create_arguments = 2
     */
    createArguments?: Record;
}
/**
 * Exercise a choice on an existing contract.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.ExerciseCommand
 */
export interface ExerciseCommand {
    /**
     * The template or interface of the contract the client wants to exercise.
     * Both package-name and package-id reference identifier formats for the template-id are supported.
     * Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4.
     * To exercise a choice on an interface, specify the interface identifier in the template_id field.
     *
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier template_id = 1
     */
    templateId?: Identifier;
    /**
     * The ID of the contract the client wants to exercise upon.
     * Must be a valid LedgerString (as described in ``value.proto``).
     * Required
     *
     * @generated from protobuf field: string contract_id = 2
     */
    contractId: string;
    /**
     * The name of the choice the client wants to exercise.
     * Must be a valid NameString (as described in ``value.proto``)
     * Required
     *
     * @generated from protobuf field: string choice = 3
     */
    choice: string;
    /**
     * The argument for this choice.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value choice_argument = 4
     */
    choiceArgument?: Value;
}
/**
 * Exercise a choice on an existing contract specified by its key.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.ExerciseByKeyCommand
 */
export interface ExerciseByKeyCommand {
    /**
     * The template of contract the client wants to exercise.
     * Both package-name and package-id reference identifier formats for the template-id 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;
    /**
     * The key of the contract the client wants to exercise upon.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value contract_key = 2
     */
    contractKey?: Value;
    /**
     * The name of the choice the client wants to exercise.
     * Must be a valid NameString (as described in ``value.proto``)
     * Required
     *
     * @generated from protobuf field: string choice = 3
     */
    choice: string;
    /**
     * The argument for this choice.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value choice_argument = 4
     */
    choiceArgument?: Value;
}
/**
 * Create a contract and exercise a choice on it in the same transaction.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.CreateAndExerciseCommand
 */
export interface CreateAndExerciseCommand {
    /**
     * The template of the contract the client wants to create.
     * Both package-name and package-id reference identifier formats for the template-id 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;
    /**
     * The arguments required for creating a contract from this template.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Record create_arguments = 2
     */
    createArguments?: Record;
    /**
     * The name of the choice the client wants to exercise.
     * Must be a valid NameString (as described in ``value.proto``).
     * Required
     *
     * @generated from protobuf field: string choice = 3
     */
    choice: string;
    /**
     * The argument for this choice.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value choice_argument = 4
     */
    choiceArgument?: Value;
}
/**
 * An additional contract that is used to resolve
 * contract & contract key lookups.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.DisclosedContract
 */
export interface DisclosedContract {
    /**
     * The template id of the contract.
     * The identifier uses the package-id reference format.
     *
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier template_id = 1
     */
    templateId?: Identifier;
    /**
     * The contract id
     * Required
     *
     * @generated from protobuf field: string contract_id = 2
     */
    contractId: string;
    /**
     * Opaque byte string containing the complete payload required by the Daml engine
     * to reconstruct a contract not known to the receiving participant.
     * Required
     *
     * @generated from protobuf field: bytes created_event_blob = 3
     */
    createdEventBlob: Uint8Array;
    /**
     * The ID of the synchronizer where the contract is currently assigned
     * Optional
     *
     * @generated from protobuf field: string synchronizer_id = 4
     */
    synchronizerId: string;
}
/**
 * A composite command that groups multiple commands together.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Commands
 */
export interface Commands {
    /**
     * Identifier of the on-ledger workflow that this command is a part of.
     * Must be a valid LedgerString (as described in ``value.proto``).
     * Optional
     *
     * @generated from protobuf field: string workflow_id = 1
     */
    workflowId: string;
    /**
     * Uniquely identifies the participant user that issued the command.
     * Must be a valid UserIdString (as described in ``value.proto``).
     * Required unless authentication is used with a user token.
     * In that case, the token's user-id will be used for the request's user_id.
     *
     * @generated from protobuf field: string user_id = 2
     */
    userId: string;
    /**
     * Uniquely identifies the command.
     * The triple (user_id, act_as, command_id) constitutes the change ID for the intended ledger change,
     * where act_as is interpreted as a set of party names.
     * The change ID can be used for matching the intended ledger changes with all their completions.
     * Must be a valid LedgerString (as described in ``value.proto``).
     * Required
     *
     * @generated from protobuf field: string command_id = 3
     */
    commandId: string;
    /**
     * Individual elements of this atomic command. Must be non-empty.
     * Required
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.Command commands = 4
     */
    commands: Command[];
    /**
     * Specifies the deduplication period for the change ID.
     * If omitted, the participant will assume the configured maximum deduplication time.
     *
     * @generated from protobuf oneof: deduplication_period
     */
    deduplicationPeriod: {
        oneofKind: 'deduplicationDuration';
        /**
         * Specifies the length of the deduplication period.
         * It is interpreted relative to the local clock at some point during the submission's processing.
         * Must be non-negative. Must not exceed the maximum deduplication time.
         *
         * @generated from protobuf field: google.protobuf.Duration deduplication_duration = 5
         */
        deduplicationDuration: Duration;
    } | {
        oneofKind: 'deduplicationOffset';
        /**
         * Specifies the start of the deduplication period by a completion stream offset (exclusive).
         * Must be a valid absolute offset (positive integer) or participant begin (zero).
         *
         * @generated from protobuf field: int64 deduplication_offset = 6
         */
        deduplicationOffset: bigint;
    } | {
        oneofKind: undefined;
    };
    /**
     * Lower bound for the ledger time assigned to the resulting transaction.
     * Note: The ledger time of a transaction is assigned as part of command interpretation.
     * Use this property if you expect that command interpretation will take a considerate amount of time, such that by
     * the time the resulting transaction is sequenced, its assigned ledger time is not valid anymore.
     * Must not be set at the same time as min_ledger_time_rel.
     * Optional
     *
     * @generated from protobuf field: google.protobuf.Timestamp min_ledger_time_abs = 7
     */
    minLedgerTimeAbs?: Timestamp;
    /**
     * Same as min_ledger_time_abs, but specified as a duration, starting from the time the command is received by the server.
     * Must not be set at the same time as min_ledger_time_abs.
     * Optional
     *
     * @generated from protobuf field: google.protobuf.Duration min_ledger_time_rel = 8
     */
    minLedgerTimeRel?: Duration;
    /**
     * Set of parties on whose behalf the command should be executed.
     * If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
     * to act on behalf of each of the given parties.
     * Each element must be a valid PartyIdString (as described in ``value.proto``).
     * Required, must be non-empty.
     *
     * @generated from protobuf field: repeated string act_as = 9
     */
    actAs: string[];
    /**
     * Set of parties on whose behalf (in addition to all parties listed in ``act_as``) contracts can be retrieved.
     * This affects Daml operations such as ``fetch``, ``fetchByKey``, ``lookupByKey``, ``exercise``, and ``exerciseByKey``.
     * Note: A participant node of a Daml network can host multiple parties. Each contract present on the participant
     * node is only visible to a subset of these parties. A command can only use contracts that are visible to at least
     * one of the parties in ``act_as`` or ``read_as``. This visibility check is independent from the Daml authorization
     * rules for fetch operations.
     * If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
     * to read contract data on behalf of each of the given parties.
     * Optional
     *
     * @generated from protobuf field: repeated string read_as = 10
     */
    readAs: string[];
    /**
     * A unique identifier to distinguish completions for different submissions with the same change ID.
     * Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission
     * with the same change ID.
     * Must be a valid LedgerString (as described in ``value.proto``).
     *
     * If omitted, the participant or the committer may set a value of their choice.
     * Optional
     *
     * @generated from protobuf field: string submission_id = 11
     */
    submissionId: string;
    /**
     * Additional contracts used to resolve contract & contract key lookups.
     * Optional
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.DisclosedContract disclosed_contracts = 12
     */
    disclosedContracts: DisclosedContract[];
    /**
     * Must be a valid synchronizer id
     * Optional
     *
     * @generated from protobuf field: string synchronizer_id = 13
     */
    synchronizerId: string;
    /**
     * The package-id selection preference of the client for resolving
     * package names and interface instances in command submission and interpretation
     *
     * @generated from protobuf field: repeated string package_id_selection_preference = 14
     */
    packageIdSelectionPreference: string[];
    /**
     * Fetches the contract keys into the caches to speed up the command processing.
     * Should only contain contract keys that are expected to be resolved during interpretation of the commands.
     * Keys of disclosed contracts do not need prefetching.
     *
     * Optional
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.PrefetchContractKey prefetch_contract_keys = 15
     */
    prefetchContractKeys: PrefetchContractKey[];
}
/**
 * Preload contracts
 *
 * @generated from protobuf message com.daml.ledger.api.v2.PrefetchContractKey
 */
export interface PrefetchContractKey {
    /**
     * The template of contract the client wants to prefetch.
     * Both package-name and package-id reference identifier formats for the template-id 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;
    /**
     * The key of the contract the client wants to prefetch.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value contract_key = 2
     */
    contractKey?: Value;
}
declare class Command$Type extends MessageType<Command> {
    constructor();
    create(value?: PartialMessage<Command>): Command;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Command): Command;
    internalBinaryWrite(message: Command, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Command
 */
export declare const Command: Command$Type;
declare class CreateCommand$Type extends MessageType<CreateCommand> {
    constructor();
    create(value?: PartialMessage<CreateCommand>): CreateCommand;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateCommand): CreateCommand;
    internalBinaryWrite(message: CreateCommand, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.CreateCommand
 */
export declare const CreateCommand: CreateCommand$Type;
declare class ExerciseCommand$Type extends MessageType<ExerciseCommand> {
    constructor();
    create(value?: PartialMessage<ExerciseCommand>): ExerciseCommand;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExerciseCommand): ExerciseCommand;
    internalBinaryWrite(message: ExerciseCommand, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.ExerciseCommand
 */
export declare const ExerciseCommand: ExerciseCommand$Type;
declare class ExerciseByKeyCommand$Type extends MessageType<ExerciseByKeyCommand> {
    constructor();
    create(value?: PartialMessage<ExerciseByKeyCommand>): ExerciseByKeyCommand;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExerciseByKeyCommand): ExerciseByKeyCommand;
    internalBinaryWrite(message: ExerciseByKeyCommand, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.ExerciseByKeyCommand
 */
export declare const ExerciseByKeyCommand: ExerciseByKeyCommand$Type;
declare class CreateAndExerciseCommand$Type extends MessageType<CreateAndExerciseCommand> {
    constructor();
    create(value?: PartialMessage<CreateAndExerciseCommand>): CreateAndExerciseCommand;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateAndExerciseCommand): CreateAndExerciseCommand;
    internalBinaryWrite(message: CreateAndExerciseCommand, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.CreateAndExerciseCommand
 */
export declare const CreateAndExerciseCommand: CreateAndExerciseCommand$Type;
declare class DisclosedContract$Type extends MessageType<DisclosedContract> {
    constructor();
    create(value?: PartialMessage<DisclosedContract>): DisclosedContract;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisclosedContract): DisclosedContract;
    internalBinaryWrite(message: DisclosedContract, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.DisclosedContract
 */
export declare const DisclosedContract: DisclosedContract$Type;
declare class Commands$Type extends MessageType<Commands> {
    constructor();
    create(value?: PartialMessage<Commands>): Commands;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Commands): Commands;
    internalBinaryWrite(message: Commands, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Commands
 */
export declare const Commands: Commands$Type;
declare class PrefetchContractKey$Type extends MessageType<PrefetchContractKey> {
    constructor();
    create(value?: PartialMessage<PrefetchContractKey>): PrefetchContractKey;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PrefetchContractKey): PrefetchContractKey;
    internalBinaryWrite(message: PrefetchContractKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.PrefetchContractKey
 */
export declare const PrefetchContractKey: PrefetchContractKey$Type;
export {};
//# sourceMappingURL=commands.d.ts.map