@cheqd/ts-proto
Version:
A TypeScript package for all transpiled cheqd ProtoBuf definitions.
1,287 lines • 195 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.3.0
// protoc unknown
// source: tendermint/abci/types.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Timestamp } from "../../google/protobuf/timestamp.js";
import { PublicKey } from "../crypto/keys.js";
import { ProofOps } from "../crypto/proof.js";
import { ConsensusParams } from "../types/params.js";
import { blockIDFlagFromJSON, blockIDFlagToJSON } from "../types/validator.js";
export var CheckTxType;
(function (CheckTxType) {
CheckTxType[CheckTxType["NEW"] = 0] = "NEW";
CheckTxType[CheckTxType["RECHECK"] = 1] = "RECHECK";
CheckTxType[CheckTxType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(CheckTxType || (CheckTxType = {}));
export function checkTxTypeFromJSON(object) {
switch (object) {
case 0:
case "NEW":
return CheckTxType.NEW;
case 1:
case "RECHECK":
return CheckTxType.RECHECK;
case -1:
case "UNRECOGNIZED":
default:
return CheckTxType.UNRECOGNIZED;
}
}
export function checkTxTypeToJSON(object) {
switch (object) {
case CheckTxType.NEW:
return "NEW";
case CheckTxType.RECHECK:
return "RECHECK";
case CheckTxType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var MisbehaviorType;
(function (MisbehaviorType) {
MisbehaviorType[MisbehaviorType["UNKNOWN"] = 0] = "UNKNOWN";
MisbehaviorType[MisbehaviorType["DUPLICATE_VOTE"] = 1] = "DUPLICATE_VOTE";
MisbehaviorType[MisbehaviorType["LIGHT_CLIENT_ATTACK"] = 2] = "LIGHT_CLIENT_ATTACK";
MisbehaviorType[MisbehaviorType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(MisbehaviorType || (MisbehaviorType = {}));
export function misbehaviorTypeFromJSON(object) {
switch (object) {
case 0:
case "UNKNOWN":
return MisbehaviorType.UNKNOWN;
case 1:
case "DUPLICATE_VOTE":
return MisbehaviorType.DUPLICATE_VOTE;
case 2:
case "LIGHT_CLIENT_ATTACK":
return MisbehaviorType.LIGHT_CLIENT_ATTACK;
case -1:
case "UNRECOGNIZED":
default:
return MisbehaviorType.UNRECOGNIZED;
}
}
export function misbehaviorTypeToJSON(object) {
switch (object) {
case MisbehaviorType.UNKNOWN:
return "UNKNOWN";
case MisbehaviorType.DUPLICATE_VOTE:
return "DUPLICATE_VOTE";
case MisbehaviorType.LIGHT_CLIENT_ATTACK:
return "LIGHT_CLIENT_ATTACK";
case MisbehaviorType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var ResponseOfferSnapshot_Result;
(function (ResponseOfferSnapshot_Result) {
/** UNKNOWN - Unknown result, abort all snapshot restoration */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["UNKNOWN"] = 0] = "UNKNOWN";
/** ACCEPT - Snapshot accepted, apply chunks */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["ACCEPT"] = 1] = "ACCEPT";
/** ABORT - Abort all snapshot restoration */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["ABORT"] = 2] = "ABORT";
/** REJECT - Reject this specific snapshot, try others */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["REJECT"] = 3] = "REJECT";
/** REJECT_FORMAT - Reject all snapshots of this format, try others */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["REJECT_FORMAT"] = 4] = "REJECT_FORMAT";
/** REJECT_SENDER - Reject all snapshots from the sender(s), try others */
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["REJECT_SENDER"] = 5] = "REJECT_SENDER";
ResponseOfferSnapshot_Result[ResponseOfferSnapshot_Result["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ResponseOfferSnapshot_Result || (ResponseOfferSnapshot_Result = {}));
export function responseOfferSnapshot_ResultFromJSON(object) {
switch (object) {
case 0:
case "UNKNOWN":
return ResponseOfferSnapshot_Result.UNKNOWN;
case 1:
case "ACCEPT":
return ResponseOfferSnapshot_Result.ACCEPT;
case 2:
case "ABORT":
return ResponseOfferSnapshot_Result.ABORT;
case 3:
case "REJECT":
return ResponseOfferSnapshot_Result.REJECT;
case 4:
case "REJECT_FORMAT":
return ResponseOfferSnapshot_Result.REJECT_FORMAT;
case 5:
case "REJECT_SENDER":
return ResponseOfferSnapshot_Result.REJECT_SENDER;
case -1:
case "UNRECOGNIZED":
default:
return ResponseOfferSnapshot_Result.UNRECOGNIZED;
}
}
export function responseOfferSnapshot_ResultToJSON(object) {
switch (object) {
case ResponseOfferSnapshot_Result.UNKNOWN:
return "UNKNOWN";
case ResponseOfferSnapshot_Result.ACCEPT:
return "ACCEPT";
case ResponseOfferSnapshot_Result.ABORT:
return "ABORT";
case ResponseOfferSnapshot_Result.REJECT:
return "REJECT";
case ResponseOfferSnapshot_Result.REJECT_FORMAT:
return "REJECT_FORMAT";
case ResponseOfferSnapshot_Result.REJECT_SENDER:
return "REJECT_SENDER";
case ResponseOfferSnapshot_Result.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var ResponseApplySnapshotChunk_Result;
(function (ResponseApplySnapshotChunk_Result) {
/** UNKNOWN - Unknown result, abort all snapshot restoration */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["UNKNOWN"] = 0] = "UNKNOWN";
/** ACCEPT - Chunk successfully accepted */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["ACCEPT"] = 1] = "ACCEPT";
/** ABORT - Abort all snapshot restoration */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["ABORT"] = 2] = "ABORT";
/** RETRY - Retry chunk (combine with refetch and reject) */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["RETRY"] = 3] = "RETRY";
/** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["RETRY_SNAPSHOT"] = 4] = "RETRY_SNAPSHOT";
/** REJECT_SNAPSHOT - Reject this snapshot, try others */
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["REJECT_SNAPSHOT"] = 5] = "REJECT_SNAPSHOT";
ResponseApplySnapshotChunk_Result[ResponseApplySnapshotChunk_Result["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ResponseApplySnapshotChunk_Result || (ResponseApplySnapshotChunk_Result = {}));
export function responseApplySnapshotChunk_ResultFromJSON(object) {
switch (object) {
case 0:
case "UNKNOWN":
return ResponseApplySnapshotChunk_Result.UNKNOWN;
case 1:
case "ACCEPT":
return ResponseApplySnapshotChunk_Result.ACCEPT;
case 2:
case "ABORT":
return ResponseApplySnapshotChunk_Result.ABORT;
case 3:
case "RETRY":
return ResponseApplySnapshotChunk_Result.RETRY;
case 4:
case "RETRY_SNAPSHOT":
return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT;
case 5:
case "REJECT_SNAPSHOT":
return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT;
case -1:
case "UNRECOGNIZED":
default:
return ResponseApplySnapshotChunk_Result.UNRECOGNIZED;
}
}
export function responseApplySnapshotChunk_ResultToJSON(object) {
switch (object) {
case ResponseApplySnapshotChunk_Result.UNKNOWN:
return "UNKNOWN";
case ResponseApplySnapshotChunk_Result.ACCEPT:
return "ACCEPT";
case ResponseApplySnapshotChunk_Result.ABORT:
return "ABORT";
case ResponseApplySnapshotChunk_Result.RETRY:
return "RETRY";
case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT:
return "RETRY_SNAPSHOT";
case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT:
return "REJECT_SNAPSHOT";
case ResponseApplySnapshotChunk_Result.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var ResponseProcessProposal_ProposalStatus;
(function (ResponseProcessProposal_ProposalStatus) {
ResponseProcessProposal_ProposalStatus[ResponseProcessProposal_ProposalStatus["UNKNOWN"] = 0] = "UNKNOWN";
ResponseProcessProposal_ProposalStatus[ResponseProcessProposal_ProposalStatus["ACCEPT"] = 1] = "ACCEPT";
ResponseProcessProposal_ProposalStatus[ResponseProcessProposal_ProposalStatus["REJECT"] = 2] = "REJECT";
ResponseProcessProposal_ProposalStatus[ResponseProcessProposal_ProposalStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ResponseProcessProposal_ProposalStatus || (ResponseProcessProposal_ProposalStatus = {}));
export function responseProcessProposal_ProposalStatusFromJSON(object) {
switch (object) {
case 0:
case "UNKNOWN":
return ResponseProcessProposal_ProposalStatus.UNKNOWN;
case 1:
case "ACCEPT":
return ResponseProcessProposal_ProposalStatus.ACCEPT;
case 2:
case "REJECT":
return ResponseProcessProposal_ProposalStatus.REJECT;
case -1:
case "UNRECOGNIZED":
default:
return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED;
}
}
export function responseProcessProposal_ProposalStatusToJSON(object) {
switch (object) {
case ResponseProcessProposal_ProposalStatus.UNKNOWN:
return "UNKNOWN";
case ResponseProcessProposal_ProposalStatus.ACCEPT:
return "ACCEPT";
case ResponseProcessProposal_ProposalStatus.REJECT:
return "REJECT";
case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var ResponseVerifyVoteExtension_VerifyStatus;
(function (ResponseVerifyVoteExtension_VerifyStatus) {
ResponseVerifyVoteExtension_VerifyStatus[ResponseVerifyVoteExtension_VerifyStatus["UNKNOWN"] = 0] = "UNKNOWN";
ResponseVerifyVoteExtension_VerifyStatus[ResponseVerifyVoteExtension_VerifyStatus["ACCEPT"] = 1] = "ACCEPT";
/**
* REJECT - Rejecting the vote extension will reject the entire precommit by the sender.
* Incorrectly implementing this thus has liveness implications as it may affect
* CometBFT's ability to receive 2/3+ valid votes to finalize the block.
* Honest nodes should never be rejected.
*/
ResponseVerifyVoteExtension_VerifyStatus[ResponseVerifyVoteExtension_VerifyStatus["REJECT"] = 2] = "REJECT";
ResponseVerifyVoteExtension_VerifyStatus[ResponseVerifyVoteExtension_VerifyStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ResponseVerifyVoteExtension_VerifyStatus || (ResponseVerifyVoteExtension_VerifyStatus = {}));
export function responseVerifyVoteExtension_VerifyStatusFromJSON(object) {
switch (object) {
case 0:
case "UNKNOWN":
return ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN;
case 1:
case "ACCEPT":
return ResponseVerifyVoteExtension_VerifyStatus.ACCEPT;
case 2:
case "REJECT":
return ResponseVerifyVoteExtension_VerifyStatus.REJECT;
case -1:
case "UNRECOGNIZED":
default:
return ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED;
}
}
export function responseVerifyVoteExtension_VerifyStatusToJSON(object) {
switch (object) {
case ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN:
return "UNKNOWN";
case ResponseVerifyVoteExtension_VerifyStatus.ACCEPT:
return "ACCEPT";
case ResponseVerifyVoteExtension_VerifyStatus.REJECT:
return "REJECT";
case ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
function createBaseRequest() {
return {
echo: undefined,
flush: undefined,
info: undefined,
initChain: undefined,
query: undefined,
checkTx: undefined,
commit: undefined,
listSnapshots: undefined,
offerSnapshot: undefined,
loadSnapshotChunk: undefined,
applySnapshotChunk: undefined,
prepareProposal: undefined,
processProposal: undefined,
extendVote: undefined,
verifyVoteExtension: undefined,
finalizeBlock: undefined,
};
}
export const Request = {
encode(message, writer = new BinaryWriter()) {
if (message.echo !== undefined) {
RequestEcho.encode(message.echo, writer.uint32(10).fork()).join();
}
if (message.flush !== undefined) {
RequestFlush.encode(message.flush, writer.uint32(18).fork()).join();
}
if (message.info !== undefined) {
RequestInfo.encode(message.info, writer.uint32(26).fork()).join();
}
if (message.initChain !== undefined) {
RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).join();
}
if (message.query !== undefined) {
RequestQuery.encode(message.query, writer.uint32(50).fork()).join();
}
if (message.checkTx !== undefined) {
RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).join();
}
if (message.commit !== undefined) {
RequestCommit.encode(message.commit, writer.uint32(90).fork()).join();
}
if (message.listSnapshots !== undefined) {
RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).join();
}
if (message.offerSnapshot !== undefined) {
RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).join();
}
if (message.loadSnapshotChunk !== undefined) {
RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).join();
}
if (message.applySnapshotChunk !== undefined) {
RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).join();
}
if (message.prepareProposal !== undefined) {
RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).join();
}
if (message.processProposal !== undefined) {
RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).join();
}
if (message.extendVote !== undefined) {
RequestExtendVote.encode(message.extendVote, writer.uint32(146).fork()).join();
}
if (message.verifyVoteExtension !== undefined) {
RequestVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(154).fork()).join();
}
if (message.finalizeBlock !== undefined) {
RequestFinalizeBlock.encode(message.finalizeBlock, writer.uint32(162).fork()).join();
}
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 = createBaseRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.echo = RequestEcho.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.flush = RequestFlush.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.info = RequestInfo.decode(reader, reader.uint32());
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.initChain = RequestInitChain.decode(reader, reader.uint32());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.query = RequestQuery.decode(reader, reader.uint32());
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.checkTx = RequestCheckTx.decode(reader, reader.uint32());
continue;
}
case 11: {
if (tag !== 90) {
break;
}
message.commit = RequestCommit.decode(reader, reader.uint32());
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32());
continue;
}
case 13: {
if (tag !== 106) {
break;
}
message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32());
continue;
}
case 14: {
if (tag !== 114) {
break;
}
message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32());
continue;
}
case 15: {
if (tag !== 122) {
break;
}
message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32());
continue;
}
case 16: {
if (tag !== 130) {
break;
}
message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32());
continue;
}
case 17: {
if (tag !== 138) {
break;
}
message.processProposal = RequestProcessProposal.decode(reader, reader.uint32());
continue;
}
case 18: {
if (tag !== 146) {
break;
}
message.extendVote = RequestExtendVote.decode(reader, reader.uint32());
continue;
}
case 19: {
if (tag !== 154) {
break;
}
message.verifyVoteExtension = RequestVerifyVoteExtension.decode(reader, reader.uint32());
continue;
}
case 20: {
if (tag !== 162) {
break;
}
message.finalizeBlock = RequestFinalizeBlock.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined,
flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined,
info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined,
initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined,
query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined,
checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined,
commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined,
listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined,
offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined,
loadSnapshotChunk: isSet(object.loadSnapshotChunk)
? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk)
: undefined,
applySnapshotChunk: isSet(object.applySnapshotChunk)
? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk)
: undefined,
prepareProposal: isSet(object.prepareProposal)
? RequestPrepareProposal.fromJSON(object.prepareProposal)
: undefined,
processProposal: isSet(object.processProposal)
? RequestProcessProposal.fromJSON(object.processProposal)
: undefined,
extendVote: isSet(object.extendVote) ? RequestExtendVote.fromJSON(object.extendVote) : undefined,
verifyVoteExtension: isSet(object.verifyVoteExtension)
? RequestVerifyVoteExtension.fromJSON(object.verifyVoteExtension)
: undefined,
finalizeBlock: isSet(object.finalizeBlock) ? RequestFinalizeBlock.fromJSON(object.finalizeBlock) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.echo !== undefined) {
obj.echo = RequestEcho.toJSON(message.echo);
}
if (message.flush !== undefined) {
obj.flush = RequestFlush.toJSON(message.flush);
}
if (message.info !== undefined) {
obj.info = RequestInfo.toJSON(message.info);
}
if (message.initChain !== undefined) {
obj.initChain = RequestInitChain.toJSON(message.initChain);
}
if (message.query !== undefined) {
obj.query = RequestQuery.toJSON(message.query);
}
if (message.checkTx !== undefined) {
obj.checkTx = RequestCheckTx.toJSON(message.checkTx);
}
if (message.commit !== undefined) {
obj.commit = RequestCommit.toJSON(message.commit);
}
if (message.listSnapshots !== undefined) {
obj.listSnapshots = RequestListSnapshots.toJSON(message.listSnapshots);
}
if (message.offerSnapshot !== undefined) {
obj.offerSnapshot = RequestOfferSnapshot.toJSON(message.offerSnapshot);
}
if (message.loadSnapshotChunk !== undefined) {
obj.loadSnapshotChunk = RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk);
}
if (message.applySnapshotChunk !== undefined) {
obj.applySnapshotChunk = RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk);
}
if (message.prepareProposal !== undefined) {
obj.prepareProposal = RequestPrepareProposal.toJSON(message.prepareProposal);
}
if (message.processProposal !== undefined) {
obj.processProposal = RequestProcessProposal.toJSON(message.processProposal);
}
if (message.extendVote !== undefined) {
obj.extendVote = RequestExtendVote.toJSON(message.extendVote);
}
if (message.verifyVoteExtension !== undefined) {
obj.verifyVoteExtension = RequestVerifyVoteExtension.toJSON(message.verifyVoteExtension);
}
if (message.finalizeBlock !== undefined) {
obj.finalizeBlock = RequestFinalizeBlock.toJSON(message.finalizeBlock);
}
return obj;
},
create(base) {
return Request.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequest();
message.echo = (object.echo !== undefined && object.echo !== null)
? RequestEcho.fromPartial(object.echo)
: undefined;
message.flush = (object.flush !== undefined && object.flush !== null)
? RequestFlush.fromPartial(object.flush)
: undefined;
message.info = (object.info !== undefined && object.info !== null)
? RequestInfo.fromPartial(object.info)
: undefined;
message.initChain = (object.initChain !== undefined && object.initChain !== null)
? RequestInitChain.fromPartial(object.initChain)
: undefined;
message.query = (object.query !== undefined && object.query !== null)
? RequestQuery.fromPartial(object.query)
: undefined;
message.checkTx = (object.checkTx !== undefined && object.checkTx !== null)
? RequestCheckTx.fromPartial(object.checkTx)
: undefined;
message.commit = (object.commit !== undefined && object.commit !== null)
? RequestCommit.fromPartial(object.commit)
: undefined;
message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null)
? RequestListSnapshots.fromPartial(object.listSnapshots)
: undefined;
message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null)
? RequestOfferSnapshot.fromPartial(object.offerSnapshot)
: undefined;
message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null)
? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk)
: undefined;
message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null)
? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk)
: undefined;
message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null)
? RequestPrepareProposal.fromPartial(object.prepareProposal)
: undefined;
message.processProposal = (object.processProposal !== undefined && object.processProposal !== null)
? RequestProcessProposal.fromPartial(object.processProposal)
: undefined;
message.extendVote = (object.extendVote !== undefined && object.extendVote !== null)
? RequestExtendVote.fromPartial(object.extendVote)
: undefined;
message.verifyVoteExtension = (object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null)
? RequestVerifyVoteExtension.fromPartial(object.verifyVoteExtension)
: undefined;
message.finalizeBlock = (object.finalizeBlock !== undefined && object.finalizeBlock !== null)
? RequestFinalizeBlock.fromPartial(object.finalizeBlock)
: undefined;
return message;
},
};
function createBaseRequestEcho() {
return { message: "" };
}
export const RequestEcho = {
encode(message, writer = new BinaryWriter()) {
if (message.message !== "") {
writer.uint32(10).string(message.message);
}
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 = createBaseRequestEcho();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.message = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
},
toJSON(message) {
const obj = {};
if (message.message !== "") {
obj.message = message.message;
}
return obj;
},
create(base) {
return RequestEcho.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestEcho();
message.message = object.message ?? "";
return message;
},
};
function createBaseRequestFlush() {
return {};
}
export const RequestFlush = {
encode(_, writer = new BinaryWriter()) {
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 = createBaseRequestFlush();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return RequestFlush.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseRequestFlush();
return message;
},
};
function createBaseRequestInfo() {
return { version: "", blockVersion: 0n, p2pVersion: 0n, abciVersion: "" };
}
export const RequestInfo = {
encode(message, writer = new BinaryWriter()) {
if (message.version !== "") {
writer.uint32(10).string(message.version);
}
if (message.blockVersion !== 0n) {
if (BigInt.asUintN(64, message.blockVersion) !== message.blockVersion) {
throw new globalThis.Error("value provided for field message.blockVersion of type uint64 too large");
}
writer.uint32(16).uint64(message.blockVersion);
}
if (message.p2pVersion !== 0n) {
if (BigInt.asUintN(64, message.p2pVersion) !== message.p2pVersion) {
throw new globalThis.Error("value provided for field message.p2pVersion of type uint64 too large");
}
writer.uint32(24).uint64(message.p2pVersion);
}
if (message.abciVersion !== "") {
writer.uint32(34).string(message.abciVersion);
}
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 = createBaseRequestInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.version = reader.string();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.blockVersion = reader.uint64();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.p2pVersion = reader.uint64();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.abciVersion = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
version: isSet(object.version) ? globalThis.String(object.version) : "",
blockVersion: isSet(object.blockVersion) ? BigInt(object.blockVersion) : 0n,
p2pVersion: isSet(object.p2pVersion) ? BigInt(object.p2pVersion) : 0n,
abciVersion: isSet(object.abciVersion) ? globalThis.String(object.abciVersion) : "",
};
},
toJSON(message) {
const obj = {};
if (message.version !== "") {
obj.version = message.version;
}
if (message.blockVersion !== 0n) {
obj.blockVersion = message.blockVersion.toString();
}
if (message.p2pVersion !== 0n) {
obj.p2pVersion = message.p2pVersion.toString();
}
if (message.abciVersion !== "") {
obj.abciVersion = message.abciVersion;
}
return obj;
},
create(base) {
return RequestInfo.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestInfo();
message.version = object.version ?? "";
message.blockVersion = object.blockVersion ?? 0n;
message.p2pVersion = object.p2pVersion ?? 0n;
message.abciVersion = object.abciVersion ?? "";
return message;
},
};
function createBaseRequestInitChain() {
return {
time: undefined,
chainId: "",
consensusParams: undefined,
validators: [],
appStateBytes: new Uint8Array(0),
initialHeight: 0n,
};
}
export const RequestInitChain = {
encode(message, writer = new BinaryWriter()) {
if (message.time !== undefined) {
Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).join();
}
if (message.chainId !== "") {
writer.uint32(18).string(message.chainId);
}
if (message.consensusParams !== undefined) {
ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).join();
}
for (const v of message.validators) {
ValidatorUpdate.encode(v, writer.uint32(34).fork()).join();
}
if (message.appStateBytes.length !== 0) {
writer.uint32(42).bytes(message.appStateBytes);
}
if (message.initialHeight !== 0n) {
if (BigInt.asIntN(64, message.initialHeight) !== message.initialHeight) {
throw new globalThis.Error("value provided for field message.initialHeight of type int64 too large");
}
writer.uint32(48).int64(message.initialHeight);
}
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 = createBaseRequestInitChain();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.chainId = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.consensusParams = ConsensusParams.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.validators.push(ValidatorUpdate.decode(reader, reader.uint32()));
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.appStateBytes = reader.bytes();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.initialHeight = reader.int64();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined,
validators: globalThis.Array.isArray(object?.validators)
? object.validators.map((e) => ValidatorUpdate.fromJSON(e))
: [],
appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(0),
initialHeight: isSet(object.initialHeight) ? BigInt(object.initialHeight) : 0n,
};
},
toJSON(message) {
const obj = {};
if (message.time !== undefined) {
obj.time = message.time.toISOString();
}
if (message.chainId !== "") {
obj.chainId = message.chainId;
}
if (message.consensusParams !== undefined) {
obj.consensusParams = ConsensusParams.toJSON(message.consensusParams);
}
if (message.validators?.length) {
obj.validators = message.validators.map((e) => ValidatorUpdate.toJSON(e));
}
if (message.appStateBytes.length !== 0) {
obj.appStateBytes = base64FromBytes(message.appStateBytes);
}
if (message.initialHeight !== 0n) {
obj.initialHeight = message.initialHeight.toString();
}
return obj;
},
create(base) {
return RequestInitChain.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestInitChain();
message.time = object.time ?? undefined;
message.chainId = object.chainId ?? "";
message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null)
? ConsensusParams.fromPartial(object.consensusParams)
: undefined;
message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
message.appStateBytes = object.appStateBytes ?? new Uint8Array(0);
message.initialHeight = object.initialHeight ?? 0n;
return message;
},
};
function createBaseRequestQuery() {
return { data: new Uint8Array(0), path: "", height: 0n, prove: false };
}
export const RequestQuery = {
encode(message, writer = new BinaryWriter()) {
if (message.data.length !== 0) {
writer.uint32(10).bytes(message.data);
}
if (message.path !== "") {
writer.uint32(18).string(message.path);
}
if (message.height !== 0n) {
if (BigInt.asIntN(64, message.height) !== message.height) {
throw new globalThis.Error("value provided for field message.height of type int64 too large");
}
writer.uint32(24).int64(message.height);
}
if (message.prove !== false) {
writer.uint32(32).bool(message.prove);
}
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 = createBaseRequestQuery();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.data = reader.bytes();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.path = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.height = reader.int64();
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.prove = reader.bool();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
path: isSet(object.path) ? globalThis.String(object.path) : "",
height: isSet(object.height) ? BigInt(object.height) : 0n,
prove: isSet(object.prove) ? globalThis.Boolean(object.prove) : false,
};
},
toJSON(message) {
const obj = {};
if (message.data.length !== 0) {
obj.data = base64FromBytes(message.data);
}
if (message.path !== "") {
obj.path = message.path;
}
if (message.height !== 0n) {
obj.height = message.height.toString();
}
if (message.prove !== false) {
obj.prove = message.prove;
}
return obj;
},
create(base) {
return RequestQuery.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestQuery();
message.data = object.data ?? new Uint8Array(0);
message.path = object.path ?? "";
message.height = object.height ?? 0n;
message.prove = object.prove ?? false;
return message;
},
};
function createBaseRequestCheckTx() {
return { tx: new Uint8Array(0), type: 0 };
}
export const RequestCheckTx = {
encode(message, writer = new BinaryWriter()) {
if (message.tx.length !== 0) {
writer.uint32(10).bytes(message.tx);
}
if (message.type !== 0) {
writer.uint32(16).int32(message.type);
}
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 = createBaseRequestCheckTx();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tx = reader.bytes();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.type = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(0),
type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.tx.length !== 0) {
obj.tx = base64FromBytes(message.tx);
}
if (message.type !== 0) {
obj.type = checkTxTypeToJSON(message.type);
}
return obj;
},
create(base) {
return RequestCheckTx.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestCheckTx();
message.tx = object.tx ?? new Uint8Array(0);
message.type = object.type ?? 0;
return message;
},
};
function createBaseRequestCommit() {
return {};
}
export const RequestCommit = {
encode(_, writer = new BinaryWriter()) {
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 = createBaseRequestCommit();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return RequestCommit.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseRequestCommit();
return message;
},
};
function createBaseRequestListSnapshots() {
return {};
}
export const RequestListSnapshots = {
encode(_, writer = new BinaryWriter()) {
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 = createBaseRequestListSnapshots();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return RequestListSnapshots.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseRequestListSnapshots();
return message;
},
};
function createBaseRequestOfferSnapshot() {
return { snapshot: undefined, appHash: new Uint8Array(0) };
}
export const RequestOfferSnapshot = {
encode(message, writer = new BinaryWriter()) {
if (message.snapshot !== undefined) {
Snapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
}
if (message.appHash.length !== 0) {
writer.uint32(18).bytes(message.appHash);
}
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 = createBaseRequestOfferSnapshot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.snapshot = Snapshot.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.appHash = reader.bytes();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(0),
};
},
toJSON(message) {
const obj = {};
if (message.snapshot !== undefined) {
obj.snapshot = Snapshot.toJSON(message.snapshot);
}
if (message.appHash.length !== 0) {
obj.appHash = base64FromBytes(message.appHash);
}
return obj;
},
create(base) {
return RequestOfferSnapshot.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRequestOfferSnapshot();
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
? Snapshot.fromPartial(object.snapshot)
: undefined;
message.appHash = object.appHash ?? new Uint8Array(0);
return message;
},
};
function createBaseRequestLoadSnapshotChunk() {
return { height: 0n, format: 0, chunk: 0 };
}
export const RequestLoadSnapshotChunk = {
encode(message, writer = new BinaryWriter()) {
if (message.height !== 0n) {
if (BigInt.asUintN(64, message.height) !== message.height) {
throw new globalThis.Error("value provided for field message.height of type uint64 too large");
}
writer.uint32(8).uint64(message.height);
}
if (message.format !== 0) {
writer.uint32(16).uint32(message.format);
}
if (message.chunk !== 0) {
writer.uint32(24).uint32(message.chunk);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReade