// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/auction/v1beta1/genesis.proto" (package "injective.auction.v1beta1", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { AddressVoucher } from "../../common/vouchers/v1/vouchers_pb";
import { LastAuctionResult } from "./auction_pb";
import { Bid } from "./auction_pb";
import { Params } from "./auction_pb";
/**
 * GenesisState defines the auction module's genesis state.
 *
 * @generated from protobuf message injective.auction.v1beta1.GenesisState
 */
export interface GenesisState {
    /**
     * params defines all the parameters of related to auction.
     *
     * @generated from protobuf field: injective.auction.v1beta1.Params params = 1
     */
    params?: Params;
    /**
     * current auction round
     *
     * @generated from protobuf field: uint64 auction_round = 2
     */
    auctionRound: bigint;
    /**
     * current highest bid
     *
     * @generated from protobuf field: injective.auction.v1beta1.Bid highest_bid = 3
     */
    highestBid?: Bid;
    /**
     * auction ending timestamp
     *
     * @generated from protobuf field: int64 auction_ending_timestamp = 4
     */
    auctionEndingTimestamp: bigint;
    /**
     * last auction result
     *
     * @generated from protobuf field: injective.auction.v1beta1.LastAuctionResult last_auction_result = 5
     */
    lastAuctionResult?: LastAuctionResult;
    /**
     * outstanding vouchers (failed basket deliveries)
     *
     * @generated from protobuf field: repeated injective.common.vouchers.v1.AddressVoucher vouchers = 6
     */
    vouchers: AddressVoucher[];
}
// @generated message type with reflection information, may provide speed optimized methods
class GenesisState$Type extends MessageType<GenesisState> {
    constructor() {
        super("injective.auction.v1beta1.GenesisState", [
            { no: 1, name: "params", kind: "message", T: () => Params, options: { "gogoproto.nullable": false } },
            { no: 2, name: "auction_round", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 3, name: "highest_bid", kind: "message", T: () => Bid },
            { no: 4, name: "auction_ending_timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 5, name: "last_auction_result", kind: "message", T: () => LastAuctionResult },
            { no: 6, name: "vouchers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AddressVoucher, options: { "gogoproto.nullable": false } }
        ]);
    }
    create(value?: PartialMessage<GenesisState>): GenesisState {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.auctionRound = 0n;
        message.auctionEndingTimestamp = 0n;
        message.vouchers = [];
        if (value !== undefined)
            reflectionMergePartial<GenesisState>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenesisState): GenesisState {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* injective.auction.v1beta1.Params params */ 1:
                    message.params = Params.internalBinaryRead(reader, reader.uint32(), options, message.params);
                    break;
                case /* uint64 auction_round */ 2:
                    message.auctionRound = reader.uint64().toBigInt();
                    break;
                case /* injective.auction.v1beta1.Bid highest_bid */ 3:
                    message.highestBid = Bid.internalBinaryRead(reader, reader.uint32(), options, message.highestBid);
                    break;
                case /* int64 auction_ending_timestamp */ 4:
                    message.auctionEndingTimestamp = reader.int64().toBigInt();
                    break;
                case /* injective.auction.v1beta1.LastAuctionResult last_auction_result */ 5:
                    message.lastAuctionResult = LastAuctionResult.internalBinaryRead(reader, reader.uint32(), options, message.lastAuctionResult);
                    break;
                case /* repeated injective.common.vouchers.v1.AddressVoucher vouchers */ 6:
                    message.vouchers.push(AddressVoucher.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: GenesisState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* injective.auction.v1beta1.Params params = 1; */
        if (message.params)
            Params.internalBinaryWrite(message.params, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* uint64 auction_round = 2; */
        if (message.auctionRound !== 0n)
            writer.tag(2, WireType.Varint).uint64(message.auctionRound);
        /* injective.auction.v1beta1.Bid highest_bid = 3; */
        if (message.highestBid)
            Bid.internalBinaryWrite(message.highestBid, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* int64 auction_ending_timestamp = 4; */
        if (message.auctionEndingTimestamp !== 0n)
            writer.tag(4, WireType.Varint).int64(message.auctionEndingTimestamp);
        /* injective.auction.v1beta1.LastAuctionResult last_auction_result = 5; */
        if (message.lastAuctionResult)
            LastAuctionResult.internalBinaryWrite(message.lastAuctionResult, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.common.vouchers.v1.AddressVoucher vouchers = 6; */
        for (let i = 0; i < message.vouchers.length; i++)
            AddressVoucher.internalBinaryWrite(message.vouchers[i], 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;
    }
}
/**
 * @generated MessageType for protobuf message injective.auction.v1beta1.GenesisState
 */
export const GenesisState = new GenesisState$Type();
