import { Timestamp } from "../../google/protobuf/timestamp"; import { ConsensusParams, ConsensusParamsSDKType } from "../types/params"; import { ProofOps, ProofOpsSDKType } from "../crypto/proof"; import { PublicKey, PublicKeySDKType } from "../crypto/keys"; import { BlockIDFlag } from "../types/validator"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long, toTimestamp, fromTimestamp } from "../../helpers"; export enum CheckTxType { NEW = 0, RECHECK = 1, UNRECOGNIZED = -1, } export const CheckTxTypeSDKType = CheckTxType; export function checkTxTypeFromJSON(object: any): CheckTxType { switch (object) { case 0: case "NEW": return CheckTxType.NEW; case 1: case "RECHECK": return CheckTxType.RECHECK; case -1: case "UNRECOGNIZED": default: return CheckTxType.UNRECOGNIZED; } } export function checkTxTypeToJSON(object: CheckTxType): string { switch (object) { case CheckTxType.NEW: return "NEW"; case CheckTxType.RECHECK: return "RECHECK"; case CheckTxType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ResponseOfferSnapshot_Result { /** UNKNOWN - Unknown result, abort all snapshot restoration */ UNKNOWN = 0, /** ACCEPT - Snapshot accepted, apply chunks */ ACCEPT = 1, /** ABORT - Abort all snapshot restoration */ ABORT = 2, /** REJECT - Reject this specific snapshot, try others */ REJECT = 3, /** REJECT_FORMAT - Reject all snapshots of this format, try others */ REJECT_FORMAT = 4, /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ REJECT_SENDER = 5, UNRECOGNIZED = -1, } export const ResponseOfferSnapshot_ResultSDKType = ResponseOfferSnapshot_Result; export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { switch (object) { case 0: case "UNKNOWN": return ResponseOfferSnapshot_Result.UNKNOWN; case 1: case "ACCEPT": return ResponseOfferSnapshot_Result.ACCEPT; case 2: case "ABORT": return ResponseOfferSnapshot_Result.ABORT; case 3: case "REJECT": return ResponseOfferSnapshot_Result.REJECT; case 4: case "REJECT_FORMAT": return ResponseOfferSnapshot_Result.REJECT_FORMAT; case 5: case "REJECT_SENDER": return ResponseOfferSnapshot_Result.REJECT_SENDER; case -1: case "UNRECOGNIZED": default: return ResponseOfferSnapshot_Result.UNRECOGNIZED; } } export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { switch (object) { case ResponseOfferSnapshot_Result.UNKNOWN: return "UNKNOWN"; case ResponseOfferSnapshot_Result.ACCEPT: return "ACCEPT"; case ResponseOfferSnapshot_Result.ABORT: return "ABORT"; case ResponseOfferSnapshot_Result.REJECT: return "REJECT"; case ResponseOfferSnapshot_Result.REJECT_FORMAT: return "REJECT_FORMAT"; case ResponseOfferSnapshot_Result.REJECT_SENDER: return "REJECT_SENDER"; case ResponseOfferSnapshot_Result.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ResponseApplySnapshotChunk_Result { /** UNKNOWN - Unknown result, abort all snapshot restoration */ UNKNOWN = 0, /** ACCEPT - Chunk successfully accepted */ ACCEPT = 1, /** ABORT - Abort all snapshot restoration */ ABORT = 2, /** RETRY - Retry chunk (combine with refetch and reject) */ RETRY = 3, /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ RETRY_SNAPSHOT = 4, /** REJECT_SNAPSHOT - Reject this snapshot, try others */ REJECT_SNAPSHOT = 5, UNRECOGNIZED = -1, } export const ResponseApplySnapshotChunk_ResultSDKType = ResponseApplySnapshotChunk_Result; export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { switch (object) { case 0: case "UNKNOWN": return ResponseApplySnapshotChunk_Result.UNKNOWN; case 1: case "ACCEPT": return ResponseApplySnapshotChunk_Result.ACCEPT; case 2: case "ABORT": return ResponseApplySnapshotChunk_Result.ABORT; case 3: case "RETRY": return ResponseApplySnapshotChunk_Result.RETRY; case 4: case "RETRY_SNAPSHOT": return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; case 5: case "REJECT_SNAPSHOT": return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; case -1: case "UNRECOGNIZED": default: return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; } } export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { switch (object) { case ResponseApplySnapshotChunk_Result.UNKNOWN: return "UNKNOWN"; case ResponseApplySnapshotChunk_Result.ACCEPT: return "ACCEPT"; case ResponseApplySnapshotChunk_Result.ABORT: return "ABORT"; case ResponseApplySnapshotChunk_Result.RETRY: return "RETRY"; case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: return "RETRY_SNAPSHOT"; case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: return "REJECT_SNAPSHOT"; case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ResponseProcessProposal_ProposalStatus { UNKNOWN = 0, ACCEPT = 1, REJECT = 2, UNRECOGNIZED = -1, } export const ResponseProcessProposal_ProposalStatusSDKType = ResponseProcessProposal_ProposalStatus; export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { switch (object) { case 0: case "UNKNOWN": return ResponseProcessProposal_ProposalStatus.UNKNOWN; case 1: case "ACCEPT": return ResponseProcessProposal_ProposalStatus.ACCEPT; case 2: case "REJECT": return ResponseProcessProposal_ProposalStatus.REJECT; case -1: case "UNRECOGNIZED": default: return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; } } export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { switch (object) { case ResponseProcessProposal_ProposalStatus.UNKNOWN: return "UNKNOWN"; case ResponseProcessProposal_ProposalStatus.ACCEPT: return "ACCEPT"; case ResponseProcessProposal_ProposalStatus.REJECT: return "REJECT"; case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ResponseVerifyVoteExtension_VerifyStatus { UNKNOWN = 0, ACCEPT = 1, /** * REJECT - Rejecting the vote extension will reject the entire precommit by the sender. * Incorrectly implementing this thus has liveness implications as it may affect * CometBFT's ability to receive 2/3+ valid votes to finalize the block. * Honest nodes should never be rejected. */ REJECT = 2, UNRECOGNIZED = -1, } export const ResponseVerifyVoteExtension_VerifyStatusSDKType = ResponseVerifyVoteExtension_VerifyStatus; export function responseVerifyVoteExtension_VerifyStatusFromJSON(object: any): ResponseVerifyVoteExtension_VerifyStatus { switch (object) { case 0: case "UNKNOWN": return ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN; case 1: case "ACCEPT": return ResponseVerifyVoteExtension_VerifyStatus.ACCEPT; case 2: case "REJECT": return ResponseVerifyVoteExtension_VerifyStatus.REJECT; case -1: case "UNRECOGNIZED": default: return ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED; } } export function responseVerifyVoteExtension_VerifyStatusToJSON(object: ResponseVerifyVoteExtension_VerifyStatus): string { switch (object) { case ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN: return "UNKNOWN"; case ResponseVerifyVoteExtension_VerifyStatus.ACCEPT: return "ACCEPT"; case ResponseVerifyVoteExtension_VerifyStatus.REJECT: return "REJECT"; case ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } export const MisbehaviorTypeSDKType = MisbehaviorType; export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: return MisbehaviorType.UNRECOGNIZED; } } export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { case MisbehaviorType.UNKNOWN: return "UNKNOWN"; case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; case MisbehaviorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; initChain?: RequestInitChain; query?: RequestQuery; checkTx?: RequestCheckTx; commit?: RequestCommit; listSnapshots?: RequestListSnapshots; offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; prepareProposal?: RequestPrepareProposal; processProposal?: RequestProcessProposal; extendVote?: RequestExtendVote; verifyVoteExtension?: RequestVerifyVoteExtension; finalizeBlock?: RequestFinalizeBlock; } export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; check_tx?: RequestCheckTxSDKType; commit?: RequestCommitSDKType; list_snapshots?: RequestListSnapshotsSDKType; offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; prepare_proposal?: RequestPrepareProposalSDKType; process_proposal?: RequestProcessProposalSDKType; extend_vote?: RequestExtendVoteSDKType; verify_vote_extension?: RequestVerifyVoteExtensionSDKType; finalize_block?: RequestFinalizeBlockSDKType; } export interface RequestEcho { message: string; } export interface RequestEchoSDKType { message: string; } export interface RequestFlush {} export interface RequestFlushSDKType {} export interface RequestInfo { version: string; blockVersion: Long; p2pVersion: Long; abciVersion: string; } export interface RequestInfoSDKType { version: string; block_version: Long; p2p_version: Long; abci_version: string; } export interface RequestInitChain { time?: Date; chainId: string; consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; initialHeight: Long; } export interface RequestInitChainSDKType { time?: Date; chain_id: string; consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_state_bytes: Uint8Array; initial_height: Long; } export interface RequestQuery { data: Uint8Array; path: string; height: Long; prove: boolean; } export interface RequestQuerySDKType { data: Uint8Array; path: string; height: Long; prove: boolean; } export interface RequestCheckTx { tx: Uint8Array; type: CheckTxType; } export interface RequestCheckTxSDKType { tx: Uint8Array; type: CheckTxType; } export interface RequestCommit {} export interface RequestCommitSDKType {} /** lists available snapshots */ export interface RequestListSnapshots {} /** lists available snapshots */ export interface RequestListSnapshotsSDKType {} /** offers a snapshot to the application */ export interface RequestOfferSnapshot { /** snapshot offered by peers */ snapshot?: Snapshot; /** light client-verified app hash for snapshot height */ appHash: Uint8Array; } /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { snapshot?: SnapshotSDKType; app_hash: Uint8Array; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunk { height: Long; format: number; chunk: number; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkSDKType { height: Long; format: number; chunk: number; } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunk { index: number; chunk: Uint8Array; sender: string; } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkSDKType { index: number; chunk: Uint8Array; sender: string; } export interface RequestPrepareProposal { /** the modified transactions cannot exceed this size. */ maxTxBytes: Long; /** * txs is an array of transactions that will be included in a block, * sent to the app for possible modifications. */ txs: Uint8Array[]; localLastCommit?: ExtendedCommitInfo; misbehavior: Misbehavior[]; height: Long; time?: Date; nextValidatorsHash: Uint8Array; /** address of the public key of the validator proposing the block. */ proposerAddress: Uint8Array; } export interface RequestPrepareProposalSDKType { max_tx_bytes: Long; txs: Uint8Array[]; local_last_commit?: ExtendedCommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; height: Long; time?: Date; next_validators_hash: Uint8Array; proposer_address: Uint8Array; } export interface RequestProcessProposal { txs: Uint8Array[]; proposedLastCommit?: CommitInfo; misbehavior: Misbehavior[]; /** hash is the merkle root hash of the fields of the proposed block. */ hash: Uint8Array; height: Long; time?: Date; nextValidatorsHash: Uint8Array; /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } export interface RequestProcessProposalSDKType { txs: Uint8Array[]; proposed_last_commit?: CommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; hash: Uint8Array; height: Long; time?: Date; next_validators_hash: Uint8Array; proposer_address: Uint8Array; } /** Extends a vote with application-injected data */ export interface RequestExtendVote { /** the hash of the block that this vote may be referring to */ hash: Uint8Array; /** the height of the extended vote */ height: Long; /** info of the block that this vote may be referring to */ time?: Date; txs: Uint8Array[]; proposedLastCommit?: CommitInfo; misbehavior: Misbehavior[]; nextValidatorsHash: Uint8Array; /** address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } /** Extends a vote with application-injected data */ export interface RequestExtendVoteSDKType { hash: Uint8Array; height: Long; time?: Date; txs: Uint8Array[]; proposed_last_commit?: CommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; next_validators_hash: Uint8Array; proposer_address: Uint8Array; } /** Verify the vote extension */ export interface RequestVerifyVoteExtension { /** the hash of the block that this received vote corresponds to */ hash: Uint8Array; /** the validator that signed the vote extension */ validatorAddress: Uint8Array; height: Long; voteExtension: Uint8Array; } /** Verify the vote extension */ export interface RequestVerifyVoteExtensionSDKType { hash: Uint8Array; validator_address: Uint8Array; height: Long; vote_extension: Uint8Array; } export interface RequestFinalizeBlock { txs: Uint8Array[]; decidedLastCommit?: CommitInfo; misbehavior: Misbehavior[]; /** hash is the merkle root hash of the fields of the decided block. */ hash: Uint8Array; height: Long; time?: Date; nextValidatorsHash: Uint8Array; /** proposer_address is the address of the public key of the original proposer of the block. */ proposerAddress: Uint8Array; } export interface RequestFinalizeBlockSDKType { txs: Uint8Array[]; decided_last_commit?: CommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; hash: Uint8Array; height: Long; time?: Date; next_validators_hash: Uint8Array; proposer_address: Uint8Array; } export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; initChain?: ResponseInitChain; query?: ResponseQuery; checkTx?: ResponseCheckTx; commit?: ResponseCommit; listSnapshots?: ResponseListSnapshots; offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; prepareProposal?: ResponsePrepareProposal; processProposal?: ResponseProcessProposal; extendVote?: ResponseExtendVote; verifyVoteExtension?: ResponseVerifyVoteExtension; finalizeBlock?: ResponseFinalizeBlock; } export interface ResponseSDKType { exception?: ResponseExceptionSDKType; echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; check_tx?: ResponseCheckTxSDKType; commit?: ResponseCommitSDKType; list_snapshots?: ResponseListSnapshotsSDKType; offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; prepare_proposal?: ResponsePrepareProposalSDKType; process_proposal?: ResponseProcessProposalSDKType; extend_vote?: ResponseExtendVoteSDKType; verify_vote_extension?: ResponseVerifyVoteExtensionSDKType; finalize_block?: ResponseFinalizeBlockSDKType; } /** nondeterministic */ export interface ResponseException { error: string; } /** nondeterministic */ export interface ResponseExceptionSDKType { error: string; } export interface ResponseEcho { message: string; } export interface ResponseEchoSDKType { message: string; } export interface ResponseFlush {} export interface ResponseFlushSDKType {} export interface ResponseInfo { data: string; version: string; appVersion: Long; lastBlockHeight: Long; lastBlockAppHash: Uint8Array; } export interface ResponseInfoSDKType { data: string; version: string; app_version: Long; last_block_height: Long; last_block_app_hash: Uint8Array; } export interface ResponseInitChain { consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appHash: Uint8Array; } export interface ResponseInitChainSDKType { consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_hash: Uint8Array; } export interface ResponseQuery { code: number; /** bytes data = 2; // use "value" instead. */ log: string; /** nondeterministic */ info: string; index: Long; key: Uint8Array; value: Uint8Array; proofOps?: ProofOps; height: Long; codespace: string; } export interface ResponseQuerySDKType { code: number; log: string; info: string; index: Long; key: Uint8Array; value: Uint8Array; proof_ops?: ProofOpsSDKType; height: Long; codespace: string; } export interface ResponseCheckTx { code: number; data: Uint8Array; /** nondeterministic */ log: string; /** nondeterministic */ info: string; gasWanted: Long; gasUsed: Long; events: Event[]; codespace: string; } export interface ResponseCheckTxSDKType { code: number; data: Uint8Array; log: string; info: string; gas_wanted: Long; gas_used: Long; events: EventSDKType[]; codespace: string; } export interface ResponseCommit { retainHeight: Long; } export interface ResponseCommitSDKType { retain_height: Long; } export interface ResponseListSnapshots { snapshots: Snapshot[]; } export interface ResponseListSnapshotsSDKType { snapshots: SnapshotSDKType[]; } export interface ResponseOfferSnapshot { result: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotSDKType { result: ResponseOfferSnapshot_Result; } export interface ResponseLoadSnapshotChunk { chunk: Uint8Array; } export interface ResponseLoadSnapshotChunkSDKType { chunk: Uint8Array; } export interface ResponseApplySnapshotChunk { result: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ refetchChunks: number[]; /** Chunk senders to reject and ban */ rejectSenders: string[]; } export interface ResponseApplySnapshotChunkSDKType { result: ResponseApplySnapshotChunk_Result; refetch_chunks: number[]; reject_senders: string[]; } export interface ResponsePrepareProposal { txs: Uint8Array[]; } export interface ResponsePrepareProposalSDKType { txs: Uint8Array[]; } export interface ResponseProcessProposal { status: ResponseProcessProposal_ProposalStatus; } export interface ResponseProcessProposalSDKType { status: ResponseProcessProposal_ProposalStatus; } export interface ResponseExtendVote { voteExtension: Uint8Array; } export interface ResponseExtendVoteSDKType { vote_extension: Uint8Array; } export interface ResponseVerifyVoteExtension { status: ResponseVerifyVoteExtension_VerifyStatus; } export interface ResponseVerifyVoteExtensionSDKType { status: ResponseVerifyVoteExtension_VerifyStatus; } export interface ResponseFinalizeBlock { /** set of block events emmitted as part of executing the block */ events: Event[]; /** * the result of executing each transaction including the events * the particular transction emitted. This should match the order * of the transactions delivered in the block itself */ txResults: ExecTxResult[]; /** a list of updates to the validator set. These will reflect the validator set at current height + 2. */ validatorUpdates: ValidatorUpdate[]; /** updates to the consensus params, if any. */ consensusParamUpdates?: ConsensusParams; /** * app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was * deterministic. It is up to the application to decide which algorithm to use. */ appHash: Uint8Array; } export interface ResponseFinalizeBlockSDKType { events: EventSDKType[]; tx_results: ExecTxResultSDKType[]; validator_updates: ValidatorUpdateSDKType[]; consensus_param_updates?: ConsensusParamsSDKType; app_hash: Uint8Array; } export interface CommitInfo { round: number; votes: VoteInfo[]; } export interface CommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; } /** * ExtendedCommitInfo is similar to CommitInfo except that it is only used in * the PrepareProposal request such that CometBFT can provide vote extensions * to the application. */ export interface ExtendedCommitInfo { /** The round at which the block proposer decided in the previous height. */ round: number; /** * List of validators' addresses in the last validator set with their voting * information, including vote extensions. */ votes: ExtendedVoteInfo[]; } /** * ExtendedCommitInfo is similar to CommitInfo except that it is only used in * the PrepareProposal request such that CometBFT can provide vote extensions * to the application. */ export interface ExtendedCommitInfoSDKType { round: number; votes: ExtendedVoteInfoSDKType[]; } /** * Event allows application developers to attach additional information to * ResponseFinalizeBlock and ResponseCheckTx. * Later, transactions may be queried using these events. */ export interface Event { type: string; attributes: EventAttribute[]; } /** * Event allows application developers to attach additional information to * ResponseFinalizeBlock and ResponseCheckTx. * Later, transactions may be queried using these events. */ export interface EventSDKType { type: string; attributes: EventAttributeSDKType[]; } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { key: string; value: string; /** nondeterministic */ index: boolean; } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { key: string; value: string; index: boolean; } /** * ExecTxResult contains results of executing one individual transaction. * * * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted */ export interface ExecTxResult { code: number; data: Uint8Array; /** nondeterministic */ log: string; /** nondeterministic */ info: string; gasWanted: Long; gasUsed: Long; events: Event[]; codespace: string; } /** * ExecTxResult contains results of executing one individual transaction. * * * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted */ export interface ExecTxResultSDKType { code: number; data: Uint8Array; log: string; info: string; gas_wanted: Long; gas_used: Long; events: EventSDKType[]; codespace: string; } /** * TxResult contains results of executing the transaction. * * One usage is indexing transaction results. */ export interface TxResult { height: Long; index: number; tx: Uint8Array; result?: ExecTxResult; } /** * TxResult contains results of executing the transaction. * * One usage is indexing transaction results. */ export interface TxResultSDKType { height: Long; index: number; tx: Uint8Array; result?: ExecTxResultSDKType; } export interface Validator { /** * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ address: Uint8Array; /** The voting power */ power: Long; } export interface ValidatorSDKType { address: Uint8Array; power: Long; } export interface ValidatorUpdate { pubKey?: PublicKey; power: Long; } export interface ValidatorUpdateSDKType { pub_key?: PublicKeySDKType; power: Long; } export interface VoteInfo { validator?: Validator; blockIdFlag: BlockIDFlag; } export interface VoteInfoSDKType { validator?: ValidatorSDKType; block_id_flag: BlockIDFlag; } export interface ExtendedVoteInfo { /** The validator that sent the vote. */ validator?: Validator; /** Non-deterministic extension provided by the sending validator's application. */ voteExtension: Uint8Array; /** Vote extension signature created by CometBFT */ extensionSignature: Uint8Array; /** block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all */ blockIdFlag: BlockIDFlag; } export interface ExtendedVoteInfoSDKType { validator?: ValidatorSDKType; vote_extension: Uint8Array; extension_signature: Uint8Array; block_id_flag: BlockIDFlag; } export interface Misbehavior { type: MisbehaviorType; /** The offending validator */ validator?: Validator; /** The height when the offense occurred */ height: Long; /** The corresponding time where the offense occurred */ time?: Date; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ totalVotingPower: Long; } export interface MisbehaviorSDKType { type: MisbehaviorType; validator?: ValidatorSDKType; height: Long; time?: Date; total_voting_power: Long; } export interface Snapshot { /** The height at which the snapshot was taken */ height: Long; /** The application-specific snapshot format */ format: number; /** Number of chunks in the snapshot */ chunks: number; /** Arbitrary snapshot hash, equal only if identical */ hash: Uint8Array; /** Arbitrary application metadata */ metadata: Uint8Array; } export interface SnapshotSDKType { height: Long; format: number; chunks: number; hash: Uint8Array; metadata: Uint8Array; } function createBaseRequest(): Request { return { echo: undefined, flush: undefined, info: undefined, initChain: undefined, query: undefined, checkTx: undefined, commit: undefined, listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined, prepareProposal: undefined, processProposal: undefined, extendVote: undefined, verifyVoteExtension: undefined, finalizeBlock: undefined }; } export const Request = { encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.echo !== undefined) { RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); } if (message.flush !== undefined) { RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); } if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } if (message.initChain !== undefined) { RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } if (message.query !== undefined) { RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); } if (message.checkTx !== undefined) { RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); } if (message.commit !== undefined) { RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); } if (message.listSnapshots !== undefined) { RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); } if (message.offerSnapshot !== undefined) { RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); } if (message.loadSnapshotChunk !== undefined) { RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); } if (message.applySnapshotChunk !== undefined) { RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } if (message.prepareProposal !== undefined) { RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); } if (message.processProposal !== undefined) { RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); } if (message.extendVote !== undefined) { RequestExtendVote.encode(message.extendVote, writer.uint32(146).fork()).ldelim(); } if (message.verifyVoteExtension !== undefined) { RequestVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(154).fork()).ldelim(); } if (message.finalizeBlock !== undefined) { RequestFinalizeBlock.encode(message.finalizeBlock, writer.uint32(162).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Request { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.echo = RequestEcho.decode(reader, reader.uint32()); break; case 2: message.flush = RequestFlush.decode(reader, reader.uint32()); break; case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; case 5: message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; case 6: message.query = RequestQuery.decode(reader, reader.uint32()); break; case 8: message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); break; case 11: message.commit = RequestCommit.decode(reader, reader.uint32()); break; case 12: message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); break; case 13: message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); break; case 14: message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); break; case 15: message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; case 16: message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); break; case 17: message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); break; case 18: message.extendVote = RequestExtendVote.decode(reader, reader.uint32()); break; case 19: message.verifyVoteExtension = RequestVerifyVoteExtension.decode(reader, reader.uint32()); break; case 20: message.finalizeBlock = RequestFinalizeBlock.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Request { const message = createBaseRequest(); message.echo = object.echo !== undefined && object.echo !== null ? RequestEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? RequestFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? RequestInfo.fromPartial(object.info) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? RequestInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? RequestQuery.fromPartial(object.query) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : undefined; message.commit = object.commit !== undefined && object.commit !== null ? RequestCommit.fromPartial(object.commit) : undefined; message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? RequestListSnapshots.fromPartial(object.listSnapshots) : undefined; message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? RequestProcessProposal.fromPartial(object.processProposal) : undefined; message.extendVote = object.extendVote !== undefined && object.extendVote !== null ? RequestExtendVote.fromPartial(object.extendVote) : undefined; message.verifyVoteExtension = object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null ? RequestVerifyVoteExtension.fromPartial(object.verifyVoteExtension) : undefined; message.finalizeBlock = object.finalizeBlock !== undefined && object.finalizeBlock !== null ? RequestFinalizeBlock.fromPartial(object.finalizeBlock) : undefined; return message; } }; function createBaseRequestEcho(): RequestEcho { return { message: "" }; } export const RequestEcho = { encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEcho(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.message = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestEcho { const message = createBaseRequestEcho(); message.message = object.message ?? ""; return message; } }; function createBaseRequestFlush(): RequestFlush { return {}; } export const RequestFlush = { encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestFlush(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: DeepPartial): RequestFlush { const message = createBaseRequestFlush(); return message; } }; function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: Long.UZERO, p2pVersion: Long.UZERO, abciVersion: "" }; } export const RequestInfo = { encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== "") { writer.uint32(10).string(message.version); } if (!message.blockVersion.isZero()) { writer.uint32(16).uint64(message.blockVersion); } if (!message.p2pVersion.isZero()) { writer.uint32(24).uint64(message.p2pVersion); } if (message.abciVersion !== "") { writer.uint32(34).string(message.abciVersion); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.version = reader.string(); break; case 2: message.blockVersion = (reader.uint64() as Long); break; case 3: message.p2pVersion = (reader.uint64() as Long); break; case 4: message.abciVersion = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestInfo { const message = createBaseRequestInfo(); message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? Long.fromValue(object.blockVersion) : Long.UZERO; message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? Long.fromValue(object.p2pVersion) : Long.UZERO; message.abciVersion = object.abciVersion ?? ""; return message; } }; function createBaseRequestInitChain(): RequestInitChain { return { time: undefined, chainId: "", consensusParams: undefined, validators: [], appStateBytes: new Uint8Array(), initialHeight: Long.ZERO }; } export const RequestInitChain = { encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); } for (const v of message.validators) { ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); } if (message.appStateBytes.length !== 0) { writer.uint32(42).bytes(message.appStateBytes); } if (!message.initialHeight.isZero()) { writer.uint32(48).int64(message.initialHeight); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 2: message.chainId = reader.string(); break; case 3: message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); break; case 4: message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 5: message.appStateBytes = reader.bytes(); break; case 6: message.initialHeight = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestInitChain { const message = createBaseRequestInitChain(); message.time = object.time ?? undefined; message.chainId = object.chainId ?? ""; message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; message.appStateBytes = object.appStateBytes ?? new Uint8Array(); message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? Long.fromValue(object.initialHeight) : Long.ZERO; return message; } }; function createBaseRequestQuery(): RequestQuery { return { data: new Uint8Array(), path: "", height: Long.ZERO, prove: false }; } export const RequestQuery = { encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } if (!message.height.isZero()) { writer.uint32(24).int64(message.height); } if (message.prove === true) { writer.uint32(32).bool(message.prove); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.data = reader.bytes(); break; case 2: message.path = reader.string(); break; case 3: message.height = (reader.int64() as Long); break; case 4: message.prove = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestQuery { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.prove = object.prove ?? false; return message; } }; function createBaseRequestCheckTx(): RequestCheckTx { return { tx: new Uint8Array(), type: 0 }; } export const RequestCheckTx = { encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } if (message.type !== 0) { writer.uint32(16).int32(message.type); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.tx = reader.bytes(); break; case 2: message.type = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestCheckTx { const message = createBaseRequestCheckTx(); message.tx = object.tx ?? new Uint8Array(); message.type = object.type ?? 0; return message; } }; function createBaseRequestCommit(): RequestCommit { return {}; } export const RequestCommit = { encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: DeepPartial): RequestCommit { const message = createBaseRequestCommit(); return message; } }; function createBaseRequestListSnapshots(): RequestListSnapshots { return {}; } export const RequestListSnapshots = { encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestListSnapshots(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: DeepPartial): RequestListSnapshots { const message = createBaseRequestListSnapshots(); return message; } }; function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { return { snapshot: undefined, appHash: new Uint8Array() }; } export const RequestOfferSnapshot = { encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.snapshot !== undefined) { Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); } if (message.appHash.length !== 0) { writer.uint32(18).bytes(message.appHash); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestOfferSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.snapshot = Snapshot.decode(reader, reader.uint32()); break; case 2: message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestOfferSnapshot { const message = createBaseRequestOfferSnapshot(); message.snapshot = object.snapshot !== undefined && object.snapshot !== null ? Snapshot.fromPartial(object.snapshot) : undefined; message.appHash = object.appHash ?? new Uint8Array(); return message; } }; function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { return { height: Long.UZERO, format: 0, chunk: 0 }; } export const RequestLoadSnapshotChunk = { encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { writer.uint32(16).uint32(message.format); } if (message.chunk !== 0) { writer.uint32(24).uint32(message.chunk); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = (reader.uint64() as Long); break; case 2: message.format = reader.uint32(); break; case 3: message.chunk = reader.uint32(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; message.format = object.format ?? 0; message.chunk = object.chunk ?? 0; return message; } }; function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { return { index: 0, chunk: new Uint8Array(), sender: "" }; } export const RequestApplySnapshotChunk = { encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } if (message.chunk.length !== 0) { writer.uint32(18).bytes(message.chunk); } if (message.sender !== "") { writer.uint32(26).string(message.sender); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestApplySnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.index = reader.uint32(); break; case 2: message.chunk = reader.bytes(); break; case 3: message.sender = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestApplySnapshotChunk { const message = createBaseRequestApplySnapshotChunk(); message.index = object.index ?? 0; message.chunk = object.chunk ?? new Uint8Array(); message.sender = object.sender ?? ""; return message; } }; function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { maxTxBytes: Long.ZERO, txs: [], localLastCommit: undefined, misbehavior: [], height: Long.ZERO, time: undefined, nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestPrepareProposal = { encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.maxTxBytes.isZero()) { writer.uint32(8).int64(message.maxTxBytes); } for (const v of message.txs) { writer.uint32(18).bytes(v!); } if (message.localLastCommit !== undefined) { ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); } for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } if (!message.height.isZero()) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); } if (message.nextValidatorsHash.length !== 0) { writer.uint32(58).bytes(message.nextValidatorsHash); } if (message.proposerAddress.length !== 0) { writer.uint32(66).bytes(message.proposerAddress); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestPrepareProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.maxTxBytes = (reader.int64() as Long); break; case 2: message.txs.push(reader.bytes()); break; case 3: message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); break; case 4: message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 5: message.height = (reader.int64() as Long); break; case 6: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.nextValidatorsHash = reader.bytes(); break; case 8: message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestPrepareProposal { const message = createBaseRequestPrepareProposal(); message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? Long.fromValue(object.maxTxBytes) : Long.ZERO; message.txs = object.txs?.map(e => e) || []; message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.time = object.time ?? undefined; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; } }; function createBaseRequestProcessProposal(): RequestProcessProposal { return { txs: [], proposedLastCommit: undefined, misbehavior: [], hash: new Uint8Array(), height: Long.ZERO, time: undefined, nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestProcessProposal = { encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } if (message.proposedLastCommit !== undefined) { CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); } for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } if (!message.height.isZero()) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); } if (message.nextValidatorsHash.length !== 0) { writer.uint32(58).bytes(message.nextValidatorsHash); } if (message.proposerAddress.length !== 0) { writer.uint32(66).bytes(message.proposerAddress); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.txs.push(reader.bytes()); break; case 2: message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); break; case 3: message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 4: message.hash = reader.bytes(); break; case 5: message.height = (reader.int64() as Long); break; case 6: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.nextValidatorsHash = reader.bytes(); break; case 8: message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestProcessProposal { const message = createBaseRequestProcessProposal(); message.txs = object.txs?.map(e => e) || []; message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; message.hash = object.hash ?? new Uint8Array(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.time = object.time ?? undefined; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; } }; function createBaseRequestExtendVote(): RequestExtendVote { return { hash: new Uint8Array(), height: Long.ZERO, time: undefined, txs: [], proposedLastCommit: undefined, misbehavior: [], nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestExtendVote = { encode(message: RequestExtendVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } if (!message.height.isZero()) { writer.uint32(16).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(26).fork()).ldelim(); } for (const v of message.txs) { writer.uint32(34).bytes(v!); } if (message.proposedLastCommit !== undefined) { CommitInfo.encode(message.proposedLastCommit, writer.uint32(42).fork()).ldelim(); } for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(50).fork()).ldelim(); } if (message.nextValidatorsHash.length !== 0) { writer.uint32(58).bytes(message.nextValidatorsHash); } if (message.proposerAddress.length !== 0) { writer.uint32(66).bytes(message.proposerAddress); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestExtendVote { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestExtendVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.hash = reader.bytes(); break; case 2: message.height = (reader.int64() as Long); break; case 3: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 4: message.txs.push(reader.bytes()); break; case 5: message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); break; case 6: message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 7: message.nextValidatorsHash = reader.bytes(); break; case 8: message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestExtendVote { const message = createBaseRequestExtendVote(); message.hash = object.hash ?? new Uint8Array(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.time = object.time ?? undefined; message.txs = object.txs?.map(e => e) || []; message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; } }; function createBaseRequestVerifyVoteExtension(): RequestVerifyVoteExtension { return { hash: new Uint8Array(), validatorAddress: new Uint8Array(), height: Long.ZERO, voteExtension: new Uint8Array() }; } export const RequestVerifyVoteExtension = { encode(message: RequestVerifyVoteExtension, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } if (message.validatorAddress.length !== 0) { writer.uint32(18).bytes(message.validatorAddress); } if (!message.height.isZero()) { writer.uint32(24).int64(message.height); } if (message.voteExtension.length !== 0) { writer.uint32(34).bytes(message.voteExtension); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestVerifyVoteExtension { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestVerifyVoteExtension(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.hash = reader.bytes(); break; case 2: message.validatorAddress = reader.bytes(); break; case 3: message.height = (reader.int64() as Long); break; case 4: message.voteExtension = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestVerifyVoteExtension { const message = createBaseRequestVerifyVoteExtension(); message.hash = object.hash ?? new Uint8Array(); message.validatorAddress = object.validatorAddress ?? new Uint8Array(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.voteExtension = object.voteExtension ?? new Uint8Array(); return message; } }; function createBaseRequestFinalizeBlock(): RequestFinalizeBlock { return { txs: [], decidedLastCommit: undefined, misbehavior: [], hash: new Uint8Array(), height: Long.ZERO, time: undefined, nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestFinalizeBlock = { encode(message: RequestFinalizeBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } if (message.decidedLastCommit !== undefined) { CommitInfo.encode(message.decidedLastCommit, writer.uint32(18).fork()).ldelim(); } for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } if (!message.height.isZero()) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); } if (message.nextValidatorsHash.length !== 0) { writer.uint32(58).bytes(message.nextValidatorsHash); } if (message.proposerAddress.length !== 0) { writer.uint32(66).bytes(message.proposerAddress); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RequestFinalizeBlock { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestFinalizeBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.txs.push(reader.bytes()); break; case 2: message.decidedLastCommit = CommitInfo.decode(reader, reader.uint32()); break; case 3: message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 4: message.hash = reader.bytes(); break; case 5: message.height = (reader.int64() as Long); break; case 6: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.nextValidatorsHash = reader.bytes(); break; case 8: message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): RequestFinalizeBlock { const message = createBaseRequestFinalizeBlock(); message.txs = object.txs?.map(e => e) || []; message.decidedLastCommit = object.decidedLastCommit !== undefined && object.decidedLastCommit !== null ? CommitInfo.fromPartial(object.decidedLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; message.hash = object.hash ?? new Uint8Array(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.time = object.time ?? undefined; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; } }; function createBaseResponse(): Response { return { exception: undefined, echo: undefined, flush: undefined, info: undefined, initChain: undefined, query: undefined, checkTx: undefined, commit: undefined, listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined, prepareProposal: undefined, processProposal: undefined, extendVote: undefined, verifyVoteExtension: undefined, finalizeBlock: undefined }; } export const Response = { encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.exception !== undefined) { ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } if (message.echo !== undefined) { ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); } if (message.flush !== undefined) { ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); } if (message.info !== undefined) { ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); } if (message.initChain !== undefined) { ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); } if (message.query !== undefined) { ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); } if (message.checkTx !== undefined) { ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); } if (message.commit !== undefined) { ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); } if (message.listSnapshots !== undefined) { ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); } if (message.offerSnapshot !== undefined) { ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); } if (message.loadSnapshotChunk !== undefined) { ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); } if (message.applySnapshotChunk !== undefined) { ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); } if (message.prepareProposal !== undefined) { ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); } if (message.processProposal !== undefined) { ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); } if (message.extendVote !== undefined) { ResponseExtendVote.encode(message.extendVote, writer.uint32(154).fork()).ldelim(); } if (message.verifyVoteExtension !== undefined) { ResponseVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(162).fork()).ldelim(); } if (message.finalizeBlock !== undefined) { ResponseFinalizeBlock.encode(message.finalizeBlock, writer.uint32(170).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Response { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.exception = ResponseException.decode(reader, reader.uint32()); break; case 2: message.echo = ResponseEcho.decode(reader, reader.uint32()); break; case 3: message.flush = ResponseFlush.decode(reader, reader.uint32()); break; case 4: message.info = ResponseInfo.decode(reader, reader.uint32()); break; case 6: message.initChain = ResponseInitChain.decode(reader, reader.uint32()); break; case 7: message.query = ResponseQuery.decode(reader, reader.uint32()); break; case 9: message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); break; case 12: message.commit = ResponseCommit.decode(reader, reader.uint32()); break; case 13: message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); break; case 14: message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); break; case 15: message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); break; case 16: message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); break; case 17: message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); break; case 18: message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); break; case 19: message.extendVote = ResponseExtendVote.decode(reader, reader.uint32()); break; case 20: message.verifyVoteExtension = ResponseVerifyVoteExtension.decode(reader, reader.uint32()); break; case 21: message.finalizeBlock = ResponseFinalizeBlock.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Response { const message = createBaseResponse(); message.exception = object.exception !== undefined && object.exception !== null ? ResponseException.fromPartial(object.exception) : undefined; message.echo = object.echo !== undefined && object.echo !== null ? ResponseEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? ResponseFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? ResponseInfo.fromPartial(object.info) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? ResponseInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? ResponseQuery.fromPartial(object.query) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? ResponseCheckTx.fromPartial(object.checkTx) : undefined; message.commit = object.commit !== undefined && object.commit !== null ? ResponseCommit.fromPartial(object.commit) : undefined; message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? ResponseListSnapshots.fromPartial(object.listSnapshots) : undefined; message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? ResponsePrepareProposal.fromPartial(object.prepareProposal) : undefined; message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? ResponseProcessProposal.fromPartial(object.processProposal) : undefined; message.extendVote = object.extendVote !== undefined && object.extendVote !== null ? ResponseExtendVote.fromPartial(object.extendVote) : undefined; message.verifyVoteExtension = object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null ? ResponseVerifyVoteExtension.fromPartial(object.verifyVoteExtension) : undefined; message.finalizeBlock = object.finalizeBlock !== undefined && object.finalizeBlock !== null ? ResponseFinalizeBlock.fromPartial(object.finalizeBlock) : undefined; return message; } }; function createBaseResponseException(): ResponseException { return { error: "" }; } export const ResponseException = { encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.error !== "") { writer.uint32(10).string(message.error); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseException(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.error = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseException { const message = createBaseResponseException(); message.error = object.error ?? ""; return message; } }; function createBaseResponseEcho(): ResponseEcho { return { message: "" }; } export const ResponseEcho = { encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEcho(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.message = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseEcho { const message = createBaseResponseEcho(); message.message = object.message ?? ""; return message; } }; function createBaseResponseFlush(): ResponseFlush { return {}; } export const ResponseFlush = { encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseFlush(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: DeepPartial): ResponseFlush { const message = createBaseResponseFlush(); return message; } }; function createBaseResponseInfo(): ResponseInfo { return { data: "", version: "", appVersion: Long.UZERO, lastBlockHeight: Long.ZERO, lastBlockAppHash: new Uint8Array() }; } export const ResponseInfo = { encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data !== "") { writer.uint32(10).string(message.data); } if (message.version !== "") { writer.uint32(18).string(message.version); } if (!message.appVersion.isZero()) { writer.uint32(24).uint64(message.appVersion); } if (!message.lastBlockHeight.isZero()) { writer.uint32(32).int64(message.lastBlockHeight); } if (message.lastBlockAppHash.length !== 0) { writer.uint32(42).bytes(message.lastBlockAppHash); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.data = reader.string(); break; case 2: message.version = reader.string(); break; case 3: message.appVersion = (reader.uint64() as Long); break; case 4: message.lastBlockHeight = (reader.int64() as Long); break; case 5: message.lastBlockAppHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseInfo { const message = createBaseResponseInfo(); message.data = object.data ?? ""; message.version = object.version ?? ""; message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? Long.fromValue(object.appVersion) : Long.UZERO; message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? Long.fromValue(object.lastBlockHeight) : Long.ZERO; message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; } }; function createBaseResponseInitChain(): ResponseInitChain { return { consensusParams: undefined, validators: [], appHash: new Uint8Array() }; } export const ResponseInitChain = { encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); } for (const v of message.validators) { ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.appHash.length !== 0) { writer.uint32(26).bytes(message.appHash); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); break; case 2: message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 3: message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseInitChain { const message = createBaseResponseInitChain(); message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; message.appHash = object.appHash ?? new Uint8Array(); return message; } }; function createBaseResponseQuery(): ResponseQuery { return { code: 0, log: "", info: "", index: Long.ZERO, key: new Uint8Array(), value: new Uint8Array(), proofOps: undefined, height: Long.ZERO, codespace: "" }; } export const ResponseQuery = { encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } if (message.log !== "") { writer.uint32(26).string(message.log); } if (message.info !== "") { writer.uint32(34).string(message.info); } if (!message.index.isZero()) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { writer.uint32(50).bytes(message.key); } if (message.value.length !== 0) { writer.uint32(58).bytes(message.value); } if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } if (!message.height.isZero()) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { writer.uint32(82).string(message.codespace); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.uint32(); break; case 3: message.log = reader.string(); break; case 4: message.info = reader.string(); break; case 5: message.index = (reader.int64() as Long); break; case 6: message.key = reader.bytes(); break; case 7: message.value = reader.bytes(); break; case 8: message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: message.height = (reader.int64() as Long); break; case 10: message.codespace = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseQuery { const message = createBaseResponseQuery(); message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.ZERO; message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.codespace = object.codespace ?? ""; return message; } }; function createBaseResponseCheckTx(): ResponseCheckTx { return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: Long.ZERO, gasUsed: Long.ZERO, events: [], codespace: "" }; } export const ResponseCheckTx = { encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } if (message.log !== "") { writer.uint32(26).string(message.log); } if (message.info !== "") { writer.uint32(34).string(message.info); } if (!message.gasWanted.isZero()) { writer.uint32(40).int64(message.gasWanted); } if (!message.gasUsed.isZero()) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { Event.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.uint32(); break; case 2: message.data = reader.bytes(); break; case 3: message.log = reader.string(); break; case 4: message.info = reader.string(); break; case 5: message.gasWanted = (reader.int64() as Long); break; case 6: message.gasUsed = (reader.int64() as Long); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); break; case 8: message.codespace = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseCheckTx { const message = createBaseResponseCheckTx(); message.code = object.code ?? 0; message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.ZERO; message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.ZERO; message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; return message; } }; function createBaseResponseCommit(): ResponseCommit { return { retainHeight: Long.ZERO }; } export const ResponseCommit = { encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.retainHeight.isZero()) { writer.uint32(24).int64(message.retainHeight); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: message.retainHeight = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseCommit { const message = createBaseResponseCommit(); message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? Long.fromValue(object.retainHeight) : Long.ZERO; return message; } }; function createBaseResponseListSnapshots(): ResponseListSnapshots { return { snapshots: [] }; } export const ResponseListSnapshots = { encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseListSnapshots(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.snapshots.push(Snapshot.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseListSnapshots { const message = createBaseResponseListSnapshots(); message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; return message; } }; function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { return { result: 0 }; } export const ResponseOfferSnapshot = { encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseOfferSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.result = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseOfferSnapshot { const message = createBaseResponseOfferSnapshot(); message.result = object.result ?? 0; return message; } }; function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { return { chunk: new Uint8Array() }; } export const ResponseLoadSnapshotChunk = { encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.chunk = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { const message = createBaseResponseLoadSnapshotChunk(); message.chunk = object.chunk ?? new Uint8Array(); return message; } }; function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { return { result: 0, refetchChunks: [], rejectSenders: [] }; } export const ResponseApplySnapshotChunk = { encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.result !== 0) { writer.uint32(8).int32(message.result); } writer.uint32(18).fork(); for (const v of message.refetchChunks) { writer.uint32(v); } writer.ldelim(); for (const v of message.rejectSenders) { writer.uint32(26).string(v!); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseApplySnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.result = (reader.int32() as any); break; case 2: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.refetchChunks.push(reader.uint32()); } } else { message.refetchChunks.push(reader.uint32()); } break; case 3: message.rejectSenders.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { const message = createBaseResponseApplySnapshotChunk(); message.result = object.result ?? 0; message.refetchChunks = object.refetchChunks?.map(e => e) || []; message.rejectSenders = object.rejectSenders?.map(e => e) || []; return message; } }; function createBaseResponsePrepareProposal(): ResponsePrepareProposal { return { txs: [] }; } export const ResponsePrepareProposal = { encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponsePrepareProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.txs.push(reader.bytes()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponsePrepareProposal { const message = createBaseResponsePrepareProposal(); message.txs = object.txs?.map(e => e) || []; return message; } }; function createBaseResponseProcessProposal(): ResponseProcessProposal { return { status: 0 }; } export const ResponseProcessProposal = { encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.status !== 0) { writer.uint32(8).int32(message.status); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.status = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseProcessProposal { const message = createBaseResponseProcessProposal(); message.status = object.status ?? 0; return message; } }; function createBaseResponseExtendVote(): ResponseExtendVote { return { voteExtension: new Uint8Array() }; } export const ResponseExtendVote = { encode(message: ResponseExtendVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.voteExtension.length !== 0) { writer.uint32(10).bytes(message.voteExtension); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseExtendVote { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseExtendVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.voteExtension = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseExtendVote { const message = createBaseResponseExtendVote(); message.voteExtension = object.voteExtension ?? new Uint8Array(); return message; } }; function createBaseResponseVerifyVoteExtension(): ResponseVerifyVoteExtension { return { status: 0 }; } export const ResponseVerifyVoteExtension = { encode(message: ResponseVerifyVoteExtension, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.status !== 0) { writer.uint32(8).int32(message.status); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseVerifyVoteExtension { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseVerifyVoteExtension(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.status = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseVerifyVoteExtension { const message = createBaseResponseVerifyVoteExtension(); message.status = object.status ?? 0; return message; } }; function createBaseResponseFinalizeBlock(): ResponseFinalizeBlock { return { events: [], txResults: [], validatorUpdates: [], consensusParamUpdates: undefined, appHash: new Uint8Array() }; } export const ResponseFinalizeBlock = { encode(message: ResponseFinalizeBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); } for (const v of message.txResults) { ExecTxResult.encode(v!, writer.uint32(18).fork()).ldelim(); } for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.consensusParamUpdates !== undefined) { ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(34).fork()).ldelim(); } if (message.appHash.length !== 0) { writer.uint32(42).bytes(message.appHash); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFinalizeBlock { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseFinalizeBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.events.push(Event.decode(reader, reader.uint32())); break; case 2: message.txResults.push(ExecTxResult.decode(reader, reader.uint32())); break; case 3: message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 4: message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); break; case 5: message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ResponseFinalizeBlock { const message = createBaseResponseFinalizeBlock(); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.txResults = object.txResults?.map(e => ExecTxResult.fromPartial(e)) || []; message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; message.consensusParamUpdates = object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) : undefined; message.appHash = object.appHash ?? new Uint8Array(); return message; } }; function createBaseCommitInfo(): CommitInfo { return { round: 0, votes: [] }; } export const CommitInfo = { encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.round = reader.int32(); break; case 2: message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): CommitInfo { const message = createBaseCommitInfo(); message.round = object.round ?? 0; message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; } }; function createBaseExtendedCommitInfo(): ExtendedCommitInfo { return { round: 0, votes: [] }; } export const ExtendedCommitInfo = { encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.round = reader.int32(); break; case 2: message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ExtendedCommitInfo { const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; return message; } }; function createBaseEvent(): Event { return { type: "", attributes: [] }; } export const Event = { encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } for (const v of message.attributes) { EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Event { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: message.attributes.push(EventAttribute.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Event { const message = createBaseEvent(); message.type = object.type ?? ""; message.attributes = object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; return message; } }; function createBaseEventAttribute(): EventAttribute { return { key: "", value: "", index: false }; } export const EventAttribute = { encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAttribute(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.key = reader.string(); break; case 2: message.value = reader.string(); break; case 3: message.index = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): EventAttribute { const message = createBaseEventAttribute(); message.key = object.key ?? ""; message.value = object.value ?? ""; message.index = object.index ?? false; return message; } }; function createBaseExecTxResult(): ExecTxResult { return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: Long.ZERO, gasUsed: Long.ZERO, events: [], codespace: "" }; } export const ExecTxResult = { encode(message: ExecTxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } if (message.log !== "") { writer.uint32(26).string(message.log); } if (message.info !== "") { writer.uint32(34).string(message.info); } if (!message.gasWanted.isZero()) { writer.uint32(40).int64(message.gasWanted); } if (!message.gasUsed.isZero()) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { Event.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ExecTxResult { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExecTxResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.uint32(); break; case 2: message.data = reader.bytes(); break; case 3: message.log = reader.string(); break; case 4: message.info = reader.string(); break; case 5: message.gasWanted = (reader.int64() as Long); break; case 6: message.gasUsed = (reader.int64() as Long); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); break; case 8: message.codespace = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ExecTxResult { const message = createBaseExecTxResult(); message.code = object.code ?? 0; message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.ZERO; message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.ZERO; message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; return message; } }; function createBaseTxResult(): TxResult { return { height: Long.ZERO, index: 0, tx: new Uint8Array(), result: undefined }; } export const TxResult = { encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { writer.uint32(8).int64(message.height); } if (message.index !== 0) { writer.uint32(16).uint32(message.index); } if (message.tx.length !== 0) { writer.uint32(26).bytes(message.tx); } if (message.result !== undefined) { ExecTxResult.encode(message.result, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = (reader.int64() as Long); break; case 2: message.index = reader.uint32(); break; case 3: message.tx = reader.bytes(); break; case 4: message.result = ExecTxResult.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): TxResult { const message = createBaseTxResult(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.index = object.index ?? 0; message.tx = object.tx ?? new Uint8Array(); message.result = object.result !== undefined && object.result !== null ? ExecTxResult.fromPartial(object.result) : undefined; return message; } }; function createBaseValidator(): Validator { return { address: new Uint8Array(), power: Long.ZERO }; } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } if (!message.power.isZero()) { writer.uint32(24).int64(message.power); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.bytes(); break; case 3: message.power = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; return message; } }; function createBaseValidatorUpdate(): ValidatorUpdate { return { pubKey: undefined, power: Long.ZERO }; } export const ValidatorUpdate = { encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } if (!message.power.isZero()) { writer.uint32(16).int64(message.power); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: message.power = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ValidatorUpdate { const message = createBaseValidatorUpdate(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; return message; } }; function createBaseVoteInfo(): VoteInfo { return { validator: undefined, blockIdFlag: 0 }; } export const VoteInfo = { encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } if (message.blockIdFlag !== 0) { writer.uint32(24).int32(message.blockIdFlag); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVoteInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.validator = Validator.decode(reader, reader.uint32()); break; case 3: message.blockIdFlag = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): VoteInfo { const message = createBaseVoteInfo(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.blockIdFlag = object.blockIdFlag ?? 0; return message; } }; function createBaseExtendedVoteInfo(): ExtendedVoteInfo { return { validator: undefined, voteExtension: new Uint8Array(), extensionSignature: new Uint8Array(), blockIdFlag: 0 }; } export const ExtendedVoteInfo = { encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } if (message.voteExtension.length !== 0) { writer.uint32(26).bytes(message.voteExtension); } if (message.extensionSignature.length !== 0) { writer.uint32(34).bytes(message.extensionSignature); } if (message.blockIdFlag !== 0) { writer.uint32(40).int32(message.blockIdFlag); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedVoteInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.validator = Validator.decode(reader, reader.uint32()); break; case 3: message.voteExtension = reader.bytes(); break; case 4: message.extensionSignature = reader.bytes(); break; case 5: message.blockIdFlag = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ExtendedVoteInfo { const message = createBaseExtendedVoteInfo(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.voteExtension = object.voteExtension ?? new Uint8Array(); message.extensionSignature = object.extensionSignature ?? new Uint8Array(); message.blockIdFlag = object.blockIdFlag ?? 0; return message; } }; function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: undefined, height: Long.ZERO, time: undefined, totalVotingPower: Long.ZERO }; } export const Misbehavior = { encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); } if (!message.height.isZero()) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } if (!message.totalVotingPower.isZero()) { writer.uint32(40).int64(message.totalVotingPower); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = (reader.int32() as any); break; case 2: message.validator = Validator.decode(reader, reader.uint32()); break; case 3: message.height = (reader.int64() as Long); break; case 4: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: message.totalVotingPower = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Misbehavior { const message = createBaseMisbehavior(); message.type = object.type ?? 0; message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.time = object.time ?? undefined; message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? Long.fromValue(object.totalVotingPower) : Long.ZERO; return message; } }; function createBaseSnapshot(): Snapshot { return { height: Long.UZERO, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() }; } export const Snapshot = { encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { writer.uint32(16).uint32(message.format); } if (message.chunks !== 0) { writer.uint32(24).uint32(message.chunks); } if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } if (message.metadata.length !== 0) { writer.uint32(42).bytes(message.metadata); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = (reader.uint64() as Long); break; case 2: message.format = reader.uint32(); break; case 3: message.chunks = reader.uint32(); break; case 4: message.hash = reader.bytes(); break; case 5: message.metadata = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Snapshot { const message = createBaseSnapshot(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; message.hash = object.hash ?? new Uint8Array(); message.metadata = object.metadata ?? new Uint8Array(); return message; } };