import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
class EnforcedRestrictionsEVMContract$Type extends MessageType {
  constructor() {
    super("injective.permissions.v1beta1.EnforcedRestrictionsEVMContract", [
      { no: 1, name: "contract_address", kind: "scalar", T: 9, options: { "cosmos_proto.scalar": "cosmos.AddressString" } },
      {
        no: 2,
        name: "pause_event_signature",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 3,
        name: "unpause_event_signature",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 4,
        name: "blacklist_event_signature",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 5,
        name: "unblacklist_event_signature",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      }
    ], { "gogoproto.equal": true });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.contractAddress = "";
    message.pauseEventSignature = "";
    message.unpauseEventSignature = "";
    message.blacklistEventSignature = "";
    message.unblacklistEventSignature = "";
    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 contract_address */
        1:
          message.contractAddress = reader.string();
          break;
        case /* string pause_event_signature */
        2:
          message.pauseEventSignature = reader.string();
          break;
        case /* string unpause_event_signature */
        3:
          message.unpauseEventSignature = reader.string();
          break;
        case /* string blacklist_event_signature */
        4:
          message.blacklistEventSignature = reader.string();
          break;
        case /* string unblacklist_event_signature */
        5:
          message.unblacklistEventSignature = 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.contractAddress !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.contractAddress);
    if (message.pauseEventSignature !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.pauseEventSignature);
    if (message.unpauseEventSignature !== "")
      writer.tag(3, WireType.LengthDelimited).string(message.unpauseEventSignature);
    if (message.blacklistEventSignature !== "")
      writer.tag(4, WireType.LengthDelimited).string(message.blacklistEventSignature);
    if (message.unblacklistEventSignature !== "")
      writer.tag(5, WireType.LengthDelimited).string(message.unblacklistEventSignature);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const EnforcedRestrictionsEVMContract = new EnforcedRestrictionsEVMContract$Type();
class Params$Type extends MessageType {
  constructor() {
    super("injective.permissions.v1beta1.Params", [
      {
        no: 1,
        name: "contract_hook_max_gas",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 2,
        name: "deprecated_enforced_restrictions_contracts",
        kind: "scalar",
        repeat: 2,
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 3, name: "enforced_restrictions_evm_contracts", kind: "message", repeat: 2, T: () => EnforcedRestrictionsEVMContract, options: { "gogoproto.nullable": false } }
    ], { "gogoproto.equal": true, "amino.name": "permissions/Params" });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.contractHookMaxGas = 0n;
    message.deprecatedEnforcedRestrictionsContracts = [];
    message.enforcedRestrictionsEvmContracts = [];
    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 /* uint64 contract_hook_max_gas */
        1:
          message.contractHookMaxGas = reader.uint64().toBigInt();
          break;
        case /* repeated string deprecated_enforced_restrictions_contracts */
        2:
          message.deprecatedEnforcedRestrictionsContracts.push(reader.string());
          break;
        case /* repeated injective.permissions.v1beta1.EnforcedRestrictionsEVMContract enforced_restrictions_evm_contracts */
        3:
          message.enforcedRestrictionsEvmContracts.push(EnforcedRestrictionsEVMContract.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.contractHookMaxGas !== 0n)
      writer.tag(1, WireType.Varint).uint64(message.contractHookMaxGas);
    for (let i = 0; i < message.deprecatedEnforcedRestrictionsContracts.length; i++)
      writer.tag(2, WireType.LengthDelimited).string(message.deprecatedEnforcedRestrictionsContracts[i]);
    for (let i = 0; i < message.enforcedRestrictionsEvmContracts.length; i++)
      EnforcedRestrictionsEVMContract.internalBinaryWrite(message.enforcedRestrictionsEvmContracts[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 Params = new Params$Type();
export {
  EnforcedRestrictionsEVMContract,
  Params
};
