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 { Coin } from "../../../cosmos/base/v1beta1/coin_pb.js";
class Params$Type extends MessageType {
  constructor() {
    super("injective.peggy.v1.Params", [
      {
        no: 1,
        name: "peggy_id",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "contract_source_hash",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 3,
        name: "bridge_ethereum_address",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 4,
        name: "bridge_chain_id",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 5,
        name: "signed_valsets_window",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 6,
        name: "signed_batches_window",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 7,
        name: "signed_claims_window",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 8,
        name: "target_batch_timeout",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 9,
        name: "average_block_time",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      {
        no: 10,
        name: "average_ethereum_block_time",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      { no: 11, name: "slash_fraction_valset", kind: "scalar", T: 12, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      { no: 12, name: "slash_fraction_batch", kind: "scalar", T: 12, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      { no: 13, name: "slash_fraction_claim", kind: "scalar", T: 12, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      { no: 14, name: "slash_fraction_conflicting_claim", kind: "scalar", T: 12, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 15,
        name: "unbond_slashing_valsets_window",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      { no: 16, name: "slash_fraction_bad_eth_signature", kind: "scalar", T: 12, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
      {
        no: 17,
        name: "cosmos_coin_denom",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 18,
        name: "cosmos_coin_erc20_contract",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 19,
        name: "claim_slashing_enabled",
        kind: "scalar",
        T: 8
        /*ScalarType.BOOL*/
      },
      {
        no: 20,
        name: "bridge_contract_start_height",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      },
      { no: 21, name: "valset_reward", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } },
      {
        no: 22,
        name: "admins",
        kind: "scalar",
        repeat: 2,
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 23,
        name: "segregated_wallet_address",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      }
    ], { "gogoproto.stringer": false, "amino.name": "peggy/Params" });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.peggyId = "";
    message.contractSourceHash = "";
    message.bridgeEthereumAddress = "";
    message.bridgeChainId = 0n;
    message.signedValsetsWindow = 0n;
    message.signedBatchesWindow = 0n;
    message.signedClaimsWindow = 0n;
    message.targetBatchTimeout = 0n;
    message.averageBlockTime = 0n;
    message.averageEthereumBlockTime = 0n;
    message.slashFractionValset = new Uint8Array(0);
    message.slashFractionBatch = new Uint8Array(0);
    message.slashFractionClaim = new Uint8Array(0);
    message.slashFractionConflictingClaim = new Uint8Array(0);
    message.unbondSlashingValsetsWindow = 0n;
    message.slashFractionBadEthSignature = new Uint8Array(0);
    message.cosmosCoinDenom = "";
    message.cosmosCoinErc20Contract = "";
    message.claimSlashingEnabled = false;
    message.bridgeContractStartHeight = 0n;
    message.admins = [];
    message.segregatedWalletAddress = "";
    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 peggy_id */
        1:
          message.peggyId = reader.string();
          break;
        case /* string contract_source_hash */
        2:
          message.contractSourceHash = reader.string();
          break;
        case /* string bridge_ethereum_address */
        3:
          message.bridgeEthereumAddress = reader.string();
          break;
        case /* uint64 bridge_chain_id */
        4:
          message.bridgeChainId = reader.uint64().toBigInt();
          break;
        case /* uint64 signed_valsets_window */
        5:
          message.signedValsetsWindow = reader.uint64().toBigInt();
          break;
        case /* uint64 signed_batches_window */
        6:
          message.signedBatchesWindow = reader.uint64().toBigInt();
          break;
        case /* uint64 signed_claims_window */
        7:
          message.signedClaimsWindow = reader.uint64().toBigInt();
          break;
        case /* uint64 target_batch_timeout */
        8:
          message.targetBatchTimeout = reader.uint64().toBigInt();
          break;
        case /* uint64 average_block_time */
        9:
          message.averageBlockTime = reader.uint64().toBigInt();
          break;
        case /* uint64 average_ethereum_block_time */
        10:
          message.averageEthereumBlockTime = reader.uint64().toBigInt();
          break;
        case /* bytes slash_fraction_valset = 11 [deprecated = true] */
        11:
          message.slashFractionValset = reader.bytes();
          break;
        case /* bytes slash_fraction_batch = 12 [deprecated = true] */
        12:
          message.slashFractionBatch = reader.bytes();
          break;
        case /* bytes slash_fraction_claim = 13 [deprecated = true] */
        13:
          message.slashFractionClaim = reader.bytes();
          break;
        case /* bytes slash_fraction_conflicting_claim = 14 [deprecated = true] */
        14:
          message.slashFractionConflictingClaim = reader.bytes();
          break;
        case /* uint64 unbond_slashing_valsets_window */
        15:
          message.unbondSlashingValsetsWindow = reader.uint64().toBigInt();
          break;
        case /* bytes slash_fraction_bad_eth_signature = 16 [deprecated = true] */
        16:
          message.slashFractionBadEthSignature = reader.bytes();
          break;
        case /* string cosmos_coin_denom */
        17:
          message.cosmosCoinDenom = reader.string();
          break;
        case /* string cosmos_coin_erc20_contract */
        18:
          message.cosmosCoinErc20Contract = reader.string();
          break;
        case /* bool claim_slashing_enabled = 19 [deprecated = true] */
        19:
          message.claimSlashingEnabled = reader.bool();
          break;
        case /* uint64 bridge_contract_start_height */
        20:
          message.bridgeContractStartHeight = reader.uint64().toBigInt();
          break;
        case /* cosmos.base.v1beta1.Coin valset_reward */
        21:
          message.valsetReward = Coin.internalBinaryRead(reader, reader.uint32(), options, message.valsetReward);
          break;
        case /* repeated string admins */
        22:
          message.admins.push(reader.string());
          break;
        case /* string segregated_wallet_address */
        23:
          message.segregatedWalletAddress = 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.peggyId !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.peggyId);
    if (message.contractSourceHash !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.contractSourceHash);
    if (message.bridgeEthereumAddress !== "")
      writer.tag(3, WireType.LengthDelimited).string(message.bridgeEthereumAddress);
    if (message.bridgeChainId !== 0n)
      writer.tag(4, WireType.Varint).uint64(message.bridgeChainId);
    if (message.signedValsetsWindow !== 0n)
      writer.tag(5, WireType.Varint).uint64(message.signedValsetsWindow);
    if (message.signedBatchesWindow !== 0n)
      writer.tag(6, WireType.Varint).uint64(message.signedBatchesWindow);
    if (message.signedClaimsWindow !== 0n)
      writer.tag(7, WireType.Varint).uint64(message.signedClaimsWindow);
    if (message.targetBatchTimeout !== 0n)
      writer.tag(8, WireType.Varint).uint64(message.targetBatchTimeout);
    if (message.averageBlockTime !== 0n)
      writer.tag(9, WireType.Varint).uint64(message.averageBlockTime);
    if (message.averageEthereumBlockTime !== 0n)
      writer.tag(10, WireType.Varint).uint64(message.averageEthereumBlockTime);
    if (message.slashFractionValset.length)
      writer.tag(11, WireType.LengthDelimited).bytes(message.slashFractionValset);
    if (message.slashFractionBatch.length)
      writer.tag(12, WireType.LengthDelimited).bytes(message.slashFractionBatch);
    if (message.slashFractionClaim.length)
      writer.tag(13, WireType.LengthDelimited).bytes(message.slashFractionClaim);
    if (message.slashFractionConflictingClaim.length)
      writer.tag(14, WireType.LengthDelimited).bytes(message.slashFractionConflictingClaim);
    if (message.unbondSlashingValsetsWindow !== 0n)
      writer.tag(15, WireType.Varint).uint64(message.unbondSlashingValsetsWindow);
    if (message.slashFractionBadEthSignature.length)
      writer.tag(16, WireType.LengthDelimited).bytes(message.slashFractionBadEthSignature);
    if (message.cosmosCoinDenom !== "")
      writer.tag(17, WireType.LengthDelimited).string(message.cosmosCoinDenom);
    if (message.cosmosCoinErc20Contract !== "")
      writer.tag(18, WireType.LengthDelimited).string(message.cosmosCoinErc20Contract);
    if (message.claimSlashingEnabled !== false)
      writer.tag(19, WireType.Varint).bool(message.claimSlashingEnabled);
    if (message.bridgeContractStartHeight !== 0n)
      writer.tag(20, WireType.Varint).uint64(message.bridgeContractStartHeight);
    if (message.valsetReward)
      Coin.internalBinaryWrite(message.valsetReward, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
    for (let i = 0; i < message.admins.length; i++)
      writer.tag(22, WireType.LengthDelimited).string(message.admins[i]);
    if (message.segregatedWalletAddress !== "")
      writer.tag(23, WireType.LengthDelimited).string(message.segregatedWalletAddress);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const Params = new Params$Type();
export {
  Params
};
