// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/peggy/v1/genesis.proto" (package "injective.peggy.v1", 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 { MintAmount } from "./rate_limit_pb";
import { RateLimitTransfers } from "./rate_limit_pb";
import { RateLimit } from "./rate_limit_pb";
import { OutgoingTransferTx } from "./batch_pb";
import { ERC20ToDenom } from "./types_pb";
import { MsgSetOrchestratorAddresses } from "./msgs_pb";
import { Attestation } from "./attestation_pb";
import { MsgConfirmBatch } from "./msgs_pb";
import { OutgoingTxBatch } from "./batch_pb";
import { MsgValsetConfirm } from "./msgs_pb";
import { Valset } from "./types_pb";
import { Params } from "./params_pb";
/**
 * GenesisState struct
 *
 * @generated from protobuf message injective.peggy.v1.GenesisState
 */
export interface GenesisState {
    /**
     * @generated from protobuf field: injective.peggy.v1.Params params = 1
     */
    params?: Params;
    /**
     * @generated from protobuf field: uint64 last_observed_nonce = 2
     */
    lastObservedNonce: bigint;
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.Valset valsets = 3
     */
    valsets: Valset[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.MsgValsetConfirm valset_confirms = 4
     */
    valsetConfirms: MsgValsetConfirm[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.OutgoingTxBatch batches = 5
     */
    batches: OutgoingTxBatch[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.MsgConfirmBatch batch_confirms = 6
     */
    batchConfirms: MsgConfirmBatch[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.Attestation attestations = 7
     */
    attestations: Attestation[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.MsgSetOrchestratorAddresses orchestrator_addresses = 8
     */
    orchestratorAddresses: MsgSetOrchestratorAddresses[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.ERC20ToDenom erc20_to_denoms = 9
     */
    erc20ToDenoms: ERC20ToDenom[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.OutgoingTransferTx unbatched_transfers = 10
     */
    unbatchedTransfers: OutgoingTransferTx[];
    /**
     * @generated from protobuf field: uint64 last_observed_ethereum_height = 11
     */
    lastObservedEthereumHeight: bigint;
    /**
     * @generated from protobuf field: uint64 last_outgoing_batch_id = 12
     */
    lastOutgoingBatchId: bigint;
    /**
     * @generated from protobuf field: uint64 last_outgoing_pool_id = 13
     */
    lastOutgoingPoolId: bigint;
    /**
     * @generated from protobuf field: injective.peggy.v1.Valset last_observed_valset = 14
     */
    lastObservedValset?: Valset;
    /**
     * @generated from protobuf field: repeated string ethereum_blacklist = 15
     */
    ethereumBlacklist: string[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.RateLimit rate_limits = 16
     */
    rateLimits: RateLimit[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.RateLimitTransfers rate_limit_transfers = 17
     */
    rateLimitTransfers: RateLimitTransfers[];
    /**
     * @generated from protobuf field: repeated injective.peggy.v1.MintAmount mint_amounts = 18
     */
    mintAmounts: MintAmount[];
}
// @generated message type with reflection information, may provide speed optimized methods
class GenesisState$Type extends MessageType<GenesisState> {
    constructor() {
        super("injective.peggy.v1.GenesisState", [
            { no: 1, name: "params", kind: "message", T: () => Params },
            { no: 2, name: "last_observed_nonce", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 3, name: "valsets", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Valset },
            { no: 4, name: "valset_confirms", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MsgValsetConfirm },
            { no: 5, name: "batches", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => OutgoingTxBatch },
            { no: 6, name: "batch_confirms", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MsgConfirmBatch },
            { no: 7, name: "attestations", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Attestation },
            { no: 8, name: "orchestrator_addresses", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MsgSetOrchestratorAddresses },
            { no: 9, name: "erc20_to_denoms", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ERC20ToDenom },
            { no: 10, name: "unbatched_transfers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => OutgoingTransferTx },
            { no: 11, name: "last_observed_ethereum_height", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 12, name: "last_outgoing_batch_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 13, name: "last_outgoing_pool_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 14, name: "last_observed_valset", kind: "message", T: () => Valset, options: { "gogoproto.nullable": false } },
            { no: 15, name: "ethereum_blacklist", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 16, name: "rate_limits", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RateLimit },
            { no: 17, name: "rate_limit_transfers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RateLimitTransfers },
            { no: 18, name: "mint_amounts", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MintAmount }
        ]);
    }
    create(value?: PartialMessage<GenesisState>): GenesisState {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.lastObservedNonce = 0n;
        message.valsets = [];
        message.valsetConfirms = [];
        message.batches = [];
        message.batchConfirms = [];
        message.attestations = [];
        message.orchestratorAddresses = [];
        message.erc20ToDenoms = [];
        message.unbatchedTransfers = [];
        message.lastObservedEthereumHeight = 0n;
        message.lastOutgoingBatchId = 0n;
        message.lastOutgoingPoolId = 0n;
        message.ethereumBlacklist = [];
        message.rateLimits = [];
        message.rateLimitTransfers = [];
        message.mintAmounts = [];
        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.peggy.v1.Params params */ 1:
                    message.params = Params.internalBinaryRead(reader, reader.uint32(), options, message.params);
                    break;
                case /* uint64 last_observed_nonce */ 2:
                    message.lastObservedNonce = reader.uint64().toBigInt();
                    break;
                case /* repeated injective.peggy.v1.Valset valsets */ 3:
                    message.valsets.push(Valset.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.MsgValsetConfirm valset_confirms */ 4:
                    message.valsetConfirms.push(MsgValsetConfirm.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.OutgoingTxBatch batches */ 5:
                    message.batches.push(OutgoingTxBatch.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.MsgConfirmBatch batch_confirms */ 6:
                    message.batchConfirms.push(MsgConfirmBatch.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.Attestation attestations */ 7:
                    message.attestations.push(Attestation.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.MsgSetOrchestratorAddresses orchestrator_addresses */ 8:
                    message.orchestratorAddresses.push(MsgSetOrchestratorAddresses.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.ERC20ToDenom erc20_to_denoms */ 9:
                    message.erc20ToDenoms.push(ERC20ToDenom.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.OutgoingTransferTx unbatched_transfers */ 10:
                    message.unbatchedTransfers.push(OutgoingTransferTx.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* uint64 last_observed_ethereum_height */ 11:
                    message.lastObservedEthereumHeight = reader.uint64().toBigInt();
                    break;
                case /* uint64 last_outgoing_batch_id */ 12:
                    message.lastOutgoingBatchId = reader.uint64().toBigInt();
                    break;
                case /* uint64 last_outgoing_pool_id */ 13:
                    message.lastOutgoingPoolId = reader.uint64().toBigInt();
                    break;
                case /* injective.peggy.v1.Valset last_observed_valset */ 14:
                    message.lastObservedValset = Valset.internalBinaryRead(reader, reader.uint32(), options, message.lastObservedValset);
                    break;
                case /* repeated string ethereum_blacklist */ 15:
                    message.ethereumBlacklist.push(reader.string());
                    break;
                case /* repeated injective.peggy.v1.RateLimit rate_limits */ 16:
                    message.rateLimits.push(RateLimit.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.RateLimitTransfers rate_limit_transfers */ 17:
                    message.rateLimitTransfers.push(RateLimitTransfers.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated injective.peggy.v1.MintAmount mint_amounts */ 18:
                    message.mintAmounts.push(MintAmount.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.peggy.v1.Params params = 1; */
        if (message.params)
            Params.internalBinaryWrite(message.params, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* uint64 last_observed_nonce = 2; */
        if (message.lastObservedNonce !== 0n)
            writer.tag(2, WireType.Varint).uint64(message.lastObservedNonce);
        /* repeated injective.peggy.v1.Valset valsets = 3; */
        for (let i = 0; i < message.valsets.length; i++)
            Valset.internalBinaryWrite(message.valsets[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.MsgValsetConfirm valset_confirms = 4; */
        for (let i = 0; i < message.valsetConfirms.length; i++)
            MsgValsetConfirm.internalBinaryWrite(message.valsetConfirms[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.OutgoingTxBatch batches = 5; */
        for (let i = 0; i < message.batches.length; i++)
            OutgoingTxBatch.internalBinaryWrite(message.batches[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.MsgConfirmBatch batch_confirms = 6; */
        for (let i = 0; i < message.batchConfirms.length; i++)
            MsgConfirmBatch.internalBinaryWrite(message.batchConfirms[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.Attestation attestations = 7; */
        for (let i = 0; i < message.attestations.length; i++)
            Attestation.internalBinaryWrite(message.attestations[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.MsgSetOrchestratorAddresses orchestrator_addresses = 8; */
        for (let i = 0; i < message.orchestratorAddresses.length; i++)
            MsgSetOrchestratorAddresses.internalBinaryWrite(message.orchestratorAddresses[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.ERC20ToDenom erc20_to_denoms = 9; */
        for (let i = 0; i < message.erc20ToDenoms.length; i++)
            ERC20ToDenom.internalBinaryWrite(message.erc20ToDenoms[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.OutgoingTransferTx unbatched_transfers = 10; */
        for (let i = 0; i < message.unbatchedTransfers.length; i++)
            OutgoingTransferTx.internalBinaryWrite(message.unbatchedTransfers[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join();
        /* uint64 last_observed_ethereum_height = 11; */
        if (message.lastObservedEthereumHeight !== 0n)
            writer.tag(11, WireType.Varint).uint64(message.lastObservedEthereumHeight);
        /* uint64 last_outgoing_batch_id = 12; */
        if (message.lastOutgoingBatchId !== 0n)
            writer.tag(12, WireType.Varint).uint64(message.lastOutgoingBatchId);
        /* uint64 last_outgoing_pool_id = 13; */
        if (message.lastOutgoingPoolId !== 0n)
            writer.tag(13, WireType.Varint).uint64(message.lastOutgoingPoolId);
        /* injective.peggy.v1.Valset last_observed_valset = 14; */
        if (message.lastObservedValset)
            Valset.internalBinaryWrite(message.lastObservedValset, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
        /* repeated string ethereum_blacklist = 15; */
        for (let i = 0; i < message.ethereumBlacklist.length; i++)
            writer.tag(15, WireType.LengthDelimited).string(message.ethereumBlacklist[i]);
        /* repeated injective.peggy.v1.RateLimit rate_limits = 16; */
        for (let i = 0; i < message.rateLimits.length; i++)
            RateLimit.internalBinaryWrite(message.rateLimits[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.RateLimitTransfers rate_limit_transfers = 17; */
        for (let i = 0; i < message.rateLimitTransfers.length; i++)
            RateLimitTransfers.internalBinaryWrite(message.rateLimitTransfers[i], writer.tag(17, WireType.LengthDelimited).fork(), options).join();
        /* repeated injective.peggy.v1.MintAmount mint_amounts = 18; */
        for (let i = 0; i < message.mintAmounts.length; i++)
            MintAmount.internalBinaryWrite(message.mintAmounts[i], writer.tag(18, 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.peggy.v1.GenesisState
 */
export const GenesisState = new GenesisState$Type();
