/* eslint-disable */ import Long from 'long'; import _m0 from 'protobufjs/minimal'; import { PageRequest, PageResponse } from '../../../../cosmos/base/query/v1beta1/pagination'; import { Any } from '../../../../google/protobuf/any'; import { BlockID } from '../../../../tendermint/types/types'; import { Block } from '../../../../tendermint/types/block'; import { DefaultNodeInfo } from '../../../../tendermint/p2p/types'; export const protobufPackage = 'cosmos.base.tendermint.v1beta1'; /** 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 { blockHeight: 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 { blockHeight: 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; pubKey?: Any; votingPower: Long; proposerPriority: 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 { blockId?: 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 { blockId?: 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 request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { defaultNodeInfo?: DefaultNodeInfo; applicationVersion?: VersionInfo; } /** 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[]; } /** Module is the type for VersionInfo */ export interface Module { /** module path */ path: string; /** module version */ version: string; /** checksum */ sum: string; } const baseGetValidatorSetByHeightRequest: object = { height: Long.ZERO }; 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 = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; 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 { const message = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; if (object.height !== undefined && object.height !== null) { message.height = Long.fromString(object.height); } else { message.height = Long.ZERO; } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromJSON(object.pagination); } else { message.pagination = undefined; } return message; }, 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 = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; if (object.height !== undefined && object.height !== null) { message.height = object.height as Long; } else { message.height = Long.ZERO; } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } else { message.pagination = undefined; } return message; }, }; const baseGetValidatorSetByHeightResponse: object = { blockHeight: Long.ZERO }; 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 = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; message.validators = []; 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 { const message = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; message.validators = []; if (object.blockHeight !== undefined && object.blockHeight !== null) { message.blockHeight = Long.fromString(object.blockHeight); } else { message.blockHeight = Long.ZERO; } if (object.validators !== undefined && object.validators !== null) { for (const e of object.validators) { message.validators.push(Validator.fromJSON(e)); } } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromJSON(object.pagination); } else { message.pagination = undefined; } return message; }, 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: DeepPartial): GetValidatorSetByHeightResponse { const message = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; message.validators = []; if (object.blockHeight !== undefined && object.blockHeight !== null) { message.blockHeight = object.blockHeight as Long; } else { message.blockHeight = Long.ZERO; } if (object.validators !== undefined && object.validators !== null) { for (const e of object.validators) { message.validators.push(Validator.fromPartial(e)); } } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromPartial(object.pagination); } else { message.pagination = undefined; } return message; }, }; const baseGetLatestValidatorSetRequest: object = {}; 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 = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; 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 { const message = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromJSON(object.pagination); } else { message.pagination = undefined; } return message; }, 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 = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } else { message.pagination = undefined; } return message; }, }; const baseGetLatestValidatorSetResponse: object = { blockHeight: Long.ZERO }; 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 = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; message.validators = []; 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 { const message = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; message.validators = []; if (object.blockHeight !== undefined && object.blockHeight !== null) { message.blockHeight = Long.fromString(object.blockHeight); } else { message.blockHeight = Long.ZERO; } if (object.validators !== undefined && object.validators !== null) { for (const e of object.validators) { message.validators.push(Validator.fromJSON(e)); } } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromJSON(object.pagination); } else { message.pagination = undefined; } return message; }, 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: DeepPartial): GetLatestValidatorSetResponse { const message = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; message.validators = []; if (object.blockHeight !== undefined && object.blockHeight !== null) { message.blockHeight = object.blockHeight as Long; } else { message.blockHeight = Long.ZERO; } if (object.validators !== undefined && object.validators !== null) { for (const e of object.validators) { message.validators.push(Validator.fromPartial(e)); } } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromPartial(object.pagination); } else { message.pagination = undefined; } return message; }, }; const baseValidator: object = { address: '', 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 = { ...baseValidator } as Validator; 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 { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { message.address = String(object.address); } else { message.address = ''; } if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = Any.fromJSON(object.pubKey); } else { message.pubKey = undefined; } if (object.votingPower !== undefined && object.votingPower !== null) { message.votingPower = Long.fromString(object.votingPower); } else { message.votingPower = Long.ZERO; } if (object.proposerPriority !== undefined && object.proposerPriority !== null) { message.proposerPriority = Long.fromString(object.proposerPriority); } else { message.proposerPriority = Long.ZERO; } return message; }, 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: DeepPartial): Validator { const message = { ...baseValidator } as Validator; if (object.address !== undefined && object.address !== null) { message.address = object.address; } else { message.address = ''; } if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = Any.fromPartial(object.pubKey); } else { message.pubKey = undefined; } if (object.votingPower !== undefined && object.votingPower !== null) { message.votingPower = object.votingPower as Long; } else { message.votingPower = Long.ZERO; } if (object.proposerPriority !== undefined && object.proposerPriority !== null) { message.proposerPriority = object.proposerPriority as Long; } else { message.proposerPriority = Long.ZERO; } return message; }, }; const baseGetBlockByHeightRequest: object = { 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 = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; 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 { const message = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; if (object.height !== undefined && object.height !== null) { message.height = Long.fromString(object.height); } else { message.height = Long.ZERO; } return message; }, 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 = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; if (object.height !== undefined && object.height !== null) { message.height = object.height as Long; } else { message.height = Long.ZERO; } return message; }, }; const baseGetBlockByHeightResponse: object = {}; 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 = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; 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 { const message = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromJSON(object.blockId); } else { message.blockId = undefined; } if (object.block !== undefined && object.block !== null) { message.block = Block.fromJSON(object.block); } else { message.block = undefined; } return message; }, 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: DeepPartial): GetBlockByHeightResponse { const message = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromPartial(object.blockId); } else { message.blockId = undefined; } if (object.block !== undefined && object.block !== null) { message.block = Block.fromPartial(object.block); } else { message.block = undefined; } return message; }, }; const baseGetLatestBlockRequest: object = {}; 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 = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetLatestBlockRequest { const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; return message; }, toJSON(_: GetLatestBlockRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: DeepPartial): GetLatestBlockRequest { const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; return message; }, }; const baseGetLatestBlockResponse: object = {}; 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 = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; 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 { const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromJSON(object.blockId); } else { message.blockId = undefined; } if (object.block !== undefined && object.block !== null) { message.block = Block.fromJSON(object.block); } else { message.block = undefined; } return message; }, 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: DeepPartial): GetLatestBlockResponse { const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromPartial(object.blockId); } else { message.blockId = undefined; } if (object.block !== undefined && object.block !== null) { message.block = Block.fromPartial(object.block); } else { message.block = undefined; } return message; }, }; const baseGetSyncingRequest: object = {}; 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 = { ...baseGetSyncingRequest } as GetSyncingRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetSyncingRequest { const message = { ...baseGetSyncingRequest } as GetSyncingRequest; return message; }, toJSON(_: GetSyncingRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: DeepPartial): GetSyncingRequest { const message = { ...baseGetSyncingRequest } as GetSyncingRequest; return message; }, }; const baseGetSyncingResponse: object = { 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 = { ...baseGetSyncingResponse } as GetSyncingResponse; 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 { const message = { ...baseGetSyncingResponse } as GetSyncingResponse; if (object.syncing !== undefined && object.syncing !== null) { message.syncing = Boolean(object.syncing); } else { message.syncing = false; } return message; }, toJSON(message: GetSyncingResponse): unknown { const obj: any = {}; message.syncing !== undefined && (obj.syncing = message.syncing); return obj; }, fromPartial(object: DeepPartial): GetSyncingResponse { const message = { ...baseGetSyncingResponse } as GetSyncingResponse; if (object.syncing !== undefined && object.syncing !== null) { message.syncing = object.syncing; } else { message.syncing = false; } return message; }, }; const baseGetNodeInfoRequest: object = {}; 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 = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): GetNodeInfoRequest { const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; return message; }, toJSON(_: GetNodeInfoRequest): unknown { const obj: any = {}; return obj; }, fromPartial(_: DeepPartial): GetNodeInfoRequest { const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; return message; }, }; const baseGetNodeInfoResponse: object = {}; export const GetNodeInfoResponse = { encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.defaultNodeInfo !== undefined) { DefaultNodeInfo.encode(message.defaultNodeInfo, 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 = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.defaultNodeInfo = DefaultNodeInfo.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 { const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; if (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) { message.defaultNodeInfo = DefaultNodeInfo.fromJSON(object.defaultNodeInfo); } else { message.defaultNodeInfo = undefined; } if (object.applicationVersion !== undefined && object.applicationVersion !== null) { message.applicationVersion = VersionInfo.fromJSON(object.applicationVersion); } else { message.applicationVersion = undefined; } return message; }, toJSON(message: GetNodeInfoResponse): unknown { const obj: any = {}; message.defaultNodeInfo !== undefined && (obj.defaultNodeInfo = message.defaultNodeInfo ? DefaultNodeInfo.toJSON(message.defaultNodeInfo) : undefined); message.applicationVersion !== undefined && (obj.applicationVersion = message.applicationVersion ? VersionInfo.toJSON(message.applicationVersion) : undefined); return obj; }, fromPartial(object: DeepPartial): GetNodeInfoResponse { const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; if (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) { message.defaultNodeInfo = DefaultNodeInfo.fromPartial(object.defaultNodeInfo); } else { message.defaultNodeInfo = undefined; } if (object.applicationVersion !== undefined && object.applicationVersion !== null) { message.applicationVersion = VersionInfo.fromPartial(object.applicationVersion); } else { message.applicationVersion = undefined; } return message; }, }; const baseVersionInfo: object = { name: '', appName: '', version: '', gitCommit: '', buildTags: '', goVersion: '' }; 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(); } 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 = { ...baseVersionInfo } as VersionInfo; message.buildDeps = []; 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; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): VersionInfo { const message = { ...baseVersionInfo } as VersionInfo; message.buildDeps = []; if (object.name !== undefined && object.name !== null) { message.name = String(object.name); } else { message.name = ''; } if (object.appName !== undefined && object.appName !== null) { message.appName = String(object.appName); } else { message.appName = ''; } if (object.version !== undefined && object.version !== null) { message.version = String(object.version); } else { message.version = ''; } if (object.gitCommit !== undefined && object.gitCommit !== null) { message.gitCommit = String(object.gitCommit); } else { message.gitCommit = ''; } if (object.buildTags !== undefined && object.buildTags !== null) { message.buildTags = String(object.buildTags); } else { message.buildTags = ''; } if (object.goVersion !== undefined && object.goVersion !== null) { message.goVersion = String(object.goVersion); } else { message.goVersion = ''; } if (object.buildDeps !== undefined && object.buildDeps !== null) { for (const e of object.buildDeps) { message.buildDeps.push(Module.fromJSON(e)); } } return message; }, 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 = []; } return obj; }, fromPartial(object: DeepPartial): VersionInfo { const message = { ...baseVersionInfo } as VersionInfo; message.buildDeps = []; if (object.name !== undefined && object.name !== null) { message.name = object.name; } else { message.name = ''; } if (object.appName !== undefined && object.appName !== null) { message.appName = object.appName; } else { message.appName = ''; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } else { message.version = ''; } if (object.gitCommit !== undefined && object.gitCommit !== null) { message.gitCommit = object.gitCommit; } else { message.gitCommit = ''; } if (object.buildTags !== undefined && object.buildTags !== null) { message.buildTags = object.buildTags; } else { message.buildTags = ''; } if (object.goVersion !== undefined && object.goVersion !== null) { message.goVersion = object.goVersion; } else { message.goVersion = ''; } if (object.buildDeps !== undefined && object.buildDeps !== null) { for (const e of object.buildDeps) { message.buildDeps.push(Module.fromPartial(e)); } } return message; }, }; const baseModule: object = { 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 = { ...baseModule } as Module; 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 { const message = { ...baseModule } as Module; if (object.path !== undefined && object.path !== null) { message.path = String(object.path); } else { message.path = ''; } if (object.version !== undefined && object.version !== null) { message.version = String(object.version); } else { message.version = ''; } if (object.sum !== undefined && object.sum !== null) { message.sum = String(object.sum); } else { message.sum = ''; } return message; }, 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 = { ...baseModule } as Module; if (object.path !== undefined && object.path !== null) { message.path = object.path; } else { message.path = ''; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } else { message.version = ''; } if (object.sum !== undefined && object.sum !== null) { message.sum = object.sum; } else { message.sum = ''; } return message; }, }; /** Service defines the gRPC querier service for tendermint queries. */ export interface Service { /** GetNodeInfo queries the current node info. */ GetNodeInfo(request: GetNodeInfoRequest): Promise; /** GetSyncing queries node syncing. */ GetSyncing(request: GetSyncingRequest): Promise; /** GetLatestBlock returns the latest block. */ GetLatestBlock(request: GetLatestBlockRequest): Promise; /** GetBlockByHeight queries block for given height. */ GetBlockByHeight(request: GetBlockByHeightRequest): Promise; /** GetLatestValidatorSet queries latest validator-set. */ GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise; /** GetValidatorSetByHeight queries validator-set at a given height. */ GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.GetNodeInfo = this.GetNodeInfo.bind(this); this.GetSyncing = this.GetSyncing.bind(this); this.GetLatestBlock = this.GetLatestBlock.bind(this); this.GetBlockByHeight = this.GetBlockByHeight.bind(this); this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this); this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this); } GetNodeInfo(request: GetNodeInfoRequest): Promise { const data = GetNodeInfoRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetNodeInfo', data); return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))); } GetSyncing(request: GetSyncingRequest): Promise { const data = GetSyncingRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetSyncing', data); return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))); } GetLatestBlock(request: GetLatestBlockRequest): Promise { const data = GetLatestBlockRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetLatestBlock', data); return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))); } GetBlockByHeight(request: GetBlockByHeightRequest): Promise { const data = GetBlockByHeightRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetBlockByHeight', data); return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))); } GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise { const data = GetLatestValidatorSetRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetLatestValidatorSet', data); return promise.then((data) => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); } GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { const data = GetValidatorSetByHeightRequest.encode(request).finish(); const promise = this.rpc.request('cosmos.base.tendermint.v1beta1.Service', 'GetValidatorSetByHeight', data); return promise.then((data) => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); } } interface Rpc { request(service: string, method: string, data: Uint8Array): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); }