import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../query/v1beta1/pagination"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../../tendermint/types/types"; import { Block, BlockAmino, BlockSDKType } from "../../../../tendermint/types/block"; import { NodeInfo, NodeInfoAmino, NodeInfoSDKType } from "../../../../tendermint/p2p/types"; import { Long, isSet } from "../../../../helpers"; import * as _m0 from "protobufjs/minimal"; /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { height: Long; /** pagination defines an pagination for the request. */ pagination?: PageRequest; } export interface GetValidatorSetByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest"; value: Uint8Array; } /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequestAmino { height: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } export interface GetValidatorSetByHeightRequestAminoMsg { type: "cosmos-sdk/GetValidatorSetByHeightRequest"; value: GetValidatorSetByHeightRequestAmino; } /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequestSDKType { height: Long; pagination?: PageRequestSDKType; } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { blockHeight: Long; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination?: PageResponse; } export interface GetValidatorSetByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse"; value: Uint8Array; } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponseAmino { block_height: string; validators: ValidatorAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } export interface GetValidatorSetByHeightResponseAminoMsg { type: "cosmos-sdk/GetValidatorSetByHeightResponse"; value: GetValidatorSetByHeightResponseAmino; } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponseSDKType { block_height: Long; validators: ValidatorSDKType[]; pagination?: PageResponseSDKType; } /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } export interface GetLatestValidatorSetRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest"; value: Uint8Array; } /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequestAmino { /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } export interface GetLatestValidatorSetRequestAminoMsg { type: "cosmos-sdk/GetLatestValidatorSetRequest"; value: GetLatestValidatorSetRequestAmino; } /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequestSDKType { pagination?: PageRequestSDKType; } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { blockHeight: Long; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination?: PageResponse; } export interface GetLatestValidatorSetResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse"; value: Uint8Array; } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponseAmino { block_height: string; validators: ValidatorAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } export interface GetLatestValidatorSetResponseAminoMsg { type: "cosmos-sdk/GetLatestValidatorSetResponse"; value: GetLatestValidatorSetResponseAmino; } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponseSDKType { block_height: Long; validators: ValidatorSDKType[]; pagination?: PageResponseSDKType; } /** Validator is the type for the validator-set. */ export interface Validator { address: string; pubKey?: Any; votingPower: Long; proposerPriority: Long; } export interface ValidatorProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator"; value: Uint8Array; } /** Validator is the type for the validator-set. */ export interface ValidatorAmino { address: string; pub_key?: AnyAmino; voting_power: string; proposer_priority: string; } export interface ValidatorAminoMsg { type: "cosmos-sdk/Validator"; value: ValidatorAmino; } /** Validator is the type for the validator-set. */ export interface ValidatorSDKType { address: string; pub_key?: AnySDKType; voting_power: Long; proposer_priority: Long; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequest { height: Long; } export interface GetBlockByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest"; value: Uint8Array; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequestAmino { height: string; } export interface GetBlockByHeightRequestAminoMsg { type: "cosmos-sdk/GetBlockByHeightRequest"; value: GetBlockByHeightRequestAmino; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequestSDKType { height: Long; } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { blockId?: BlockID; block?: Block; } export interface GetBlockByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse"; value: Uint8Array; } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponseAmino { block_id?: BlockIDAmino; block?: BlockAmino; } export interface GetBlockByHeightResponseAminoMsg { type: "cosmos-sdk/GetBlockByHeightResponse"; value: GetBlockByHeightResponseAmino; } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponseSDKType { block_id?: BlockIDSDKType; block?: BlockSDKType; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequest {} export interface GetLatestBlockRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest"; value: Uint8Array; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequestAmino {} export interface GetLatestBlockRequestAminoMsg { type: "cosmos-sdk/GetLatestBlockRequest"; value: GetLatestBlockRequestAmino; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequestSDKType {} /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponse { blockId?: BlockID; block?: Block; } export interface GetLatestBlockResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse"; value: Uint8Array; } /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponseAmino { block_id?: BlockIDAmino; block?: BlockAmino; } export interface GetLatestBlockResponseAminoMsg { type: "cosmos-sdk/GetLatestBlockResponse"; value: GetLatestBlockResponseAmino; } /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponseSDKType { block_id?: BlockIDSDKType; block?: BlockSDKType; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequest {} export interface GetSyncingRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest"; value: Uint8Array; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequestAmino {} export interface GetSyncingRequestAminoMsg { type: "cosmos-sdk/GetSyncingRequest"; value: GetSyncingRequestAmino; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequestSDKType {} /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponse { syncing: boolean; } export interface GetSyncingResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse"; value: Uint8Array; } /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponseAmino { syncing: boolean; } export interface GetSyncingResponseAminoMsg { type: "cosmos-sdk/GetSyncingResponse"; value: GetSyncingResponseAmino; } /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponseSDKType { syncing: boolean; } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequest {} export interface GetNodeInfoRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest"; value: Uint8Array; } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequestAmino {} export interface GetNodeInfoRequestAminoMsg { type: "cosmos-sdk/GetNodeInfoRequest"; value: GetNodeInfoRequestAmino; } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequestSDKType {} /** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { nodeInfo?: NodeInfo; applicationVersion?: VersionInfo; } export interface GetNodeInfoResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse"; value: Uint8Array; } /** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponseAmino { node_info?: NodeInfoAmino; application_version?: VersionInfoAmino; } export interface GetNodeInfoResponseAminoMsg { type: "cosmos-sdk/GetNodeInfoResponse"; value: GetNodeInfoResponseAmino; } /** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponseSDKType { node_info?: NodeInfoSDKType; application_version?: VersionInfoSDKType; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfo { name: string; appName: string; version: string; gitCommit: string; buildTags: string; goVersion: string; buildDeps: Module[]; /** Since: cosmos-sdk 0.43 */ cosmosSdkVersion: string; } export interface VersionInfoProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo"; value: Uint8Array; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfoAmino { name: string; app_name: string; version: string; git_commit: string; build_tags: string; go_version: string; build_deps: ModuleAmino[]; /** Since: cosmos-sdk 0.43 */ cosmos_sdk_version: string; } export interface VersionInfoAminoMsg { type: "cosmos-sdk/VersionInfo"; value: VersionInfoAmino; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfoSDKType { name: string; app_name: string; version: string; git_commit: string; build_tags: string; go_version: string; build_deps: ModuleSDKType[]; cosmos_sdk_version: string; } /** Module is the type for VersionInfo */ export interface Module { /** module path */ path: string; /** module version */ version: string; /** checksum */ sum: string; } export interface ModuleProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Module"; value: Uint8Array; } /** Module is the type for VersionInfo */ export interface ModuleAmino { /** module path */ path: string; /** module version */ version: string; /** checksum */ sum: string; } export interface ModuleAminoMsg { type: "cosmos-sdk/Module"; value: ModuleAmino; } /** Module is the type for VersionInfo */ export interface ModuleSDKType { path: string; version: string; sum: string; } function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { return { height: Long.ZERO, pagination: undefined }; } export const GetValidatorSetByHeightRequest = { encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = (reader.int64() as Long); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetValidatorSetByHeightRequest { return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetValidatorSetByHeightRequest): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetValidatorSetByHeightRequest { const message = createBaseGetValidatorSetByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetValidatorSetByHeightRequestAmino): GetValidatorSetByHeightRequest { return { height: Long.fromString(object.height), pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined }; }, toAmino(message: GetValidatorSetByHeightRequest): GetValidatorSetByHeightRequestAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: GetValidatorSetByHeightRequestAminoMsg): GetValidatorSetByHeightRequest { return GetValidatorSetByHeightRequest.fromAmino(object.value); }, toAminoMsg(message: GetValidatorSetByHeightRequest): GetValidatorSetByHeightRequestAminoMsg { return { type: "cosmos-sdk/GetValidatorSetByHeightRequest", value: GetValidatorSetByHeightRequest.toAmino(message) }; }, fromProtoMsg(message: GetValidatorSetByHeightRequestProtoMsg): GetValidatorSetByHeightRequest { return GetValidatorSetByHeightRequest.decode(message.value); }, toProto(message: GetValidatorSetByHeightRequest): Uint8Array { return GetValidatorSetByHeightRequest.encode(message).finish(); }, toProtoMsg(message: GetValidatorSetByHeightRequest): GetValidatorSetByHeightRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", value: GetValidatorSetByHeightRequest.encode(message).finish() }; } }; function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { return { blockHeight: Long.ZERO, validators: [], pagination: undefined }; } export const GetValidatorSetByHeightResponse = { encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.blockHeight.isZero()) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { Validator.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockHeight = (reader.int64() as Long); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); break; case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetValidatorSetByHeightResponse { return { blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetValidatorSetByHeightResponse): unknown { const obj: any = {}; message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetValidatorSetByHeightResponse { const message = createBaseGetValidatorSetByHeightResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.ZERO; message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetValidatorSetByHeightResponseAmino): GetValidatorSetByHeightResponse { return { blockHeight: Long.fromString(object.block_height), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined }; }, toAmino(message: GetValidatorSetByHeightResponse): GetValidatorSetByHeightResponseAmino { const obj: any = {}; obj.block_height = message.blockHeight ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { obj.validators = []; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: GetValidatorSetByHeightResponseAminoMsg): GetValidatorSetByHeightResponse { return GetValidatorSetByHeightResponse.fromAmino(object.value); }, toAminoMsg(message: GetValidatorSetByHeightResponse): GetValidatorSetByHeightResponseAminoMsg { return { type: "cosmos-sdk/GetValidatorSetByHeightResponse", value: GetValidatorSetByHeightResponse.toAmino(message) }; }, fromProtoMsg(message: GetValidatorSetByHeightResponseProtoMsg): GetValidatorSetByHeightResponse { return GetValidatorSetByHeightResponse.decode(message.value); }, toProto(message: GetValidatorSetByHeightResponse): Uint8Array { return GetValidatorSetByHeightResponse.encode(message).finish(); }, toProtoMsg(message: GetValidatorSetByHeightResponse): GetValidatorSetByHeightResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", value: GetValidatorSetByHeightResponse.encode(message).finish() }; } }; function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest { return { pagination: undefined }; } export const GetLatestValidatorSetRequest = { encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetLatestValidatorSetRequest { return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetLatestValidatorSetRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetLatestValidatorSetRequest { const message = createBaseGetLatestValidatorSetRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetLatestValidatorSetRequestAmino): GetLatestValidatorSetRequest { return { pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined }; }, toAmino(message: GetLatestValidatorSetRequest): GetLatestValidatorSetRequestAmino { const obj: any = {}; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: GetLatestValidatorSetRequestAminoMsg): GetLatestValidatorSetRequest { return GetLatestValidatorSetRequest.fromAmino(object.value); }, toAminoMsg(message: GetLatestValidatorSetRequest): GetLatestValidatorSetRequestAminoMsg { return { type: "cosmos-sdk/GetLatestValidatorSetRequest", value: GetLatestValidatorSetRequest.toAmino(message) }; }, fromProtoMsg(message: GetLatestValidatorSetRequestProtoMsg): GetLatestValidatorSetRequest { return GetLatestValidatorSetRequest.decode(message.value); }, toProto(message: GetLatestValidatorSetRequest): Uint8Array { return GetLatestValidatorSetRequest.encode(message).finish(); }, toProtoMsg(message: GetLatestValidatorSetRequest): GetLatestValidatorSetRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", value: GetLatestValidatorSetRequest.encode(message).finish() }; } }; function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { return { blockHeight: Long.ZERO, validators: [], pagination: undefined }; } export const GetLatestValidatorSetResponse = { encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.blockHeight.isZero()) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { Validator.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockHeight = (reader.int64() as Long); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); break; case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetLatestValidatorSetResponse { return { blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetLatestValidatorSetResponse): unknown { const obj: any = {}; message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetLatestValidatorSetResponse { const message = createBaseGetLatestValidatorSetResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.ZERO; message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetLatestValidatorSetResponseAmino): GetLatestValidatorSetResponse { return { blockHeight: Long.fromString(object.block_height), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined }; }, toAmino(message: GetLatestValidatorSetResponse): GetLatestValidatorSetResponseAmino { const obj: any = {}; obj.block_height = message.blockHeight ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { obj.validators = []; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: GetLatestValidatorSetResponseAminoMsg): GetLatestValidatorSetResponse { return GetLatestValidatorSetResponse.fromAmino(object.value); }, toAminoMsg(message: GetLatestValidatorSetResponse): GetLatestValidatorSetResponseAminoMsg { return { type: "cosmos-sdk/GetLatestValidatorSetResponse", value: GetLatestValidatorSetResponse.toAmino(message) }; }, fromProtoMsg(message: GetLatestValidatorSetResponseProtoMsg): GetLatestValidatorSetResponse { return GetLatestValidatorSetResponse.decode(message.value); }, toProto(message: GetLatestValidatorSetResponse): Uint8Array { return GetLatestValidatorSetResponse.encode(message).finish(); }, toProtoMsg(message: GetLatestValidatorSetResponse): GetLatestValidatorSetResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", value: GetLatestValidatorSetResponse.encode(message).finish() }; } }; function createBaseValidator(): Validator { return { address: "", pubKey: undefined, votingPower: Long.ZERO, proposerPriority: Long.ZERO }; } export const Validator = { encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } if (!message.votingPower.isZero()) { writer.uint32(24).int64(message.votingPower); } if (!message.proposerPriority.isZero()) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Validator { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: message.votingPower = (reader.int64() as Long); break; case 4: message.proposerPriority = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Validator { return { address: isSet(object.address) ? String(object.address) : "", pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); return obj; }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? ""; message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? Long.fromValue(object.votingPower) : Long.ZERO; message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? Long.fromValue(object.proposerPriority) : Long.ZERO; return message; }, fromAmino(object: ValidatorAmino): Validator { return { address: object.address, pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, votingPower: Long.fromString(object.voting_power), proposerPriority: Long.fromString(object.proposer_priority) }; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; obj.address = message.address; obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; obj.proposer_priority = message.proposerPriority ? message.proposerPriority.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { return Validator.fromAmino(object.value); }, toAminoMsg(message: Validator): ValidatorAminoMsg { return { type: "cosmos-sdk/Validator", value: Validator.toAmino(message) }; }, fromProtoMsg(message: ValidatorProtoMsg): Validator { return Validator.decode(message.value); }, toProto(message: Validator): Uint8Array { return Validator.encode(message).finish(); }, toProtoMsg(message: Validator): ValidatorProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator", value: Validator.encode(message).finish() }; } }; function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest { return { height: Long.ZERO }; } export const GetBlockByHeightRequest = { encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.height.isZero()) { writer.uint32(8).int64(message.height); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetBlockByHeightRequest { return { height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO }; }, toJSON(message: GetBlockByHeightRequest): unknown { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); return obj; }, fromPartial(object: Partial): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; return message; }, fromAmino(object: GetBlockByHeightRequestAmino): GetBlockByHeightRequest { return { height: Long.fromString(object.height) }; }, toAmino(message: GetBlockByHeightRequest): GetBlockByHeightRequestAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: GetBlockByHeightRequestAminoMsg): GetBlockByHeightRequest { return GetBlockByHeightRequest.fromAmino(object.value); }, toAminoMsg(message: GetBlockByHeightRequest): GetBlockByHeightRequestAminoMsg { return { type: "cosmos-sdk/GetBlockByHeightRequest", value: GetBlockByHeightRequest.toAmino(message) }; }, fromProtoMsg(message: GetBlockByHeightRequestProtoMsg): GetBlockByHeightRequest { return GetBlockByHeightRequest.decode(message.value); }, toProto(message: GetBlockByHeightRequest): Uint8Array { return GetBlockByHeightRequest.encode(message).finish(); }, toProtoMsg(message: GetBlockByHeightRequest): GetBlockByHeightRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", value: GetBlockByHeightRequest.encode(message).finish() }; } }; function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { return { blockId: undefined, block: undefined }; } export const GetBlockByHeightResponse = { encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: message.block = Block.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetBlockByHeightResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined }; }, toJSON(message: GetBlockByHeightResponse): unknown { const obj: any = {}; message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); return obj; }, fromPartial(object: Partial): GetBlockByHeightResponse { const message = createBaseGetBlockByHeightResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; return message; }, fromAmino(object: GetBlockByHeightResponseAmino): GetBlockByHeightResponse { return { blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, block: object?.block ? Block.fromAmino(object.block) : undefined }; }, toAmino(message: GetBlockByHeightResponse): GetBlockByHeightResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? Block.toAmino(message.block) : undefined; return obj; }, fromAminoMsg(object: GetBlockByHeightResponseAminoMsg): GetBlockByHeightResponse { return GetBlockByHeightResponse.fromAmino(object.value); }, toAminoMsg(message: GetBlockByHeightResponse): GetBlockByHeightResponseAminoMsg { return { type: "cosmos-sdk/GetBlockByHeightResponse", value: GetBlockByHeightResponse.toAmino(message) }; }, fromProtoMsg(message: GetBlockByHeightResponseProtoMsg): GetBlockByHeightResponse { return GetBlockByHeightResponse.decode(message.value); }, toProto(message: GetBlockByHeightResponse): Uint8Array { return GetBlockByHeightResponse.encode(message).finish(); }, toProtoMsg(message: GetBlockByHeightResponse): GetBlockByHeightResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", value: GetBlockByHeightResponse.encode(message).finish() }; } }; function createBaseGetLatestBlockRequest(): GetLatestBlockRequest { return {}; } export const GetLatestBlockRequest = { encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetLatestBlockRequest { return {}; }, toJSON(_: GetLatestBlockRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: Partial): GetLatestBlockRequest { const message = createBaseGetLatestBlockRequest(); return message; }, fromAmino(_: GetLatestBlockRequestAmino): GetLatestBlockRequest { return {}; }, toAmino(_: GetLatestBlockRequest): GetLatestBlockRequestAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: GetLatestBlockRequestAminoMsg): GetLatestBlockRequest { return GetLatestBlockRequest.fromAmino(object.value); }, toAminoMsg(message: GetLatestBlockRequest): GetLatestBlockRequestAminoMsg { return { type: "cosmos-sdk/GetLatestBlockRequest", value: GetLatestBlockRequest.toAmino(message) }; }, fromProtoMsg(message: GetLatestBlockRequestProtoMsg): GetLatestBlockRequest { return GetLatestBlockRequest.decode(message.value); }, toProto(message: GetLatestBlockRequest): Uint8Array { return GetLatestBlockRequest.encode(message).finish(); }, toProtoMsg(message: GetLatestBlockRequest): GetLatestBlockRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", value: GetLatestBlockRequest.encode(message).finish() }; } }; function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { return { blockId: undefined, block: undefined }; } export const GetLatestBlockResponse = { encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: message.block = Block.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetLatestBlockResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined }; }, toJSON(message: GetLatestBlockResponse): unknown { const obj: any = {}; message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); return obj; }, fromPartial(object: Partial): GetLatestBlockResponse { const message = createBaseGetLatestBlockResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; return message; }, fromAmino(object: GetLatestBlockResponseAmino): GetLatestBlockResponse { return { blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, block: object?.block ? Block.fromAmino(object.block) : undefined }; }, toAmino(message: GetLatestBlockResponse): GetLatestBlockResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? Block.toAmino(message.block) : undefined; return obj; }, fromAminoMsg(object: GetLatestBlockResponseAminoMsg): GetLatestBlockResponse { return GetLatestBlockResponse.fromAmino(object.value); }, toAminoMsg(message: GetLatestBlockResponse): GetLatestBlockResponseAminoMsg { return { type: "cosmos-sdk/GetLatestBlockResponse", value: GetLatestBlockResponse.toAmino(message) }; }, fromProtoMsg(message: GetLatestBlockResponseProtoMsg): GetLatestBlockResponse { return GetLatestBlockResponse.decode(message.value); }, toProto(message: GetLatestBlockResponse): Uint8Array { return GetLatestBlockResponse.encode(message).finish(); }, toProtoMsg(message: GetLatestBlockResponse): GetLatestBlockResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", value: GetLatestBlockResponse.encode(message).finish() }; } }; function createBaseGetSyncingRequest(): GetSyncingRequest { return {}; } export const GetSyncingRequest = { encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetSyncingRequest { return {}; }, toJSON(_: GetSyncingRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: Partial): GetSyncingRequest { const message = createBaseGetSyncingRequest(); return message; }, fromAmino(_: GetSyncingRequestAmino): GetSyncingRequest { return {}; }, toAmino(_: GetSyncingRequest): GetSyncingRequestAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: GetSyncingRequestAminoMsg): GetSyncingRequest { return GetSyncingRequest.fromAmino(object.value); }, toAminoMsg(message: GetSyncingRequest): GetSyncingRequestAminoMsg { return { type: "cosmos-sdk/GetSyncingRequest", value: GetSyncingRequest.toAmino(message) }; }, fromProtoMsg(message: GetSyncingRequestProtoMsg): GetSyncingRequest { return GetSyncingRequest.decode(message.value); }, toProto(message: GetSyncingRequest): Uint8Array { return GetSyncingRequest.encode(message).finish(); }, toProtoMsg(message: GetSyncingRequest): GetSyncingRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest", value: GetSyncingRequest.encode(message).finish() }; } }; function createBaseGetSyncingResponse(): GetSyncingResponse { return { syncing: false }; } export const GetSyncingResponse = { encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.syncing = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetSyncingResponse { return { syncing: isSet(object.syncing) ? Boolean(object.syncing) : false }; }, toJSON(message: GetSyncingResponse): unknown { const obj: any = {}; message.syncing !== undefined && (obj.syncing = message.syncing); return obj; }, fromPartial(object: Partial): GetSyncingResponse { const message = createBaseGetSyncingResponse(); message.syncing = object.syncing ?? false; return message; }, fromAmino(object: GetSyncingResponseAmino): GetSyncingResponse { return { syncing: object.syncing }; }, toAmino(message: GetSyncingResponse): GetSyncingResponseAmino { const obj: any = {}; obj.syncing = message.syncing; return obj; }, fromAminoMsg(object: GetSyncingResponseAminoMsg): GetSyncingResponse { return GetSyncingResponse.fromAmino(object.value); }, toAminoMsg(message: GetSyncingResponse): GetSyncingResponseAminoMsg { return { type: "cosmos-sdk/GetSyncingResponse", value: GetSyncingResponse.toAmino(message) }; }, fromProtoMsg(message: GetSyncingResponseProtoMsg): GetSyncingResponse { return GetSyncingResponse.decode(message.value); }, toProto(message: GetSyncingResponse): Uint8Array { return GetSyncingResponse.encode(message).finish(); }, toProtoMsg(message: GetSyncingResponse): GetSyncingResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse", value: GetSyncingResponse.encode(message).finish() }; } }; function createBaseGetNodeInfoRequest(): GetNodeInfoRequest { return {}; } export const GetNodeInfoRequest = { encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetNodeInfoRequest { return {}; }, toJSON(_: GetNodeInfoRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: Partial): GetNodeInfoRequest { const message = createBaseGetNodeInfoRequest(); return message; }, fromAmino(_: GetNodeInfoRequestAmino): GetNodeInfoRequest { return {}; }, toAmino(_: GetNodeInfoRequest): GetNodeInfoRequestAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: GetNodeInfoRequestAminoMsg): GetNodeInfoRequest { return GetNodeInfoRequest.fromAmino(object.value); }, toAminoMsg(message: GetNodeInfoRequest): GetNodeInfoRequestAminoMsg { return { type: "cosmos-sdk/GetNodeInfoRequest", value: GetNodeInfoRequest.toAmino(message) }; }, fromProtoMsg(message: GetNodeInfoRequestProtoMsg): GetNodeInfoRequest { return GetNodeInfoRequest.decode(message.value); }, toProto(message: GetNodeInfoRequest): Uint8Array { return GetNodeInfoRequest.encode(message).finish(); }, toProtoMsg(message: GetNodeInfoRequest): GetNodeInfoRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", value: GetNodeInfoRequest.encode(message).finish() }; } }; function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { return { nodeInfo: undefined, applicationVersion: undefined }; } export const GetNodeInfoResponse = { encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.nodeInfo !== undefined) { NodeInfo.encode(message.nodeInfo, writer.uint32(10).fork()).ldelim(); } if (message.applicationVersion !== undefined) { VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.nodeInfo = NodeInfo.decode(reader, reader.uint32()); break; case 2: message.applicationVersion = VersionInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetNodeInfoResponse { return { nodeInfo: isSet(object.nodeInfo) ? NodeInfo.fromJSON(object.nodeInfo) : undefined, applicationVersion: isSet(object.applicationVersion) ? VersionInfo.fromJSON(object.applicationVersion) : undefined }; }, toJSON(message: GetNodeInfoResponse): unknown { const obj: any = {}; message.nodeInfo !== undefined && (obj.nodeInfo = message.nodeInfo ? NodeInfo.toJSON(message.nodeInfo) : undefined); message.applicationVersion !== undefined && (obj.applicationVersion = message.applicationVersion ? VersionInfo.toJSON(message.applicationVersion) : undefined); return obj; }, fromPartial(object: Partial): GetNodeInfoResponse { const message = createBaseGetNodeInfoResponse(); message.nodeInfo = object.nodeInfo !== undefined && object.nodeInfo !== null ? NodeInfo.fromPartial(object.nodeInfo) : undefined; message.applicationVersion = object.applicationVersion !== undefined && object.applicationVersion !== null ? VersionInfo.fromPartial(object.applicationVersion) : undefined; return message; }, fromAmino(object: GetNodeInfoResponseAmino): GetNodeInfoResponse { return { nodeInfo: object?.node_info ? NodeInfo.fromAmino(object.node_info) : undefined, applicationVersion: object?.application_version ? VersionInfo.fromAmino(object.application_version) : undefined }; }, toAmino(message: GetNodeInfoResponse): GetNodeInfoResponseAmino { const obj: any = {}; obj.node_info = message.nodeInfo ? NodeInfo.toAmino(message.nodeInfo) : undefined; obj.application_version = message.applicationVersion ? VersionInfo.toAmino(message.applicationVersion) : undefined; return obj; }, fromAminoMsg(object: GetNodeInfoResponseAminoMsg): GetNodeInfoResponse { return GetNodeInfoResponse.fromAmino(object.value); }, toAminoMsg(message: GetNodeInfoResponse): GetNodeInfoResponseAminoMsg { return { type: "cosmos-sdk/GetNodeInfoResponse", value: GetNodeInfoResponse.toAmino(message) }; }, fromProtoMsg(message: GetNodeInfoResponseProtoMsg): GetNodeInfoResponse { return GetNodeInfoResponse.decode(message.value); }, toProto(message: GetNodeInfoResponse): Uint8Array { return GetNodeInfoResponse.encode(message).finish(); }, toProtoMsg(message: GetNodeInfoResponse): GetNodeInfoResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", value: GetNodeInfoResponse.encode(message).finish() }; } }; function createBaseVersionInfo(): VersionInfo { return { name: "", appName: "", version: "", gitCommit: "", buildTags: "", goVersion: "", buildDeps: [], cosmosSdkVersion: "" }; } export const VersionInfo = { encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } if (message.appName !== "") { writer.uint32(18).string(message.appName); } if (message.version !== "") { writer.uint32(26).string(message.version); } if (message.gitCommit !== "") { writer.uint32(34).string(message.gitCommit); } if (message.buildTags !== "") { writer.uint32(42).string(message.buildTags); } if (message.goVersion !== "") { writer.uint32(50).string(message.goVersion); } for (const v of message.buildDeps) { Module.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.cosmosSdkVersion !== "") { writer.uint32(66).string(message.cosmosSdkVersion); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersionInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.appName = reader.string(); break; case 3: message.version = reader.string(); break; case 4: message.gitCommit = reader.string(); break; case 5: message.buildTags = reader.string(); break; case 6: message.goVersion = reader.string(); break; case 7: message.buildDeps.push(Module.decode(reader, reader.uint32())); break; case 8: message.cosmosSdkVersion = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): VersionInfo { return { name: isSet(object.name) ? String(object.name) : "", appName: isSet(object.appName) ? String(object.appName) : "", version: isSet(object.version) ? String(object.version) : "", gitCommit: isSet(object.gitCommit) ? String(object.gitCommit) : "", buildTags: isSet(object.buildTags) ? String(object.buildTags) : "", goVersion: isSet(object.goVersion) ? String(object.goVersion) : "", buildDeps: Array.isArray(object?.buildDeps) ? object.buildDeps.map((e: any) => Module.fromJSON(e)) : [], cosmosSdkVersion: isSet(object.cosmosSdkVersion) ? String(object.cosmosSdkVersion) : "" }; }, toJSON(message: VersionInfo): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.appName !== undefined && (obj.appName = message.appName); message.version !== undefined && (obj.version = message.version); message.gitCommit !== undefined && (obj.gitCommit = message.gitCommit); message.buildTags !== undefined && (obj.buildTags = message.buildTags); message.goVersion !== undefined && (obj.goVersion = message.goVersion); if (message.buildDeps) { obj.buildDeps = message.buildDeps.map(e => e ? Module.toJSON(e) : undefined); } else { obj.buildDeps = []; } message.cosmosSdkVersion !== undefined && (obj.cosmosSdkVersion = message.cosmosSdkVersion); return obj; }, fromPartial(object: Partial): VersionInfo { const message = createBaseVersionInfo(); message.name = object.name ?? ""; message.appName = object.appName ?? ""; message.version = object.version ?? ""; message.gitCommit = object.gitCommit ?? ""; message.buildTags = object.buildTags ?? ""; message.goVersion = object.goVersion ?? ""; message.buildDeps = object.buildDeps?.map(e => Module.fromPartial(e)) || []; message.cosmosSdkVersion = object.cosmosSdkVersion ?? ""; return message; }, fromAmino(object: VersionInfoAmino): VersionInfo { return { name: object.name, appName: object.app_name, version: object.version, gitCommit: object.git_commit, buildTags: object.build_tags, goVersion: object.go_version, buildDeps: Array.isArray(object?.build_deps) ? object.build_deps.map((e: any) => Module.fromAmino(e)) : [], cosmosSdkVersion: object.cosmos_sdk_version }; }, toAmino(message: VersionInfo): VersionInfoAmino { const obj: any = {}; obj.name = message.name; obj.app_name = message.appName; obj.version = message.version; obj.git_commit = message.gitCommit; obj.build_tags = message.buildTags; obj.go_version = message.goVersion; if (message.buildDeps) { obj.build_deps = message.buildDeps.map(e => e ? Module.toAmino(e) : undefined); } else { obj.build_deps = []; } obj.cosmos_sdk_version = message.cosmosSdkVersion; return obj; }, fromAminoMsg(object: VersionInfoAminoMsg): VersionInfo { return VersionInfo.fromAmino(object.value); }, toAminoMsg(message: VersionInfo): VersionInfoAminoMsg { return { type: "cosmos-sdk/VersionInfo", value: VersionInfo.toAmino(message) }; }, fromProtoMsg(message: VersionInfoProtoMsg): VersionInfo { return VersionInfo.decode(message.value); }, toProto(message: VersionInfo): Uint8Array { return VersionInfo.encode(message).finish(); }, toProtoMsg(message: VersionInfo): VersionInfoProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo", value: VersionInfo.encode(message).finish() }; } }; function createBaseModule(): Module { return { path: "", version: "", sum: "" }; } export const Module = { encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.path !== "") { writer.uint32(10).string(message.path); } if (message.version !== "") { writer.uint32(18).string(message.version); } if (message.sum !== "") { writer.uint32(26).string(message.sum); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Module { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.path = reader.string(); break; case 2: message.version = reader.string(); break; case 3: message.sum = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Module { return { path: isSet(object.path) ? String(object.path) : "", version: isSet(object.version) ? String(object.version) : "", sum: isSet(object.sum) ? String(object.sum) : "" }; }, toJSON(message: Module): unknown { const obj: any = {}; message.path !== undefined && (obj.path = message.path); message.version !== undefined && (obj.version = message.version); message.sum !== undefined && (obj.sum = message.sum); return obj; }, fromPartial(object: Partial): Module { const message = createBaseModule(); message.path = object.path ?? ""; message.version = object.version ?? ""; message.sum = object.sum ?? ""; return message; }, fromAmino(object: ModuleAmino): Module { return { path: object.path, version: object.version, sum: object.sum }; }, toAmino(message: Module): ModuleAmino { const obj: any = {}; obj.path = message.path; obj.version = message.version; obj.sum = message.sum; return obj; }, fromAminoMsg(object: ModuleAminoMsg): Module { return Module.fromAmino(object.value); }, toAminoMsg(message: Module): ModuleAminoMsg { return { type: "cosmos-sdk/Module", value: Module.toAmino(message) }; }, fromProtoMsg(message: ModuleProtoMsg): Module { return Module.decode(message.value); }, toProto(message: Module): Uint8Array { return Module.encode(message).finish(); }, toProtoMsg(message: Module): ModuleProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.Module", value: Module.encode(message).finish() }; } };