import { Timestamp } from "../../google/protobuf/timestamp"; import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum CheckTxType { NEW = 0, RECHECK = 1, UNRECOGNIZED = -1, } export const CheckTxTypeSDKType = CheckTxType; export const CheckTxTypeAmino = 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 const ResponseOfferSnapshot_ResultAmino = 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 const ResponseApplySnapshotChunk_ResultAmino = 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 EvidenceType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } export const EvidenceTypeSDKType = EvidenceType; export const EvidenceTypeAmino = EvidenceType; export function evidenceTypeFromJSON(object: any): EvidenceType { switch (object) { case 0: case "UNKNOWN": return EvidenceType.UNKNOWN; case 1: case "DUPLICATE_VOTE": return EvidenceType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": return EvidenceType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: return EvidenceType.UNRECOGNIZED; } } export function evidenceTypeToJSON(object: EvidenceType): string { switch (object) { case EvidenceType.UNKNOWN: return "UNKNOWN"; case EvidenceType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; case EvidenceType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; case EvidenceType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; setOption?: RequestSetOption; initChain?: RequestInitChain; query?: RequestQuery; beginBlock?: RequestBeginBlock; checkTx?: RequestCheckTx; deliverTx?: RequestDeliverTx; endBlock?: RequestEndBlock; commit?: RequestCommit; listSnapshots?: RequestListSnapshots; offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; } export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; value: Uint8Array; } export interface RequestAmino { echo?: RequestEchoAmino; flush?: RequestFlushAmino; info?: RequestInfoAmino; set_option?: RequestSetOptionAmino; init_chain?: RequestInitChainAmino; query?: RequestQueryAmino; begin_block?: RequestBeginBlockAmino; check_tx?: RequestCheckTxAmino; deliver_tx?: RequestDeliverTxAmino; end_block?: RequestEndBlockAmino; commit?: RequestCommitAmino; list_snapshots?: RequestListSnapshotsAmino; offer_snapshot?: RequestOfferSnapshotAmino; load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; } export interface RequestAminoMsg { type: "/tendermint.abci.Request"; value: RequestAmino; } export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; set_option?: RequestSetOptionSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; begin_block?: RequestBeginBlockSDKType; check_tx?: RequestCheckTxSDKType; deliver_tx?: RequestDeliverTxSDKType; end_block?: RequestEndBlockSDKType; commit?: RequestCommitSDKType; list_snapshots?: RequestListSnapshotsSDKType; offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; } export interface RequestEcho { message: string; } export interface RequestEchoProtoMsg { typeUrl: "/tendermint.abci.RequestEcho"; value: Uint8Array; } export interface RequestEchoAmino { message?: string; } export interface RequestEchoAminoMsg { type: "/tendermint.abci.RequestEcho"; value: RequestEchoAmino; } export interface RequestEchoSDKType { message: string; } export interface RequestFlush {} export interface RequestFlushProtoMsg { typeUrl: "/tendermint.abci.RequestFlush"; value: Uint8Array; } export interface RequestFlushAmino {} export interface RequestFlushAminoMsg { type: "/tendermint.abci.RequestFlush"; value: RequestFlushAmino; } export interface RequestFlushSDKType {} export interface RequestInfo { version: string; blockVersion: bigint; p2pVersion: bigint; } export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; value: Uint8Array; } export interface RequestInfoAmino { version?: string; block_version?: string; p2p_version?: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; value: RequestInfoAmino; } export interface RequestInfoSDKType { version: string; block_version: bigint; p2p_version: bigint; } /** nondeterministic */ export interface RequestSetOption { key: string; value: string; } export interface RequestSetOptionProtoMsg { typeUrl: "/tendermint.abci.RequestSetOption"; value: Uint8Array; } /** nondeterministic */ export interface RequestSetOptionAmino { key?: string; value?: string; } export interface RequestSetOptionAminoMsg { type: "/tendermint.abci.RequestSetOption"; value: RequestSetOptionAmino; } /** nondeterministic */ export interface RequestSetOptionSDKType { key: string; value: string; } export interface RequestInitChain { time: Date; chainId: string; consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; initialHeight: bigint; } export interface RequestInitChainProtoMsg { typeUrl: "/tendermint.abci.RequestInitChain"; value: Uint8Array; } export interface RequestInitChainAmino { time?: string; chain_id?: string; consensus_params?: ConsensusParamsAmino; validators?: ValidatorUpdateAmino[]; app_state_bytes?: string; initial_height?: string; } export interface RequestInitChainAminoMsg { type: "/tendermint.abci.RequestInitChain"; value: RequestInitChainAmino; } export interface RequestInitChainSDKType { time: Date; chain_id: string; consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_state_bytes: Uint8Array; initial_height: bigint; } export interface RequestQuery { data: Uint8Array; path: string; height: bigint; prove: boolean; } export interface RequestQueryProtoMsg { typeUrl: "/tendermint.abci.RequestQuery"; value: Uint8Array; } export interface RequestQueryAmino { data?: string; path?: string; height?: string; prove?: boolean; } export interface RequestQueryAminoMsg { type: "/tendermint.abci.RequestQuery"; value: RequestQueryAmino; } export interface RequestQuerySDKType { data: Uint8Array; path: string; height: bigint; prove: boolean; } export interface RequestBeginBlock { hash: Uint8Array; header: Header; lastCommitInfo: LastCommitInfo; byzantineValidators: Evidence[]; } export interface RequestBeginBlockProtoMsg { typeUrl: "/tendermint.abci.RequestBeginBlock"; value: Uint8Array; } export interface RequestBeginBlockAmino { hash?: string; header?: HeaderAmino; last_commit_info?: LastCommitInfoAmino; byzantine_validators?: EvidenceAmino[]; } export interface RequestBeginBlockAminoMsg { type: "/tendermint.abci.RequestBeginBlock"; value: RequestBeginBlockAmino; } export interface RequestBeginBlockSDKType { hash: Uint8Array; header: HeaderSDKType; last_commit_info: LastCommitInfoSDKType; byzantine_validators: EvidenceSDKType[]; } export interface RequestCheckTx { tx: Uint8Array; type: CheckTxType; } export interface RequestCheckTxProtoMsg { typeUrl: "/tendermint.abci.RequestCheckTx"; value: Uint8Array; } export interface RequestCheckTxAmino { tx?: string; type?: CheckTxType; } export interface RequestCheckTxAminoMsg { type: "/tendermint.abci.RequestCheckTx"; value: RequestCheckTxAmino; } export interface RequestCheckTxSDKType { tx: Uint8Array; type: CheckTxType; } export interface RequestDeliverTx { tx: Uint8Array; } export interface RequestDeliverTxProtoMsg { typeUrl: "/tendermint.abci.RequestDeliverTx"; value: Uint8Array; } export interface RequestDeliverTxAmino { tx?: string; } export interface RequestDeliverTxAminoMsg { type: "/tendermint.abci.RequestDeliverTx"; value: RequestDeliverTxAmino; } export interface RequestDeliverTxSDKType { tx: Uint8Array; } export interface RequestEndBlock { height: bigint; } export interface RequestEndBlockProtoMsg { typeUrl: "/tendermint.abci.RequestEndBlock"; value: Uint8Array; } export interface RequestEndBlockAmino { height?: string; } export interface RequestEndBlockAminoMsg { type: "/tendermint.abci.RequestEndBlock"; value: RequestEndBlockAmino; } export interface RequestEndBlockSDKType { height: bigint; } export interface RequestCommit {} export interface RequestCommitProtoMsg { typeUrl: "/tendermint.abci.RequestCommit"; value: Uint8Array; } export interface RequestCommitAmino {} export interface RequestCommitAminoMsg { type: "/tendermint.abci.RequestCommit"; value: RequestCommitAmino; } export interface RequestCommitSDKType {} /** lists available snapshots */ export interface RequestListSnapshots {} export interface RequestListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.RequestListSnapshots"; value: Uint8Array; } /** lists available snapshots */ export interface RequestListSnapshotsAmino {} export interface RequestListSnapshotsAminoMsg { type: "/tendermint.abci.RequestListSnapshots"; value: RequestListSnapshotsAmino; } /** 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; } export interface RequestOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.RequestOfferSnapshot"; value: Uint8Array; } /** offers a snapshot to the application */ export interface RequestOfferSnapshotAmino { /** snapshot offered by peers */ snapshot?: SnapshotAmino; /** light client-verified app hash for snapshot height */ app_hash?: string; } export interface RequestOfferSnapshotAminoMsg { type: "/tendermint.abci.RequestOfferSnapshot"; value: RequestOfferSnapshotAmino; } /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { snapshot?: SnapshotSDKType; app_hash: Uint8Array; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunk { height: bigint; format: number; chunk: number; } export interface RequestLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk"; value: Uint8Array; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkAmino { height?: string; format?: number; chunk?: number; } export interface RequestLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.RequestLoadSnapshotChunk"; value: RequestLoadSnapshotChunkAmino; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkSDKType { height: bigint; format: number; chunk: number; } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunk { index: number; chunk: Uint8Array; sender: string; } export interface RequestApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk"; value: Uint8Array; } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkAmino { index?: number; chunk?: string; sender?: string; } export interface RequestApplySnapshotChunkAminoMsg { type: "/tendermint.abci.RequestApplySnapshotChunk"; value: RequestApplySnapshotChunkAmino; } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkSDKType { index: number; chunk: Uint8Array; sender: string; } export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; setOption?: ResponseSetOption; initChain?: ResponseInitChain; query?: ResponseQuery; beginBlock?: ResponseBeginBlock; checkTx?: ResponseCheckTx; deliverTx?: ResponseDeliverTx; endBlock?: ResponseEndBlock; commit?: ResponseCommit; listSnapshots?: ResponseListSnapshots; offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; } export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; value: Uint8Array; } export interface ResponseAmino { exception?: ResponseExceptionAmino; echo?: ResponseEchoAmino; flush?: ResponseFlushAmino; info?: ResponseInfoAmino; set_option?: ResponseSetOptionAmino; init_chain?: ResponseInitChainAmino; query?: ResponseQueryAmino; begin_block?: ResponseBeginBlockAmino; check_tx?: ResponseCheckTxAmino; deliver_tx?: ResponseDeliverTxAmino; end_block?: ResponseEndBlockAmino; commit?: ResponseCommitAmino; list_snapshots?: ResponseListSnapshotsAmino; offer_snapshot?: ResponseOfferSnapshotAmino; load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; } export interface ResponseAminoMsg { type: "/tendermint.abci.Response"; value: ResponseAmino; } export interface ResponseSDKType { exception?: ResponseExceptionSDKType; echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; set_option?: ResponseSetOptionSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; begin_block?: ResponseBeginBlockSDKType; check_tx?: ResponseCheckTxSDKType; deliver_tx?: ResponseDeliverTxSDKType; end_block?: ResponseEndBlockSDKType; commit?: ResponseCommitSDKType; list_snapshots?: ResponseListSnapshotsSDKType; offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; } /** nondeterministic */ export interface ResponseException { error: string; } export interface ResponseExceptionProtoMsg { typeUrl: "/tendermint.abci.ResponseException"; value: Uint8Array; } /** nondeterministic */ export interface ResponseExceptionAmino { error?: string; } export interface ResponseExceptionAminoMsg { type: "/tendermint.abci.ResponseException"; value: ResponseExceptionAmino; } /** nondeterministic */ export interface ResponseExceptionSDKType { error: string; } export interface ResponseEcho { message: string; } export interface ResponseEchoProtoMsg { typeUrl: "/tendermint.abci.ResponseEcho"; value: Uint8Array; } export interface ResponseEchoAmino { message?: string; } export interface ResponseEchoAminoMsg { type: "/tendermint.abci.ResponseEcho"; value: ResponseEchoAmino; } export interface ResponseEchoSDKType { message: string; } export interface ResponseFlush {} export interface ResponseFlushProtoMsg { typeUrl: "/tendermint.abci.ResponseFlush"; value: Uint8Array; } export interface ResponseFlushAmino {} export interface ResponseFlushAminoMsg { type: "/tendermint.abci.ResponseFlush"; value: ResponseFlushAmino; } export interface ResponseFlushSDKType {} export interface ResponseInfo { data: string; version: string; appVersion: bigint; lastBlockHeight: bigint; lastBlockAppHash: Uint8Array; } export interface ResponseInfoProtoMsg { typeUrl: "/tendermint.abci.ResponseInfo"; value: Uint8Array; } export interface ResponseInfoAmino { data?: string; version?: string; app_version?: string; last_block_height?: string; last_block_app_hash?: string; } export interface ResponseInfoAminoMsg { type: "/tendermint.abci.ResponseInfo"; value: ResponseInfoAmino; } export interface ResponseInfoSDKType { data: string; version: string; app_version: bigint; last_block_height: bigint; last_block_app_hash: Uint8Array; } /** nondeterministic */ export interface ResponseSetOption { code: number; /** bytes data = 2; */ log: string; info: string; } export interface ResponseSetOptionProtoMsg { typeUrl: "/tendermint.abci.ResponseSetOption"; value: Uint8Array; } /** nondeterministic */ export interface ResponseSetOptionAmino { code?: number; /** bytes data = 2; */ log?: string; info?: string; } export interface ResponseSetOptionAminoMsg { type: "/tendermint.abci.ResponseSetOption"; value: ResponseSetOptionAmino; } /** nondeterministic */ export interface ResponseSetOptionSDKType { code: number; log: string; info: string; } export interface ResponseInitChain { consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appHash: Uint8Array; } export interface ResponseInitChainProtoMsg { typeUrl: "/tendermint.abci.ResponseInitChain"; value: Uint8Array; } export interface ResponseInitChainAmino { consensus_params?: ConsensusParamsAmino; validators?: ValidatorUpdateAmino[]; app_hash?: string; } export interface ResponseInitChainAminoMsg { type: "/tendermint.abci.ResponseInitChain"; value: ResponseInitChainAmino; } 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: bigint; key: Uint8Array; value: Uint8Array; proofOps?: ProofOps; height: bigint; codespace: string; } export interface ResponseQueryProtoMsg { typeUrl: "/tendermint.abci.ResponseQuery"; value: Uint8Array; } export interface ResponseQueryAmino { code?: number; /** bytes data = 2; // use "value" instead. */ log?: string; /** nondeterministic */ info?: string; index?: string; key?: string; value?: string; proof_ops?: ProofOpsAmino; height?: string; codespace?: string; } export interface ResponseQueryAminoMsg { type: "/tendermint.abci.ResponseQuery"; value: ResponseQueryAmino; } export interface ResponseQuerySDKType { code: number; log: string; info: string; index: bigint; key: Uint8Array; value: Uint8Array; proof_ops?: ProofOpsSDKType; height: bigint; codespace: string; } export interface ResponseBeginBlock { events: Event[]; } export interface ResponseBeginBlockProtoMsg { typeUrl: "/tendermint.abci.ResponseBeginBlock"; value: Uint8Array; } export interface ResponseBeginBlockAmino { events?: EventAmino[]; } export interface ResponseBeginBlockAminoMsg { type: "/tendermint.abci.ResponseBeginBlock"; value: ResponseBeginBlockAmino; } export interface ResponseBeginBlockSDKType { events: EventSDKType[]; } export interface ResponseCheckTx { code: number; data: Uint8Array; /** nondeterministic */ log: string; /** nondeterministic */ info: string; gasWanted: bigint; gasUsed: bigint; events: Event[]; codespace: string; } export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; value: Uint8Array; } export interface ResponseCheckTxAmino { code?: number; data?: string; /** nondeterministic */ log?: string; /** nondeterministic */ info?: string; gas_wanted?: string; gas_used?: string; events?: EventAmino[]; codespace?: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; value: ResponseCheckTxAmino; } export interface ResponseCheckTxSDKType { code: number; data: Uint8Array; log: string; info: string; gas_wanted: bigint; gas_used: bigint; events: EventSDKType[]; codespace: string; } export interface ResponseDeliverTx { code: number; data: Uint8Array; /** nondeterministic */ log: string; /** nondeterministic */ info: string; gasWanted: bigint; gasUsed: bigint; events: Event[]; codespace: string; } export interface ResponseDeliverTxProtoMsg { typeUrl: "/tendermint.abci.ResponseDeliverTx"; value: Uint8Array; } export interface ResponseDeliverTxAmino { code?: number; data?: string; /** nondeterministic */ log?: string; /** nondeterministic */ info?: string; gas_wanted?: string; gas_used?: string; events?: EventAmino[]; codespace?: string; } export interface ResponseDeliverTxAminoMsg { type: "/tendermint.abci.ResponseDeliverTx"; value: ResponseDeliverTxAmino; } export interface ResponseDeliverTxSDKType { code: number; data: Uint8Array; log: string; info: string; gas_wanted: bigint; gas_used: bigint; events: EventSDKType[]; codespace: string; } export interface ResponseEndBlock { validatorUpdates: ValidatorUpdate[]; consensusParamUpdates?: ConsensusParams; events: Event[]; } export interface ResponseEndBlockProtoMsg { typeUrl: "/tendermint.abci.ResponseEndBlock"; value: Uint8Array; } export interface ResponseEndBlockAmino { validator_updates?: ValidatorUpdateAmino[]; consensus_param_updates?: ConsensusParamsAmino; events?: EventAmino[]; } export interface ResponseEndBlockAminoMsg { type: "/tendermint.abci.ResponseEndBlock"; value: ResponseEndBlockAmino; } export interface ResponseEndBlockSDKType { validator_updates: ValidatorUpdateSDKType[]; consensus_param_updates?: ConsensusParamsSDKType; events: EventSDKType[]; } export interface ResponseCommit { /** reserve 1 */ data: Uint8Array; retainHeight: bigint; } export interface ResponseCommitProtoMsg { typeUrl: "/tendermint.abci.ResponseCommit"; value: Uint8Array; } export interface ResponseCommitAmino { /** reserve 1 */ data?: string; retain_height?: string; } export interface ResponseCommitAminoMsg { type: "/tendermint.abci.ResponseCommit"; value: ResponseCommitAmino; } export interface ResponseCommitSDKType { data: Uint8Array; retain_height: bigint; } export interface ResponseListSnapshots { snapshots: Snapshot[]; } export interface ResponseListSnapshotsProtoMsg { typeUrl: "/tendermint.abci.ResponseListSnapshots"; value: Uint8Array; } export interface ResponseListSnapshotsAmino { snapshots?: SnapshotAmino[]; } export interface ResponseListSnapshotsAminoMsg { type: "/tendermint.abci.ResponseListSnapshots"; value: ResponseListSnapshotsAmino; } export interface ResponseListSnapshotsSDKType { snapshots: SnapshotSDKType[]; } export interface ResponseOfferSnapshot { result: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotProtoMsg { typeUrl: "/tendermint.abci.ResponseOfferSnapshot"; value: Uint8Array; } export interface ResponseOfferSnapshotAmino { result?: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotAminoMsg { type: "/tendermint.abci.ResponseOfferSnapshot"; value: ResponseOfferSnapshotAmino; } export interface ResponseOfferSnapshotSDKType { result: ResponseOfferSnapshot_Result; } export interface ResponseLoadSnapshotChunk { chunk: Uint8Array; } export interface ResponseLoadSnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk"; value: Uint8Array; } export interface ResponseLoadSnapshotChunkAmino { chunk?: string; } export interface ResponseLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseLoadSnapshotChunk"; value: ResponseLoadSnapshotChunkAmino; } 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 ResponseApplySnapshotChunkProtoMsg { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk"; value: Uint8Array; } export interface ResponseApplySnapshotChunkAmino { result?: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ refetch_chunks?: number[]; /** Chunk senders to reject and ban */ reject_senders?: string[]; } export interface ResponseApplySnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseApplySnapshotChunk"; value: ResponseApplySnapshotChunkAmino; } export interface ResponseApplySnapshotChunkSDKType { result: ResponseApplySnapshotChunk_Result; refetch_chunks: number[]; reject_senders: string[]; } /** * ConsensusParams contains all consensus-relevant parameters * that can be adjusted by the abci app */ export interface ConsensusParams { block?: BlockParams; evidence?: EvidenceParams; validator?: ValidatorParams; version?: VersionParams; } export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.abci.ConsensusParams"; value: Uint8Array; } /** * ConsensusParams contains all consensus-relevant parameters * that can be adjusted by the abci app */ export interface ConsensusParamsAmino { block?: BlockParamsAmino; evidence?: EvidenceParamsAmino; validator?: ValidatorParamsAmino; version?: VersionParamsAmino; } export interface ConsensusParamsAminoMsg { type: "/tendermint.abci.ConsensusParams"; value: ConsensusParamsAmino; } /** * ConsensusParams contains all consensus-relevant parameters * that can be adjusted by the abci app */ export interface ConsensusParamsSDKType { block?: BlockParamsSDKType; evidence?: EvidenceParamsSDKType; validator?: ValidatorParamsSDKType; version?: VersionParamsSDKType; } /** BlockParams contains limits on the block size. */ export interface BlockParams { /** Note: must be greater than 0 */ maxBytes: bigint; /** Note: must be greater or equal to -1 */ maxGas: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.abci.BlockParams"; value: Uint8Array; } /** BlockParams contains limits on the block size. */ export interface BlockParamsAmino { /** Note: must be greater than 0 */ max_bytes?: string; /** Note: must be greater or equal to -1 */ max_gas?: string; } export interface BlockParamsAminoMsg { type: "/tendermint.abci.BlockParams"; value: BlockParamsAmino; } /** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; } export interface LastCommitInfo { round: number; votes: VoteInfo[]; } export interface LastCommitInfoProtoMsg { typeUrl: "/tendermint.abci.LastCommitInfo"; value: Uint8Array; } export interface LastCommitInfoAmino { round?: number; votes?: VoteInfoAmino[]; } export interface LastCommitInfoAminoMsg { type: "/tendermint.abci.LastCommitInfo"; value: LastCommitInfoAmino; } export interface LastCommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; } /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. * Later, transactions may be queried using these events. */ export interface Event { type: string; attributes: EventAttribute[]; } export interface EventProtoMsg { typeUrl: "/tendermint.abci.Event"; value: Uint8Array; } /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. * Later, transactions may be queried using these events. */ export interface EventAmino { type?: string; attributes?: EventAttributeAmino[]; } export interface EventAminoMsg { type: "/tendermint.abci.Event"; value: EventAmino; } /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. * 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: Uint8Array; value: Uint8Array; /** nondeterministic */ index: boolean; } export interface EventAttributeProtoMsg { typeUrl: "/tendermint.abci.EventAttribute"; value: Uint8Array; } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeAmino { key?: string; value?: string; /** nondeterministic */ index?: boolean; } export interface EventAttributeAminoMsg { type: "/tendermint.abci.EventAttribute"; value: EventAttributeAmino; } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { key: Uint8Array; value: Uint8Array; index: boolean; } /** * TxResult contains results of executing the transaction. * * One usage is indexing transaction results. */ export interface TxResult { height: bigint; index: number; tx: Uint8Array; result: ResponseDeliverTx; } export interface TxResultProtoMsg { typeUrl: "/tendermint.abci.TxResult"; value: Uint8Array; } /** * TxResult contains results of executing the transaction. * * One usage is indexing transaction results. */ export interface TxResultAmino { height?: string; index?: number; tx?: string; result?: ResponseDeliverTxAmino; } export interface TxResultAminoMsg { type: "/tendermint.abci.TxResult"; value: TxResultAmino; } /** * TxResult contains results of executing the transaction. * * One usage is indexing transaction results. */ export interface TxResultSDKType { height: bigint; index: number; tx: Uint8Array; result: ResponseDeliverTxSDKType; } /** Validator */ export interface Validator { /** * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ address: Uint8Array; /** The voting power */ power: bigint; } export interface ValidatorProtoMsg { typeUrl: "/tendermint.abci.Validator"; value: Uint8Array; } /** Validator */ export interface ValidatorAmino { /** * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ address?: string; /** The voting power */ power?: string; } export interface ValidatorAminoMsg { type: "/tendermint.abci.Validator"; value: ValidatorAmino; } /** Validator */ export interface ValidatorSDKType { address: Uint8Array; power: bigint; } /** ValidatorUpdate */ export interface ValidatorUpdate { pubKey: PublicKey; power: bigint; } export interface ValidatorUpdateProtoMsg { typeUrl: "/tendermint.abci.ValidatorUpdate"; value: Uint8Array; } /** ValidatorUpdate */ export interface ValidatorUpdateAmino { pub_key?: PublicKeyAmino; power?: string; } export interface ValidatorUpdateAminoMsg { type: "/tendermint.abci.ValidatorUpdate"; value: ValidatorUpdateAmino; } /** ValidatorUpdate */ export interface ValidatorUpdateSDKType { pub_key: PublicKeySDKType; power: bigint; } /** VoteInfo */ export interface VoteInfo { validator: Validator; signedLastBlock: boolean; } export interface VoteInfoProtoMsg { typeUrl: "/tendermint.abci.VoteInfo"; value: Uint8Array; } /** VoteInfo */ export interface VoteInfoAmino { validator?: ValidatorAmino; signed_last_block?: boolean; } export interface VoteInfoAminoMsg { type: "/tendermint.abci.VoteInfo"; value: VoteInfoAmino; } /** VoteInfo */ export interface VoteInfoSDKType { validator: ValidatorSDKType; signed_last_block: boolean; } export interface Evidence { type: EvidenceType; /** The offending validator */ validator: Validator; /** The height when the offense occurred */ height: bigint; /** 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: bigint; } export interface EvidenceProtoMsg { typeUrl: "/tendermint.abci.Evidence"; value: Uint8Array; } export interface EvidenceAmino { type?: EvidenceType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ height?: string; /** The corresponding time where the offense occurred */ time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ total_voting_power?: string; } export interface EvidenceAminoMsg { type: "/tendermint.abci.Evidence"; value: EvidenceAmino; } export interface EvidenceSDKType { type: EvidenceType; validator: ValidatorSDKType; height: bigint; time: Date; total_voting_power: bigint; } export interface Snapshot { /** The height at which the snapshot was taken */ height: bigint; /** 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 SnapshotProtoMsg { typeUrl: "/tendermint.abci.Snapshot"; value: Uint8Array; } export interface SnapshotAmino { /** The height at which the snapshot was taken */ height?: string; /** The application-specific snapshot format */ format?: number; /** Number of chunks in the snapshot */ chunks?: number; /** Arbitrary snapshot hash, equal only if identical */ hash?: string; /** Arbitrary application metadata */ metadata?: string; } export interface SnapshotAminoMsg { type: "/tendermint.abci.Snapshot"; value: SnapshotAmino; } export interface SnapshotSDKType { height: bigint; format: number; chunks: number; hash: Uint8Array; metadata: Uint8Array; } function createBaseRequest(): Request { return { echo: undefined, flush: undefined, info: undefined, setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, checkTx: undefined, deliverTx: undefined, endBlock: undefined, commit: undefined, listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined }; } export const Request = { typeUrl: "/tendermint.abci.Request", encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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.setOption !== undefined) { RequestSetOption.encode(message.setOption, writer.uint32(34).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.beginBlock !== undefined) { RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); } if (message.checkTx !== undefined) { RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); } if (message.deliverTx !== undefined) { RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); } if (message.endBlock !== undefined) { RequestEndBlock.encode(message.endBlock, writer.uint32(82).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(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Request { const reader = input instanceof BinaryReader ? input : new BinaryReader(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 4: message.setOption = RequestSetOption.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 7: message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); break; case 8: message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); break; case 9: message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); break; case 10: message.endBlock = RequestEndBlock.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; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): 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.setOption = object.setOption !== undefined && object.setOption !== null ? RequestSetOption.fromPartial(object.setOption) : 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.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? RequestBeginBlock.fromPartial(object.beginBlock) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : undefined; message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? RequestDeliverTx.fromPartial(object.deliverTx) : undefined; message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? RequestEndBlock.fromPartial(object.endBlock) : 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; return message; }, fromAmino(object: RequestAmino): Request { const message = createBaseRequest(); if (object.echo !== undefined && object.echo !== null) { message.echo = RequestEcho.fromAmino(object.echo); } if (object.flush !== undefined && object.flush !== null) { message.flush = RequestFlush.fromAmino(object.flush); } if (object.info !== undefined && object.info !== null) { message.info = RequestInfo.fromAmino(object.info); } if (object.set_option !== undefined && object.set_option !== null) { message.setOption = RequestSetOption.fromAmino(object.set_option); } if (object.init_chain !== undefined && object.init_chain !== null) { message.initChain = RequestInitChain.fromAmino(object.init_chain); } if (object.query !== undefined && object.query !== null) { message.query = RequestQuery.fromAmino(object.query); } if (object.begin_block !== undefined && object.begin_block !== null) { message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); } if (object.check_tx !== undefined && object.check_tx !== null) { message.checkTx = RequestCheckTx.fromAmino(object.check_tx); } if (object.deliver_tx !== undefined && object.deliver_tx !== null) { message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); } if (object.end_block !== undefined && object.end_block !== null) { message.endBlock = RequestEndBlock.fromAmino(object.end_block); } if (object.commit !== undefined && object.commit !== null) { message.commit = RequestCommit.fromAmino(object.commit); } if (object.list_snapshots !== undefined && object.list_snapshots !== null) { message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); } if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); } if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); } if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); } return message; }, toAmino(message: Request): RequestAmino { const obj: any = {}; obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; obj.check_tx = message.checkTx ? RequestCheckTx.toAmino(message.checkTx) : undefined; obj.deliver_tx = message.deliverTx ? RequestDeliverTx.toAmino(message.deliverTx) : undefined; obj.end_block = message.endBlock ? RequestEndBlock.toAmino(message.endBlock) : undefined; obj.commit = message.commit ? RequestCommit.toAmino(message.commit) : undefined; obj.list_snapshots = message.listSnapshots ? RequestListSnapshots.toAmino(message.listSnapshots) : undefined; obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; return obj; }, fromAminoMsg(object: RequestAminoMsg): Request { return Request.fromAmino(object.value); }, fromProtoMsg(message: RequestProtoMsg): Request { return Request.decode(message.value); }, toProto(message: Request): Uint8Array { return Request.encode(message).finish(); }, toProtoMsg(message: Request): RequestProtoMsg { return { typeUrl: "/tendermint.abci.Request", value: Request.encode(message).finish() }; } }; function createBaseRequestEcho(): RequestEcho { return { message: "" }; } export const RequestEcho = { typeUrl: "/tendermint.abci.RequestEcho", encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): RequestEcho { const message = createBaseRequestEcho(); message.message = object.message ?? ""; return message; }, fromAmino(object: RequestEchoAmino): RequestEcho { const message = createBaseRequestEcho(); if (object.message !== undefined && object.message !== null) { message.message = object.message; } return message; }, toAmino(message: RequestEcho): RequestEchoAmino { const obj: any = {}; obj.message = message.message; return obj; }, fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { return RequestEcho.fromAmino(object.value); }, fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { return RequestEcho.decode(message.value); }, toProto(message: RequestEcho): Uint8Array { return RequestEcho.encode(message).finish(); }, toProtoMsg(message: RequestEcho): RequestEchoProtoMsg { return { typeUrl: "/tendermint.abci.RequestEcho", value: RequestEcho.encode(message).finish() }; } }; function createBaseRequestFlush(): RequestFlush { return {}; } export const RequestFlush = { typeUrl: "/tendermint.abci.RequestFlush", encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(_: Partial): RequestFlush { const message = createBaseRequestFlush(); return message; }, fromAmino(_: RequestFlushAmino): RequestFlush { const message = createBaseRequestFlush(); return message; }, toAmino(_: RequestFlush): RequestFlushAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { return RequestFlush.fromAmino(object.value); }, fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { return RequestFlush.decode(message.value); }, toProto(message: RequestFlush): Uint8Array { return RequestFlush.encode(message).finish(); }, toProtoMsg(message: RequestFlush): RequestFlushProtoMsg { return { typeUrl: "/tendermint.abci.RequestFlush", value: RequestFlush.encode(message).finish() }; } }; function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: BigInt(0), p2pVersion: BigInt(0) }; } export const RequestInfo = { typeUrl: "/tendermint.abci.RequestInfo", encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); } if (message.blockVersion !== BigInt(0)) { writer.uint32(16).uint64(message.blockVersion); } if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; case 3: message.p2pVersion = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestInfo { const message = createBaseRequestInfo(); message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { const message = createBaseRequestInfo(); if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.block_version !== undefined && object.block_version !== null) { message.blockVersion = BigInt(object.block_version); } if (object.p2p_version !== undefined && object.p2p_version !== null) { message.p2pVersion = BigInt(object.p2p_version); } return message; }, toAmino(message: RequestInfo): RequestInfoAmino { const obj: any = {}; obj.version = message.version; obj.block_version = message.blockVersion ? message.blockVersion.toString() : undefined; obj.p2p_version = message.p2pVersion ? message.p2pVersion.toString() : undefined; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { return RequestInfo.fromAmino(object.value); }, fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { return RequestInfo.decode(message.value); }, toProto(message: RequestInfo): Uint8Array { return RequestInfo.encode(message).finish(); }, toProtoMsg(message: RequestInfo): RequestInfoProtoMsg { return { typeUrl: "/tendermint.abci.RequestInfo", value: RequestInfo.encode(message).finish() }; } }; function createBaseRequestSetOption(): RequestSetOption { return { key: "", value: "" }; } export const RequestSetOption = { typeUrl: "/tendermint.abci.RequestSetOption", encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestSetOption(); 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; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestSetOption { const message = createBaseRequestSetOption(); message.key = object.key ?? ""; message.value = object.value ?? ""; return message; }, fromAmino(object: RequestSetOptionAmino): RequestSetOption { const message = createBaseRequestSetOption(); if (object.key !== undefined && object.key !== null) { message.key = object.key; } if (object.value !== undefined && object.value !== null) { message.value = object.value; } return message; }, toAmino(message: RequestSetOption): RequestSetOptionAmino { const obj: any = {}; obj.key = message.key; obj.value = message.value; return obj; }, fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { return RequestSetOption.fromAmino(object.value); }, fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { return RequestSetOption.decode(message.value); }, toProto(message: RequestSetOption): Uint8Array { return RequestSetOption.encode(message).finish(); }, toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { return { typeUrl: "/tendermint.abci.RequestSetOption", value: RequestSetOption.encode(message).finish() }; } }; function createBaseRequestInitChain(): RequestInitChain { return { time: new Date(), chainId: "", consensusParams: undefined, validators: [], appStateBytes: new Uint8Array(), initialHeight: BigInt(0) }; } export const RequestInitChain = { typeUrl: "/tendermint.abci.RequestInitChain", encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { writer.uint32(48).int64(message.initialHeight); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): 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 ? BigInt(object.initialHeight.toString()) : BigInt(0); return message; }, fromAmino(object: RequestInitChainAmino): RequestInitChain { const message = createBaseRequestInitChain(); if (object.time !== undefined && object.time !== null) { message.time = fromTimestamp(Timestamp.fromAmino(object.time)); } if (object.chain_id !== undefined && object.chain_id !== null) { message.chainId = object.chain_id; } if (object.consensus_params !== undefined && object.consensus_params !== null) { message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); } message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { message.appStateBytes = bytesFromBase64(object.app_state_bytes); } if (object.initial_height !== undefined && object.initial_height !== null) { message.initialHeight = BigInt(object.initial_height); } return message; }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { obj.validators = []; } obj.app_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; obj.initial_height = message.initialHeight ? message.initialHeight.toString() : undefined; return obj; }, fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { return RequestInitChain.fromAmino(object.value); }, fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { return RequestInitChain.decode(message.value); }, toProto(message: RequestInitChain): Uint8Array { return RequestInitChain.encode(message).finish(); }, toProtoMsg(message: RequestInitChain): RequestInitChainProtoMsg { return { typeUrl: "/tendermint.abci.RequestInitChain", value: RequestInitChain.encode(message).finish() }; } }; function createBaseRequestQuery(): RequestQuery { return { data: new Uint8Array(), path: "", height: BigInt(0), prove: false }; } export const RequestQuery = { typeUrl: "/tendermint.abci.RequestQuery", encode(message: RequestQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { writer.uint32(32).bool(message.prove); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestQuery { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; case 4: message.prove = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestQuery { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.prove = object.prove ?? false; return message; }, fromAmino(object: RequestQueryAmino): RequestQuery { const message = createBaseRequestQuery(); if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } if (object.path !== undefined && object.path !== null) { message.path = object.path; } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.prove !== undefined && object.prove !== null) { message.prove = object.prove; } return message; }, toAmino(message: RequestQuery): RequestQueryAmino { const obj: any = {}; obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.path = message.path; obj.height = message.height ? message.height.toString() : undefined; obj.prove = message.prove; return obj; }, fromAminoMsg(object: RequestQueryAminoMsg): RequestQuery { return RequestQuery.fromAmino(object.value); }, fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { return RequestQuery.decode(message.value); }, toProto(message: RequestQuery): Uint8Array { return RequestQuery.encode(message).finish(); }, toProtoMsg(message: RequestQuery): RequestQueryProtoMsg { return { typeUrl: "/tendermint.abci.RequestQuery", value: RequestQuery.encode(message).finish() }; } }; function createBaseRequestBeginBlock(): RequestBeginBlock { return { hash: new Uint8Array(), header: Header.fromPartial({}), lastCommitInfo: LastCommitInfo.fromPartial({}), byzantineValidators: [] }; } export const RequestBeginBlock = { typeUrl: "/tendermint.abci.RequestBeginBlock", encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(18).fork()).ldelim(); } if (message.lastCommitInfo !== undefined) { LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); } for (const v of message.byzantineValidators) { Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestBeginBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.hash = reader.bytes(); break; case 2: message.header = Header.decode(reader, reader.uint32()); break; case 3: message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); break; case 4: message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestBeginBlock { const message = createBaseRequestBeginBlock(); message.hash = object.hash ?? new Uint8Array(); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? LastCommitInfo.fromPartial(object.lastCommitInfo) : undefined; message.byzantineValidators = object.byzantineValidators?.map(e => Evidence.fromPartial(e)) || []; return message; }, fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { const message = createBaseRequestBeginBlock(); if (object.hash !== undefined && object.hash !== null) { message.hash = bytesFromBase64(object.hash); } if (object.header !== undefined && object.header !== null) { message.header = Header.fromAmino(object.header); } if (object.last_commit_info !== undefined && object.last_commit_info !== null) { message.lastCommitInfo = LastCommitInfo.fromAmino(object.last_commit_info); } message.byzantineValidators = object.byzantine_validators?.map(e => Evidence.fromAmino(e)) || []; return message; }, toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { const obj: any = {}; obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; if (message.byzantineValidators) { obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); } else { obj.byzantine_validators = []; } return obj; }, fromAminoMsg(object: RequestBeginBlockAminoMsg): RequestBeginBlock { return RequestBeginBlock.fromAmino(object.value); }, fromProtoMsg(message: RequestBeginBlockProtoMsg): RequestBeginBlock { return RequestBeginBlock.decode(message.value); }, toProto(message: RequestBeginBlock): Uint8Array { return RequestBeginBlock.encode(message).finish(); }, toProtoMsg(message: RequestBeginBlock): RequestBeginBlockProtoMsg { return { typeUrl: "/tendermint.abci.RequestBeginBlock", value: RequestBeginBlock.encode(message).finish() }; } }; function createBaseRequestCheckTx(): RequestCheckTx { return { tx: new Uint8Array(), type: 0 }; } export const RequestCheckTx = { typeUrl: "/tendermint.abci.RequestCheckTx", encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): RequestCheckTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): RequestCheckTx { const message = createBaseRequestCheckTx(); message.tx = object.tx ?? new Uint8Array(); message.type = object.type ?? 0; return message; }, fromAmino(object: RequestCheckTxAmino): RequestCheckTx { const message = createBaseRequestCheckTx(); if (object.tx !== undefined && object.tx !== null) { message.tx = bytesFromBase64(object.tx); } if (object.type !== undefined && object.type !== null) { message.type = checkTxTypeFromJSON(object.type); } return message; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { const obj: any = {}; obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; obj.type = checkTxTypeToJSON(message.type); return obj; }, fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { return RequestCheckTx.fromAmino(object.value); }, fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { return RequestCheckTx.decode(message.value); }, toProto(message: RequestCheckTx): Uint8Array { return RequestCheckTx.encode(message).finish(); }, toProtoMsg(message: RequestCheckTx): RequestCheckTxProtoMsg { return { typeUrl: "/tendermint.abci.RequestCheckTx", value: RequestCheckTx.encode(message).finish() }; } }; function createBaseRequestDeliverTx(): RequestDeliverTx { return { tx: new Uint8Array() }; } export const RequestDeliverTx = { typeUrl: "/tendermint.abci.RequestDeliverTx", encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestDeliverTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.tx = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestDeliverTx { const message = createBaseRequestDeliverTx(); message.tx = object.tx ?? new Uint8Array(); return message; }, fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { const message = createBaseRequestDeliverTx(); if (object.tx !== undefined && object.tx !== null) { message.tx = bytesFromBase64(object.tx); } return message; }, toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { const obj: any = {}; obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; return obj; }, fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { return RequestDeliverTx.fromAmino(object.value); }, fromProtoMsg(message: RequestDeliverTxProtoMsg): RequestDeliverTx { return RequestDeliverTx.decode(message.value); }, toProto(message: RequestDeliverTx): Uint8Array { return RequestDeliverTx.encode(message).finish(); }, toProtoMsg(message: RequestDeliverTx): RequestDeliverTxProtoMsg { return { typeUrl: "/tendermint.abci.RequestDeliverTx", value: RequestDeliverTx.encode(message).finish() }; } }; function createBaseRequestEndBlock(): RequestEndBlock { return { height: BigInt(0) }; } export const RequestEndBlock = { typeUrl: "/tendermint.abci.RequestEndBlock", encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): RequestEndBlock { const message = createBaseRequestEndBlock(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: RequestEndBlockAmino): RequestEndBlock { const message = createBaseRequestEndBlock(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } return message; }, toAmino(message: RequestEndBlock): RequestEndBlockAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { return RequestEndBlock.fromAmino(object.value); }, fromProtoMsg(message: RequestEndBlockProtoMsg): RequestEndBlock { return RequestEndBlock.decode(message.value); }, toProto(message: RequestEndBlock): Uint8Array { return RequestEndBlock.encode(message).finish(); }, toProtoMsg(message: RequestEndBlock): RequestEndBlockProtoMsg { return { typeUrl: "/tendermint.abci.RequestEndBlock", value: RequestEndBlock.encode(message).finish() }; } }; function createBaseRequestCommit(): RequestCommit { return {}; } export const RequestCommit = { typeUrl: "/tendermint.abci.RequestCommit", encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(_: Partial): RequestCommit { const message = createBaseRequestCommit(); return message; }, fromAmino(_: RequestCommitAmino): RequestCommit { const message = createBaseRequestCommit(); return message; }, toAmino(_: RequestCommit): RequestCommitAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { return RequestCommit.fromAmino(object.value); }, fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { return RequestCommit.decode(message.value); }, toProto(message: RequestCommit): Uint8Array { return RequestCommit.encode(message).finish(); }, toProtoMsg(message: RequestCommit): RequestCommitProtoMsg { return { typeUrl: "/tendermint.abci.RequestCommit", value: RequestCommit.encode(message).finish() }; } }; function createBaseRequestListSnapshots(): RequestListSnapshots { return {}; } export const RequestListSnapshots = { typeUrl: "/tendermint.abci.RequestListSnapshots", encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(_: Partial): RequestListSnapshots { const message = createBaseRequestListSnapshots(); return message; }, fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { const message = createBaseRequestListSnapshots(); return message; }, toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { return RequestListSnapshots.fromAmino(object.value); }, fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { return RequestListSnapshots.decode(message.value); }, toProto(message: RequestListSnapshots): Uint8Array { return RequestListSnapshots.encode(message).finish(); }, toProtoMsg(message: RequestListSnapshots): RequestListSnapshotsProtoMsg { return { typeUrl: "/tendermint.abci.RequestListSnapshots", value: RequestListSnapshots.encode(message).finish() }; } }; function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { return { snapshot: undefined, appHash: new Uint8Array() }; } export const RequestOfferSnapshot = { typeUrl: "/tendermint.abci.RequestOfferSnapshot", encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): 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; }, fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { const message = createBaseRequestOfferSnapshot(); if (object.snapshot !== undefined && object.snapshot !== null) { message.snapshot = Snapshot.fromAmino(object.snapshot); } if (object.app_hash !== undefined && object.app_hash !== null) { message.appHash = bytesFromBase64(object.app_hash); } return message; }, toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { const obj: any = {}; obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { return RequestOfferSnapshot.fromAmino(object.value); }, fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { return RequestOfferSnapshot.decode(message.value); }, toProto(message: RequestOfferSnapshot): Uint8Array { return RequestOfferSnapshot.encode(message).finish(); }, toProtoMsg(message: RequestOfferSnapshot): RequestOfferSnapshotProtoMsg { return { typeUrl: "/tendermint.abci.RequestOfferSnapshot", value: RequestOfferSnapshot.encode(message).finish() }; } }; function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { return { height: BigInt(0), format: 0, chunk: 0 }; } export const RequestLoadSnapshotChunk = { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", encode(message: RequestLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { 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: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); 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: Partial): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.format = object.format ?? 0; message.chunk = object.chunk ?? 0; return message; }, fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.format !== undefined && object.format !== null) { message.format = object.format; } if (object.chunk !== undefined && object.chunk !== null) { message.chunk = object.chunk; } return message; }, toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.format = message.format; obj.chunk = message.chunk; return obj; }, fromAminoMsg(object: RequestLoadSnapshotChunkAminoMsg): RequestLoadSnapshotChunk { return RequestLoadSnapshotChunk.fromAmino(object.value); }, fromProtoMsg(message: RequestLoadSnapshotChunkProtoMsg): RequestLoadSnapshotChunk { return RequestLoadSnapshotChunk.decode(message.value); }, toProto(message: RequestLoadSnapshotChunk): Uint8Array { return RequestLoadSnapshotChunk.encode(message).finish(); }, toProtoMsg(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkProtoMsg { return { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", value: RequestLoadSnapshotChunk.encode(message).finish() }; } }; function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { return { index: 0, chunk: new Uint8Array(), sender: "" }; } export const RequestApplySnapshotChunk = { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): RequestApplySnapshotChunk { const message = createBaseRequestApplySnapshotChunk(); message.index = object.index ?? 0; message.chunk = object.chunk ?? new Uint8Array(); message.sender = object.sender ?? ""; return message; }, fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { const message = createBaseRequestApplySnapshotChunk(); if (object.index !== undefined && object.index !== null) { message.index = object.index; } if (object.chunk !== undefined && object.chunk !== null) { message.chunk = bytesFromBase64(object.chunk); } if (object.sender !== undefined && object.sender !== null) { message.sender = object.sender; } return message; }, toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { const obj: any = {}; obj.index = message.index; obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; obj.sender = message.sender; return obj; }, fromAminoMsg(object: RequestApplySnapshotChunkAminoMsg): RequestApplySnapshotChunk { return RequestApplySnapshotChunk.fromAmino(object.value); }, fromProtoMsg(message: RequestApplySnapshotChunkProtoMsg): RequestApplySnapshotChunk { return RequestApplySnapshotChunk.decode(message.value); }, toProto(message: RequestApplySnapshotChunk): Uint8Array { return RequestApplySnapshotChunk.encode(message).finish(); }, toProtoMsg(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkProtoMsg { return { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", value: RequestApplySnapshotChunk.encode(message).finish() }; } }; function createBaseResponse(): Response { return { exception: undefined, echo: undefined, flush: undefined, info: undefined, setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, checkTx: undefined, deliverTx: undefined, endBlock: undefined, commit: undefined, listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, applySnapshotChunk: undefined }; } export const Response = { typeUrl: "/tendermint.abci.Response", encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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.setOption !== undefined) { ResponseSetOption.encode(message.setOption, writer.uint32(42).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.beginBlock !== undefined) { ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); } if (message.checkTx !== undefined) { ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); } if (message.deliverTx !== undefined) { ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); } if (message.endBlock !== undefined) { ResponseEndBlock.encode(message.endBlock, writer.uint32(90).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(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Response { const reader = input instanceof BinaryReader ? input : new BinaryReader(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 5: message.setOption = ResponseSetOption.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 8: message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); break; case 9: message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); break; case 10: message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); break; case 11: message.endBlock = ResponseEndBlock.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; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): 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.setOption = object.setOption !== undefined && object.setOption !== null ? ResponseSetOption.fromPartial(object.setOption) : 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.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? ResponseBeginBlock.fromPartial(object.beginBlock) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? ResponseCheckTx.fromPartial(object.checkTx) : undefined; message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? ResponseDeliverTx.fromPartial(object.deliverTx) : undefined; message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? ResponseEndBlock.fromPartial(object.endBlock) : 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; return message; }, fromAmino(object: ResponseAmino): Response { const message = createBaseResponse(); if (object.exception !== undefined && object.exception !== null) { message.exception = ResponseException.fromAmino(object.exception); } if (object.echo !== undefined && object.echo !== null) { message.echo = ResponseEcho.fromAmino(object.echo); } if (object.flush !== undefined && object.flush !== null) { message.flush = ResponseFlush.fromAmino(object.flush); } if (object.info !== undefined && object.info !== null) { message.info = ResponseInfo.fromAmino(object.info); } if (object.set_option !== undefined && object.set_option !== null) { message.setOption = ResponseSetOption.fromAmino(object.set_option); } if (object.init_chain !== undefined && object.init_chain !== null) { message.initChain = ResponseInitChain.fromAmino(object.init_chain); } if (object.query !== undefined && object.query !== null) { message.query = ResponseQuery.fromAmino(object.query); } if (object.begin_block !== undefined && object.begin_block !== null) { message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); } if (object.check_tx !== undefined && object.check_tx !== null) { message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); } if (object.deliver_tx !== undefined && object.deliver_tx !== null) { message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); } if (object.end_block !== undefined && object.end_block !== null) { message.endBlock = ResponseEndBlock.fromAmino(object.end_block); } if (object.commit !== undefined && object.commit !== null) { message.commit = ResponseCommit.fromAmino(object.commit); } if (object.list_snapshots !== undefined && object.list_snapshots !== null) { message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); } if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); } if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); } if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); } return message; }, toAmino(message: Response): ResponseAmino { const obj: any = {}; obj.exception = message.exception ? ResponseException.toAmino(message.exception) : undefined; obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; obj.check_tx = message.checkTx ? ResponseCheckTx.toAmino(message.checkTx) : undefined; obj.deliver_tx = message.deliverTx ? ResponseDeliverTx.toAmino(message.deliverTx) : undefined; obj.end_block = message.endBlock ? ResponseEndBlock.toAmino(message.endBlock) : undefined; obj.commit = message.commit ? ResponseCommit.toAmino(message.commit) : undefined; obj.list_snapshots = message.listSnapshots ? ResponseListSnapshots.toAmino(message.listSnapshots) : undefined; obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; return obj; }, fromAminoMsg(object: ResponseAminoMsg): Response { return Response.fromAmino(object.value); }, fromProtoMsg(message: ResponseProtoMsg): Response { return Response.decode(message.value); }, toProto(message: Response): Uint8Array { return Response.encode(message).finish(); }, toProtoMsg(message: Response): ResponseProtoMsg { return { typeUrl: "/tendermint.abci.Response", value: Response.encode(message).finish() }; } }; function createBaseResponseException(): ResponseException { return { error: "" }; } export const ResponseException = { typeUrl: "/tendermint.abci.ResponseException", encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.error !== "") { writer.uint32(10).string(message.error); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): ResponseException { const message = createBaseResponseException(); message.error = object.error ?? ""; return message; }, fromAmino(object: ResponseExceptionAmino): ResponseException { const message = createBaseResponseException(); if (object.error !== undefined && object.error !== null) { message.error = object.error; } return message; }, toAmino(message: ResponseException): ResponseExceptionAmino { const obj: any = {}; obj.error = message.error; return obj; }, fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { return ResponseException.fromAmino(object.value); }, fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { return ResponseException.decode(message.value); }, toProto(message: ResponseException): Uint8Array { return ResponseException.encode(message).finish(); }, toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { return { typeUrl: "/tendermint.abci.ResponseException", value: ResponseException.encode(message).finish() }; } }; function createBaseResponseEcho(): ResponseEcho { return { message: "" }; } export const ResponseEcho = { typeUrl: "/tendermint.abci.ResponseEcho", encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): ResponseEcho { const message = createBaseResponseEcho(); message.message = object.message ?? ""; return message; }, fromAmino(object: ResponseEchoAmino): ResponseEcho { const message = createBaseResponseEcho(); if (object.message !== undefined && object.message !== null) { message.message = object.message; } return message; }, toAmino(message: ResponseEcho): ResponseEchoAmino { const obj: any = {}; obj.message = message.message; return obj; }, fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { return ResponseEcho.fromAmino(object.value); }, fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { return ResponseEcho.decode(message.value); }, toProto(message: ResponseEcho): Uint8Array { return ResponseEcho.encode(message).finish(); }, toProtoMsg(message: ResponseEcho): ResponseEchoProtoMsg { return { typeUrl: "/tendermint.abci.ResponseEcho", value: ResponseEcho.encode(message).finish() }; } }; function createBaseResponseFlush(): ResponseFlush { return {}; } export const ResponseFlush = { typeUrl: "/tendermint.abci.ResponseFlush", encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(_: Partial): ResponseFlush { const message = createBaseResponseFlush(); return message; }, fromAmino(_: ResponseFlushAmino): ResponseFlush { const message = createBaseResponseFlush(); return message; }, toAmino(_: ResponseFlush): ResponseFlushAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { return ResponseFlush.fromAmino(object.value); }, fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { return ResponseFlush.decode(message.value); }, toProto(message: ResponseFlush): Uint8Array { return ResponseFlush.encode(message).finish(); }, toProtoMsg(message: ResponseFlush): ResponseFlushProtoMsg { return { typeUrl: "/tendermint.abci.ResponseFlush", value: ResponseFlush.encode(message).finish() }; } }; function createBaseResponseInfo(): ResponseInfo { return { data: "", version: "", appVersion: BigInt(0), lastBlockHeight: BigInt(0), lastBlockAppHash: new Uint8Array() }; } export const ResponseInfo = { typeUrl: "/tendermint.abci.ResponseInfo", encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data !== "") { writer.uint32(10).string(message.data); } if (message.version !== "") { writer.uint32(18).string(message.version); } if (message.appVersion !== BigInt(0)) { writer.uint32(24).uint64(message.appVersion); } if (message.lastBlockHeight !== BigInt(0)) { writer.uint32(32).int64(message.lastBlockHeight); } if (message.lastBlockAppHash.length !== 0) { writer.uint32(42).bytes(message.lastBlockAppHash); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; case 4: message.lastBlockHeight = reader.int64(); break; case 5: message.lastBlockAppHash = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ResponseInfo { const message = createBaseResponseInfo(); message.data = object.data ?? ""; message.version = object.version ?? ""; message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? BigInt(object.lastBlockHeight.toString()) : BigInt(0); message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; }, fromAmino(object: ResponseInfoAmino): ResponseInfo { const message = createBaseResponseInfo(); if (object.data !== undefined && object.data !== null) { message.data = object.data; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.app_version !== undefined && object.app_version !== null) { message.appVersion = BigInt(object.app_version); } if (object.last_block_height !== undefined && object.last_block_height !== null) { message.lastBlockHeight = BigInt(object.last_block_height); } if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); } return message; }, toAmino(message: ResponseInfo): ResponseInfoAmino { const obj: any = {}; obj.data = message.data; obj.version = message.version; obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; obj.last_block_height = message.lastBlockHeight ? message.lastBlockHeight.toString() : undefined; obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { return ResponseInfo.fromAmino(object.value); }, fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { return ResponseInfo.decode(message.value); }, toProto(message: ResponseInfo): Uint8Array { return ResponseInfo.encode(message).finish(); }, toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { return { typeUrl: "/tendermint.abci.ResponseInfo", value: ResponseInfo.encode(message).finish() }; } }; function createBaseResponseSetOption(): ResponseSetOption { return { code: 0, log: "", info: "" }; } export const ResponseSetOption = { typeUrl: "/tendermint.abci.ResponseSetOption", encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseSetOption(); 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; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ResponseSetOption { const message = createBaseResponseSetOption(); message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; return message; }, fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { const message = createBaseResponseSetOption(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } return message; }, toAmino(message: ResponseSetOption): ResponseSetOptionAmino { const obj: any = {}; obj.code = message.code; obj.log = message.log; obj.info = message.info; return obj; }, fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { return ResponseSetOption.fromAmino(object.value); }, fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { return ResponseSetOption.decode(message.value); }, toProto(message: ResponseSetOption): Uint8Array { return ResponseSetOption.encode(message).finish(); }, toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { return { typeUrl: "/tendermint.abci.ResponseSetOption", value: ResponseSetOption.encode(message).finish() }; } }; function createBaseResponseInitChain(): ResponseInitChain { return { consensusParams: undefined, validators: [], appHash: new Uint8Array() }; } export const ResponseInitChain = { typeUrl: "/tendermint.abci.ResponseInitChain", encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): ResponseInitChain { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): 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; }, fromAmino(object: ResponseInitChainAmino): ResponseInitChain { const message = createBaseResponseInitChain(); if (object.consensus_params !== undefined && object.consensus_params !== null) { message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); } message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; if (object.app_hash !== undefined && object.app_hash !== null) { message.appHash = bytesFromBase64(object.app_hash); } return message; }, toAmino(message: ResponseInitChain): ResponseInitChainAmino { const obj: any = {}; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { obj.validators = []; } obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { return ResponseInitChain.fromAmino(object.value); }, fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { return ResponseInitChain.decode(message.value); }, toProto(message: ResponseInitChain): Uint8Array { return ResponseInitChain.encode(message).finish(); }, toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { return { typeUrl: "/tendermint.abci.ResponseInitChain", value: ResponseInitChain.encode(message).finish() }; } }; function createBaseResponseQuery(): ResponseQuery { return { code: 0, log: "", info: "", index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), proofOps: undefined, height: BigInt(0), codespace: "" }; } export const ResponseQuery = { typeUrl: "/tendermint.abci.ResponseQuery", encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { 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 !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { writer.uint32(82).string(message.codespace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); 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(); break; case 10: message.codespace = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): 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 ? BigInt(object.index.toString()) : BigInt(0); 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 ? BigInt(object.height.toString()) : BigInt(0); message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ResponseQueryAmino): ResponseQuery { const message = createBaseResponseQuery(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } if (object.index !== undefined && object.index !== null) { message.index = BigInt(object.index); } if (object.key !== undefined && object.key !== null) { message.key = bytesFromBase64(object.key); } if (object.value !== undefined && object.value !== null) { message.value = bytesFromBase64(object.value); } if (object.proof_ops !== undefined && object.proof_ops !== null) { message.proofOps = ProofOps.fromAmino(object.proof_ops); } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.codespace !== undefined && object.codespace !== null) { message.codespace = object.codespace; } return message; }, toAmino(message: ResponseQuery): ResponseQueryAmino { const obj: any = {}; obj.code = message.code; obj.log = message.log; obj.info = message.info; obj.index = message.index ? message.index.toString() : undefined; obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.codespace = message.codespace; return obj; }, fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { return ResponseQuery.fromAmino(object.value); }, fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { return ResponseQuery.decode(message.value); }, toProto(message: ResponseQuery): Uint8Array { return ResponseQuery.encode(message).finish(); }, toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { return { typeUrl: "/tendermint.abci.ResponseQuery", value: ResponseQuery.encode(message).finish() }; } }; function createBaseResponseBeginBlock(): ResponseBeginBlock { return { events: [] }; } export const ResponseBeginBlock = { typeUrl: "/tendermint.abci.ResponseBeginBlock", encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseBeginBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseBeginBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.events.push(Event.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ResponseBeginBlock { const message = createBaseResponseBeginBlock(); message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { const message = createBaseResponseBeginBlock(); message.events = object.events?.map(e => Event.fromAmino(e)) || []; return message; }, toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { const obj: any = {}; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } return obj; }, fromAminoMsg(object: ResponseBeginBlockAminoMsg): ResponseBeginBlock { return ResponseBeginBlock.fromAmino(object.value); }, fromProtoMsg(message: ResponseBeginBlockProtoMsg): ResponseBeginBlock { return ResponseBeginBlock.decode(message.value); }, toProto(message: ResponseBeginBlock): Uint8Array { return ResponseBeginBlock.encode(message).finish(); }, toProtoMsg(message: ResponseBeginBlock): ResponseBeginBlockProtoMsg { return { typeUrl: "/tendermint.abci.ResponseBeginBlock", value: ResponseBeginBlock.encode(message).finish() }; } }; function createBaseResponseCheckTx(): ResponseCheckTx { return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: BigInt(0), gasUsed: BigInt(0), events: [], codespace: "" }; } export const ResponseCheckTx = { typeUrl: "/tendermint.abci.ResponseCheckTx", encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } if (message.gasUsed !== BigInt(0)) { 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: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; case 6: message.gasUsed = reader.int64(); 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: Partial): 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 ? BigInt(object.gasWanted.toString()) : BigInt(0); message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { const message = createBaseResponseCheckTx(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } if (object.gas_wanted !== undefined && object.gas_wanted !== null) { message.gasWanted = BigInt(object.gas_wanted); } if (object.gas_used !== undefined && object.gas_used !== null) { message.gasUsed = BigInt(object.gas_used); } message.events = object.events?.map(e => Event.fromAmino(e)) || []; if (object.codespace !== undefined && object.codespace !== null) { message.codespace = object.codespace; } return message; }, toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { const obj: any = {}; obj.code = message.code; obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } obj.codespace = message.codespace; return obj; }, fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { return ResponseCheckTx.fromAmino(object.value); }, fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { return ResponseCheckTx.decode(message.value); }, toProto(message: ResponseCheckTx): Uint8Array { return ResponseCheckTx.encode(message).finish(); }, toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { return { typeUrl: "/tendermint.abci.ResponseCheckTx", value: ResponseCheckTx.encode(message).finish() }; } }; function createBaseResponseDeliverTx(): ResponseDeliverTx { return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: BigInt(0), gasUsed: BigInt(0), events: [], codespace: "" }; } export const ResponseDeliverTx = { typeUrl: "/tendermint.abci.ResponseDeliverTx", encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } if (message.gasUsed !== BigInt(0)) { 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: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseDeliverTx(); 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(); break; case 6: message.gasUsed = reader.int64(); 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: Partial): ResponseDeliverTx { const message = createBaseResponseDeliverTx(); 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 ? BigInt(object.gasWanted.toString()) : BigInt(0); message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { const message = createBaseResponseDeliverTx(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } if (object.gas_wanted !== undefined && object.gas_wanted !== null) { message.gasWanted = BigInt(object.gas_wanted); } if (object.gas_used !== undefined && object.gas_used !== null) { message.gasUsed = BigInt(object.gas_used); } message.events = object.events?.map(e => Event.fromAmino(e)) || []; if (object.codespace !== undefined && object.codespace !== null) { message.codespace = object.codespace; } return message; }, toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { const obj: any = {}; obj.code = message.code; obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } obj.codespace = message.codespace; return obj; }, fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { return ResponseDeliverTx.fromAmino(object.value); }, fromProtoMsg(message: ResponseDeliverTxProtoMsg): ResponseDeliverTx { return ResponseDeliverTx.decode(message.value); }, toProto(message: ResponseDeliverTx): Uint8Array { return ResponseDeliverTx.encode(message).finish(); }, toProtoMsg(message: ResponseDeliverTx): ResponseDeliverTxProtoMsg { return { typeUrl: "/tendermint.abci.ResponseDeliverTx", value: ResponseDeliverTx.encode(message).finish() }; } }; function createBaseResponseEndBlock(): ResponseEndBlock { return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] }; } export const ResponseEndBlock = { typeUrl: "/tendermint.abci.ResponseEndBlock", encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.consensusParamUpdates !== undefined) { ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); } for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 2: message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); break; case 3: message.events.push(Event.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ResponseEndBlock { const message = createBaseResponseEndBlock(); message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; message.consensusParamUpdates = object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) : undefined; message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { const message = createBaseResponseEndBlock(); message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); } message.events = object.events?.map(e => Event.fromAmino(e)) || []; return message; }, toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { const obj: any = {}; if (message.validatorUpdates) { obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { obj.validator_updates = []; } obj.consensus_param_updates = message.consensusParamUpdates ? ConsensusParams.toAmino(message.consensusParamUpdates) : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } return obj; }, fromAminoMsg(object: ResponseEndBlockAminoMsg): ResponseEndBlock { return ResponseEndBlock.fromAmino(object.value); }, fromProtoMsg(message: ResponseEndBlockProtoMsg): ResponseEndBlock { return ResponseEndBlock.decode(message.value); }, toProto(message: ResponseEndBlock): Uint8Array { return ResponseEndBlock.encode(message).finish(); }, toProtoMsg(message: ResponseEndBlock): ResponseEndBlockProtoMsg { return { typeUrl: "/tendermint.abci.ResponseEndBlock", value: ResponseEndBlock.encode(message).finish() }; } }; function createBaseResponseCommit(): ResponseCommit { return { data: new Uint8Array(), retainHeight: BigInt(0) }; } export const ResponseCommit = { typeUrl: "/tendermint.abci.ResponseCommit", encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } if (message.retainHeight !== BigInt(0)) { writer.uint32(24).int64(message.retainHeight); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { const reader = input instanceof BinaryReader ? input : new BinaryReader(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 2: message.data = reader.bytes(); break; case 3: message.retainHeight = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ResponseCommit { const message = createBaseResponseCommit(); message.data = object.data ?? new Uint8Array(); message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? BigInt(object.retainHeight.toString()) : BigInt(0); return message; }, fromAmino(object: ResponseCommitAmino): ResponseCommit { const message = createBaseResponseCommit(); if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } if (object.retain_height !== undefined && object.retain_height !== null) { message.retainHeight = BigInt(object.retain_height); } return message; }, toAmino(message: ResponseCommit): ResponseCommitAmino { const obj: any = {}; obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.retain_height = message.retainHeight ? message.retainHeight.toString() : undefined; return obj; }, fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { return ResponseCommit.fromAmino(object.value); }, fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { return ResponseCommit.decode(message.value); }, toProto(message: ResponseCommit): Uint8Array { return ResponseCommit.encode(message).finish(); }, toProtoMsg(message: ResponseCommit): ResponseCommitProtoMsg { return { typeUrl: "/tendermint.abci.ResponseCommit", value: ResponseCommit.encode(message).finish() }; } }; function createBaseResponseListSnapshots(): ResponseListSnapshots { return { snapshots: [] }; } export const ResponseListSnapshots = { typeUrl: "/tendermint.abci.ResponseListSnapshots", encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): ResponseListSnapshots { const message = createBaseResponseListSnapshots(); message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; return message; }, fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { const message = createBaseResponseListSnapshots(); message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; return message; }, toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { const obj: any = {}; if (message.snapshots) { obj.snapshots = message.snapshots.map(e => e ? Snapshot.toAmino(e) : undefined); } else { obj.snapshots = []; } return obj; }, fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { return ResponseListSnapshots.fromAmino(object.value); }, fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { return ResponseListSnapshots.decode(message.value); }, toProto(message: ResponseListSnapshots): Uint8Array { return ResponseListSnapshots.encode(message).finish(); }, toProtoMsg(message: ResponseListSnapshots): ResponseListSnapshotsProtoMsg { return { typeUrl: "/tendermint.abci.ResponseListSnapshots", value: ResponseListSnapshots.encode(message).finish() }; } }; function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { return { result: 0 }; } export const ResponseOfferSnapshot = { typeUrl: "/tendermint.abci.ResponseOfferSnapshot", encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): ResponseOfferSnapshot { const message = createBaseResponseOfferSnapshot(); message.result = object.result ?? 0; return message; }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { const message = createBaseResponseOfferSnapshot(); if (object.result !== undefined && object.result !== null) { message.result = responseOfferSnapshot_ResultFromJSON(object.result); } return message; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { const obj: any = {}; obj.result = responseOfferSnapshot_ResultToJSON(message.result); return obj; }, fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { return ResponseOfferSnapshot.fromAmino(object.value); }, fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { return ResponseOfferSnapshot.decode(message.value); }, toProto(message: ResponseOfferSnapshot): Uint8Array { return ResponseOfferSnapshot.encode(message).finish(); }, toProtoMsg(message: ResponseOfferSnapshot): ResponseOfferSnapshotProtoMsg { return { typeUrl: "/tendermint.abci.ResponseOfferSnapshot", value: ResponseOfferSnapshot.encode(message).finish() }; } }; function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { return { chunk: new Uint8Array() }; } export const ResponseLoadSnapshotChunk = { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): ResponseLoadSnapshotChunk { const message = createBaseResponseLoadSnapshotChunk(); message.chunk = object.chunk ?? new Uint8Array(); return message; }, fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { const message = createBaseResponseLoadSnapshotChunk(); if (object.chunk !== undefined && object.chunk !== null) { message.chunk = bytesFromBase64(object.chunk); } return message; }, toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { const obj: any = {}; obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; return obj; }, fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { return ResponseLoadSnapshotChunk.fromAmino(object.value); }, fromProtoMsg(message: ResponseLoadSnapshotChunkProtoMsg): ResponseLoadSnapshotChunk { return ResponseLoadSnapshotChunk.decode(message.value); }, toProto(message: ResponseLoadSnapshotChunk): Uint8Array { return ResponseLoadSnapshotChunk.encode(message).finish(); }, toProtoMsg(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkProtoMsg { return { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", value: ResponseLoadSnapshotChunk.encode(message).finish() }; } }; function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { return { result: 0, refetchChunks: [], rejectSenders: [] }; } export const ResponseApplySnapshotChunk = { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): 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; }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { const message = createBaseResponseApplySnapshotChunk(); if (object.result !== undefined && object.result !== null) { message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); } message.refetchChunks = object.refetch_chunks?.map(e => e) || []; message.rejectSenders = object.reject_senders?.map(e => e) || []; return message; }, toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { const obj: any = {}; obj.result = responseApplySnapshotChunk_ResultToJSON(message.result); if (message.refetchChunks) { obj.refetch_chunks = message.refetchChunks.map(e => e); } else { obj.refetch_chunks = []; } if (message.rejectSenders) { obj.reject_senders = message.rejectSenders.map(e => e); } else { obj.reject_senders = []; } return obj; }, fromAminoMsg(object: ResponseApplySnapshotChunkAminoMsg): ResponseApplySnapshotChunk { return ResponseApplySnapshotChunk.fromAmino(object.value); }, fromProtoMsg(message: ResponseApplySnapshotChunkProtoMsg): ResponseApplySnapshotChunk { return ResponseApplySnapshotChunk.decode(message.value); }, toProto(message: ResponseApplySnapshotChunk): Uint8Array { return ResponseApplySnapshotChunk.encode(message).finish(); }, toProtoMsg(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkProtoMsg { return { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", value: ResponseApplySnapshotChunk.encode(message).finish() }; } }; function createBaseConsensusParams(): ConsensusParams { return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; } export const ConsensusParams = { typeUrl: "/tendermint.abci.ConsensusParams", encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.block !== undefined) { BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); } if (message.evidence !== undefined) { EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); } if (message.validator !== undefined) { ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); } if (message.version !== undefined) { VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.block = BlockParams.decode(reader, reader.uint32()); break; case 2: message.evidence = EvidenceParams.decode(reader, reader.uint32()); break; case 3: message.validator = ValidatorParams.decode(reader, reader.uint32()); break; case 4: message.version = VersionParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): ConsensusParams { const message = createBaseConsensusParams(); message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; return message; }, fromAmino(object: ConsensusParamsAmino): ConsensusParams { const message = createBaseConsensusParams(); if (object.block !== undefined && object.block !== null) { message.block = BlockParams.fromAmino(object.block); } if (object.evidence !== undefined && object.evidence !== null) { message.evidence = EvidenceParams.fromAmino(object.evidence); } if (object.validator !== undefined && object.validator !== null) { message.validator = ValidatorParams.fromAmino(object.validator); } if (object.version !== undefined && object.version !== null) { message.version = VersionParams.fromAmino(object.version); } return message; }, toAmino(message: ConsensusParams): ConsensusParamsAmino { const obj: any = {}; obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; return obj; }, fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { return ConsensusParams.fromAmino(object.value); }, fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { return ConsensusParams.decode(message.value); }, toProto(message: ConsensusParams): Uint8Array { return ConsensusParams.encode(message).finish(); }, toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { return { typeUrl: "/tendermint.abci.ConsensusParams", value: ConsensusParams.encode(message).finish() }; } }; function createBaseBlockParams(): BlockParams { return { maxBytes: BigInt(0), maxGas: BigInt(0) }; } export const BlockParams = { typeUrl: "/tendermint.abci.BlockParams", encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxBytes); } if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.maxBytes = reader.int64(); break; case 2: message.maxGas = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): BlockParams { const message = createBaseBlockParams(); message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { const message = createBaseBlockParams(); if (object.max_bytes !== undefined && object.max_bytes !== null) { message.maxBytes = BigInt(object.max_bytes); } if (object.max_gas !== undefined && object.max_gas !== null) { message.maxGas = BigInt(object.max_gas); } return message; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { return BlockParams.fromAmino(object.value); }, fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { return BlockParams.decode(message.value); }, toProto(message: BlockParams): Uint8Array { return BlockParams.encode(message).finish(); }, toProtoMsg(message: BlockParams): BlockParamsProtoMsg { return { typeUrl: "/tendermint.abci.BlockParams", value: BlockParams.encode(message).finish() }; } }; function createBaseLastCommitInfo(): LastCommitInfo { return { round: 0, votes: [] }; } export const LastCommitInfo = { typeUrl: "/tendermint.abci.LastCommitInfo", encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): LastCommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLastCommitInfo(); 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: Partial): LastCommitInfo { const message = createBaseLastCommitInfo(); message.round = object.round ?? 0; message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; }, fromAmino(object: LastCommitInfoAmino): LastCommitInfo { const message = createBaseLastCommitInfo(); if (object.round !== undefined && object.round !== null) { message.round = object.round; } message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; return message; }, toAmino(message: LastCommitInfo): LastCommitInfoAmino { const obj: any = {}; obj.round = message.round; if (message.votes) { obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); } else { obj.votes = []; } return obj; }, fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { return LastCommitInfo.fromAmino(object.value); }, fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { return LastCommitInfo.decode(message.value); }, toProto(message: LastCommitInfo): Uint8Array { return LastCommitInfo.encode(message).finish(); }, toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { return { typeUrl: "/tendermint.abci.LastCommitInfo", value: LastCommitInfo.encode(message).finish() }; } }; function createBaseEvent(): Event { return { type: "", attributes: [] }; } export const Event = { typeUrl: "/tendermint.abci.Event", encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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: BinaryReader | Uint8Array, length?: number): Event { const reader = input instanceof BinaryReader ? input : new BinaryReader(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: Partial): Event { const message = createBaseEvent(); message.type = object.type ?? ""; message.attributes = object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; return message; }, fromAmino(object: EventAmino): Event { const message = createBaseEvent(); if (object.type !== undefined && object.type !== null) { message.type = object.type; } message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; return message; }, toAmino(message: Event): EventAmino { const obj: any = {}; obj.type = message.type; if (message.attributes) { obj.attributes = message.attributes.map(e => e ? EventAttribute.toAmino(e) : undefined); } else { obj.attributes = []; } return obj; }, fromAminoMsg(object: EventAminoMsg): Event { return Event.fromAmino(object.value); }, fromProtoMsg(message: EventProtoMsg): Event { return Event.decode(message.value); }, toProto(message: Event): Uint8Array { return Event.encode(message).finish(); }, toProtoMsg(message: Event): EventProtoMsg { return { typeUrl: "/tendermint.abci.Event", value: Event.encode(message).finish() }; } }; function createBaseEventAttribute(): EventAttribute { return { key: new Uint8Array(), value: new Uint8Array(), index: false }; } export const EventAttribute = { typeUrl: "/tendermint.abci.EventAttribute", encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { const reader = input instanceof BinaryReader ? input : new BinaryReader(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.bytes(); break; case 2: message.value = reader.bytes(); break; case 3: message.index = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); message.index = object.index ?? false; return message; }, fromAmino(object: EventAttributeAmino): EventAttribute { const message = createBaseEventAttribute(); if (object.key !== undefined && object.key !== null) { message.key = bytesFromBase64(object.key); } if (object.value !== undefined && object.value !== null) { message.value = bytesFromBase64(object.value); } if (object.index !== undefined && object.index !== null) { message.index = object.index; } return message; }, toAmino(message: EventAttribute): EventAttributeAmino { const obj: any = {}; obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.index = message.index; return obj; }, fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { return EventAttribute.fromAmino(object.value); }, fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { return EventAttribute.decode(message.value); }, toProto(message: EventAttribute): Uint8Array { return EventAttribute.encode(message).finish(); }, toProtoMsg(message: EventAttribute): EventAttributeProtoMsg { return { typeUrl: "/tendermint.abci.EventAttribute", value: EventAttribute.encode(message).finish() }; } }; function createBaseTxResult(): TxResult { return { height: BigInt(0), index: 0, tx: new Uint8Array(), result: ResponseDeliverTx.fromPartial({}) }; } export const TxResult = { typeUrl: "/tendermint.abci.TxResult", encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { 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) { ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TxResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; case 2: message.index = reader.uint32(); break; case 3: message.tx = reader.bytes(); break; case 4: message.result = ResponseDeliverTx.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): TxResult { const message = createBaseTxResult(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.index = object.index ?? 0; message.tx = object.tx ?? new Uint8Array(); message.result = object.result !== undefined && object.result !== null ? ResponseDeliverTx.fromPartial(object.result) : undefined; return message; }, fromAmino(object: TxResultAmino): TxResult { const message = createBaseTxResult(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.index !== undefined && object.index !== null) { message.index = object.index; } if (object.tx !== undefined && object.tx !== null) { message.tx = bytesFromBase64(object.tx); } if (object.result !== undefined && object.result !== null) { message.result = ResponseDeliverTx.fromAmino(object.result); } return message; }, toAmino(message: TxResult): TxResultAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.index = message.index; obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; return obj; }, fromAminoMsg(object: TxResultAminoMsg): TxResult { return TxResult.fromAmino(object.value); }, fromProtoMsg(message: TxResultProtoMsg): TxResult { return TxResult.decode(message.value); }, toProto(message: TxResult): Uint8Array { return TxResult.encode(message).finish(); }, toProtoMsg(message: TxResult): TxResultProtoMsg { return { typeUrl: "/tendermint.abci.TxResult", value: TxResult.encode(message).finish() }; } }; function createBaseValidator(): Validator { return { address: new Uint8Array(), power: BigInt(0) }; } export const Validator = { typeUrl: "/tendermint.abci.Validator", encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } if (message.power !== BigInt(0)) { writer.uint32(24).int64(message.power); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Validator { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorAmino): Validator { const message = createBaseValidator(); if (object.address !== undefined && object.address !== null) { message.address = bytesFromBase64(object.address); } if (object.power !== undefined && object.power !== null) { message.power = BigInt(object.power); } return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.power = message.power ? message.power.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { return Validator.fromAmino(object.value); }, fromProtoMsg(message: ValidatorProtoMsg): Validator { return Validator.decode(message.value); }, toProto(message: Validator): Uint8Array { return Validator.encode(message).finish(); }, toProtoMsg(message: Validator): ValidatorProtoMsg { return { typeUrl: "/tendermint.abci.Validator", value: Validator.encode(message).finish() }; } }; function createBaseValidatorUpdate(): ValidatorUpdate { return { pubKey: PublicKey.fromPartial({}), power: BigInt(0) }; } export const ValidatorUpdate = { typeUrl: "/tendermint.abci.ValidatorUpdate", encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } if (message.power !== BigInt(0)) { writer.uint32(16).int64(message.power); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): 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 ? BigInt(object.power.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { const message = createBaseValidatorUpdate(); if (object.pub_key !== undefined && object.pub_key !== null) { message.pubKey = PublicKey.fromAmino(object.pub_key); } if (object.power !== undefined && object.power !== null) { message.power = BigInt(object.power); } return message; }, toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { const obj: any = {}; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; obj.power = message.power ? message.power.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { return ValidatorUpdate.fromAmino(object.value); }, fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { return ValidatorUpdate.decode(message.value); }, toProto(message: ValidatorUpdate): Uint8Array { return ValidatorUpdate.encode(message).finish(); }, toProtoMsg(message: ValidatorUpdate): ValidatorUpdateProtoMsg { return { typeUrl: "/tendermint.abci.ValidatorUpdate", value: ValidatorUpdate.encode(message).finish() }; } }; function createBaseVoteInfo(): VoteInfo { return { validator: Validator.fromPartial({}), signedLastBlock: false }; } export const VoteInfo = { typeUrl: "/tendermint.abci.VoteInfo", encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } if (message.signedLastBlock === true) { writer.uint32(16).bool(message.signedLastBlock); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(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 2: message.signedLastBlock = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): VoteInfo { const message = createBaseVoteInfo(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.signedLastBlock = object.signedLastBlock ?? false; return message; }, fromAmino(object: VoteInfoAmino): VoteInfo { const message = createBaseVoteInfo(); if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromAmino(object.validator); } if (object.signed_last_block !== undefined && object.signed_last_block !== null) { message.signedLastBlock = object.signed_last_block; } return message; }, toAmino(message: VoteInfo): VoteInfoAmino { const obj: any = {}; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.signed_last_block = message.signedLastBlock; return obj; }, fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { return VoteInfo.fromAmino(object.value); }, fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { return VoteInfo.decode(message.value); }, toProto(message: VoteInfo): Uint8Array { return VoteInfo.encode(message).finish(); }, toProtoMsg(message: VoteInfo): VoteInfoProtoMsg { return { typeUrl: "/tendermint.abci.VoteInfo", value: VoteInfo.encode(message).finish() }; } }; function createBaseEvidence(): Evidence { return { type: 0, validator: Validator.fromPartial({}), height: BigInt(0), time: new Date(), totalVotingPower: BigInt(0) }; } export const Evidence = { typeUrl: "/tendermint.abci.Evidence", encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } if (message.totalVotingPower !== BigInt(0)) { writer.uint32(40).int64(message.totalVotingPower); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Evidence { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidence(); 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(); break; case 4: message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: message.totalVotingPower = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): Evidence { const message = createBaseEvidence(); 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 ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time ?? undefined; message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, fromAmino(object: EvidenceAmino): Evidence { const message = createBaseEvidence(); if (object.type !== undefined && object.type !== null) { message.type = evidenceTypeFromJSON(object.type); } if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromAmino(object.validator); } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.time !== undefined && object.time !== null) { message.time = fromTimestamp(Timestamp.fromAmino(object.time)); } if (object.total_voting_power !== undefined && object.total_voting_power !== null) { message.totalVotingPower = BigInt(object.total_voting_power); } return message; }, toAmino(message: Evidence): EvidenceAmino { const obj: any = {}; obj.type = evidenceTypeToJSON(message.type); obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, fromAminoMsg(object: EvidenceAminoMsg): Evidence { return Evidence.fromAmino(object.value); }, fromProtoMsg(message: EvidenceProtoMsg): Evidence { return Evidence.decode(message.value); }, toProto(message: Evidence): Uint8Array { return Evidence.encode(message).finish(); }, toProtoMsg(message: Evidence): EvidenceProtoMsg { return { typeUrl: "/tendermint.abci.Evidence", value: Evidence.encode(message).finish() }; } }; function createBaseSnapshot(): Snapshot { return { height: BigInt(0), format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() }; } export const Snapshot = { typeUrl: "/tendermint.abci.Snapshot", encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { 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: BinaryReader | Uint8Array, length?: number): Snapshot { const reader = input instanceof BinaryReader ? input : new BinaryReader(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(); 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: Partial): Snapshot { const message = createBaseSnapshot(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; message.hash = object.hash ?? new Uint8Array(); message.metadata = object.metadata ?? new Uint8Array(); return message; }, fromAmino(object: SnapshotAmino): Snapshot { const message = createBaseSnapshot(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.format !== undefined && object.format !== null) { message.format = object.format; } if (object.chunks !== undefined && object.chunks !== null) { message.chunks = object.chunks; } if (object.hash !== undefined && object.hash !== null) { message.hash = bytesFromBase64(object.hash); } if (object.metadata !== undefined && object.metadata !== null) { message.metadata = bytesFromBase64(object.metadata); } return message; }, toAmino(message: Snapshot): SnapshotAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.format = message.format; obj.chunks = message.chunks; obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; return obj; }, fromAminoMsg(object: SnapshotAminoMsg): Snapshot { return Snapshot.fromAmino(object.value); }, fromProtoMsg(message: SnapshotProtoMsg): Snapshot { return Snapshot.decode(message.value); }, toProto(message: Snapshot): Uint8Array { return Snapshot.encode(message).finish(); }, toProtoMsg(message: Snapshot): SnapshotProtoMsg { return { typeUrl: "/tendermint.abci.Snapshot", value: Snapshot.encode(message).finish() }; } };