interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
1,309 lines • 77.1 kB
JavaScript
import { PageRequest, PageResponse } from "../../query/v1beta1/pagination";
import { Any } from "../../../../google/protobuf/any";
import { BlockID } from "../../../../tendermint/types/types";
import { Block as Block1 } from "../../../../tendermint/types/block";
import { Block as Block2 } from "./types";
import { DefaultNodeInfo } from "../../../../tendermint/p2p/types";
import { BinaryReader, BinaryWriter } from "../../../../binary";
import { GlobalDecoderRegistry } from "../../../../registry";
import { bytesFromBase64, base64FromBytes } from "../../../../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
*/
export const GetValidatorSetByHeightRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest",
aminoType: "cosmos-sdk/GetValidatorSetByHeightRequest",
is(o) {
return o && (o.$typeUrl === GetValidatorSetByHeightRequest.typeUrl || typeof o.height === "bigint");
},
isAmino(o) {
return o && (o.$typeUrl === GetValidatorSetByHeightRequest.typeUrl || typeof o.height === "bigint");
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 = 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 ? 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 = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined;
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return GetValidatorSetByHeightRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetValidatorSetByHeightRequest",
value: GetValidatorSetByHeightRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetValidatorSetByHeightRequest.decode(message.value);
},
toProto(message) {
return GetValidatorSetByHeightRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest",
value: GetValidatorSetByHeightRequest.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetValidatorSetByHeightRequest.typeUrl)) {
return;
}
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
*/
export const GetValidatorSetByHeightResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse",
aminoType: "cosmos-sdk/GetValidatorSetByHeightResponse",
is(o) {
return o && (o.$typeUrl === GetValidatorSetByHeightResponse.typeUrl || typeof o.blockHeight === "bigint" && Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])));
},
isAmino(o) {
return o && (o.$typeUrl === GetValidatorSetByHeightResponse.typeUrl || typeof o.block_height === "bigint" && Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])));
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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(Validator.decode(reader, reader.uint32()));
break;
case 3:
message.pagination = 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 => Validator.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? 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 => Validator.fromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = 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 ? Validator.toAmino(e) : undefined);
}
else {
obj.validators = message.validators;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return GetValidatorSetByHeightResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetValidatorSetByHeightResponse",
value: GetValidatorSetByHeightResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetValidatorSetByHeightResponse.decode(message.value);
},
toProto(message) {
return GetValidatorSetByHeightResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse",
value: GetValidatorSetByHeightResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetValidatorSetByHeightResponse.typeUrl)) {
return;
}
Validator.registerTypeUrl();
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
*/
export const GetLatestValidatorSetRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest",
aminoType: "cosmos-sdk/GetLatestValidatorSetRequest",
is(o) {
return o && o.$typeUrl === GetLatestValidatorSetRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetLatestValidatorSetRequest.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 = 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 ? PageRequest.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseGetLatestValidatorSetRequest();
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return GetLatestValidatorSetRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetLatestValidatorSetRequest",
value: GetLatestValidatorSetRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetLatestValidatorSetRequest.decode(message.value);
},
toProto(message) {
return GetLatestValidatorSetRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest",
value: GetLatestValidatorSetRequest.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetLatestValidatorSetRequest.typeUrl)) {
return;
}
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
*/
export const GetLatestValidatorSetResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse",
aminoType: "cosmos-sdk/GetLatestValidatorSetResponse",
is(o) {
return o && (o.$typeUrl === GetLatestValidatorSetResponse.typeUrl || typeof o.blockHeight === "bigint" && Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])));
},
isAmino(o) {
return o && (o.$typeUrl === GetLatestValidatorSetResponse.typeUrl || typeof o.block_height === "bigint" && Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])));
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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(Validator.decode(reader, reader.uint32()));
break;
case 3:
message.pagination = 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 => Validator.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? 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 => Validator.fromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = 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 ? Validator.toAmino(e) : undefined);
}
else {
obj.validators = message.validators;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return GetLatestValidatorSetResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetLatestValidatorSetResponse",
value: GetLatestValidatorSetResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetLatestValidatorSetResponse.decode(message.value);
},
toProto(message) {
return GetLatestValidatorSetResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse",
value: GetLatestValidatorSetResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetLatestValidatorSetResponse.typeUrl)) {
return;
}
Validator.registerTypeUrl();
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
*/
export const Validator = {
typeUrl: "/cosmos.base.tendermint.v1beta1.Validator",
aminoType: "cosmos-sdk/Validator",
is(o) {
return o && (o.$typeUrl === Validator.typeUrl || typeof o.address === "string" && typeof o.votingPower === "bigint" && typeof o.proposerPriority === "bigint");
},
isAmino(o) {
return o && (o.$typeUrl === Validator.typeUrl || typeof o.address === "string" && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint");
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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.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.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.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.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 Validator.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/Validator",
value: Validator.toAmino(message)
};
},
fromProtoMsg(message) {
return Validator.decode(message.value);
},
toProto(message) {
return Validator.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.Validator",
value: 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
*/
export const GetBlockByHeightRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest",
aminoType: "cosmos-sdk/GetBlockByHeightRequest",
is(o) {
return o && (o.$typeUrl === GetBlockByHeightRequest.typeUrl || typeof o.height === "bigint");
},
isAmino(o) {
return o && (o.$typeUrl === GetBlockByHeightRequest.typeUrl || typeof o.height === "bigint");
},
encode(message, writer = BinaryWriter.create()) {
if (message.height !== BigInt(0)) {
writer.uint32(8).int64(message.height);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 GetBlockByHeightRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetBlockByHeightRequest",
value: GetBlockByHeightRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetBlockByHeightRequest.decode(message.value);
},
toProto(message) {
return GetBlockByHeightRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest",
value: 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
*/
export const GetBlockByHeightResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse",
aminoType: "cosmos-sdk/GetBlockByHeightResponse",
is(o) {
return o && o.$typeUrl === GetBlockByHeightResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetBlockByHeightResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 = BlockID.decode(reader, reader.uint32());
break;
case 2:
message.block = Block1.decode(reader, reader.uint32());
break;
case 3:
message.sdkBlock = Block2.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 ? 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) {
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) {
const obj = {};
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) {
return GetBlockByHeightResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetBlockByHeightResponse",
value: GetBlockByHeightResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetBlockByHeightResponse.decode(message.value);
},
toProto(message) {
return GetBlockByHeightResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse",
value: GetBlockByHeightResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetBlockByHeightResponse.typeUrl)) {
return;
}
BlockID.registerTypeUrl();
Block1.registerTypeUrl();
Block2.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
*/
export const GetLatestBlockRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest",
aminoType: "cosmos-sdk/GetLatestBlockRequest",
is(o) {
return o && o.$typeUrl === GetLatestBlockRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetLatestBlockRequest.typeUrl;
},
encode(_, writer = BinaryWriter.create()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 GetLatestBlockRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetLatestBlockRequest",
value: GetLatestBlockRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetLatestBlockRequest.decode(message.value);
},
toProto(message) {
return GetLatestBlockRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest",
value: 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
*/
export const GetLatestBlockResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse",
aminoType: "cosmos-sdk/GetLatestBlockResponse",
is(o) {
return o && o.$typeUrl === GetLatestBlockResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetLatestBlockResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
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;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 = BlockID.decode(reader, reader.uint32());
break;
case 2:
message.block = Block1.decode(reader, reader.uint32());
break;
case 3:
message.sdkBlock = Block2.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 ? 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) {
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) {
const obj = {};
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) {
return GetLatestBlockResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetLatestBlockResponse",
value: GetLatestBlockResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetLatestBlockResponse.decode(message.value);
},
toProto(message) {
return GetLatestBlockResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse",
value: GetLatestBlockResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetLatestBlockResponse.typeUrl)) {
return;
}
BlockID.registerTypeUrl();
Block1.registerTypeUrl();
Block2.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
*/
export const GetSyncingRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest",
aminoType: "cosmos-sdk/GetSyncingRequest",
is(o) {
return o && o.$typeUrl === GetSyncingRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetSyncingRequest.typeUrl;
},
encode(_, writer = BinaryWriter.create()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 GetSyncingRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetSyncingRequest",
value: GetSyncingRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetSyncingRequest.decode(message.value);
},
toProto(message) {
return GetSyncingRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest",
value: 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
*/
export const GetSyncingResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse",
aminoType: "cosmos-sdk/GetSyncingResponse",
is(o) {
return o && (o.$typeUrl === GetSyncingResponse.typeUrl || typeof o.syncing === "boolean");
},
isAmino(o) {
return o && (o.$typeUrl === GetSyncingResponse.typeUrl || typeof o.syncing === "boolean");
},
encode(message, writer = BinaryWriter.create()) {
if (message.syncing === true) {
writer.uint32(8).bool(message.syncing);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 GetSyncingResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetSyncingResponse",
value: GetSyncingResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetSyncingResponse.decode(message.value);
},
toProto(message) {
return GetSyncingResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse",
value: 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
*/
export const GetNodeInfoRequest = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest",
aminoType: "cosmos-sdk/GetNodeInfoRequest",
is(o) {
return o && o.$typeUrl === GetNodeInfoRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetNodeInfoRequest.typeUrl;
},
encode(_, writer = BinaryWriter.create()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 GetNodeInfoRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetNodeInfoRequest",
value: GetNodeInfoRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return GetNodeInfoRequest.decode(message.value);
},
toProto(message) {
return GetNodeInfoRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest",
value: 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
*/
export const GetNodeInfoResponse = {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse",
aminoType: "cosmos-sdk/GetNodeInfoResponse",
is(o) {
return o && o.$typeUrl === GetNodeInfoResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === GetNodeInfoResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.defaultNodeInfo !== undefined) {
DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim();
}
if (message.applicationVersion !== undefined) {
VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new 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 = DefaultNodeInfo.decode(reader, reader.uint32());
break;
case 2:
message.applicationVersion = 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 ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo) : undefined;
message.applicationVersion = object.applicationVersion !== undefined && object.applicationVersion !== null ? 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 = 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) {
const obj = {};
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) {
return GetNodeInfoResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/GetNodeInfoResponse",
value: GetNodeInfoResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return GetNodeInfoResponse.decode(message.value);
},
toProto(message) {
return GetNodeInfoResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse",
value: GetNodeInfoResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(GetNodeInfoResponse.typeUrl)) {
return;
}
DefaultNodeInfo.registerTypeUrl();
VersionInfo.registerTypeUrl();
}
};
function createBaseVersionInfo() {
return {
name: "",
appName: "",
version: "",
gitCommit: "",
buildTags: "",
goVersion: "",
buildDeps: [],
cosmosSdkVersion: ""
};
}
/**
* VersionInfo is the type for the GetNodeInfoResponse message.
* @name VersionInfo
* @package cosmos.base.tendermint.v1beta1
* @see proto type: cosmos.base.tendermint.v1beta1.VersionInfo
*/
export const VersionInfo = {
typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo",
aminoType: "cosmos-sdk/VersionInfo",
is(o) {
return o && (o.$typeUrl === VersionInfo.typeUrl || typeof o.name === "string" && typeof o.appName === "string" && typeof o.version === "string" && typeof o.gitCommit === "string" && typeof o.buildTags === "string" && typeof o.goVersion === "string" && Array.isArray(o.buildDeps) && (!o.buildDeps.length || Module.is(o.buildDeps[0])) && typeof o.cosmosSdkVersion === "string");
},
isAmino(o) {
return o && (o.$typeUrl === VersionInfo.typeUrl || typeof o.name === "string" && typeof o.app_name === "string" && typeof o.version === "string" && typeof o.git_commit === "string" && typeof o.build_tags === "string" && typeof o.go_version === "string" && Array.isArray(o.build_deps) && (!o.build_deps.length || Module.isAmino(o.build_deps[0])) && typeof o.cosmos_sdk_version === "string");
},
encode(message, writer = BinaryWriter.create()) {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.appName !== "") {
writer.uint32(18).string(message.appName);
}
if (message.version !== "") {
writer.uint32(26).string(message.version);
}
if (message.gitCommit !== "") {
writer.uint32(34).string(message.gitCommit);
}
if (message.buildTags !== "") {
writer.uint32(42).string(message.buildTags);
}
if (message.goVersion !== "") {
writer.uint32(50).string(message.goVersion);
}
for (const v of message.buildDeps) {
Module.encode(v, writer.uint32(58).fork()).ldelim();
}
if (message.cosmosSdkVersion !== "") {
writer.uint32(66).string(message.cosmosSdkVersion);
}
return writer;
},
decode(input, length) {
const reader = inpu