UNPKG

interchainjs

Version:

InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.

1,250 lines 80.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProofOps = exports.ProofOp = exports.ABCIQueryResponse = exports.ABCIQueryRequest = exports.Module = exports.VersionInfo = exports.GetNodeInfoResponse = exports.GetNodeInfoRequest = exports.GetSyncingResponse = exports.GetSyncingRequest = exports.GetLatestBlockResponse = exports.GetLatestBlockRequest = exports.GetBlockByHeightResponse = exports.GetBlockByHeightRequest = exports.Validator = exports.GetLatestValidatorSetResponse = exports.GetLatestValidatorSetRequest = exports.GetValidatorSetByHeightResponse = exports.GetValidatorSetByHeightRequest = void 0; const pagination_1 = require("../../query/v1beta1/pagination"); const any_1 = require("../../../../google/protobuf/any"); const types_1 = require("../../../../tendermint/types/types"); const block_1 = require("../../../../tendermint/types/block"); const types_2 = require("./types"); const types_3 = require("../../../../tendermint/p2p/types"); const binary_1 = require("../../../../binary"); const registry_1 = require("../../../../registry"); const helpers_1 = require("../../../../helpers"); function createBaseGetValidatorSetByHeightRequest() { return { height: BigInt(0), pagination: undefined }; } /** * GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. * @name GetValidatorSetByHeightRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest */ exports.GetValidatorSetByHeightRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", aminoType: "cosmos-sdk/GetValidatorSetByHeightRequest", is(o) { return o && (o.$typeUrl === exports.GetValidatorSetByHeightRequest.typeUrl || typeof o.height === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === exports.GetValidatorSetByHeightRequest.typeUrl || typeof o.height === "bigint"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = reader.int64(); break; case 2: message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { 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 ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseGetValidatorSetByHeightRequest(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetValidatorSetByHeightRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetValidatorSetByHeightRequest", value: exports.GetValidatorSetByHeightRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetValidatorSetByHeightRequest.decode(message.value); }, toProto(message) { return exports.GetValidatorSetByHeightRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", value: exports.GetValidatorSetByHeightRequest.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetValidatorSetByHeightRequest.typeUrl)) { return; } pagination_1.PageRequest.registerTypeUrl(); } }; function createBaseGetValidatorSetByHeightResponse() { return { blockHeight: BigInt(0), validators: [], pagination: undefined }; } /** * GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. * @name GetValidatorSetByHeightResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse */ exports.GetValidatorSetByHeightResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", aminoType: "cosmos-sdk/GetValidatorSetByHeightResponse", is(o) { return o && (o.$typeUrl === exports.GetValidatorSetByHeightResponse.typeUrl || typeof o.blockHeight === "bigint" && Array.isArray(o.validators) && (!o.validators.length || exports.Validator.is(o.validators[0]))); }, isAmino(o) { return o && (o.$typeUrl === exports.GetValidatorSetByHeightResponse.typeUrl || typeof o.block_height === "bigint" && Array.isArray(o.validators) && (!o.validators.length || exports.Validator.isAmino(o.validators[0]))); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { exports.Validator.encode(v, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockHeight = reader.int64(); break; case 2: message.validators.push(exports.Validator.decode(reader, reader.uint32())); break; case 3: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetValidatorSetByHeightResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); message.validators = object.validators?.map(e => exports.Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseGetValidatorSetByHeightResponse(); if (object.block_height !== undefined && object.block_height !== null) { message.blockHeight = BigInt(object.block_height); } message.validators = object.validators?.map(e => exports.Validator.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? exports.Validator.toAmino(e) : undefined); } else { obj.validators = message.validators; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetValidatorSetByHeightResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetValidatorSetByHeightResponse", value: exports.GetValidatorSetByHeightResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetValidatorSetByHeightResponse.decode(message.value); }, toProto(message) { return exports.GetValidatorSetByHeightResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", value: exports.GetValidatorSetByHeightResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetValidatorSetByHeightResponse.typeUrl)) { return; } exports.Validator.registerTypeUrl(); pagination_1.PageResponse.registerTypeUrl(); } }; function createBaseGetLatestValidatorSetRequest() { return { pagination: undefined }; } /** * GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. * @name GetLatestValidatorSetRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest */ exports.GetLatestValidatorSetRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", aminoType: "cosmos-sdk/GetLatestValidatorSetRequest", is(o) { return o && o.$typeUrl === exports.GetLatestValidatorSetRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetLatestValidatorSetRequest.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetLatestValidatorSetRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseGetLatestValidatorSetRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetLatestValidatorSetRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetLatestValidatorSetRequest", value: exports.GetLatestValidatorSetRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetLatestValidatorSetRequest.decode(message.value); }, toProto(message) { return exports.GetLatestValidatorSetRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", value: exports.GetLatestValidatorSetRequest.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetLatestValidatorSetRequest.typeUrl)) { return; } pagination_1.PageRequest.registerTypeUrl(); } }; function createBaseGetLatestValidatorSetResponse() { return { blockHeight: BigInt(0), validators: [], pagination: undefined }; } /** * GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. * @name GetLatestValidatorSetResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse */ exports.GetLatestValidatorSetResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", aminoType: "cosmos-sdk/GetLatestValidatorSetResponse", is(o) { return o && (o.$typeUrl === exports.GetLatestValidatorSetResponse.typeUrl || typeof o.blockHeight === "bigint" && Array.isArray(o.validators) && (!o.validators.length || exports.Validator.is(o.validators[0]))); }, isAmino(o) { return o && (o.$typeUrl === exports.GetLatestValidatorSetResponse.typeUrl || typeof o.block_height === "bigint" && Array.isArray(o.validators) && (!o.validators.length || exports.Validator.isAmino(o.validators[0]))); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { exports.Validator.encode(v, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockHeight = reader.int64(); break; case 2: message.validators.push(exports.Validator.decode(reader, reader.uint32())); break; case 3: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetLatestValidatorSetResponse(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); message.validators = object.validators?.map(e => exports.Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseGetLatestValidatorSetResponse(); if (object.block_height !== undefined && object.block_height !== null) { message.blockHeight = BigInt(object.block_height); } message.validators = object.validators?.map(e => exports.Validator.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight?.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? exports.Validator.toAmino(e) : undefined); } else { obj.validators = message.validators; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetLatestValidatorSetResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetLatestValidatorSetResponse", value: exports.GetLatestValidatorSetResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetLatestValidatorSetResponse.decode(message.value); }, toProto(message) { return exports.GetLatestValidatorSetResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", value: exports.GetLatestValidatorSetResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetLatestValidatorSetResponse.typeUrl)) { return; } exports.Validator.registerTypeUrl(); pagination_1.PageResponse.registerTypeUrl(); } }; function createBaseValidator() { return { address: "", pubKey: undefined, votingPower: BigInt(0), proposerPriority: BigInt(0) }; } /** * Validator is the type for the validator-set. * @name Validator * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.Validator */ exports.Validator = { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator", aminoType: "cosmos-sdk/Validator", is(o) { return o && (o.$typeUrl === exports.Validator.typeUrl || typeof o.address === "string" && typeof o.votingPower === "bigint" && typeof o.proposerPriority === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === exports.Validator.typeUrl || typeof o.address === "string" && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { any_1.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; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.pubKey = any_1.Any.decode(reader, reader.uint32()); break; case 3: message.votingPower = reader.int64(); break; case 4: message.proposerPriority = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseValidator(); message.address = object.address ?? ""; message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? any_1.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) { 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_1.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) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; obj.pub_key = message.pubKey ? any_1.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) { return exports.Validator.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/Validator", value: exports.Validator.toAmino(message) }; }, fromProtoMsg(message) { return exports.Validator.decode(message.value); }, toProto(message) { return exports.Validator.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator", value: exports.Validator.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetBlockByHeightRequest() { return { height: BigInt(0) }; } /** * GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. * @name GetBlockByHeightRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest */ exports.GetBlockByHeightRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", aminoType: "cosmos-sdk/GetBlockByHeightRequest", is(o) { return o && (o.$typeUrl === exports.GetBlockByHeightRequest.typeUrl || typeof o.height === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === exports.GetBlockByHeightRequest.typeUrl || typeof o.height === "bigint"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.height = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetBlockByHeightRequest(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object) { const message = createBaseGetBlockByHeightRequest(); if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } return message; }, toAmino(message) { const obj = {}; obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; return obj; }, fromAminoMsg(object) { return exports.GetBlockByHeightRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetBlockByHeightRequest", value: exports.GetBlockByHeightRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetBlockByHeightRequest.decode(message.value); }, toProto(message) { return exports.GetBlockByHeightRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", value: exports.GetBlockByHeightRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetBlockByHeightResponse() { return { blockId: undefined, block: undefined, sdkBlock: undefined }; } /** * GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. * @name GetBlockByHeightResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse */ exports.GetBlockByHeightResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", aminoType: "cosmos-sdk/GetBlockByHeightResponse", is(o) { return o && o.$typeUrl === exports.GetBlockByHeightResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetBlockByHeightResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.blockId !== undefined) { types_1.BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { block_1.Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } if (message.sdkBlock !== undefined) { types_2.Block.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockId = types_1.BlockID.decode(reader, reader.uint32()); break; case 2: message.block = block_1.Block.decode(reader, reader.uint32()); break; case 3: message.sdkBlock = types_2.Block.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetBlockByHeightResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? types_1.BlockID.fromPartial(object.blockId) : undefined; message.block = object.block !== undefined && object.block !== null ? block_1.Block.fromPartial(object.block) : undefined; message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? types_2.Block.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object) { const message = createBaseGetBlockByHeightResponse(); if (object.block_id !== undefined && object.block_id !== null) { message.blockId = types_1.BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { message.block = block_1.Block.fromAmino(object.block); } if (object.sdk_block !== undefined && object.sdk_block !== null) { message.sdkBlock = types_2.Block.fromAmino(object.sdk_block); } return message; }, toAmino(message) { const obj = {}; obj.block_id = message.blockId ? types_1.BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? block_1.Block.toAmino(message.block) : undefined; obj.sdk_block = message.sdkBlock ? types_2.Block.toAmino(message.sdkBlock) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetBlockByHeightResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetBlockByHeightResponse", value: exports.GetBlockByHeightResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetBlockByHeightResponse.decode(message.value); }, toProto(message) { return exports.GetBlockByHeightResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", value: exports.GetBlockByHeightResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetBlockByHeightResponse.typeUrl)) { return; } types_1.BlockID.registerTypeUrl(); block_1.Block.registerTypeUrl(); types_2.Block.registerTypeUrl(); } }; function createBaseGetLatestBlockRequest() { return {}; } /** * GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. * @name GetLatestBlockRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetLatestBlockRequest */ exports.GetLatestBlockRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", aminoType: "cosmos-sdk/GetLatestBlockRequest", is(o) { return o && o.$typeUrl === exports.GetLatestBlockRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetLatestBlockRequest.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseGetLatestBlockRequest(); return message; }, fromAmino(_) { const message = createBaseGetLatestBlockRequest(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.GetLatestBlockRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetLatestBlockRequest", value: exports.GetLatestBlockRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetLatestBlockRequest.decode(message.value); }, toProto(message) { return exports.GetLatestBlockRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", value: exports.GetLatestBlockRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetLatestBlockResponse() { return { blockId: undefined, block: undefined, sdkBlock: undefined }; } /** * GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. * @name GetLatestBlockResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetLatestBlockResponse */ exports.GetLatestBlockResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", aminoType: "cosmos-sdk/GetLatestBlockResponse", is(o) { return o && o.$typeUrl === exports.GetLatestBlockResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetLatestBlockResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.blockId !== undefined) { types_1.BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { block_1.Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } if (message.sdkBlock !== undefined) { types_2.Block.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockId = types_1.BlockID.decode(reader, reader.uint32()); break; case 2: message.block = block_1.Block.decode(reader, reader.uint32()); break; case 3: message.sdkBlock = types_2.Block.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetLatestBlockResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? types_1.BlockID.fromPartial(object.blockId) : undefined; message.block = object.block !== undefined && object.block !== null ? block_1.Block.fromPartial(object.block) : undefined; message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? types_2.Block.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object) { const message = createBaseGetLatestBlockResponse(); if (object.block_id !== undefined && object.block_id !== null) { message.blockId = types_1.BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { message.block = block_1.Block.fromAmino(object.block); } if (object.sdk_block !== undefined && object.sdk_block !== null) { message.sdkBlock = types_2.Block.fromAmino(object.sdk_block); } return message; }, toAmino(message) { const obj = {}; obj.block_id = message.blockId ? types_1.BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? block_1.Block.toAmino(message.block) : undefined; obj.sdk_block = message.sdkBlock ? types_2.Block.toAmino(message.sdkBlock) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetLatestBlockResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetLatestBlockResponse", value: exports.GetLatestBlockResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetLatestBlockResponse.decode(message.value); }, toProto(message) { return exports.GetLatestBlockResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", value: exports.GetLatestBlockResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetLatestBlockResponse.typeUrl)) { return; } types_1.BlockID.registerTypeUrl(); block_1.Block.registerTypeUrl(); types_2.Block.registerTypeUrl(); } }; function createBaseGetSyncingRequest() { return {}; } /** * GetSyncingRequest is the request type for the Query/GetSyncing RPC method. * @name GetSyncingRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetSyncingRequest */ exports.GetSyncingRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest", aminoType: "cosmos-sdk/GetSyncingRequest", is(o) { return o && o.$typeUrl === exports.GetSyncingRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetSyncingRequest.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseGetSyncingRequest(); return message; }, fromAmino(_) { const message = createBaseGetSyncingRequest(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.GetSyncingRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetSyncingRequest", value: exports.GetSyncingRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetSyncingRequest.decode(message.value); }, toProto(message) { return exports.GetSyncingRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest", value: exports.GetSyncingRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetSyncingResponse() { return { syncing: false }; } /** * GetSyncingResponse is the response type for the Query/GetSyncing RPC method. * @name GetSyncingResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetSyncingResponse */ exports.GetSyncingResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse", aminoType: "cosmos-sdk/GetSyncingResponse", is(o) { return o && (o.$typeUrl === exports.GetSyncingResponse.typeUrl || typeof o.syncing === "boolean"); }, isAmino(o) { return o && (o.$typeUrl === exports.GetSyncingResponse.typeUrl || typeof o.syncing === "boolean"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.syncing = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetSyncingResponse(); message.syncing = object.syncing ?? false; return message; }, fromAmino(object) { const message = createBaseGetSyncingResponse(); if (object.syncing !== undefined && object.syncing !== null) { message.syncing = object.syncing; } return message; }, toAmino(message) { const obj = {}; obj.syncing = message.syncing === false ? undefined : message.syncing; return obj; }, fromAminoMsg(object) { return exports.GetSyncingResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetSyncingResponse", value: exports.GetSyncingResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetSyncingResponse.decode(message.value); }, toProto(message) { return exports.GetSyncingResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse", value: exports.GetSyncingResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetNodeInfoRequest() { return {}; } /** * GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. * @name GetNodeInfoRequest * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetNodeInfoRequest */ exports.GetNodeInfoRequest = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", aminoType: "cosmos-sdk/GetNodeInfoRequest", is(o) { return o && o.$typeUrl === exports.GetNodeInfoRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetNodeInfoRequest.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseGetNodeInfoRequest(); return message; }, fromAmino(_) { const message = createBaseGetNodeInfoRequest(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.GetNodeInfoRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetNodeInfoRequest", value: exports.GetNodeInfoRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetNodeInfoRequest.decode(message.value); }, toProto(message) { return exports.GetNodeInfoRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", value: exports.GetNodeInfoRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseGetNodeInfoResponse() { return { defaultNodeInfo: undefined, applicationVersion: undefined }; } /** * GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. * @name GetNodeInfoResponse * @package cosmos.base.tendermint.v1beta1 * @see proto type: cosmos.base.tendermint.v1beta1.GetNodeInfoResponse */ exports.GetNodeInfoResponse = { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", aminoType: "cosmos-sdk/GetNodeInfoResponse", is(o) { return o && o.$typeUrl === exports.GetNodeInfoResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.GetNodeInfoResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.defaultNodeInfo !== undefined) { types_3.DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); } if (message.applicationVersion !== undefined) { exports.VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.defaultNodeInfo = types_3.DefaultNodeInfo.decode(reader, reader.uint32()); break; case 2: message.applicationVersion = exports.VersionInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGetNodeInfoResponse(); message.defaultNodeInfo = object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null ? types_3.DefaultNodeInfo.fromPartial(object.defaultNodeInfo) : undefined; message.applicationVersion = object.applicationVersion !== undefined && object.applicationVersion !== null ? exports.VersionInfo.fromPartial(object.applicationVersion) : undefined; return message; }, fromAmino(object) { const message = createBaseGetNodeInfoResponse(); if (object.default_node_info !== undefined && object.default_node_info !== null) { message.defaultNodeInfo = types_3.DefaultNodeInfo.fromAmino(object.default_node_info); } if (object.application_version !== undefined && object.application_version !== null) { message.applicationVersion = exports.VersionInfo.fromAmino(object.application_version); } return message; }, toAmino(message) { const obj = {}; obj.default_node_info = message.defaultNodeInfo ? types_3.DefaultNodeInfo.toAmino(message.defaultNodeInfo) : undefined; obj.application_version = message.applicationVersion ? exports.VersionInfo.toAmino(message.applicationVersion) : undefined; return obj; }, fromAminoMsg(object) { return exports.GetNodeInfoResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/GetNodeInfoResponse", value: exports.GetNodeInfoResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.GetNodeInfoResponse.decode(message.value); }, toProto(message) { return exports.GetNodeInfoResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", value: exports.GetNodeInfoResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.GetNodeInfoResponse.