"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var interactive_submission_service_exports = {};
__export(interactive_submission_service_exports, {
  DamlTransaction: () => DamlTransaction,
  DamlTransaction_Node: () => DamlTransaction_Node,
  DamlTransaction_NodeSeed: () => DamlTransaction_NodeSeed,
  ExecuteSubmissionRequest: () => ExecuteSubmissionRequest,
  ExecuteSubmissionResponse: () => ExecuteSubmissionResponse,
  GetPreferredPackageVersionRequest: () => GetPreferredPackageVersionRequest,
  GetPreferredPackageVersionResponse: () => GetPreferredPackageVersionResponse,
  GetPreferredPackagesRequest: () => GetPreferredPackagesRequest,
  GetPreferredPackagesResponse: () => GetPreferredPackagesResponse,
  HashingSchemeVersion: () => HashingSchemeVersion,
  InteractiveSubmissionService: () => InteractiveSubmissionService,
  Metadata: () => Metadata,
  Metadata_GlobalKeyMappingEntry: () => Metadata_GlobalKeyMappingEntry,
  Metadata_InputContract: () => Metadata_InputContract,
  Metadata_SubmitterInfo: () => Metadata_SubmitterInfo,
  MinLedgerTime: () => MinLedgerTime,
  PackagePreference: () => PackagePreference,
  PackageVettingRequirement: () => PackageVettingRequirement,
  PartySignatures: () => PartySignatures,
  PrepareSubmissionRequest: () => PrepareSubmissionRequest,
  PrepareSubmissionResponse: () => PrepareSubmissionResponse,
  PreparedTransaction: () => PreparedTransaction,
  Signature: () => Signature,
  SignatureFormat: () => SignatureFormat,
  SigningAlgorithmSpec: () => SigningAlgorithmSpec,
  SinglePartySignatures: () => SinglePartySignatures
});
module.exports = __toCommonJS(interactive_submission_service_exports);
var import_runtime_rpc = require("@protobuf-ts/runtime-rpc");
var import_runtime = require("@protobuf-ts/runtime");
var import_runtime2 = require("@protobuf-ts/runtime");
var import_runtime3 = require("@protobuf-ts/runtime");
var import_runtime4 = require("@protobuf-ts/runtime");
var import_package_reference = require("../package_reference.cjs");
var import_interactive_submission_data = require("./transaction/v1/interactive_submission_data.cjs");
var import_interactive_submission_data2 = require("./transaction/v1/interactive_submission_data.cjs");
var import_value = require("../value.cjs");
var import_interactive_submission_common_data = require("./interactive_submission_common_data.cjs");
var import_duration = require("../../../../../../google/protobuf/duration.cjs");
var import_commands = require("../commands.cjs");
var import_commands2 = require("../commands.cjs");
var import_timestamp = require("../../../../../../google/protobuf/timestamp.cjs");
var import_commands3 = require("../commands.cjs");
var HashingSchemeVersion = /* @__PURE__ */ ((HashingSchemeVersion2) => {
  HashingSchemeVersion2[HashingSchemeVersion2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  HashingSchemeVersion2[HashingSchemeVersion2["V2"] = 2] = "V2";
  return HashingSchemeVersion2;
})(HashingSchemeVersion || {});
var SigningAlgorithmSpec = /* @__PURE__ */ ((SigningAlgorithmSpec2) => {
  SigningAlgorithmSpec2[SigningAlgorithmSpec2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  SigningAlgorithmSpec2[SigningAlgorithmSpec2["ED25519"] = 1] = "ED25519";
  SigningAlgorithmSpec2[SigningAlgorithmSpec2["EC_DSA_SHA_256"] = 2] = "EC_DSA_SHA_256";
  SigningAlgorithmSpec2[SigningAlgorithmSpec2["EC_DSA_SHA_384"] = 3] = "EC_DSA_SHA_384";
  return SigningAlgorithmSpec2;
})(SigningAlgorithmSpec || {});
var SignatureFormat = /* @__PURE__ */ ((SignatureFormat2) => {
  SignatureFormat2[SignatureFormat2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  SignatureFormat2[SignatureFormat2["RAW"] = 1] = "RAW";
  SignatureFormat2[SignatureFormat2["DER"] = 2] = "DER";
  SignatureFormat2[SignatureFormat2["CONCAT"] = 3] = "CONCAT";
  SignatureFormat2[SignatureFormat2["SYMBOLIC"] = 1e4] = "SYMBOLIC";
  return SignatureFormat2;
})(SignatureFormat || {});
class PrepareSubmissionRequest$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PrepareSubmissionRequest", [
      {
        no: 1,
        name: "user_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "command_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "commands",
        kind: "message",
        repeat: 2,
        T: () => import_commands3.Command
      },
      {
        no: 4,
        name: "min_ledger_time",
        kind: "message",
        T: () => MinLedgerTime
      },
      {
        no: 11,
        name: "max_record_time",
        kind: "message",
        T: () => import_timestamp.Timestamp
      },
      {
        no: 5,
        name: "act_as",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 6,
        name: "read_as",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "disclosed_contracts",
        kind: "message",
        repeat: 2,
        T: () => import_commands2.DisclosedContract
      },
      {
        no: 8,
        name: "synchronizer_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 9,
        name: "package_id_selection_preference",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 10,
        name: "verbose_hashing",
        kind: "scalar",
        T: 8
      },
      {
        no: 15,
        name: "prefetch_contract_keys",
        kind: "message",
        repeat: 2,
        T: () => import_commands.PrefetchContractKey
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.userId = "";
    message.commandId = "";
    message.commands = [];
    message.actAs = [];
    message.readAs = [];
    message.disclosedContracts = [];
    message.synchronizerId = "";
    message.packageIdSelectionPreference = [];
    message.verboseHashing = false;
    message.prefetchContractKeys = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string user_id */
        1:
          message.userId = reader.string();
          break;
        case /* string command_id */
        2:
          message.commandId = reader.string();
          break;
        case /* repeated com.daml.ledger.api.v2.Command commands */
        3:
          message.commands.push(
            import_commands3.Command.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* com.daml.ledger.api.v2.interactive.MinLedgerTime min_ledger_time */
        4:
          message.minLedgerTime = MinLedgerTime.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.minLedgerTime
          );
          break;
        case /* optional google.protobuf.Timestamp max_record_time */
        11:
          message.maxRecordTime = import_timestamp.Timestamp.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.maxRecordTime
          );
          break;
        case /* repeated string act_as */
        5:
          message.actAs.push(reader.string());
          break;
        case /* repeated string read_as */
        6:
          message.readAs.push(reader.string());
          break;
        case /* repeated com.daml.ledger.api.v2.DisclosedContract disclosed_contracts */
        7:
          message.disclosedContracts.push(
            import_commands2.DisclosedContract.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* string synchronizer_id */
        8:
          message.synchronizerId = reader.string();
          break;
        case /* repeated string package_id_selection_preference */
        9:
          message.packageIdSelectionPreference.push(reader.string());
          break;
        case /* bool verbose_hashing */
        10:
          message.verboseHashing = reader.bool();
          break;
        case /* repeated com.daml.ledger.api.v2.PrefetchContractKey prefetch_contract_keys */
        15:
          message.prefetchContractKeys.push(
            import_commands.PrefetchContractKey.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.userId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.userId);
    if (message.commandId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.commandId);
    for (let i = 0; i < message.commands.length; i++)
      import_commands3.Command.internalBinaryWrite(
        message.commands[i],
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.minLedgerTime)
      MinLedgerTime.internalBinaryWrite(
        message.minLedgerTime,
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.actAs.length; i++)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.actAs[i]);
    for (let i = 0; i < message.readAs.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.readAs[i]);
    for (let i = 0; i < message.disclosedContracts.length; i++)
      import_commands2.DisclosedContract.internalBinaryWrite(
        message.disclosedContracts[i],
        writer.tag(7, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.synchronizerId !== "")
      writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    for (let i = 0; i < message.packageIdSelectionPreference.length; i++)
      writer.tag(9, import_runtime.WireType.LengthDelimited).string(message.packageIdSelectionPreference[i]);
    if (message.verboseHashing !== false)
      writer.tag(10, import_runtime.WireType.Varint).bool(message.verboseHashing);
    if (message.maxRecordTime)
      import_timestamp.Timestamp.internalBinaryWrite(
        message.maxRecordTime,
        writer.tag(11, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.prefetchContractKeys.length; i++)
      import_commands.PrefetchContractKey.internalBinaryWrite(
        message.prefetchContractKeys[i],
        writer.tag(15, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PrepareSubmissionRequest = new PrepareSubmissionRequest$Type();
class PrepareSubmissionResponse$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PrepareSubmissionResponse", [
      {
        no: 1,
        name: "prepared_transaction",
        kind: "message",
        T: () => PreparedTransaction
      },
      {
        no: 2,
        name: "prepared_transaction_hash",
        kind: "scalar",
        T: 12
      },
      {
        no: 3,
        name: "hashing_scheme_version",
        kind: "enum",
        T: () => [
          "com.daml.ledger.api.v2.interactive.HashingSchemeVersion",
          HashingSchemeVersion,
          "HASHING_SCHEME_VERSION_"
        ]
      },
      {
        no: 4,
        name: "hashing_details",
        kind: "scalar",
        opt: true,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.preparedTransactionHash = new Uint8Array(0);
    message.hashingSchemeVersion = 0;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.PreparedTransaction prepared_transaction */
        1:
          message.preparedTransaction = PreparedTransaction.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.preparedTransaction
          );
          break;
        case /* bytes prepared_transaction_hash */
        2:
          message.preparedTransactionHash = reader.bytes();
          break;
        case /* com.daml.ledger.api.v2.interactive.HashingSchemeVersion hashing_scheme_version */
        3:
          message.hashingSchemeVersion = reader.int32();
          break;
        case /* optional string hashing_details */
        4:
          message.hashingDetails = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.preparedTransaction)
      PreparedTransaction.internalBinaryWrite(
        message.preparedTransaction,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.preparedTransactionHash.length)
      writer.tag(2, import_runtime.WireType.LengthDelimited).bytes(message.preparedTransactionHash);
    if (message.hashingSchemeVersion !== 0)
      writer.tag(3, import_runtime.WireType.Varint).int32(message.hashingSchemeVersion);
    if (message.hashingDetails !== void 0)
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.hashingDetails);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PrepareSubmissionResponse = new PrepareSubmissionResponse$Type();
class Signature$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.Signature", [
      {
        no: 1,
        name: "format",
        kind: "enum",
        T: () => [
          "com.daml.ledger.api.v2.interactive.SignatureFormat",
          SignatureFormat,
          "SIGNATURE_FORMAT_"
        ]
      },
      {
        no: 2,
        name: "signature",
        kind: "scalar",
        T: 12
      },
      {
        no: 3,
        name: "signed_by",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "signing_algorithm_spec",
        kind: "enum",
        T: () => [
          "com.daml.ledger.api.v2.interactive.SigningAlgorithmSpec",
          SigningAlgorithmSpec,
          "SIGNING_ALGORITHM_SPEC_"
        ]
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.format = 0;
    message.signature = new Uint8Array(0);
    message.signedBy = "";
    message.signingAlgorithmSpec = 0;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.SignatureFormat format */
        1:
          message.format = reader.int32();
          break;
        case /* bytes signature */
        2:
          message.signature = reader.bytes();
          break;
        case /* string signed_by */
        3:
          message.signedBy = reader.string();
          break;
        case /* com.daml.ledger.api.v2.interactive.SigningAlgorithmSpec signing_algorithm_spec */
        4:
          message.signingAlgorithmSpec = reader.int32();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.format !== 0)
      writer.tag(1, import_runtime.WireType.Varint).int32(message.format);
    if (message.signature.length)
      writer.tag(2, import_runtime.WireType.LengthDelimited).bytes(message.signature);
    if (message.signedBy !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.signedBy);
    if (message.signingAlgorithmSpec !== 0)
      writer.tag(4, import_runtime.WireType.Varint).int32(message.signingAlgorithmSpec);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Signature = new Signature$Type();
class SinglePartySignatures$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.SinglePartySignatures", [
      {
        no: 1,
        name: "party",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "signatures",
        kind: "message",
        repeat: 2,
        T: () => Signature
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.party = "";
    message.signatures = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string party */
        1:
          message.party = reader.string();
          break;
        case /* repeated com.daml.ledger.api.v2.interactive.Signature signatures */
        2:
          message.signatures.push(
            Signature.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.party !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.party);
    for (let i = 0; i < message.signatures.length; i++)
      Signature.internalBinaryWrite(
        message.signatures[i],
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SinglePartySignatures = new SinglePartySignatures$Type();
class PartySignatures$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PartySignatures", [
      {
        no: 1,
        name: "signatures",
        kind: "message",
        repeat: 2,
        T: () => SinglePartySignatures
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.signatures = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated com.daml.ledger.api.v2.interactive.SinglePartySignatures signatures */
        1:
          message.signatures.push(
            SinglePartySignatures.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.signatures.length; i++)
      SinglePartySignatures.internalBinaryWrite(
        message.signatures[i],
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PartySignatures = new PartySignatures$Type();
class ExecuteSubmissionRequest$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionRequest", [
      {
        no: 1,
        name: "prepared_transaction",
        kind: "message",
        T: () => PreparedTransaction
      },
      {
        no: 2,
        name: "party_signatures",
        kind: "message",
        T: () => PartySignatures
      },
      {
        no: 3,
        name: "deduplication_duration",
        kind: "message",
        oneof: "deduplicationPeriod",
        T: () => import_duration.Duration
      },
      {
        no: 4,
        name: "deduplication_offset",
        kind: "scalar",
        oneof: "deduplicationPeriod",
        T: 3,
        L: 0
      },
      {
        no: 5,
        name: "submission_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 6,
        name: "user_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 7,
        name: "hashing_scheme_version",
        kind: "enum",
        T: () => [
          "com.daml.ledger.api.v2.interactive.HashingSchemeVersion",
          HashingSchemeVersion,
          "HASHING_SCHEME_VERSION_"
        ]
      },
      {
        no: 8,
        name: "min_ledger_time",
        kind: "message",
        T: () => MinLedgerTime
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.deduplicationPeriod = { oneofKind: void 0 };
    message.submissionId = "";
    message.userId = "";
    message.hashingSchemeVersion = 0;
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.PreparedTransaction prepared_transaction */
        1:
          message.preparedTransaction = PreparedTransaction.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.preparedTransaction
          );
          break;
        case /* com.daml.ledger.api.v2.interactive.PartySignatures party_signatures */
        2:
          message.partySignatures = PartySignatures.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.partySignatures
          );
          break;
        case /* google.protobuf.Duration deduplication_duration */
        3:
          message.deduplicationPeriod = {
            oneofKind: "deduplicationDuration",
            deduplicationDuration: import_duration.Duration.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.deduplicationPeriod.deduplicationDuration
            )
          };
          break;
        case /* int64 deduplication_offset */
        4:
          message.deduplicationPeriod = {
            oneofKind: "deduplicationOffset",
            deduplicationOffset: reader.int64().toBigInt()
          };
          break;
        case /* string submission_id */
        5:
          message.submissionId = reader.string();
          break;
        case /* string user_id */
        6:
          message.userId = reader.string();
          break;
        case /* com.daml.ledger.api.v2.interactive.HashingSchemeVersion hashing_scheme_version */
        7:
          message.hashingSchemeVersion = reader.int32();
          break;
        case /* com.daml.ledger.api.v2.interactive.MinLedgerTime min_ledger_time */
        8:
          message.minLedgerTime = MinLedgerTime.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.minLedgerTime
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.preparedTransaction)
      PreparedTransaction.internalBinaryWrite(
        message.preparedTransaction,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.partySignatures)
      PartySignatures.internalBinaryWrite(
        message.partySignatures,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.deduplicationPeriod.oneofKind === "deduplicationDuration")
      import_duration.Duration.internalBinaryWrite(
        message.deduplicationPeriod.deduplicationDuration,
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.deduplicationPeriod.oneofKind === "deduplicationOffset")
      writer.tag(4, import_runtime.WireType.Varint).int64(message.deduplicationPeriod.deduplicationOffset);
    if (message.submissionId !== "")
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.submissionId);
    if (message.userId !== "")
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.userId);
    if (message.hashingSchemeVersion !== 0)
      writer.tag(7, import_runtime.WireType.Varint).int32(message.hashingSchemeVersion);
    if (message.minLedgerTime)
      MinLedgerTime.internalBinaryWrite(
        message.minLedgerTime,
        writer.tag(8, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExecuteSubmissionRequest = new ExecuteSubmissionRequest$Type();
class ExecuteSubmissionResponse$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.ExecuteSubmissionResponse",
      []
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ExecuteSubmissionResponse = new ExecuteSubmissionResponse$Type();
class MinLedgerTime$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.MinLedgerTime", [
      {
        no: 1,
        name: "min_ledger_time_abs",
        kind: "message",
        oneof: "time",
        T: () => import_timestamp.Timestamp
      },
      {
        no: 2,
        name: "min_ledger_time_rel",
        kind: "message",
        oneof: "time",
        T: () => import_duration.Duration
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.time = { oneofKind: void 0 };
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* google.protobuf.Timestamp min_ledger_time_abs */
        1:
          message.time = {
            oneofKind: "minLedgerTimeAbs",
            minLedgerTimeAbs: import_timestamp.Timestamp.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.time.minLedgerTimeAbs
            )
          };
          break;
        case /* google.protobuf.Duration min_ledger_time_rel */
        2:
          message.time = {
            oneofKind: "minLedgerTimeRel",
            minLedgerTimeRel: import_duration.Duration.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.time.minLedgerTimeRel
            )
          };
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.time.oneofKind === "minLedgerTimeAbs")
      import_timestamp.Timestamp.internalBinaryWrite(
        message.time.minLedgerTimeAbs,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.time.oneofKind === "minLedgerTimeRel")
      import_duration.Duration.internalBinaryWrite(
        message.time.minLedgerTimeRel,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const MinLedgerTime = new MinLedgerTime$Type();
class PreparedTransaction$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PreparedTransaction", [
      {
        no: 1,
        name: "transaction",
        kind: "message",
        T: () => DamlTransaction
      },
      { no: 2, name: "metadata", kind: "message", T: () => Metadata }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.DamlTransaction transaction */
        1:
          message.transaction = DamlTransaction.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.transaction
          );
          break;
        case /* com.daml.ledger.api.v2.interactive.Metadata metadata */
        2:
          message.metadata = Metadata.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.metadata
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.transaction)
      DamlTransaction.internalBinaryWrite(
        message.transaction,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.metadata)
      Metadata.internalBinaryWrite(
        message.metadata,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PreparedTransaction = new PreparedTransaction$Type();
class Metadata$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.Metadata", [
      {
        no: 2,
        name: "submitter_info",
        kind: "message",
        T: () => Metadata_SubmitterInfo
      },
      {
        no: 3,
        name: "synchronizer_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "mediator_group",
        kind: "scalar",
        T: 13
      },
      {
        no: 5,
        name: "transaction_uuid",
        kind: "scalar",
        T: 9
      },
      {
        no: 6,
        name: "preparation_time",
        kind: "scalar",
        T: 4,
        L: 0
      },
      {
        no: 7,
        name: "input_contracts",
        kind: "message",
        repeat: 2,
        T: () => Metadata_InputContract
      },
      {
        no: 9,
        name: "min_ledger_effective_time",
        kind: "scalar",
        opt: true,
        T: 4,
        L: 0
      },
      {
        no: 10,
        name: "max_ledger_effective_time",
        kind: "scalar",
        opt: true,
        T: 4,
        L: 0
      },
      {
        no: 8,
        name: "global_key_mapping",
        kind: "message",
        repeat: 2,
        T: () => Metadata_GlobalKeyMappingEntry
      },
      {
        no: 11,
        name: "max_record_time",
        kind: "scalar",
        opt: true,
        T: 4,
        L: 0
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.mediatorGroup = 0;
    message.transactionUuid = "";
    message.preparationTime = 0n;
    message.inputContracts = [];
    message.globalKeyMapping = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo submitter_info */
        2:
          message.submitterInfo = Metadata_SubmitterInfo.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.submitterInfo
          );
          break;
        case /* string synchronizer_id */
        3:
          message.synchronizerId = reader.string();
          break;
        case /* uint32 mediator_group */
        4:
          message.mediatorGroup = reader.uint32();
          break;
        case /* string transaction_uuid */
        5:
          message.transactionUuid = reader.string();
          break;
        case /* uint64 preparation_time */
        6:
          message.preparationTime = reader.uint64().toBigInt();
          break;
        case /* repeated com.daml.ledger.api.v2.interactive.Metadata.InputContract input_contracts */
        7:
          message.inputContracts.push(
            Metadata_InputContract.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* optional uint64 min_ledger_effective_time */
        9:
          message.minLedgerEffectiveTime = reader.uint64().toBigInt();
          break;
        case /* optional uint64 max_ledger_effective_time */
        10:
          message.maxLedgerEffectiveTime = reader.uint64().toBigInt();
          break;
        case /* repeated com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry global_key_mapping */
        8:
          message.globalKeyMapping.push(
            Metadata_GlobalKeyMappingEntry.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* optional uint64 max_record_time */
        11:
          message.maxRecordTime = reader.uint64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.submitterInfo)
      Metadata_SubmitterInfo.internalBinaryWrite(
        message.submitterInfo,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.synchronizerId !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    if (message.mediatorGroup !== 0)
      writer.tag(4, import_runtime.WireType.Varint).uint32(message.mediatorGroup);
    if (message.transactionUuid !== "")
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.transactionUuid);
    if (message.preparationTime !== 0n)
      writer.tag(6, import_runtime.WireType.Varint).uint64(message.preparationTime);
    for (let i = 0; i < message.inputContracts.length; i++)
      Metadata_InputContract.internalBinaryWrite(
        message.inputContracts[i],
        writer.tag(7, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.globalKeyMapping.length; i++)
      Metadata_GlobalKeyMappingEntry.internalBinaryWrite(
        message.globalKeyMapping[i],
        writer.tag(8, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.minLedgerEffectiveTime !== void 0)
      writer.tag(9, import_runtime.WireType.Varint).uint64(message.minLedgerEffectiveTime);
    if (message.maxLedgerEffectiveTime !== void 0)
      writer.tag(10, import_runtime.WireType.Varint).uint64(message.maxLedgerEffectiveTime);
    if (message.maxRecordTime !== void 0)
      writer.tag(11, import_runtime.WireType.Varint).uint64(message.maxRecordTime);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Metadata = new Metadata$Type();
class Metadata_SubmitterInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo", [
      {
        no: 1,
        name: "act_as",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "command_id",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.actAs = [];
    message.commandId = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string act_as */
        1:
          message.actAs.push(reader.string());
          break;
        case /* string command_id */
        2:
          message.commandId = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.actAs.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.actAs[i]);
    if (message.commandId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.commandId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Metadata_SubmitterInfo = new Metadata_SubmitterInfo$Type();
class Metadata_GlobalKeyMappingEntry$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry",
      [
        { no: 1, name: "key", kind: "message", T: () => import_interactive_submission_common_data.GlobalKey },
        { no: 2, name: "value", kind: "message", T: () => import_value.Value }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.GlobalKey key */
        1:
          message.key = import_interactive_submission_common_data.GlobalKey.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.key
          );
          break;
        case /* optional com.daml.ledger.api.v2.Value value */
        2:
          message.value = import_value.Value.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.value
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.key)
      import_interactive_submission_common_data.GlobalKey.internalBinaryWrite(
        message.key,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.value)
      import_value.Value.internalBinaryWrite(
        message.value,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Metadata_GlobalKeyMappingEntry = new Metadata_GlobalKeyMappingEntry$Type();
class Metadata_InputContract$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.Metadata.InputContract", [
      {
        no: 1,
        name: "v1",
        kind: "message",
        oneof: "contract",
        T: () => import_interactive_submission_data2.Create
      },
      {
        no: 1e3,
        name: "created_at",
        kind: "scalar",
        T: 4,
        L: 0
      },
      {
        no: 1002,
        name: "event_blob",
        kind: "scalar",
        T: 12
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.contract = { oneofKind: void 0 };
    message.createdAt = 0n;
    message.eventBlob = new Uint8Array(0);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.transaction.v1.Create v1 */
        1:
          message.contract = {
            oneofKind: "v1",
            v1: import_interactive_submission_data2.Create.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.contract.v1
            )
          };
          break;
        case /* uint64 created_at */
        1e3:
          message.createdAt = reader.uint64().toBigInt();
          break;
        case /* bytes event_blob */
        1002:
          message.eventBlob = reader.bytes();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.contract.oneofKind === "v1")
      import_interactive_submission_data2.Create.internalBinaryWrite(
        message.contract.v1,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.createdAt !== 0n)
      writer.tag(1e3, import_runtime.WireType.Varint).uint64(message.createdAt);
    if (message.eventBlob.length)
      writer.tag(1002, import_runtime.WireType.LengthDelimited).bytes(message.eventBlob);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Metadata_InputContract = new Metadata_InputContract$Type();
class DamlTransaction$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.DamlTransaction", [
      {
        no: 1,
        name: "version",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "roots",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 3,
        name: "nodes",
        kind: "message",
        repeat: 2,
        T: () => DamlTransaction_Node
      },
      {
        no: 4,
        name: "node_seeds",
        kind: "message",
        repeat: 2,
        T: () => DamlTransaction_NodeSeed
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.version = "";
    message.roots = [];
    message.nodes = [];
    message.nodeSeeds = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string version */
        1:
          message.version = reader.string();
          break;
        case /* repeated string roots */
        2:
          message.roots.push(reader.string());
          break;
        case /* repeated com.daml.ledger.api.v2.interactive.DamlTransaction.Node nodes */
        3:
          message.nodes.push(
            DamlTransaction_Node.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* repeated com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed node_seeds */
        4:
          message.nodeSeeds.push(
            DamlTransaction_NodeSeed.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.version !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.version);
    for (let i = 0; i < message.roots.length; i++)
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.roots[i]);
    for (let i = 0; i < message.nodes.length; i++)
      DamlTransaction_Node.internalBinaryWrite(
        message.nodes[i],
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.nodeSeeds.length; i++)
      DamlTransaction_NodeSeed.internalBinaryWrite(
        message.nodeSeeds[i],
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DamlTransaction = new DamlTransaction$Type();
class DamlTransaction_NodeSeed$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed", [
      {
        no: 1,
        name: "node_id",
        kind: "scalar",
        T: 5
      },
      {
        no: 2,
        name: "seed",
        kind: "scalar",
        T: 12
        /*ScalarType.BYTES*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.nodeId = 0;
    message.seed = new Uint8Array(0);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* int32 node_id */
        1:
          message.nodeId = reader.int32();
          break;
        case /* bytes seed */
        2:
          message.seed = reader.bytes();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.nodeId !== 0)
      writer.tag(1, import_runtime.WireType.Varint).int32(message.nodeId);
    if (message.seed.length)
      writer.tag(2, import_runtime.WireType.LengthDelimited).bytes(message.seed);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DamlTransaction_NodeSeed = new DamlTransaction_NodeSeed$Type();
class DamlTransaction_Node$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.DamlTransaction.Node", [
      {
        no: 1,
        name: "node_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 1e3,
        name: "v1",
        kind: "message",
        oneof: "versionedNode",
        T: () => import_interactive_submission_data.Node
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.nodeId = "";
    message.versionedNode = { oneofKind: void 0 };
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string node_id */
        1:
          message.nodeId = reader.string();
          break;
        case /* com.daml.ledger.api.v2.interactive.transaction.v1.Node v1 */
        1e3:
          message.versionedNode = {
            oneofKind: "v1",
            v1: import_interactive_submission_data.Node.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.versionedNode.v1
            )
          };
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.nodeId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.nodeId);
    if (message.versionedNode.oneofKind === "v1")
      import_interactive_submission_data.Node.internalBinaryWrite(
        message.versionedNode.v1,
        writer.tag(1e3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DamlTransaction_Node = new DamlTransaction_Node$Type();
class GetPreferredPackageVersionRequest$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.GetPreferredPackageVersionRequest",
      [
        {
          no: 1,
          name: "parties",
          kind: "scalar",
          repeat: 2,
          T: 9
        },
        {
          no: 2,
          name: "package_name",
          kind: "scalar",
          T: 9
        },
        {
          no: 3,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 4,
          name: "vetting_valid_at",
          kind: "message",
          T: () => import_timestamp.Timestamp
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.parties = [];
    message.packageName = "";
    message.synchronizerId = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string parties */
        1:
          message.parties.push(reader.string());
          break;
        case /* string package_name */
        2:
          message.packageName = reader.string();
          break;
        case /* string synchronizer_id */
        3:
          message.synchronizerId = reader.string();
          break;
        case /* google.protobuf.Timestamp vetting_valid_at */
        4:
          message.vettingValidAt = import_timestamp.Timestamp.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.vettingValidAt
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.parties.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.parties[i]);
    if (message.packageName !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.packageName);
    if (message.synchronizerId !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    if (message.vettingValidAt)
      import_timestamp.Timestamp.internalBinaryWrite(
        message.vettingValidAt,
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const GetPreferredPackageVersionRequest = new GetPreferredPackageVersionRequest$Type();
class GetPreferredPackageVersionResponse$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.GetPreferredPackageVersionResponse",
      [
        {
          no: 1,
          name: "package_preference",
          kind: "message",
          T: () => PackagePreference
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.interactive.PackagePreference package_preference */
        1:
          message.packagePreference = PackagePreference.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.packagePreference
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.packagePreference)
      PackagePreference.internalBinaryWrite(
        message.packagePreference,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const GetPreferredPackageVersionResponse = new GetPreferredPackageVersionResponse$Type();
class PackagePreference$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PackagePreference", [
      {
        no: 1,
        name: "package_reference",
        kind: "message",
        T: () => import_package_reference.PackageReference
      },
      {
        no: 2,
        name: "synchronizer_id",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.PackageReference package_reference */
        1:
          message.packageReference = import_package_reference.PackageReference.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.packageReference
          );
          break;
        case /* string synchronizer_id */
        2:
          message.synchronizerId = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.packageReference)
      import_package_reference.PackageReference.internalBinaryWrite(
        message.packageReference,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.synchronizerId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PackagePreference = new PackagePreference$Type();
class PackageVettingRequirement$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.PackageVettingRequirement", [
      {
        no: 1,
        name: "parties",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "package_name",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.parties = [];
    message.packageName = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated string parties */
        1:
          message.parties.push(reader.string());
          break;
        case /* string package_name */
        2:
          message.packageName = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.parties.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.parties[i]);
    if (message.packageName !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.packageName);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PackageVettingRequirement = new PackageVettingRequirement$Type();
class GetPreferredPackagesRequest$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.GetPreferredPackagesRequest",
      [
        {
          no: 1,
          name: "package_vetting_requirements",
          kind: "message",
          repeat: 2,
          T: () => PackageVettingRequirement
        },
        {
          no: 2,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 3,
          name: "vetting_valid_at",
          kind: "message",
          T: () => import_timestamp.Timestamp
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.packageVettingRequirements = [];
    message.synchronizerId = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated com.daml.ledger.api.v2.interactive.PackageVettingRequirement package_vetting_requirements */
        1:
          message.packageVettingRequirements.push(
            PackageVettingRequirement.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* string synchronizer_id */
        2:
          message.synchronizerId = reader.string();
          break;
        case /* google.protobuf.Timestamp vetting_valid_at */
        3:
          message.vettingValidAt = import_timestamp.Timestamp.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.vettingValidAt
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.packageVettingRequirements.length; i++)
      PackageVettingRequirement.internalBinaryWrite(
        message.packageVettingRequirements[i],
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.synchronizerId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    if (message.vettingValidAt)
      import_timestamp.Timestamp.internalBinaryWrite(
        message.vettingValidAt,
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const GetPreferredPackagesRequest = new GetPreferredPackagesRequest$Type();
class GetPreferredPackagesResponse$Type extends import_runtime4.MessageType {
  constructor() {
    super(
      "com.daml.ledger.api.v2.interactive.GetPreferredPackagesResponse",
      [
        {
          no: 1,
          name: "package_references",
          kind: "message",
          repeat: 2,
          T: () => import_package_reference.PackageReference
        },
        {
          no: 2,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.packageReferences = [];
    message.synchronizerId = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(
        this,
        message,
        value
      );
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* repeated com.daml.ledger.api.v2.PackageReference package_references */
        1:
          message.packageReferences.push(
            import_package_reference.PackageReference.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* string synchronizer_id */
        2:
          message.synchronizerId = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.packageReferences.length; i++)
      import_package_reference.PackageReference.internalBinaryWrite(
        message.packageReferences[i],
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.synchronizerId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.synchronizerId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const GetPreferredPackagesResponse = new GetPreferredPackagesResponse$Type();
const InteractiveSubmissionService = new import_runtime_rpc.ServiceType(
  "com.daml.ledger.api.v2.interactive.InteractiveSubmissionService",
  [
    {
      name: "PrepareSubmission",
      options: {},
      I: PrepareSubmissionRequest,
      O: PrepareSubmissionResponse
    },
    {
      name: "ExecuteSubmission",
      options: {},
      I: ExecuteSubmissionRequest,
      O: ExecuteSubmissionResponse
    },
    {
      name: "GetPreferredPackageVersion",
      options: {},
      I: GetPreferredPackageVersionRequest,
      O: GetPreferredPackageVersionResponse
    },
    {
      name: "GetPreferredPackages",
      options: {},
      I: GetPreferredPackagesRequest,
      O: GetPreferredPackagesResponse
    }
  ]
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  DamlTransaction,
  DamlTransaction_Node,
  DamlTransaction_NodeSeed,
  ExecuteSubmissionRequest,
  ExecuteSubmissionResponse,
  GetPreferredPackageVersionRequest,
  GetPreferredPackageVersionResponse,
  GetPreferredPackagesRequest,
  GetPreferredPackagesResponse,
  HashingSchemeVersion,
  InteractiveSubmissionService,
  Metadata,
  Metadata_GlobalKeyMappingEntry,
  Metadata_InputContract,
  Metadata_SubmitterInfo,
  MinLedgerTime,
  PackagePreference,
  PackageVettingRequirement,
  PartySignatures,
  PrepareSubmissionRequest,
  PrepareSubmissionResponse,
  PreparedTransaction,
  Signature,
  SignatureFormat,
  SigningAlgorithmSpec,
  SinglePartySignatures
});
//# sourceMappingURL=interactive_submission_service.cjs.map