import { ServiceType } from "@protobuf-ts/runtime-rpc";
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 { Params } from "./auction_pb.js";
import { Coin } from "../../../cosmos/base/v1beta1/coin_pb.js";
class MsgBid$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgBid", [
      {
        no: 1,
        name: "sender",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      { no: 2, name: "bid_amount", kind: "message", T: () => Coin, options: { "gogoproto.nullable": false } },
      {
        no: 3,
        name: "round",
        kind: "scalar",
        T: 4,
        L: 0
        /*LongType.BIGINT*/
      }
    ], { "gogoproto.goproto_getters": false, "gogoproto.equal": false, "amino.name": "auction/MsgBid", "cosmos.msg.v1.signer": ["sender"] });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.sender = "";
    message.round = 0n;
    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 sender */
        1:
          message.sender = reader.string();
          break;
        case /* cosmos.base.v1beta1.Coin bid_amount */
        2:
          message.bidAmount = Coin.internalBinaryRead(reader, reader.uint32(), options, message.bidAmount);
          break;
        case /* uint64 round */
        3:
          message.round = reader.uint64().toBigInt();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.sender !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.sender);
    if (message.bidAmount)
      Coin.internalBinaryWrite(message.bidAmount, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
    if (message.round !== 0n)
      writer.tag(3, WireType.Varint).uint64(message.round);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const MsgBid = new MsgBid$Type();
class MsgBidResponse$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgBidResponse", []);
  }
  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 MsgBidResponse = new MsgBidResponse$Type();
class MsgUpdateParams$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgUpdateParams", [
      { no: 1, name: "authority", kind: "scalar", T: 9, options: { "cosmos_proto.scalar": "cosmos.AddressString" } },
      { no: 2, name: "params", kind: "message", T: () => Params, options: { "gogoproto.nullable": false } }
    ], { "amino.name": "auction/MsgUpdateParams", "cosmos.msg.v1.signer": ["authority"] });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.authority = "";
    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 authority */
        1:
          message.authority = reader.string();
          break;
        case /* injective.auction.v1beta1.Params params */
        2:
          message.params = Params.internalBinaryRead(reader, reader.uint32(), options, message.params);
          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.authority !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.authority);
    if (message.params)
      Params.internalBinaryWrite(message.params, 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 MsgUpdateParams = new MsgUpdateParams$Type();
class MsgUpdateParamsResponse$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgUpdateParamsResponse", []);
  }
  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 MsgUpdateParamsResponse = new MsgUpdateParamsResponse$Type();
class MsgClaimVoucher$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgClaimVoucher", [
      {
        no: 1,
        name: "sender",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "denom",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      }
    ], { "gogoproto.goproto_getters": false, "gogoproto.equal": false, "amino.name": "auction/MsgClaimVoucher", "cosmos.msg.v1.signer": ["sender"] });
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.sender = "";
    message.denom = "";
    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 sender */
        1:
          message.sender = reader.string();
          break;
        case /* string denom */
        2:
          message.denom = 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.sender !== "")
      writer.tag(1, WireType.LengthDelimited).string(message.sender);
    if (message.denom !== "")
      writer.tag(2, WireType.LengthDelimited).string(message.denom);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
    return writer;
  }
}
const MsgClaimVoucher = new MsgClaimVoucher$Type();
class MsgClaimVoucherResponse$Type extends MessageType {
  constructor() {
    super("injective.auction.v1beta1.MsgClaimVoucherResponse", []);
  }
  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 MsgClaimVoucherResponse = new MsgClaimVoucherResponse$Type();
const Msg = new ServiceType("injective.auction.v1beta1.Msg", [
  { name: "Bid", options: {}, I: MsgBid, O: MsgBidResponse },
  { name: "UpdateParams", options: {}, I: MsgUpdateParams, O: MsgUpdateParamsResponse },
  { name: "ClaimVoucher", options: {}, I: MsgClaimVoucher, O: MsgClaimVoucherResponse }
], { "cosmos.msg.v1.service": true });
export {
  Msg,
  MsgBid,
  MsgBidResponse,
  MsgClaimVoucher,
  MsgClaimVoucherResponse,
  MsgUpdateParams,
  MsgUpdateParamsResponse
};
