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 as Block1 } from "../../../../tendermint/types/block"; import { BlockAmino as Block1Amino } from "../../../../tendermint/types/block"; import { BlockSDKType as Block1SDKType } from "../../../../tendermint/types/block"; import { Block as Block2 } from "./types"; import { BlockAmino as Block2Amino } from "./types"; import { BlockSDKType as Block2SDKType } from "./types"; import { DefaultNodeInfo, DefaultNodeInfoAmino, DefaultNodeInfoSDKType } from "../../../../tendermint/p2p/types"; import { BinaryWriter } from "../../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * GetValidatorSetByHeightRequest is the request type for the * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { height: bigint; /** 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: bigint; pagination?: PageRequestSDKType; } /** * GetValidatorSetByHeightResponse is the response type for the * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { blockHeight: bigint; 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: bigint; 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: bigint; 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: bigint; validators: ValidatorSDKType[]; pagination?: PageResponseSDKType; } /** Validator is the type for the validator-set. */ export interface Validator { address: string; pubKey?: Any; votingPower: bigint; proposerPriority: bigint; } 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: bigint; proposer_priority: bigint; } /** * GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight * RPC method. */ export interface GetBlockByHeightRequest { height: bigint; } 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: bigint; } /** * GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight * RPC method. */ export interface GetBlockByHeightResponse { blockId?: BlockID; /** Deprecated: please use `sdk_block` instead */ block?: Block1; /** Since: cosmos-sdk 0.47 */ sdkBlock?: Block2; } 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; /** Deprecated: please use `sdk_block` instead */ block?: Block1Amino; /** Since: cosmos-sdk 0.47 */ sdk_block?: Block2Amino; } 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?: Block1SDKType; sdk_block?: Block2SDKType; } /** * 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; /** Deprecated: please use `sdk_block` instead */ block?: Block1; /** Since: cosmos-sdk 0.47 */ sdkBlock?: Block2; } 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; /** Deprecated: please use `sdk_block` instead */ block?: Block1Amino; /** Since: cosmos-sdk 0.47 */ sdk_block?: Block2Amino; } 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?: Block1SDKType; sdk_block?: Block2SDKType; } /** 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 { defaultNodeInfo?: DefaultNodeInfo; 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 { default_node_info?: DefaultNodeInfoAmino; 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 { default_node_info?: DefaultNodeInfoSDKType; 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; } /** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ export interface ABCIQueryRequest { data: Uint8Array; path: string; height: bigint; prove: boolean; } export interface ABCIQueryRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest"; value: Uint8Array; } /** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ export interface ABCIQueryRequestAmino { data?: string; path?: string; height?: string; prove?: boolean; } export interface ABCIQueryRequestAminoMsg { type: "cosmos-sdk/ABCIQueryRequest"; value: ABCIQueryRequestAmino; } /** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ export interface ABCIQueryRequestSDKType { data: Uint8Array; path: string; height: bigint; prove: boolean; } /** * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC * query. * * Note: This type is a duplicate of the ResponseQuery proto type defined in * Tendermint. */ export interface ABCIQueryResponse { code: number; /** nondeterministic */ log: string; /** nondeterministic */ info: string; index: bigint; key: Uint8Array; value: Uint8Array; proofOps?: ProofOps; height: bigint; codespace: string; } export interface ABCIQueryResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse"; value: Uint8Array; } /** * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC * query. * * Note: This type is a duplicate of the ResponseQuery proto type defined in * Tendermint. */ export interface ABCIQueryResponseAmino { code?: number; /** nondeterministic */ log?: string; /** nondeterministic */ info?: string; index?: string; key?: string; value?: string; proof_ops?: ProofOpsAmino; height?: string; codespace?: string; } export interface ABCIQueryResponseAminoMsg { type: "cosmos-sdk/ABCIQueryResponse"; value: ABCIQueryResponseAmino; } /** * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC * query. * * Note: This type is a duplicate of the ResponseQuery proto type defined in * Tendermint. */ export interface ABCIQueryResponseSDKType { code: number; log: string; info: string; index: bigint; key: Uint8Array; value: Uint8Array; proof_ops?: ProofOpsSDKType; height: bigint; codespace: string; } /** * ProofOp defines an operation used for calculating Merkle root. The data could * be arbitrary format, providing nessecary data for example neighbouring node * hash. * * Note: This type is a duplicate of the ProofOp proto type defined in * Tendermint. */ export interface ProofOp { type: string; key: Uint8Array; data: Uint8Array; } export interface ProofOpProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp"; value: Uint8Array; } /** * ProofOp defines an operation used for calculating Merkle root. The data could * be arbitrary format, providing nessecary data for example neighbouring node * hash. * * Note: This type is a duplicate of the ProofOp proto type defined in * Tendermint. */ export interface ProofOpAmino { type?: string; key?: string; data?: string; } export interface ProofOpAminoMsg { type: "cosmos-sdk/ProofOp"; value: ProofOpAmino; } /** * ProofOp defines an operation used for calculating Merkle root. The data could * be arbitrary format, providing nessecary data for example neighbouring node * hash. * * Note: This type is a duplicate of the ProofOp proto type defined in * Tendermint. */ export interface ProofOpSDKType { type: string; key: Uint8Array; data: Uint8Array; } /** * ProofOps is Merkle proof defined by the list of ProofOps. * * Note: This type is a duplicate of the ProofOps proto type defined in * Tendermint. */ export interface ProofOps { ops: ProofOp[]; } export interface ProofOpsProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps"; value: Uint8Array; } /** * ProofOps is Merkle proof defined by the list of ProofOps. * * Note: This type is a duplicate of the ProofOps proto type defined in * Tendermint. */ export interface ProofOpsAmino { ops?: ProofOpAmino[]; } export interface ProofOpsAminoMsg { type: "cosmos-sdk/ProofOps"; value: ProofOpsAmino; } /** * ProofOps is Merkle proof defined by the list of ProofOps. * * Note: This type is a duplicate of the ProofOps proto type defined in * Tendermint. */ export interface ProofOpsSDKType { ops: ProofOpSDKType[]; } function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { return { height: BigInt(0), pagination: undefined }; } export const GetValidatorSetByHeightRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", encode(message: GetValidatorSetByHeightRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, fromJSON(object: any): GetValidatorSetByHeightRequest { return { height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, fromPartial(object: Partial): GetValidatorSetByHeightRequest { const message = createBaseGetValidatorSetByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetValidatorSetByHeightRequestAmino): GetValidatorSetByHeightRequest { const message = createBaseGetValidatorSetByHeightRequest(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message: GetValidatorSetByHeightRequest): GetValidatorSetByHeightRequestAmino { const obj: any = {}; obj.height = message.height !== BigInt(0) ? 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: BigInt(0), validators: [], pagination: undefined }; } export const GetValidatorSetByHeightResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", encode(message: GetValidatorSetByHeightResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockHeight !== BigInt(0)) { 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; }, fromJSON(object: any): GetValidatorSetByHeightResponse { return { blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, fromPartial(object: Partial): GetValidatorSetByHeightResponse { const message = createBaseGetValidatorSetByHeightResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); 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 { const message = createBaseGetValidatorSetByHeightResponse(); if (object.block_height !== undefined && object.block_height !== null) { message.blockHeight = BigInt(object.block_height); } message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message: GetValidatorSetByHeightResponse): GetValidatorSetByHeightResponseAmino { const obj: any = {}; obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { obj.validators = message.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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", encode(message: GetLatestValidatorSetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, fromJSON(object: any): GetLatestValidatorSetRequest { return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, 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 { const message = createBaseGetLatestValidatorSetRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromAmino(object.pagination); } return message; }, 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: BigInt(0), validators: [], pagination: undefined }; } export const GetLatestValidatorSetResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", encode(message: GetLatestValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockHeight !== BigInt(0)) { 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; }, fromJSON(object: any): GetLatestValidatorSetResponse { return { blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, fromPartial(object: Partial): GetLatestValidatorSetResponse { const message = createBaseGetLatestValidatorSetResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); 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 { const message = createBaseGetLatestValidatorSetResponse(); if (object.block_height !== undefined && object.block_height !== null) { message.blockHeight = BigInt(object.block_height); } message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message: GetLatestValidatorSetResponse): GetLatestValidatorSetResponseAmino { const obj: any = {}; obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { obj.validators = message.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: BigInt(0), proposerPriority: BigInt(0) }; } export const Validator = { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator", encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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 !== BigInt(0)) { writer.uint32(24).int64(message.votingPower); } if (message.proposerPriority !== BigInt(0)) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, 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) ? BigInt(object.votingPower.toString()) : BigInt(0), proposerPriority: isSet(object.proposerPriority) ? BigInt(object.proposerPriority.toString()) : BigInt(0) }; }, 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 ? BigInt(object.votingPower.toString()) : BigInt(0); message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorAmino): Validator { const message = createBaseValidator(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } if (object.pub_key !== undefined && object.pub_key !== null) { message.pubKey = Any.fromAmino(object.pub_key); } if (object.voting_power !== undefined && object.voting_power !== null) { message.votingPower = BigInt(object.voting_power); } if (object.proposer_priority !== undefined && object.proposer_priority !== null) { message.proposerPriority = BigInt(object.proposer_priority); } return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; obj.proposer_priority = message.proposerPriority !== BigInt(0) ? 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: BigInt(0) }; } export const GetBlockByHeightRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", encode(message: GetBlockByHeightRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, fromJSON(object: any): GetBlockByHeightRequest { return { height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, fromPartial(object: Partial): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: GetBlockByHeightRequestAmino): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } return message; }, toAmino(message: GetBlockByHeightRequest): GetBlockByHeightRequestAmino { const obj: any = {}; obj.height = message.height !== BigInt(0) ? 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, sdkBlock: undefined }; } export const GetBlockByHeightResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", encode(message: GetBlockByHeightResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block1.encode(message.block, writer.uint32(18).fork()).ldelim(); } if (message.sdkBlock !== undefined) { Block2.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, fromJSON(object: any): GetBlockByHeightResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block1.fromJSON(object.block) : undefined, sdkBlock: isSet(object.sdkBlock) ? Block2.fromJSON(object.sdkBlock) : undefined }; }, 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 ? Block1.fromPartial(object.block) : undefined; message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? Block2.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object: GetBlockByHeightResponseAmino): GetBlockByHeightResponse { const message = createBaseGetBlockByHeightResponse(); if (object.block_id !== undefined && object.block_id !== null) { message.blockId = BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { message.block = Block1.fromAmino(object.block); } if (object.sdk_block !== undefined && object.sdk_block !== null) { message.sdkBlock = Block2.fromAmino(object.sdk_block); } return message; }, toAmino(message: GetBlockByHeightResponse): GetBlockByHeightResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? Block1.toAmino(message.block) : undefined; obj.sdk_block = message.sdkBlock ? Block2.toAmino(message.sdkBlock) : 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", encode(_: GetLatestBlockRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, fromJSON(_: any): GetLatestBlockRequest { return {}; }, fromPartial(_: Partial): GetLatestBlockRequest { const message = createBaseGetLatestBlockRequest(); return message; }, fromAmino(_: GetLatestBlockRequestAmino): GetLatestBlockRequest { const message = createBaseGetLatestBlockRequest(); return message; }, 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, sdkBlock: undefined }; } export const GetLatestBlockResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", encode(message: GetLatestBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block1.encode(message.block, writer.uint32(18).fork()).ldelim(); } if (message.sdkBlock !== undefined) { Block2.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, fromJSON(object: any): GetLatestBlockResponse { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, block: isSet(object.block) ? Block1.fromJSON(object.block) : undefined, sdkBlock: isSet(object.sdkBlock) ? Block2.fromJSON(object.sdkBlock) : undefined }; }, 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 ? Block1.fromPartial(object.block) : undefined; message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? Block2.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object: GetLatestBlockResponseAmino): GetLatestBlockResponse { const message = createBaseGetLatestBlockResponse(); if (object.block_id !== undefined && object.block_id !== null) { message.blockId = BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { message.block = Block1.fromAmino(object.block); } if (object.sdk_block !== undefined && object.sdk_block !== null) { message.sdkBlock = Block2.fromAmino(object.sdk_block); } return message; }, toAmino(message: GetLatestBlockResponse): GetLatestBlockResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? Block1.toAmino(message.block) : undefined; obj.sdk_block = message.sdkBlock ? Block2.toAmino(message.sdkBlock) : 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest", encode(_: GetSyncingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, fromJSON(_: any): GetSyncingRequest { return {}; }, fromPartial(_: Partial): GetSyncingRequest { const message = createBaseGetSyncingRequest(); return message; }, fromAmino(_: GetSyncingRequestAmino): GetSyncingRequest { const message = createBaseGetSyncingRequest(); return message; }, 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse", encode(message: GetSyncingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, fromJSON(object: any): GetSyncingResponse { return { syncing: isSet(object.syncing) ? Boolean(object.syncing) : false }; }, fromPartial(object: Partial): GetSyncingResponse { const message = createBaseGetSyncingResponse(); message.syncing = object.syncing ?? false; return message; }, fromAmino(object: GetSyncingResponseAmino): GetSyncingResponse { const message = createBaseGetSyncingResponse(); if (object.syncing !== undefined && object.syncing !== null) { message.syncing = object.syncing; } return message; }, toAmino(message: GetSyncingResponse): GetSyncingResponseAmino { const obj: any = {}; obj.syncing = message.syncing === false ? undefined : 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", encode(_: GetNodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, fromJSON(_: any): GetNodeInfoRequest { return {}; }, fromPartial(_: Partial): GetNodeInfoRequest { const message = createBaseGetNodeInfoRequest(); return message; }, fromAmino(_: GetNodeInfoRequestAmino): GetNodeInfoRequest { const message = createBaseGetNodeInfoRequest(); return message; }, 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 { defaultNodeInfo: undefined, applicationVersion: undefined }; } export const GetNodeInfoResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", encode(message: GetNodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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; }, fromJSON(object: any): GetNodeInfoResponse { return { defaultNodeInfo: isSet(object.defaultNodeInfo) ? DefaultNodeInfo.fromJSON(object.defaultNodeInfo) : undefined, applicationVersion: isSet(object.applicationVersion) ? VersionInfo.fromJSON(object.applicationVersion) : undefined }; }, fromPartial(object: Partial): GetNodeInfoResponse { const message = createBaseGetNodeInfoResponse(); message.defaultNodeInfo = object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo) : undefined; message.applicationVersion = object.applicationVersion !== undefined && object.applicationVersion !== null ? VersionInfo.fromPartial(object.applicationVersion) : undefined; return message; }, fromAmino(object: GetNodeInfoResponseAmino): GetNodeInfoResponse { const message = createBaseGetNodeInfoResponse(); if (object.default_node_info !== undefined && object.default_node_info !== null) { message.defaultNodeInfo = DefaultNodeInfo.fromAmino(object.default_node_info); } if (object.application_version !== undefined && object.application_version !== null) { message.applicationVersion = VersionInfo.fromAmino(object.application_version); } return message; }, toAmino(message: GetNodeInfoResponse): GetNodeInfoResponseAmino { const obj: any = {}; obj.default_node_info = message.defaultNodeInfo ? DefaultNodeInfo.toAmino(message.defaultNodeInfo) : 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo", encode(message: VersionInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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; }, 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) : "" }; }, 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 { const message = createBaseVersionInfo(); if (object.name !== undefined && object.name !== null) { message.name = object.name; } if (object.app_name !== undefined && object.app_name !== null) { message.appName = object.app_name; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.git_commit !== undefined && object.git_commit !== null) { message.gitCommit = object.git_commit; } if (object.build_tags !== undefined && object.build_tags !== null) { message.buildTags = object.build_tags; } if (object.go_version !== undefined && object.go_version !== null) { message.goVersion = object.go_version; } message.buildDeps = object.build_deps?.map(e => Module.fromAmino(e)) || []; if (object.cosmos_sdk_version !== undefined && object.cosmos_sdk_version !== null) { message.cosmosSdkVersion = object.cosmos_sdk_version; } return message; }, toAmino(message: VersionInfo): VersionInfoAmino { const obj: any = {}; obj.name = message.name === "" ? undefined : message.name; obj.app_name = message.appName === "" ? undefined : message.appName; obj.version = message.version === "" ? undefined : message.version; obj.git_commit = message.gitCommit === "" ? undefined : message.gitCommit; obj.build_tags = message.buildTags === "" ? undefined : message.buildTags; obj.go_version = message.goVersion === "" ? undefined : message.goVersion; if (message.buildDeps) { obj.build_deps = message.buildDeps.map(e => e ? Module.toAmino(e) : undefined); } else { obj.build_deps = message.buildDeps; } obj.cosmos_sdk_version = message.cosmosSdkVersion === "" ? undefined : 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 = { typeUrl: "/cosmos.base.tendermint.v1beta1.Module", encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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; }, 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) : "" }; }, 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 { const message = createBaseModule(); if (object.path !== undefined && object.path !== null) { message.path = object.path; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.sum !== undefined && object.sum !== null) { message.sum = object.sum; } return message; }, toAmino(message: Module): ModuleAmino { const obj: any = {}; obj.path = message.path === "" ? undefined : message.path; obj.version = message.version === "" ? undefined : message.version; obj.sum = message.sum === "" ? undefined : 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() }; } }; function createBaseABCIQueryRequest(): ABCIQueryRequest { return { data: new Uint8Array(), path: "", height: BigInt(0), prove: false }; } export const ABCIQueryRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest", encode(message: ABCIQueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { writer.uint32(32).bool(message.prove); } return writer; }, fromJSON(object: any): ABCIQueryRequest { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), path: isSet(object.path) ? String(object.path) : "", height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), prove: isSet(object.prove) ? Boolean(object.prove) : false }; }, fromPartial(object: Partial): ABCIQueryRequest { const message = createBaseABCIQueryRequest(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.prove = object.prove ?? false; return message; }, fromAmino(object: ABCIQueryRequestAmino): ABCIQueryRequest { const message = createBaseABCIQueryRequest(); if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } if (object.path !== undefined && object.path !== null) { message.path = object.path; } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.prove !== undefined && object.prove !== null) { message.prove = object.prove; } return message; }, toAmino(message: ABCIQueryRequest): ABCIQueryRequestAmino { const obj: any = {}; obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.path = message.path === "" ? undefined : message.path; obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.prove = message.prove === false ? undefined : message.prove; return obj; }, fromAminoMsg(object: ABCIQueryRequestAminoMsg): ABCIQueryRequest { return ABCIQueryRequest.fromAmino(object.value); }, toAminoMsg(message: ABCIQueryRequest): ABCIQueryRequestAminoMsg { return { type: "cosmos-sdk/ABCIQueryRequest", value: ABCIQueryRequest.toAmino(message) }; }, fromProtoMsg(message: ABCIQueryRequestProtoMsg): ABCIQueryRequest { return ABCIQueryRequest.decode(message.value); }, toProto(message: ABCIQueryRequest): Uint8Array { return ABCIQueryRequest.encode(message).finish(); }, toProtoMsg(message: ABCIQueryRequest): ABCIQueryRequestProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest", value: ABCIQueryRequest.encode(message).finish() }; } }; function createBaseABCIQueryResponse(): ABCIQueryResponse { return { code: 0, log: "", info: "", index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), proofOps: undefined, height: BigInt(0), codespace: "" }; } export const ABCIQueryResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse", encode(message: ABCIQueryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } if (message.log !== "") { writer.uint32(26).string(message.log); } if (message.info !== "") { writer.uint32(34).string(message.info); } if (message.index !== BigInt(0)) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { writer.uint32(50).bytes(message.key); } if (message.value.length !== 0) { writer.uint32(58).bytes(message.value); } if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } if (message.height !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { writer.uint32(82).string(message.codespace); } return writer; }, fromJSON(object: any): ABCIQueryResponse { return { code: isSet(object.code) ? Number(object.code) : 0, log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), codespace: isSet(object.codespace) ? String(object.codespace) : "" }; }, fromPartial(object: Partial): ABCIQueryResponse { const message = createBaseABCIQueryResponse(); message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ABCIQueryResponseAmino): ABCIQueryResponse { const message = createBaseABCIQueryResponse(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } if (object.index !== undefined && object.index !== null) { message.index = BigInt(object.index); } if (object.key !== undefined && object.key !== null) { message.key = bytesFromBase64(object.key); } if (object.value !== undefined && object.value !== null) { message.value = bytesFromBase64(object.value); } if (object.proof_ops !== undefined && object.proof_ops !== null) { message.proofOps = ProofOps.fromAmino(object.proof_ops); } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.codespace !== undefined && object.codespace !== null) { message.codespace = object.codespace; } return message; }, toAmino(message: ABCIQueryResponse): ABCIQueryResponseAmino { const obj: any = {}; obj.code = message.code === 0 ? undefined : message.code; obj.log = message.log === "" ? undefined : message.log; obj.info = message.info === "" ? undefined : message.info; obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.codespace = message.codespace === "" ? undefined : message.codespace; return obj; }, fromAminoMsg(object: ABCIQueryResponseAminoMsg): ABCIQueryResponse { return ABCIQueryResponse.fromAmino(object.value); }, toAminoMsg(message: ABCIQueryResponse): ABCIQueryResponseAminoMsg { return { type: "cosmos-sdk/ABCIQueryResponse", value: ABCIQueryResponse.toAmino(message) }; }, fromProtoMsg(message: ABCIQueryResponseProtoMsg): ABCIQueryResponse { return ABCIQueryResponse.decode(message.value); }, toProto(message: ABCIQueryResponse): Uint8Array { return ABCIQueryResponse.encode(message).finish(); }, toProtoMsg(message: ABCIQueryResponse): ABCIQueryResponseProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse", value: ABCIQueryResponse.encode(message).finish() }; } }; function createBaseProofOp(): ProofOp { return { type: "", key: new Uint8Array(), data: new Uint8Array() }; } export const ProofOp = { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp", encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } if (message.key.length !== 0) { writer.uint32(18).bytes(message.key); } if (message.data.length !== 0) { writer.uint32(26).bytes(message.data); } return writer; }, fromJSON(object: any): ProofOp { return { type: isSet(object.type) ? String(object.type) : "", key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, fromPartial(object: Partial): ProofOp { const message = createBaseProofOp(); message.type = object.type ?? ""; message.key = object.key ?? new Uint8Array(); message.data = object.data ?? new Uint8Array(); return message; }, fromAmino(object: ProofOpAmino): ProofOp { const message = createBaseProofOp(); if (object.type !== undefined && object.type !== null) { message.type = object.type; } if (object.key !== undefined && object.key !== null) { message.key = bytesFromBase64(object.key); } if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); } return message; }, toAmino(message: ProofOp): ProofOpAmino { const obj: any = {}; obj.type = message.type === "" ? undefined : message.type; obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: ProofOpAminoMsg): ProofOp { return ProofOp.fromAmino(object.value); }, toAminoMsg(message: ProofOp): ProofOpAminoMsg { return { type: "cosmos-sdk/ProofOp", value: ProofOp.toAmino(message) }; }, fromProtoMsg(message: ProofOpProtoMsg): ProofOp { return ProofOp.decode(message.value); }, toProto(message: ProofOp): Uint8Array { return ProofOp.encode(message).finish(); }, toProtoMsg(message: ProofOp): ProofOpProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp", value: ProofOp.encode(message).finish() }; } }; function createBaseProofOps(): ProofOps { return { ops: [] }; } export const ProofOps = { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps", encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, fromJSON(object: any): ProofOps { return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; }, fromPartial(object: Partial): ProofOps { const message = createBaseProofOps(); message.ops = object.ops?.map(e => ProofOp.fromPartial(e)) || []; return message; }, fromAmino(object: ProofOpsAmino): ProofOps { const message = createBaseProofOps(); message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; return message; }, toAmino(message: ProofOps): ProofOpsAmino { const obj: any = {}; if (message.ops) { obj.ops = message.ops.map(e => e ? ProofOp.toAmino(e) : undefined); } else { obj.ops = message.ops; } return obj; }, fromAminoMsg(object: ProofOpsAminoMsg): ProofOps { return ProofOps.fromAmino(object.value); }, toAminoMsg(message: ProofOps): ProofOpsAminoMsg { return { type: "cosmos-sdk/ProofOps", value: ProofOps.toAmino(message) }; }, fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { return ProofOps.decode(message.value); }, toProto(message: ProofOps): Uint8Array { return ProofOps.encode(message).finish(); }, toProtoMsg(message: ProofOps): ProofOpsProtoMsg { return { typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps", value: ProofOps.encode(message).finish() }; } };