import { PageRequest, PageResponse } from "../../query/v1beta1/pagination"; import { Any } from "../../../../google/protobuf/any"; import { BlockID } from "../../../../tendermint/types/types"; import { Block } from "../../../../tendermint/types/block"; import { NodeInfo } from "../../../../tendermint/p2p/types"; import * as _m0 from "protobufjs/minimal"; import { Long, isSet, DeepPartial } from "@osmonauts/helpers"; /** 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; } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { block_height: Long; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination?: PageResponse; } /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequest { /** pagination defines an pagination for the request. */ pagination?: PageRequest; } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { block_height: Long; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination?: PageResponse; } /** Validator is the type for the validator-set. */ export interface Validator { address: string; pub_key: Any; voting_power: Long; proposer_priority: Long; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequest { height: Long; } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { block_id: BlockID; block: Block; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequest {} /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponse { block_id: BlockID; block: Block; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequest {} /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponse { syncing: boolean; } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequest {} /** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { node_info: NodeInfo; application_version: VersionInfo; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfo { name: string; app_name: string; version: string; git_commit: string; build_tags: string; go_version: string; build_deps: Module[]; /** Since: cosmos-sdk 0.43 */ cosmos_sdk_version: string; } /** Module is the type for VersionInfo */ export interface Module { /** module path */ path: string; /** module version */ version: string; /** checksum */ 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.fromString(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: DeepPartial): 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; } }; function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { return { block_height: Long.ZERO, validators: [], pagination: undefined }; } export const GetValidatorSetByHeightResponse = { encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.block_height.isZero()) { writer.uint32(8).int64(message.block_height); } 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.block_height = (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 { block_height: isSet(object.block_height) ? Long.fromString(object.block_height) : 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.block_height !== undefined && (obj.block_height = (message.block_height || 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: DeepPartial): GetValidatorSetByHeightResponse { const message = createBaseGetValidatorSetByHeightResponse(); message.block_height = object.block_height !== undefined && object.block_height !== null ? Long.fromValue(object.block_height) : 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; } }; 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: DeepPartial): GetLatestValidatorSetRequest { const message = createBaseGetLatestValidatorSetRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; } }; function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { return { block_height: Long.ZERO, validators: [], pagination: undefined }; } export const GetLatestValidatorSetResponse = { encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.block_height.isZero()) { writer.uint32(8).int64(message.block_height); } 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.block_height = (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 { block_height: isSet(object.block_height) ? Long.fromString(object.block_height) : 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.block_height !== undefined && (obj.block_height = (message.block_height || 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: DeepPartial): GetLatestValidatorSetResponse { const message = createBaseGetLatestValidatorSetResponse(); message.block_height = object.block_height !== undefined && object.block_height !== null ? Long.fromValue(object.block_height) : 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; } }; function createBaseValidator(): Validator { return { address: "", pub_key: undefined, voting_power: Long.ZERO, proposer_priority: 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.pub_key !== undefined) { Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); } if (!message.voting_power.isZero()) { writer.uint32(24).int64(message.voting_power); } if (!message.proposer_priority.isZero()) { writer.uint32(32).int64(message.proposer_priority); } 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.pub_key = Any.decode(reader, reader.uint32()); break; case 3: message.voting_power = (reader.int64() as Long); break; case 4: message.proposer_priority = (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) : "", pub_key: isSet(object.pub_key) ? Any.fromJSON(object.pub_key) : undefined, voting_power: isSet(object.voting_power) ? Long.fromString(object.voting_power) : Long.ZERO, proposer_priority: isSet(object.proposer_priority) ? Long.fromString(object.proposer_priority) : Long.ZERO }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.pub_key !== undefined && (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); message.voting_power !== undefined && (obj.voting_power = (message.voting_power || Long.ZERO).toString()); message.proposer_priority !== undefined && (obj.proposer_priority = (message.proposer_priority || Long.ZERO).toString()); return obj; }, fromPartial(object: DeepPartial): Validator { const message = createBaseValidator(); message.address = object.address ?? ""; message.pub_key = object.pub_key !== undefined && object.pub_key !== null ? Any.fromPartial(object.pub_key) : undefined; message.voting_power = object.voting_power !== undefined && object.voting_power !== null ? Long.fromValue(object.voting_power) : Long.ZERO; message.proposer_priority = object.proposer_priority !== undefined && object.proposer_priority !== null ? Long.fromValue(object.proposer_priority) : Long.ZERO; return message; } }; 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.fromString(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: DeepPartial): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; return message; } }; function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { return { block_id: undefined, block: undefined }; } export const GetBlockByHeightResponse = { encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block_id !== undefined) { BlockID.encode(message.block_id, 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.block_id = 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 { block_id: isSet(object.block_id) ? BlockID.fromJSON(object.block_id) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined }; }, toJSON(message: GetBlockByHeightResponse): unknown { const obj: any = {}; message.block_id !== undefined && (obj.block_id = message.block_id ? BlockID.toJSON(message.block_id) : undefined); message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); return obj; }, fromPartial(object: DeepPartial): GetBlockByHeightResponse { const message = createBaseGetBlockByHeightResponse(); message.block_id = object.block_id !== undefined && object.block_id !== null ? BlockID.fromPartial(object.block_id) : undefined; message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; return message; } }; 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(_: DeepPartial): GetLatestBlockRequest { const message = createBaseGetLatestBlockRequest(); return message; } }; function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { return { block_id: undefined, block: undefined }; } export const GetLatestBlockResponse = { encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block_id !== undefined) { BlockID.encode(message.block_id, 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.block_id = 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 { block_id: isSet(object.block_id) ? BlockID.fromJSON(object.block_id) : undefined, block: isSet(object.block) ? Block.fromJSON(object.block) : undefined }; }, toJSON(message: GetLatestBlockResponse): unknown { const obj: any = {}; message.block_id !== undefined && (obj.block_id = message.block_id ? BlockID.toJSON(message.block_id) : undefined); message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); return obj; }, fromPartial(object: DeepPartial): GetLatestBlockResponse { const message = createBaseGetLatestBlockResponse(); message.block_id = object.block_id !== undefined && object.block_id !== null ? BlockID.fromPartial(object.block_id) : undefined; message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; return message; } }; 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(_: DeepPartial): GetSyncingRequest { const message = createBaseGetSyncingRequest(); return message; } }; 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: DeepPartial): GetSyncingResponse { const message = createBaseGetSyncingResponse(); message.syncing = object.syncing ?? false; return message; } }; 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(_: DeepPartial): GetNodeInfoRequest { const message = createBaseGetNodeInfoRequest(); return message; } }; function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { return { node_info: undefined, application_version: undefined }; } export const GetNodeInfoResponse = { encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.node_info !== undefined) { NodeInfo.encode(message.node_info, writer.uint32(10).fork()).ldelim(); } if (message.application_version !== undefined) { VersionInfo.encode(message.application_version, 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.node_info = NodeInfo.decode(reader, reader.uint32()); break; case 2: message.application_version = VersionInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GetNodeInfoResponse { return { node_info: isSet(object.node_info) ? NodeInfo.fromJSON(object.node_info) : undefined, application_version: isSet(object.application_version) ? VersionInfo.fromJSON(object.application_version) : undefined }; }, toJSON(message: GetNodeInfoResponse): unknown { const obj: any = {}; message.node_info !== undefined && (obj.node_info = message.node_info ? NodeInfo.toJSON(message.node_info) : undefined); message.application_version !== undefined && (obj.application_version = message.application_version ? VersionInfo.toJSON(message.application_version) : undefined); return obj; }, fromPartial(object: DeepPartial): GetNodeInfoResponse { const message = createBaseGetNodeInfoResponse(); message.node_info = object.node_info !== undefined && object.node_info !== null ? NodeInfo.fromPartial(object.node_info) : undefined; message.application_version = object.application_version !== undefined && object.application_version !== null ? VersionInfo.fromPartial(object.application_version) : undefined; return message; } }; function createBaseVersionInfo(): VersionInfo { return { name: "", app_name: "", version: "", git_commit: "", build_tags: "", go_version: "", build_deps: [], cosmos_sdk_version: "" }; } 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.app_name !== "") { writer.uint32(18).string(message.app_name); } if (message.version !== "") { writer.uint32(26).string(message.version); } if (message.git_commit !== "") { writer.uint32(34).string(message.git_commit); } if (message.build_tags !== "") { writer.uint32(42).string(message.build_tags); } if (message.go_version !== "") { writer.uint32(50).string(message.go_version); } for (const v of message.build_deps) { Module.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.cosmos_sdk_version !== "") { writer.uint32(66).string(message.cosmos_sdk_version); } 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.app_name = reader.string(); break; case 3: message.version = reader.string(); break; case 4: message.git_commit = reader.string(); break; case 5: message.build_tags = reader.string(); break; case 6: message.go_version = reader.string(); break; case 7: message.build_deps.push(Module.decode(reader, reader.uint32())); break; case 8: message.cosmos_sdk_version = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): VersionInfo { return { name: isSet(object.name) ? String(object.name) : "", app_name: isSet(object.app_name) ? String(object.app_name) : "", version: isSet(object.version) ? String(object.version) : "", git_commit: isSet(object.git_commit) ? String(object.git_commit) : "", build_tags: isSet(object.build_tags) ? String(object.build_tags) : "", go_version: isSet(object.go_version) ? String(object.go_version) : "", build_deps: Array.isArray(object?.build_deps) ? object.build_deps.map((e: any) => Module.fromJSON(e)) : [], cosmos_sdk_version: isSet(object.cosmos_sdk_version) ? String(object.cosmos_sdk_version) : "" }; }, toJSON(message: VersionInfo): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.app_name !== undefined && (obj.app_name = message.app_name); message.version !== undefined && (obj.version = message.version); message.git_commit !== undefined && (obj.git_commit = message.git_commit); message.build_tags !== undefined && (obj.build_tags = message.build_tags); message.go_version !== undefined && (obj.go_version = message.go_version); if (message.build_deps) { obj.build_deps = message.build_deps.map(e => e ? Module.toJSON(e) : undefined); } else { obj.build_deps = []; } message.cosmos_sdk_version !== undefined && (obj.cosmos_sdk_version = message.cosmos_sdk_version); return obj; }, fromPartial(object: DeepPartial): VersionInfo { const message = createBaseVersionInfo(); message.name = object.name ?? ""; message.app_name = object.app_name ?? ""; message.version = object.version ?? ""; message.git_commit = object.git_commit ?? ""; message.build_tags = object.build_tags ?? ""; message.go_version = object.go_version ?? ""; message.build_deps = object.build_deps?.map(e => Module.fromPartial(e)) || []; message.cosmos_sdk_version = object.cosmos_sdk_version ?? ""; return message; } }; 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: DeepPartial): Module { const message = createBaseModule(); message.path = object.path ?? ""; message.version = object.version ?? ""; message.sum = object.sum ?? ""; return message; } };