// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
// @generated from protobuf file "injective/peggy/v1/params.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 { Coin } from "../../../cosmos/base/v1beta1/coin_pb";
// Params represent the peggy genesis and store parameters
// peggy_id:
// a random 32 byte value to prevent signature reuse, for example if the
// cosmos validators decided to use the same Ethereum keys for another chain
// also running Peggy we would not want it to be possible to play a deposit
// from chain A back on chain B's peggy. This value IS USED ON ETHEREUM so
// it must be set in your genesis.json before launch and not changed after
// deploying Peggy
// 
// contract_hash:
// the code hash of a known good version of the Peggy contract
// solidity code. This can be used to verify the correct version
// of the contract has been deployed. This is a reference value for
// goernance action only it is never read by any Peggy code
// 
// bridge_ethereum_address:
// is address of the bridge contract on the Ethereum side, this is a
// reference value for governance only and is not actually used by any
// Peggy code
// 
// bridge_chain_id:
// the unique identifier of the Ethereum chain, this is a reference value
// only and is not actually used by any Peggy code
// 
// These reference values may be used by future Peggy client implemetnations
// to allow for saftey features or convenience features like the peggy address
// in your relayer. A relayer would require a configured peggy address if
// governance had not set the address on the chain it was relaying for.
// 
// signed_valsets_window
// signed_batches_window
// signed_claims_window
// 
// These values represent the time in blocks that a validator has to submit
// a signature for a batch or valset, or to submit a claim for a particular
// attestation nonce. In the case of attestations this clock starts when the
// attestation is created, but only allows for slashing once the event has
// passed
// 
// target_batch_timeout:
// 
// This is the 'target' value for when batches time out, this is a target
// becuase Ethereum is a probabalistic chain and you can't say for sure what the
// block frequency is ahead of time.
// 
// average_block_time
// average_ethereum_block_time
// 
// These values are the average Cosmos block time and Ethereum block time
// repsectively and they are used to copute what the target batch timeout is. It
// is important that governance updates these in case of any major, prolonged
// change in the time it takes to produce a block
// 
// slash_fraction_valset
// slash_fraction_batch
// slash_fraction_claim
// slash_fraction_conflicting_claim
// 
// The slashing fractions for the various peggy related slashing conditions. The
// first three refer to not submitting a particular message, the third for
// submitting a different claim for the same Ethereum event
// 
// unbond_slashing_valsets_window
// 
// The unbond slashing valsets window is used to determine how many blocks after
// starting to unbond a validator needs to continue signing blocks. The goal of
// this paramater is that when a validator leaves the set, if their leaving
// creates enough change in the validator set to justify an update they will
// sign a validator set update for the Ethereum bridge that does not include
// themselves. Allowing us to remove them from the Ethereum bridge and replace
// them with the new set gracefully.
// 
// valset_reward
// 
// Valset rewards are the amount of tokens this chain issues to relayers of
// validator sets. These can be any ERC20 token in the bridge, but it's strongly
// advised that chains use only Cosmos originated tokens, which the bridge
// effectively mints on Ethereum. If you run out of the token you are using for
// validator set rewards valset updates will fail and the bridge will be
// vulnerable to highjacking. For these paramaters the zero values are special
// and indicate not to attempt any reward. This is the default for
// bootstrapping.

/**
 * @generated from protobuf message injective.peggy.v1.Params
 */
export interface Params {
    /**
     * @generated from protobuf field: string peggy_id = 1
     */
    peggyId: string;
    /**
     * @generated from protobuf field: string contract_source_hash = 2
     */
    contractSourceHash: string;
    /**
     * @generated from protobuf field: string bridge_ethereum_address = 3
     */
    bridgeEthereumAddress: string;
    /**
     * @generated from protobuf field: uint64 bridge_chain_id = 4
     */
    bridgeChainId: bigint;
    /**
     * @generated from protobuf field: uint64 signed_valsets_window = 5
     */
    signedValsetsWindow: bigint;
    /**
     * @generated from protobuf field: uint64 signed_batches_window = 6
     */
    signedBatchesWindow: bigint;
    /**
     * @generated from protobuf field: uint64 signed_claims_window = 7
     */
    signedClaimsWindow: bigint;
    /**
     * @generated from protobuf field: uint64 target_batch_timeout = 8
     */
    targetBatchTimeout: bigint;
    /**
     * @generated from protobuf field: uint64 average_block_time = 9
     */
    averageBlockTime: bigint;
    /**
     * @generated from protobuf field: uint64 average_ethereum_block_time = 10
     */
    averageEthereumBlockTime: bigint;
    /**
     * @deprecated
     * @generated from protobuf field: bytes slash_fraction_valset = 11 [deprecated = true]
     */
    slashFractionValset: Uint8Array;
    /**
     * @deprecated
     * @generated from protobuf field: bytes slash_fraction_batch = 12 [deprecated = true]
     */
    slashFractionBatch: Uint8Array;
    /**
     * @deprecated
     * @generated from protobuf field: bytes slash_fraction_claim = 13 [deprecated = true]
     */
    slashFractionClaim: Uint8Array;
    /**
     * @deprecated
     * @generated from protobuf field: bytes slash_fraction_conflicting_claim = 14 [deprecated = true]
     */
    slashFractionConflictingClaim: Uint8Array;
    /**
     * @generated from protobuf field: uint64 unbond_slashing_valsets_window = 15
     */
    unbondSlashingValsetsWindow: bigint;
    /**
     * @deprecated
     * @generated from protobuf field: bytes slash_fraction_bad_eth_signature = 16 [deprecated = true]
     */
    slashFractionBadEthSignature: Uint8Array;
    /**
     * @generated from protobuf field: string cosmos_coin_denom = 17
     */
    cosmosCoinDenom: string;
    /**
     * @generated from protobuf field: string cosmos_coin_erc20_contract = 18
     */
    cosmosCoinErc20Contract: string;
    /**
     * @deprecated
     * @generated from protobuf field: bool claim_slashing_enabled = 19 [deprecated = true]
     */
    claimSlashingEnabled: boolean;
    /**
     * @generated from protobuf field: uint64 bridge_contract_start_height = 20
     */
    bridgeContractStartHeight: bigint;
    /**
     * @generated from protobuf field: cosmos.base.v1beta1.Coin valset_reward = 21
     */
    valsetReward?: Coin;
    /**
     * @generated from protobuf field: repeated string admins = 22
     */
    admins: string[];
    /**
     * address for receiving Peggy Deposits from sanctioned Ethereum addresses
     *
     * @generated from protobuf field: string segregated_wallet_address = 23
     */
    segregatedWalletAddress: string;
}
// @generated message type with reflection information, may provide speed optimized methods
class Params$Type extends MessageType<Params> {
    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 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 5, name: "signed_valsets_window", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 6, name: "signed_batches_window", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 7, name: "signed_claims_window", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 8, name: "target_batch_timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 9, name: "average_block_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 10, name: "average_ethereum_block_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 11, name: "slash_fraction_valset", kind: "scalar", T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
            { no: 12, name: "slash_fraction_batch", kind: "scalar", T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
            { no: 13, name: "slash_fraction_claim", kind: "scalar", T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
            { no: 14, name: "slash_fraction_conflicting_claim", kind: "scalar", T: 12 /*ScalarType.BYTES*/, options: { "gogoproto.nullable": false, "gogoproto.customtype": "cosmossdk.io/math.LegacyDec" } },
            { no: 15, name: "unbond_slashing_valsets_window", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 16, name: "slash_fraction_bad_eth_signature", kind: "scalar", T: 12 /*ScalarType.BYTES*/, 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 /*ScalarType.UINT64*/, 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 /*RepeatType.UNPACKED*/, 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?: PartialMessage<Params>): Params {
        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 !== undefined)
            reflectionMergePartial<Params>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Params): Params {
        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: Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string peggy_id = 1; */
        if (message.peggyId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.peggyId);
        /* string contract_source_hash = 2; */
        if (message.contractSourceHash !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.contractSourceHash);
        /* string bridge_ethereum_address = 3; */
        if (message.bridgeEthereumAddress !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.bridgeEthereumAddress);
        /* uint64 bridge_chain_id = 4; */
        if (message.bridgeChainId !== 0n)
            writer.tag(4, WireType.Varint).uint64(message.bridgeChainId);
        /* uint64 signed_valsets_window = 5; */
        if (message.signedValsetsWindow !== 0n)
            writer.tag(5, WireType.Varint).uint64(message.signedValsetsWindow);
        /* uint64 signed_batches_window = 6; */
        if (message.signedBatchesWindow !== 0n)
            writer.tag(6, WireType.Varint).uint64(message.signedBatchesWindow);
        /* uint64 signed_claims_window = 7; */
        if (message.signedClaimsWindow !== 0n)
            writer.tag(7, WireType.Varint).uint64(message.signedClaimsWindow);
        /* uint64 target_batch_timeout = 8; */
        if (message.targetBatchTimeout !== 0n)
            writer.tag(8, WireType.Varint).uint64(message.targetBatchTimeout);
        /* uint64 average_block_time = 9; */
        if (message.averageBlockTime !== 0n)
            writer.tag(9, WireType.Varint).uint64(message.averageBlockTime);
        /* uint64 average_ethereum_block_time = 10; */
        if (message.averageEthereumBlockTime !== 0n)
            writer.tag(10, WireType.Varint).uint64(message.averageEthereumBlockTime);
        /* bytes slash_fraction_valset = 11 [deprecated = true]; */
        if (message.slashFractionValset.length)
            writer.tag(11, WireType.LengthDelimited).bytes(message.slashFractionValset);
        /* bytes slash_fraction_batch = 12 [deprecated = true]; */
        if (message.slashFractionBatch.length)
            writer.tag(12, WireType.LengthDelimited).bytes(message.slashFractionBatch);
        /* bytes slash_fraction_claim = 13 [deprecated = true]; */
        if (message.slashFractionClaim.length)
            writer.tag(13, WireType.LengthDelimited).bytes(message.slashFractionClaim);
        /* bytes slash_fraction_conflicting_claim = 14 [deprecated = true]; */
        if (message.slashFractionConflictingClaim.length)
            writer.tag(14, WireType.LengthDelimited).bytes(message.slashFractionConflictingClaim);
        /* uint64 unbond_slashing_valsets_window = 15; */
        if (message.unbondSlashingValsetsWindow !== 0n)
            writer.tag(15, WireType.Varint).uint64(message.unbondSlashingValsetsWindow);
        /* bytes slash_fraction_bad_eth_signature = 16 [deprecated = true]; */
        if (message.slashFractionBadEthSignature.length)
            writer.tag(16, WireType.LengthDelimited).bytes(message.slashFractionBadEthSignature);
        /* string cosmos_coin_denom = 17; */
        if (message.cosmosCoinDenom !== "")
            writer.tag(17, WireType.LengthDelimited).string(message.cosmosCoinDenom);
        /* string cosmos_coin_erc20_contract = 18; */
        if (message.cosmosCoinErc20Contract !== "")
            writer.tag(18, WireType.LengthDelimited).string(message.cosmosCoinErc20Contract);
        /* bool claim_slashing_enabled = 19 [deprecated = true]; */
        if (message.claimSlashingEnabled !== false)
            writer.tag(19, WireType.Varint).bool(message.claimSlashingEnabled);
        /* uint64 bridge_contract_start_height = 20; */
        if (message.bridgeContractStartHeight !== 0n)
            writer.tag(20, WireType.Varint).uint64(message.bridgeContractStartHeight);
        /* cosmos.base.v1beta1.Coin valset_reward = 21; */
        if (message.valsetReward)
            Coin.internalBinaryWrite(message.valsetReward, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
        /* repeated string admins = 22; */
        for (let i = 0; i < message.admins.length; i++)
            writer.tag(22, WireType.LengthDelimited).string(message.admins[i]);
        /* string segregated_wallet_address = 23; */
        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;
    }
}
/**
 * @generated MessageType for protobuf message injective.peggy.v1.Params
 */
export const Params = new Params$Type();
