import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { Signature } from "../../crypto/v30/crypto.js";
import { DynamicSequencingParameters } from "./sequencing_parameters.js";
import { DynamicSynchronizerParameters } from "./synchronizer_parameters.js";
import { Timestamp } from "../../../../../google/protobuf/timestamp.js";
import { ParticipantSynchronizerLimits } from "./synchronizer_parameters.js";
import { PublicKey } from "../../crypto/v30/crypto.js";
import { SigningPublicKey } from "../../crypto/v30/crypto.js";
var Enums_TopologyChangeOp = /* @__PURE__ */ ((Enums_TopologyChangeOp2) => {
  Enums_TopologyChangeOp2[Enums_TopologyChangeOp2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  Enums_TopologyChangeOp2[Enums_TopologyChangeOp2["ADD_REPLACE"] = 1] = "ADD_REPLACE";
  Enums_TopologyChangeOp2[Enums_TopologyChangeOp2["REMOVE"] = 2] = "REMOVE";
  return Enums_TopologyChangeOp2;
})(Enums_TopologyChangeOp || {});
var Enums_ParticipantPermission = /* @__PURE__ */ ((Enums_ParticipantPermission2) => {
  Enums_ParticipantPermission2[Enums_ParticipantPermission2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  Enums_ParticipantPermission2[Enums_ParticipantPermission2["SUBMISSION"] = 1] = "SUBMISSION";
  Enums_ParticipantPermission2[Enums_ParticipantPermission2["CONFIRMATION"] = 2] = "CONFIRMATION";
  Enums_ParticipantPermission2[Enums_ParticipantPermission2["OBSERVATION"] = 3] = "OBSERVATION";
  return Enums_ParticipantPermission2;
})(Enums_ParticipantPermission || {});
var Enums_TopologyMappingCode = /* @__PURE__ */ ((Enums_TopologyMappingCode2) => {
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["NAMESPACE_DELEGATION"] = 1] = "NAMESPACE_DELEGATION";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["DECENTRALIZED_NAMESPACE_DEFINITION"] = 3] = "DECENTRALIZED_NAMESPACE_DEFINITION";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["OWNER_TO_KEY_MAPPING"] = 4] = "OWNER_TO_KEY_MAPPING";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["SYNCHRONIZER_TRUST_CERTIFICATE"] = 5] = "SYNCHRONIZER_TRUST_CERTIFICATE";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["PARTICIPANT_PERMISSION"] = 6] = "PARTICIPANT_PERMISSION";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["PARTY_HOSTING_LIMITS"] = 7] = "PARTY_HOSTING_LIMITS";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["VETTED_PACKAGES"] = 8] = "VETTED_PACKAGES";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["PARTY_TO_PARTICIPANT"] = 9] = "PARTY_TO_PARTICIPANT";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["SYNCHRONIZER_PARAMETERS_STATE"] = 11] = "SYNCHRONIZER_PARAMETERS_STATE";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["MEDIATOR_SYNCHRONIZER_STATE"] = 12] = "MEDIATOR_SYNCHRONIZER_STATE";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["SEQUENCER_SYNCHRONIZER_STATE"] = 13] = "SEQUENCER_SYNCHRONIZER_STATE";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["PURGE_TOPOLOGY_TXS"] = 15] = "PURGE_TOPOLOGY_TXS";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["SEQUENCING_DYNAMIC_PARAMETERS_STATE"] = 17] = "SEQUENCING_DYNAMIC_PARAMETERS_STATE";
  Enums_TopologyMappingCode2[Enums_TopologyMappingCode2["PARTY_TO_KEY_MAPPING"] = 18] = "PARTY_TO_KEY_MAPPING";
  return Enums_TopologyMappingCode2;
})(Enums_TopologyMappingCode || {});
class Enums$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.Enums", []);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Enums = new Enums$Type();
class NamespaceDelegation$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.NamespaceDelegation", [
      {
        no: 1,
        name: "namespace",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "target_key",
        kind: "message",
        T: () => SigningPublicKey
      },
      {
        no: 3,
        name: "is_root_delegation",
        kind: "scalar",
        T: 8
      },
      {
        no: 4,
        name: "can_sign_all_mappings",
        kind: "message",
        oneof: "restriction",
        T: () => NamespaceDelegation_CanSignAllMappings
      },
      {
        no: 5,
        name: "can_sign_all_but_namespace_delegations",
        kind: "message",
        oneof: "restriction",
        T: () => NamespaceDelegation_CanSignAllButNamespaceDelegations
      },
      {
        no: 6,
        name: "can_sign_specific_mapings",
        kind: "message",
        oneof: "restriction",
        T: () => NamespaceDelegation_CanSignSpecificMappings
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.namespace = "";
    message.isRootDelegation = false;
    message.restriction = { oneofKind: void 0 };
    if (value !== void 0)
      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 namespace */
        1:
          message.namespace = reader.string();
          break;
        case /* com.digitalasset.canton.crypto.v30.SigningPublicKey target_key */
        2:
          message.targetKey = SigningPublicKey.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.targetKey
          );
          break;
        case /* bool is_root_delegation = 3 [deprecated = true] */
        3:
          message.isRootDelegation = reader.bool();
          break;
        case /* com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignAllMappings can_sign_all_mappings */
        4:
          message.restriction = {
            oneofKind: "canSignAllMappings",
            canSignAllMappings: NamespaceDelegation_CanSignAllMappings.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.restriction.canSignAllMappings
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignAllButNamespaceDelegations can_sign_all_but_namespace_delegations */
        5:
          message.restriction = {
            oneofKind: "canSignAllButNamespaceDelegations",
            canSignAllButNamespaceDelegations: NamespaceDelegation_CanSignAllButNamespaceDelegations.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.restriction.canSignAllButNamespaceDelegations
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignSpecificMappings can_sign_specific_mapings */
        6:
          message.restriction = {
            oneofKind: "canSignSpecificMapings",
            canSignSpecificMapings: NamespaceDelegation_CanSignSpecificMappings.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.restriction.canSignSpecificMapings
            )
          };
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.namespace !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.namespace);
    if (message.targetKey)
      SigningPublicKey.internalBinaryWrite(
        message.targetKey,
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.isRootDelegation !== false)
      writer.tag(3, WireType.Varint).bool(message.isRootDelegation);
    if (message.restriction.oneofKind === "canSignAllMappings")
      NamespaceDelegation_CanSignAllMappings.internalBinaryWrite(
        message.restriction.canSignAllMappings,
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.restriction.oneofKind === "canSignAllButNamespaceDelegations")
      NamespaceDelegation_CanSignAllButNamespaceDelegations.internalBinaryWrite(
        message.restriction.canSignAllButNamespaceDelegations,
        writer.tag(5, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.restriction.oneofKind === "canSignSpecificMapings")
      NamespaceDelegation_CanSignSpecificMappings.internalBinaryWrite(
        message.restriction.canSignSpecificMapings,
        writer.tag(6, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const NamespaceDelegation = new NamespaceDelegation$Type();
class NamespaceDelegation_CanSignAllMappings$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignAllMappings",
      []
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const NamespaceDelegation_CanSignAllMappings = new NamespaceDelegation_CanSignAllMappings$Type();
class NamespaceDelegation_CanSignAllButNamespaceDelegations$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignAllButNamespaceDelegations",
      []
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    if (value !== void 0)
      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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const NamespaceDelegation_CanSignAllButNamespaceDelegations = new NamespaceDelegation_CanSignAllButNamespaceDelegations$Type();
class NamespaceDelegation_CanSignSpecificMappings$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.NamespaceDelegation.CanSignSpecificMappings",
      [
        {
          no: 1,
          name: "mappings",
          kind: "enum",
          repeat: 1,
          T: () => [
            "com.digitalasset.canton.protocol.v30.Enums.TopologyMappingCode",
            Enums_TopologyMappingCode,
            "TOPOLOGY_MAPPING_CODE_"
          ]
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.mappings = [];
    if (value !== void 0)
      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.digitalasset.canton.protocol.v30.Enums.TopologyMappingCode mappings */
        1:
          if (wireType === WireType.LengthDelimited)
            for (let e = reader.int32() + reader.pos; reader.pos < e; )
              message.mappings.push(reader.int32());
          else message.mappings.push(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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.mappings.length) {
      writer.tag(1, WireType.LengthDelimited).fork();
      for (let i = 0; i < message.mappings.length; i++)
        writer.int32(message.mappings[i]);
      writer.join();
    }
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const NamespaceDelegation_CanSignSpecificMappings = new NamespaceDelegation_CanSignSpecificMappings$Type();
class DecentralizedNamespaceDefinition$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.DecentralizedNamespaceDefinition",
      [
        {
          no: 1,
          name: "decentralized_namespace",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "threshold",
          kind: "scalar",
          T: 5
        },
        {
          no: 3,
          name: "owners",
          kind: "scalar",
          repeat: 2,
          T: 9
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.decentralizedNamespace = "";
    message.threshold = 0;
    message.owners = [];
    if (value !== void 0)
      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 decentralized_namespace */
        1:
          message.decentralizedNamespace = reader.string();
          break;
        case /* int32 threshold */
        2:
          message.threshold = reader.int32();
          break;
        case /* repeated string owners */
        3:
          message.owners.push(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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.decentralizedNamespace !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.decentralizedNamespace);
    if (message.threshold !== 0)
      writer.tag(2, WireType.Varint).int32(message.threshold);
    for (let i = 0; i < message.owners.length; i++)
      writer.tag(3, WireType.LengthDelimited).string(message.owners[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DecentralizedNamespaceDefinition = new DecentralizedNamespaceDefinition$Type();
class OwnerToKeyMapping$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.OwnerToKeyMapping", [
      {
        no: 1,
        name: "member",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "public_keys",
        kind: "message",
        repeat: 2,
        T: () => PublicKey
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.member = "";
    message.publicKeys = [];
    if (value !== void 0)
      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 member */
        1:
          message.member = reader.string();
          break;
        case /* repeated com.digitalasset.canton.crypto.v30.PublicKey public_keys */
        2:
          message.publicKeys.push(
            PublicKey.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.member !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.member);
    for (let i = 0; i < message.publicKeys.length; i++)
      PublicKey.internalBinaryWrite(
        message.publicKeys[i],
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const OwnerToKeyMapping = new OwnerToKeyMapping$Type();
class PartyToKeyMapping$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.PartyToKeyMapping", [
      {
        no: 1,
        name: "party",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "threshold",
        kind: "scalar",
        T: 13
      },
      {
        no: 4,
        name: "signing_keys",
        kind: "message",
        repeat: 2,
        T: () => SigningPublicKey
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.party = "";
    message.threshold = 0;
    message.signingKeys = [];
    if (value !== void 0)
      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 /* uint32 threshold */
        3:
          message.threshold = reader.uint32();
          break;
        case /* repeated com.digitalasset.canton.crypto.v30.SigningPublicKey signing_keys */
        4:
          message.signingKeys.push(
            SigningPublicKey.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.party !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.party);
    if (message.threshold !== 0)
      writer.tag(3, WireType.Varint).uint32(message.threshold);
    for (let i = 0; i < message.signingKeys.length; i++)
      SigningPublicKey.internalBinaryWrite(
        message.signingKeys[i],
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PartyToKeyMapping = new PartyToKeyMapping$Type();
class SynchronizerTrustCertificate$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.SynchronizerTrustCertificate",
      [
        {
          no: 1,
          name: "participant_uid",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.participantUid = "";
    message.synchronizerId = "";
    if (value !== void 0)
      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 participant_uid */
        1:
          message.participantUid = reader.string();
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.participantUid !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.participantUid);
    if (message.synchronizerId !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.synchronizerId);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SynchronizerTrustCertificate = new SynchronizerTrustCertificate$Type();
class ParticipantSynchronizerPermission$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.ParticipantSynchronizerPermission",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "participant_uid",
          kind: "scalar",
          T: 9
        },
        {
          no: 3,
          name: "permission",
          kind: "enum",
          T: () => [
            "com.digitalasset.canton.protocol.v30.Enums.ParticipantPermission",
            Enums_ParticipantPermission,
            "PARTICIPANT_PERMISSION_"
          ]
        },
        {
          no: 4,
          name: "limits",
          kind: "message",
          T: () => ParticipantSynchronizerLimits
        },
        {
          no: 5,
          name: "login_after",
          kind: "scalar",
          opt: true,
          T: 3,
          L: 0
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.participantUid = "";
    message.permission = 0;
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* string participant_uid */
        2:
          message.participantUid = reader.string();
          break;
        case /* com.digitalasset.canton.protocol.v30.Enums.ParticipantPermission permission */
        3:
          message.permission = reader.int32();
          break;
        case /* com.digitalasset.canton.protocol.v30.ParticipantSynchronizerLimits limits */
        4:
          message.limits = ParticipantSynchronizerLimits.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.limits
          );
          break;
        case /* optional int64 login_after */
        5:
          message.loginAfter = reader.int64().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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.participantUid !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.participantUid);
    if (message.permission !== 0)
      writer.tag(3, WireType.Varint).int32(message.permission);
    if (message.limits)
      ParticipantSynchronizerLimits.internalBinaryWrite(
        message.limits,
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.loginAfter !== void 0)
      writer.tag(5, WireType.Varint).int64(message.loginAfter);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ParticipantSynchronizerPermission = new ParticipantSynchronizerPermission$Type();
class PartyHostingLimits$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.PartyHostingLimits", [
      {
        no: 1,
        name: "synchronizer_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "party",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.party = "";
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* string party */
        2:
          message.party = 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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.party !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.party);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PartyHostingLimits = new PartyHostingLimits$Type();
class VettedPackages$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.VettedPackages", [
      {
        no: 1,
        name: "participant_uid",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "package_ids",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 4,
        name: "packages",
        kind: "message",
        repeat: 2,
        T: () => VettedPackages_VettedPackage
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.participantUid = "";
    message.packageIds = [];
    message.packages = [];
    if (value !== void 0)
      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 participant_uid */
        1:
          message.participantUid = reader.string();
          break;
        case /* repeated string package_ids = 2 [deprecated = true] */
        2:
          message.packageIds.push(reader.string());
          break;
        case /* repeated com.digitalasset.canton.protocol.v30.VettedPackages.VettedPackage packages */
        4:
          message.packages.push(
            VettedPackages_VettedPackage.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.participantUid !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.participantUid);
    for (let i = 0; i < message.packageIds.length; i++)
      writer.tag(2, WireType.LengthDelimited).string(message.packageIds[i]);
    for (let i = 0; i < message.packages.length; i++)
      VettedPackages_VettedPackage.internalBinaryWrite(
        message.packages[i],
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const VettedPackages = new VettedPackages$Type();
class VettedPackages_VettedPackage$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.VettedPackages.VettedPackage",
      [
        {
          no: 1,
          name: "package_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "valid_from",
          kind: "message",
          T: () => Timestamp
        },
        {
          no: 3,
          name: "valid_until",
          kind: "message",
          T: () => Timestamp
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.packageId = "";
    if (value !== void 0)
      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 package_id */
        1:
          message.packageId = reader.string();
          break;
        case /* google.protobuf.Timestamp valid_from */
        2:
          message.validFrom = Timestamp.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.validFrom
          );
          break;
        case /* google.protobuf.Timestamp valid_until */
        3:
          message.validUntil = Timestamp.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.validUntil
          );
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.packageId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.packageId);
    if (message.validFrom)
      Timestamp.internalBinaryWrite(
        message.validFrom,
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.validUntil)
      Timestamp.internalBinaryWrite(
        message.validUntil,
        writer.tag(3, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const VettedPackages_VettedPackage = new VettedPackages_VettedPackage$Type();
class PartyToParticipant$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.PartyToParticipant", [
      {
        no: 1,
        name: "party",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "threshold",
        kind: "scalar",
        T: 13
      },
      {
        no: 3,
        name: "participants",
        kind: "message",
        repeat: 2,
        T: () => PartyToParticipant_HostingParticipant
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.party = "";
    message.threshold = 0;
    message.participants = [];
    if (value !== void 0)
      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 /* uint32 threshold */
        2:
          message.threshold = reader.uint32();
          break;
        case /* repeated com.digitalasset.canton.protocol.v30.PartyToParticipant.HostingParticipant participants */
        3:
          message.participants.push(
            PartyToParticipant_HostingParticipant.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.party !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.party);
    if (message.threshold !== 0)
      writer.tag(2, WireType.Varint).uint32(message.threshold);
    for (let i = 0; i < message.participants.length; i++)
      PartyToParticipant_HostingParticipant.internalBinaryWrite(
        message.participants[i],
        writer.tag(3, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PartyToParticipant = new PartyToParticipant$Type();
class PartyToParticipant_HostingParticipant$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.PartyToParticipant.HostingParticipant",
      [
        {
          no: 1,
          name: "participant_uid",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "permission",
          kind: "enum",
          T: () => [
            "com.digitalasset.canton.protocol.v30.Enums.ParticipantPermission",
            Enums_ParticipantPermission,
            "PARTICIPANT_PERMISSION_"
          ]
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.participantUid = "";
    message.permission = 0;
    if (value !== void 0)
      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 participant_uid */
        1:
          message.participantUid = reader.string();
          break;
        case /* com.digitalasset.canton.protocol.v30.Enums.ParticipantPermission permission */
        2:
          message.permission = 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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.participantUid !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.participantUid);
    if (message.permission !== 0)
      writer.tag(2, WireType.Varint).int32(message.permission);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PartyToParticipant_HostingParticipant = new PartyToParticipant_HostingParticipant$Type();
class SynchronizerParametersState$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.SynchronizerParametersState",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "synchronizer_parameters",
          kind: "message",
          T: () => DynamicSynchronizerParameters
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* com.digitalasset.canton.protocol.v30.DynamicSynchronizerParameters synchronizer_parameters */
        2:
          message.synchronizerParameters = DynamicSynchronizerParameters.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.synchronizerParameters
          );
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.synchronizerParameters)
      DynamicSynchronizerParameters.internalBinaryWrite(
        message.synchronizerParameters,
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SynchronizerParametersState = new SynchronizerParametersState$Type();
class DynamicSequencingParametersState$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.DynamicSequencingParametersState",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "sequencing_parameters",
          kind: "message",
          T: () => DynamicSequencingParameters
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* com.digitalasset.canton.protocol.v30.DynamicSequencingParameters sequencing_parameters */
        2:
          message.sequencingParameters = DynamicSequencingParameters.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.sequencingParameters
          );
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.sequencingParameters)
      DynamicSequencingParameters.internalBinaryWrite(
        message.sequencingParameters,
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DynamicSequencingParametersState = new DynamicSequencingParametersState$Type();
class MediatorSynchronizerState$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.MediatorSynchronizerState",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "group",
          kind: "scalar",
          T: 13
        },
        {
          no: 3,
          name: "threshold",
          kind: "scalar",
          T: 13
        },
        {
          no: 4,
          name: "active",
          kind: "scalar",
          repeat: 2,
          T: 9
        },
        {
          no: 5,
          name: "observers",
          kind: "scalar",
          repeat: 2,
          T: 9
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.group = 0;
    message.threshold = 0;
    message.active = [];
    message.observers = [];
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* uint32 group */
        2:
          message.group = reader.uint32();
          break;
        case /* uint32 threshold */
        3:
          message.threshold = reader.uint32();
          break;
        case /* repeated string active */
        4:
          message.active.push(reader.string());
          break;
        case /* repeated string observers */
        5:
          message.observers.push(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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.group !== 0)
      writer.tag(2, WireType.Varint).uint32(message.group);
    if (message.threshold !== 0)
      writer.tag(3, WireType.Varint).uint32(message.threshold);
    for (let i = 0; i < message.active.length; i++)
      writer.tag(4, WireType.LengthDelimited).string(message.active[i]);
    for (let i = 0; i < message.observers.length; i++)
      writer.tag(5, WireType.LengthDelimited).string(message.observers[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const MediatorSynchronizerState = new MediatorSynchronizerState$Type();
class SequencerSynchronizerState$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.SequencerSynchronizerState",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "threshold",
          kind: "scalar",
          T: 13
        },
        {
          no: 3,
          name: "active",
          kind: "scalar",
          repeat: 2,
          T: 9
        },
        {
          no: 4,
          name: "observers",
          kind: "scalar",
          repeat: 2,
          T: 9
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.threshold = 0;
    message.active = [];
    message.observers = [];
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* uint32 threshold */
        2:
          message.threshold = reader.uint32();
          break;
        case /* repeated string active */
        3:
          message.active.push(reader.string());
          break;
        case /* repeated string observers */
        4:
          message.observers.push(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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.threshold !== 0)
      writer.tag(2, WireType.Varint).uint32(message.threshold);
    for (let i = 0; i < message.active.length; i++)
      writer.tag(3, WireType.LengthDelimited).string(message.active[i]);
    for (let i = 0; i < message.observers.length; i++)
      writer.tag(4, WireType.LengthDelimited).string(message.observers[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SequencerSynchronizerState = new SequencerSynchronizerState$Type();
class PurgeTopologyTransaction$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.PurgeTopologyTransaction", [
      {
        no: 1,
        name: "synchronizer_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "mappings",
        kind: "message",
        repeat: 2,
        T: () => TopologyMapping
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    message.mappings = [];
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* repeated com.digitalasset.canton.protocol.v30.TopologyMapping mappings */
        2:
          message.mappings.push(
            TopologyMapping.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    for (let i = 0; i < message.mappings.length; i++)
      TopologyMapping.internalBinaryWrite(
        message.mappings[i],
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PurgeTopologyTransaction = new PurgeTopologyTransaction$Type();
class TopologyMapping$Type extends MessageType {
  constructor() {
    super("com.digitalasset.canton.protocol.v30.TopologyMapping", [
      {
        no: 1,
        name: "namespace_delegation",
        kind: "message",
        oneof: "mapping",
        T: () => NamespaceDelegation
      },
      {
        no: 3,
        name: "decentralized_namespace_definition",
        kind: "message",
        oneof: "mapping",
        T: () => DecentralizedNamespaceDefinition
      },
      {
        no: 4,
        name: "owner_to_key_mapping",
        kind: "message",
        oneof: "mapping",
        T: () => OwnerToKeyMapping
      },
      {
        no: 5,
        name: "synchronizer_trust_certificate",
        kind: "message",
        oneof: "mapping",
        T: () => SynchronizerTrustCertificate
      },
      {
        no: 6,
        name: "participant_permission",
        kind: "message",
        oneof: "mapping",
        T: () => ParticipantSynchronizerPermission
      },
      {
        no: 7,
        name: "party_hosting_limits",
        kind: "message",
        oneof: "mapping",
        T: () => PartyHostingLimits
      },
      {
        no: 8,
        name: "vetted_packages",
        kind: "message",
        oneof: "mapping",
        T: () => VettedPackages
      },
      {
        no: 9,
        name: "party_to_participant",
        kind: "message",
        oneof: "mapping",
        T: () => PartyToParticipant
      },
      {
        no: 11,
        name: "synchronizer_parameters_state",
        kind: "message",
        oneof: "mapping",
        T: () => SynchronizerParametersState
      },
      {
        no: 12,
        name: "mediator_synchronizer_state",
        kind: "message",
        oneof: "mapping",
        T: () => MediatorSynchronizerState
      },
      {
        no: 13,
        name: "sequencer_synchronizer_state",
        kind: "message",
        oneof: "mapping",
        T: () => SequencerSynchronizerState
      },
      {
        no: 14,
        name: "purge_topology_txs",
        kind: "message",
        oneof: "mapping",
        T: () => PurgeTopologyTransaction
      },
      {
        no: 15,
        name: "sequencing_dynamic_parameters_state",
        kind: "message",
        oneof: "mapping",
        T: () => DynamicSequencingParametersState
      },
      {
        no: 16,
        name: "party_to_key_mapping",
        kind: "message",
        oneof: "mapping",
        T: () => PartyToKeyMapping
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.mapping = { oneofKind: void 0 };
    if (value !== void 0)
      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.digitalasset.canton.protocol.v30.NamespaceDelegation namespace_delegation */
        1:
          message.mapping = {
            oneofKind: "namespaceDelegation",
            namespaceDelegation: NamespaceDelegation.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.namespaceDelegation
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.DecentralizedNamespaceDefinition decentralized_namespace_definition */
        3:
          message.mapping = {
            oneofKind: "decentralizedNamespaceDefinition",
            decentralizedNamespaceDefinition: DecentralizedNamespaceDefinition.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.decentralizedNamespaceDefinition
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.OwnerToKeyMapping owner_to_key_mapping */
        4:
          message.mapping = {
            oneofKind: "ownerToKeyMapping",
            ownerToKeyMapping: OwnerToKeyMapping.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.ownerToKeyMapping
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.SynchronizerTrustCertificate synchronizer_trust_certificate */
        5:
          message.mapping = {
            oneofKind: "synchronizerTrustCertificate",
            synchronizerTrustCertificate: SynchronizerTrustCertificate.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.synchronizerTrustCertificate
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.ParticipantSynchronizerPermission participant_permission */
        6:
          message.mapping = {
            oneofKind: "participantPermission",
            participantPermission: ParticipantSynchronizerPermission.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.participantPermission
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.PartyHostingLimits party_hosting_limits */
        7:
          message.mapping = {
            oneofKind: "partyHostingLimits",
            partyHostingLimits: PartyHostingLimits.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.partyHostingLimits
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.VettedPackages vetted_packages */
        8:
          message.mapping = {
            oneofKind: "vettedPackages",
            vettedPackages: VettedPackages.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.vettedPackages
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.PartyToParticipant party_to_participant */
        9:
          message.mapping = {
            oneofKind: "partyToParticipant",
            partyToParticipant: PartyToParticipant.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.partyToParticipant
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.SynchronizerParametersState synchronizer_parameters_state */
        11:
          message.mapping = {
            oneofKind: "synchronizerParametersState",
            synchronizerParametersState: SynchronizerParametersState.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.synchronizerParametersState
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.MediatorSynchronizerState mediator_synchronizer_state */
        12:
          message.mapping = {
            oneofKind: "mediatorSynchronizerState",
            mediatorSynchronizerState: MediatorSynchronizerState.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.mediatorSynchronizerState
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.SequencerSynchronizerState sequencer_synchronizer_state */
        13:
          message.mapping = {
            oneofKind: "sequencerSynchronizerState",
            sequencerSynchronizerState: SequencerSynchronizerState.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.sequencerSynchronizerState
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.PurgeTopologyTransaction purge_topology_txs */
        14:
          message.mapping = {
            oneofKind: "purgeTopologyTxs",
            purgeTopologyTxs: PurgeTopologyTransaction.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.purgeTopologyTxs
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.DynamicSequencingParametersState sequencing_dynamic_parameters_state */
        15:
          message.mapping = {
            oneofKind: "sequencingDynamicParametersState",
            sequencingDynamicParametersState: DynamicSequencingParametersState.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.sequencingDynamicParametersState
            )
          };
          break;
        case /* com.digitalasset.canton.protocol.v30.PartyToKeyMapping party_to_key_mapping */
        16:
          message.mapping = {
            oneofKind: "partyToKeyMapping",
            partyToKeyMapping: PartyToKeyMapping.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.mapping.partyToKeyMapping
            )
          };
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.mapping.oneofKind === "namespaceDelegation")
      NamespaceDelegation.internalBinaryWrite(
        message.mapping.namespaceDelegation,
        writer.tag(1, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "decentralizedNamespaceDefinition")
      DecentralizedNamespaceDefinition.internalBinaryWrite(
        message.mapping.decentralizedNamespaceDefinition,
        writer.tag(3, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "ownerToKeyMapping")
      OwnerToKeyMapping.internalBinaryWrite(
        message.mapping.ownerToKeyMapping,
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "synchronizerTrustCertificate")
      SynchronizerTrustCertificate.internalBinaryWrite(
        message.mapping.synchronizerTrustCertificate,
        writer.tag(5, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "participantPermission")
      ParticipantSynchronizerPermission.internalBinaryWrite(
        message.mapping.participantPermission,
        writer.tag(6, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "partyHostingLimits")
      PartyHostingLimits.internalBinaryWrite(
        message.mapping.partyHostingLimits,
        writer.tag(7, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "vettedPackages")
      VettedPackages.internalBinaryWrite(
        message.mapping.vettedPackages,
        writer.tag(8, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "partyToParticipant")
      PartyToParticipant.internalBinaryWrite(
        message.mapping.partyToParticipant,
        writer.tag(9, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "synchronizerParametersState")
      SynchronizerParametersState.internalBinaryWrite(
        message.mapping.synchronizerParametersState,
        writer.tag(11, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "mediatorSynchronizerState")
      MediatorSynchronizerState.internalBinaryWrite(
        message.mapping.mediatorSynchronizerState,
        writer.tag(12, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "sequencerSynchronizerState")
      SequencerSynchronizerState.internalBinaryWrite(
        message.mapping.sequencerSynchronizerState,
        writer.tag(13, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "purgeTopologyTxs")
      PurgeTopologyTransaction.internalBinaryWrite(
        message.mapping.purgeTopologyTxs,
        writer.tag(14, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "sequencingDynamicParametersState")
      DynamicSequencingParametersState.internalBinaryWrite(
        message.mapping.sequencingDynamicParametersState,
        writer.tag(15, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.mapping.oneofKind === "partyToKeyMapping")
      PartyToKeyMapping.internalBinaryWrite(
        message.mapping.partyToKeyMapping,
        writer.tag(16, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const TopologyMapping = new TopologyMapping$Type();
class TopologyTransaction$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.TopologyTransaction",
      [
        {
          no: 1,
          name: "operation",
          kind: "enum",
          T: () => [
            "com.digitalasset.canton.protocol.v30.Enums.TopologyChangeOp",
            Enums_TopologyChangeOp,
            "TOPOLOGY_CHANGE_OP_"
          ]
        },
        {
          no: 2,
          name: "serial",
          kind: "scalar",
          T: 13
        },
        {
          no: 3,
          name: "mapping",
          kind: "message",
          T: () => TopologyMapping
        }
      ],
      {
        "scalapb.message": {
          companionExtends: [
            "com.digitalasset.canton.version.StableProtoVersion"
          ]
        }
      }
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.operation = 0;
    message.serial = 0;
    if (value !== void 0)
      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.digitalasset.canton.protocol.v30.Enums.TopologyChangeOp operation */
        1:
          message.operation = reader.int32();
          break;
        case /* uint32 serial */
        2:
          message.serial = reader.uint32();
          break;
        case /* com.digitalasset.canton.protocol.v30.TopologyMapping mapping */
        3:
          message.mapping = TopologyMapping.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.mapping
          );
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.operation !== 0)
      writer.tag(1, WireType.Varint).int32(message.operation);
    if (message.serial !== 0)
      writer.tag(2, WireType.Varint).uint32(message.serial);
    if (message.mapping)
      TopologyMapping.internalBinaryWrite(
        message.mapping,
        writer.tag(3, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const TopologyTransaction = new TopologyTransaction$Type();
class MultiTransactionSignatures$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.MultiTransactionSignatures",
      [
        {
          no: 1,
          name: "transaction_hashes",
          kind: "scalar",
          repeat: 2,
          T: 12
        },
        {
          no: 2,
          name: "signatures",
          kind: "message",
          repeat: 2,
          T: () => Signature
        }
      ]
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.transactionHashes = [];
    message.signatures = [];
    if (value !== void 0)
      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 bytes transaction_hashes */
        1:
          message.transactionHashes.push(reader.bytes());
          break;
        case /* repeated com.digitalasset.canton.crypto.v30.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.transactionHashes.length; i++)
      writer.tag(1, WireType.LengthDelimited).bytes(message.transactionHashes[i]);
    for (let i = 0; i < message.signatures.length; i++)
      Signature.internalBinaryWrite(
        message.signatures[i],
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const MultiTransactionSignatures = new MultiTransactionSignatures$Type();
class SignedTopologyTransaction$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.SignedTopologyTransaction",
      [
        {
          no: 1,
          name: "transaction",
          kind: "scalar",
          T: 12
        },
        {
          no: 2,
          name: "signatures",
          kind: "message",
          repeat: 2,
          T: () => Signature
        },
        {
          no: 3,
          name: "proposal",
          kind: "scalar",
          T: 8
        },
        {
          no: 4,
          name: "multi_transaction_signatures",
          kind: "message",
          repeat: 2,
          T: () => MultiTransactionSignatures
        }
      ],
      {
        "scalapb.message": {
          companionExtends: [
            "com.digitalasset.canton.version.StableProtoVersion"
          ]
        }
      }
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.transaction = new Uint8Array(0);
    message.signatures = [];
    message.proposal = false;
    message.multiTransactionSignatures = [];
    if (value !== void 0)
      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 /* bytes transaction */
        1:
          message.transaction = reader.bytes();
          break;
        case /* repeated com.digitalasset.canton.crypto.v30.Signature signatures */
        2:
          message.signatures.push(
            Signature.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        case /* bool proposal */
        3:
          message.proposal = reader.bool();
          break;
        case /* repeated com.digitalasset.canton.protocol.v30.MultiTransactionSignatures multi_transaction_signatures */
        4:
          message.multiTransactionSignatures.push(
            MultiTransactionSignatures.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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.transaction.length)
      writer.tag(1, WireType.LengthDelimited).bytes(message.transaction);
    for (let i = 0; i < message.signatures.length; i++)
      Signature.internalBinaryWrite(
        message.signatures[i],
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.proposal !== false)
      writer.tag(3, WireType.Varint).bool(message.proposal);
    for (let i = 0; i < message.multiTransactionSignatures.length; i++)
      MultiTransactionSignatures.internalBinaryWrite(
        message.multiTransactionSignatures[i],
        writer.tag(4, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SignedTopologyTransaction = new SignedTopologyTransaction$Type();
class SignedTopologyTransactions$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.SignedTopologyTransactions",
      [
        {
          no: 1,
          name: "signed_transaction",
          kind: "scalar",
          repeat: 2,
          T: 12
        }
      ],
      {
        "scalapb.message": {
          companionExtends: [
            "com.digitalasset.canton.version.StableProtoVersion"
          ]
        }
      }
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.signedTransaction = [];
    if (value !== void 0)
      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 bytes signed_transaction */
        1:
          message.signedTransaction.push(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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    for (let i = 0; i < message.signedTransaction.length; i++)
      writer.tag(1, WireType.LengthDelimited).bytes(message.signedTransaction[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const SignedTopologyTransactions = new SignedTopologyTransactions$Type();
class TopologyTransactionsBroadcast$Type extends MessageType {
  constructor() {
    super(
      "com.digitalasset.canton.protocol.v30.TopologyTransactionsBroadcast",
      [
        {
          no: 1,
          name: "synchronizer_id",
          kind: "scalar",
          T: 9
        },
        {
          no: 2,
          name: "signed_transactions",
          kind: "message",
          T: () => SignedTopologyTransactions
        }
      ],
      {
        "scalapb.message": {
          companionExtends: [
            "com.digitalasset.canton.version.StableProtoVersion"
          ]
        }
      }
    );
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.synchronizerId = "";
    if (value !== void 0)
      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 synchronizer_id */
        1:
          message.synchronizerId = reader.string();
          break;
        case /* com.digitalasset.canton.protocol.v30.SignedTopologyTransactions signed_transactions */
        2:
          message.signedTransactions = SignedTopologyTransactions.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.signedTransactions
          );
          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 ? UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.synchronizerId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.synchronizerId);
    if (message.signedTransactions)
      SignedTopologyTransactions.internalBinaryWrite(
        message.signedTransactions,
        writer.tag(2, WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const TopologyTransactionsBroadcast = new TopologyTransactionsBroadcast$Type();
export {
  DecentralizedNamespaceDefinition,
  DynamicSequencingParametersState,
  Enums,
  Enums_ParticipantPermission,
  Enums_TopologyChangeOp,
  Enums_TopologyMappingCode,
  MediatorSynchronizerState,
  MultiTransactionSignatures,
  NamespaceDelegation,
  NamespaceDelegation_CanSignAllButNamespaceDelegations,
  NamespaceDelegation_CanSignAllMappings,
  NamespaceDelegation_CanSignSpecificMappings,
  OwnerToKeyMapping,
  ParticipantSynchronizerPermission,
  PartyHostingLimits,
  PartyToKeyMapping,
  PartyToParticipant,
  PartyToParticipant_HostingParticipant,
  PurgeTopologyTransaction,
  SequencerSynchronizerState,
  SignedTopologyTransaction,
  SignedTopologyTransactions,
  SynchronizerParametersState,
  SynchronizerTrustCertificate,
  TopologyMapping,
  TopologyTransaction,
  TopologyTransactionsBroadcast,
  VettedPackages,
  VettedPackages_VettedPackage
};
//# sourceMappingURL=topology.js.map