UNPKG

interchainjs

Version:

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

1,058 lines 240 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Event = exports.ExtendedCommitInfo = exports.CommitInfo = exports.ResponseFinalizeBlock = exports.ResponseVerifyVoteExtension = exports.ResponseExtendVote = exports.ResponseProcessProposal = exports.ResponsePrepareProposal = exports.ResponseApplySnapshotChunk = exports.ResponseLoadSnapshotChunk = exports.ResponseOfferSnapshot = exports.ResponseListSnapshots = exports.ResponseCommit = exports.ResponseCheckTx = exports.ResponseQuery = exports.ResponseInitChain = exports.ResponseInfo = exports.ResponseFlush = exports.ResponseEcho = exports.ResponseException = exports.Response = exports.RequestFinalizeBlock = exports.RequestVerifyVoteExtension = exports.RequestExtendVote = exports.RequestProcessProposal = exports.RequestPrepareProposal = exports.RequestApplySnapshotChunk = exports.RequestLoadSnapshotChunk = exports.RequestOfferSnapshot = exports.RequestListSnapshots = exports.RequestCommit = exports.RequestCheckTx = exports.RequestQuery = exports.RequestInitChain = exports.RequestInfo = exports.RequestFlush = exports.RequestEcho = exports.Request = exports.MisbehaviorTypeAmino = exports.MisbehaviorType = exports.ResponseVerifyVoteExtension_VerifyStatusAmino = exports.ResponseVerifyVoteExtension_VerifyStatus = exports.ResponseProcessProposal_ProposalStatusAmino = exports.ResponseProcessProposal_ProposalStatus = exports.ResponseApplySnapshotChunk_ResultAmino = exports.ResponseApplySnapshotChunk_Result = exports.ResponseOfferSnapshot_ResultAmino = exports.ResponseOfferSnapshot_Result = exports.CheckTxTypeAmino = exports.CheckTxType = void 0; exports.Snapshot = exports.Misbehavior = exports.ExtendedVoteInfo = exports.VoteInfo = exports.ValidatorUpdate = exports.Validator = exports.TxResult = exports.ExecTxResult = exports.EventAttribute = void 0; exports.checkTxTypeFromJSON = checkTxTypeFromJSON; exports.checkTxTypeToJSON = checkTxTypeToJSON; exports.responseOfferSnapshot_ResultFromJSON = responseOfferSnapshot_ResultFromJSON; exports.responseOfferSnapshot_ResultToJSON = responseOfferSnapshot_ResultToJSON; exports.responseApplySnapshotChunk_ResultFromJSON = responseApplySnapshotChunk_ResultFromJSON; exports.responseApplySnapshotChunk_ResultToJSON = responseApplySnapshotChunk_ResultToJSON; exports.responseProcessProposal_ProposalStatusFromJSON = responseProcessProposal_ProposalStatusFromJSON; exports.responseProcessProposal_ProposalStatusToJSON = responseProcessProposal_ProposalStatusToJSON; exports.responseVerifyVoteExtension_VerifyStatusFromJSON = responseVerifyVoteExtension_VerifyStatusFromJSON; exports.responseVerifyVoteExtension_VerifyStatusToJSON = responseVerifyVoteExtension_VerifyStatusToJSON; exports.misbehaviorTypeFromJSON = misbehaviorTypeFromJSON; exports.misbehaviorTypeToJSON = misbehaviorTypeToJSON; const timestamp_1 = require("../../google/protobuf/timestamp"); const params_1 = require("../types/params"); const proof_1 = require("../crypto/proof"); const keys_1 = require("../crypto/keys"); const binary_1 = require("../../binary"); const registry_1 = require("../../registry"); const helpers_1 = require("../../helpers"); var CheckTxType; (function (CheckTxType) { CheckTxType[CheckTxType["NEW"] = 0] = "NEW"; CheckTxType[CheckTxType["RECHECK"] = 1] = "RECHECK"; CheckTxType[CheckTxType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; })(CheckTxType || (exports.CheckTxType = CheckTxType = {})); exports.CheckTxTypeAmino = CheckTxType; 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; } } function checkTxTypeToJSON(object) { switch (object) { case CheckTxType.NEW: return "NEW"; case CheckTxType.RECHECK: return "RECHECK"; case CheckTxType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } 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 || (exports.ResponseOfferSnapshot_Result = ResponseOfferSnapshot_Result = {})); exports.ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result; 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; } } 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"; } } 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 || (exports.ResponseApplySnapshotChunk_Result = ResponseApplySnapshotChunk_Result = {})); exports.ResponseApplySnapshotChunk_ResultAmino = ResponseApplySnapshotChunk_Result; 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; } } 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"; } } 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 || (exports.ResponseProcessProposal_ProposalStatus = ResponseProcessProposal_ProposalStatus = {})); exports.ResponseProcessProposal_ProposalStatusAmino = ResponseProcessProposal_ProposalStatus; 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; } } 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"; } } 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 || (exports.ResponseVerifyVoteExtension_VerifyStatus = ResponseVerifyVoteExtension_VerifyStatus = {})); exports.ResponseVerifyVoteExtension_VerifyStatusAmino = ResponseVerifyVoteExtension_VerifyStatus; 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; } } 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"; } } 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 || (exports.MisbehaviorType = MisbehaviorType = {})); exports.MisbehaviorTypeAmino = MisbehaviorType; 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; } } 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"; } } 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 }; } /** * @name Request * @package tendermint.abci * @see proto type: tendermint.abci.Request */ exports.Request = { typeUrl: "/tendermint.abci.Request", is(o) { return o && o.$typeUrl === exports.Request.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.Request.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.echo !== undefined) { exports.RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); } if (message.flush !== undefined) { exports.RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); } if (message.info !== undefined) { exports.RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } if (message.initChain !== undefined) { exports.RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } if (message.query !== undefined) { exports.RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); } if (message.checkTx !== undefined) { exports.RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); } if (message.commit !== undefined) { exports.RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); } if (message.listSnapshots !== undefined) { exports.RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); } if (message.offerSnapshot !== undefined) { exports.RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); } if (message.loadSnapshotChunk !== undefined) { exports.RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); } if (message.applySnapshotChunk !== undefined) { exports.RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } if (message.prepareProposal !== undefined) { exports.RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); } if (message.processProposal !== undefined) { exports.RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); } if (message.extendVote !== undefined) { exports.RequestExtendVote.encode(message.extendVote, writer.uint32(146).fork()).ldelim(); } if (message.verifyVoteExtension !== undefined) { exports.RequestVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(154).fork()).ldelim(); } if (message.finalizeBlock !== undefined) { exports.RequestFinalizeBlock.encode(message.finalizeBlock, writer.uint32(162).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 = createBaseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.echo = exports.RequestEcho.decode(reader, reader.uint32()); break; case 2: message.flush = exports.RequestFlush.decode(reader, reader.uint32()); break; case 3: message.info = exports.RequestInfo.decode(reader, reader.uint32()); break; case 5: message.initChain = exports.RequestInitChain.decode(reader, reader.uint32()); break; case 6: message.query = exports.RequestQuery.decode(reader, reader.uint32()); break; case 8: message.checkTx = exports.RequestCheckTx.decode(reader, reader.uint32()); break; case 11: message.commit = exports.RequestCommit.decode(reader, reader.uint32()); break; case 12: message.listSnapshots = exports.RequestListSnapshots.decode(reader, reader.uint32()); break; case 13: message.offerSnapshot = exports.RequestOfferSnapshot.decode(reader, reader.uint32()); break; case 14: message.loadSnapshotChunk = exports.RequestLoadSnapshotChunk.decode(reader, reader.uint32()); break; case 15: message.applySnapshotChunk = exports.RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; case 16: message.prepareProposal = exports.RequestPrepareProposal.decode(reader, reader.uint32()); break; case 17: message.processProposal = exports.RequestProcessProposal.decode(reader, reader.uint32()); break; case 18: message.extendVote = exports.RequestExtendVote.decode(reader, reader.uint32()); break; case 19: message.verifyVoteExtension = exports.RequestVerifyVoteExtension.decode(reader, reader.uint32()); break; case 20: message.finalizeBlock = exports.RequestFinalizeBlock.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseRequest(); message.echo = object.echo !== undefined && object.echo !== null ? exports.RequestEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? exports.RequestFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? exports.RequestInfo.fromPartial(object.info) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? exports.RequestInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? exports.RequestQuery.fromPartial(object.query) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? exports.RequestCheckTx.fromPartial(object.checkTx) : undefined; message.commit = object.commit !== undefined && object.commit !== null ? exports.RequestCommit.fromPartial(object.commit) : undefined; message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? exports.RequestListSnapshots.fromPartial(object.listSnapshots) : undefined; message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? exports.RequestOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? exports.RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? exports.RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? exports.RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? exports.RequestProcessProposal.fromPartial(object.processProposal) : undefined; message.extendVote = object.extendVote !== undefined && object.extendVote !== null ? exports.RequestExtendVote.fromPartial(object.extendVote) : undefined; message.verifyVoteExtension = object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null ? exports.RequestVerifyVoteExtension.fromPartial(object.verifyVoteExtension) : undefined; message.finalizeBlock = object.finalizeBlock !== undefined && object.finalizeBlock !== null ? exports.RequestFinalizeBlock.fromPartial(object.finalizeBlock) : undefined; return message; }, fromAmino(object) { const message = createBaseRequest(); if (object.echo !== undefined && object.echo !== null) { message.echo = exports.RequestEcho.fromAmino(object.echo); } if (object.flush !== undefined && object.flush !== null) { message.flush = exports.RequestFlush.fromAmino(object.flush); } if (object.info !== undefined && object.info !== null) { message.info = exports.RequestInfo.fromAmino(object.info); } if (object.init_chain !== undefined && object.init_chain !== null) { message.initChain = exports.RequestInitChain.fromAmino(object.init_chain); } if (object.query !== undefined && object.query !== null) { message.query = exports.RequestQuery.fromAmino(object.query); } if (object.check_tx !== undefined && object.check_tx !== null) { message.checkTx = exports.RequestCheckTx.fromAmino(object.check_tx); } if (object.commit !== undefined && object.commit !== null) { message.commit = exports.RequestCommit.fromAmino(object.commit); } if (object.list_snapshots !== undefined && object.list_snapshots !== null) { message.listSnapshots = exports.RequestListSnapshots.fromAmino(object.list_snapshots); } if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { message.offerSnapshot = exports.RequestOfferSnapshot.fromAmino(object.offer_snapshot); } if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { message.loadSnapshotChunk = exports.RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); } if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { message.applySnapshotChunk = exports.RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); } if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { message.prepareProposal = exports.RequestPrepareProposal.fromAmino(object.prepare_proposal); } if (object.process_proposal !== undefined && object.process_proposal !== null) { message.processProposal = exports.RequestProcessProposal.fromAmino(object.process_proposal); } if (object.extend_vote !== undefined && object.extend_vote !== null) { message.extendVote = exports.RequestExtendVote.fromAmino(object.extend_vote); } if (object.verify_vote_extension !== undefined && object.verify_vote_extension !== null) { message.verifyVoteExtension = exports.RequestVerifyVoteExtension.fromAmino(object.verify_vote_extension); } if (object.finalize_block !== undefined && object.finalize_block !== null) { message.finalizeBlock = exports.RequestFinalizeBlock.fromAmino(object.finalize_block); } return message; }, toAmino(message) { const obj = {}; obj.echo = message.echo ? exports.RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? exports.RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? exports.RequestInfo.toAmino(message.info) : undefined; obj.init_chain = message.initChain ? exports.RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? exports.RequestQuery.toAmino(message.query) : undefined; obj.check_tx = message.checkTx ? exports.RequestCheckTx.toAmino(message.checkTx) : undefined; obj.commit = message.commit ? exports.RequestCommit.toAmino(message.commit) : undefined; obj.list_snapshots = message.listSnapshots ? exports.RequestListSnapshots.toAmino(message.listSnapshots) : undefined; obj.offer_snapshot = message.offerSnapshot ? exports.RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? exports.RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? exports.RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; obj.prepare_proposal = message.prepareProposal ? exports.RequestPrepareProposal.toAmino(message.prepareProposal) : undefined; obj.process_proposal = message.processProposal ? exports.RequestProcessProposal.toAmino(message.processProposal) : undefined; obj.extend_vote = message.extendVote ? exports.RequestExtendVote.toAmino(message.extendVote) : undefined; obj.verify_vote_extension = message.verifyVoteExtension ? exports.RequestVerifyVoteExtension.toAmino(message.verifyVoteExtension) : undefined; obj.finalize_block = message.finalizeBlock ? exports.RequestFinalizeBlock.toAmino(message.finalizeBlock) : undefined; return obj; }, fromAminoMsg(object) { return exports.Request.fromAmino(object.value); }, fromProtoMsg(message) { return exports.Request.decode(message.value); }, toProto(message) { return exports.Request.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/tendermint.abci.Request", value: exports.Request.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.Request.typeUrl)) { return; } exports.RequestEcho.registerTypeUrl(); exports.RequestFlush.registerTypeUrl(); exports.RequestInfo.registerTypeUrl(); exports.RequestInitChain.registerTypeUrl(); exports.RequestQuery.registerTypeUrl(); exports.RequestCheckTx.registerTypeUrl(); exports.RequestCommit.registerTypeUrl(); exports.RequestListSnapshots.registerTypeUrl(); exports.RequestOfferSnapshot.registerTypeUrl(); exports.RequestLoadSnapshotChunk.registerTypeUrl(); exports.RequestApplySnapshotChunk.registerTypeUrl(); exports.RequestPrepareProposal.registerTypeUrl(); exports.RequestProcessProposal.registerTypeUrl(); exports.RequestExtendVote.registerTypeUrl(); exports.RequestVerifyVoteExtension.registerTypeUrl(); exports.RequestFinalizeBlock.registerTypeUrl(); } }; function createBaseRequestEcho() { return { message: "" }; } /** * @name RequestEcho * @package tendermint.abci * @see proto type: tendermint.abci.RequestEcho */ exports.RequestEcho = { typeUrl: "/tendermint.abci.RequestEcho", is(o) { return o && (o.$typeUrl === exports.RequestEcho.typeUrl || typeof o.message === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.RequestEcho.typeUrl || typeof o.message === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.message !== "") { writer.uint32(10).string(message.message); } 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 = createBaseRequestEcho(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.message = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseRequestEcho(); message.message = object.message ?? ""; return message; }, fromAmino(object) { const message = createBaseRequestEcho(); if (object.message !== undefined && object.message !== null) { message.message = object.message; } return message; }, toAmino(message) { const obj = {}; obj.message = message.message === "" ? undefined : message.message; return obj; }, fromAminoMsg(object) { return exports.RequestEcho.fromAmino(object.value); }, fromProtoMsg(message) { return exports.RequestEcho.decode(message.value); }, toProto(message) { return exports.RequestEcho.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/tendermint.abci.RequestEcho", value: exports.RequestEcho.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseRequestFlush() { return {}; } /** * @name RequestFlush * @package tendermint.abci * @see proto type: tendermint.abci.RequestFlush */ exports.RequestFlush = { typeUrl: "/tendermint.abci.RequestFlush", is(o) { return o && o.$typeUrl === exports.RequestFlush.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.RequestFlush.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 = createBaseRequestFlush(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseRequestFlush(); return message; }, fromAmino(_) { const message = createBaseRequestFlush(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.RequestFlush.fromAmino(object.value); }, fromProtoMsg(message) { return exports.RequestFlush.decode(message.value); }, toProto(message) { return exports.RequestFlush.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/tendermint.abci.RequestFlush", value: exports.RequestFlush.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseRequestInfo() { return { version: "", blockVersion: BigInt(0), p2pVersion: BigInt(0), abciVersion: "" }; } /** * @name RequestInfo * @package tendermint.abci * @see proto type: tendermint.abci.RequestInfo */ exports.RequestInfo = { typeUrl: "/tendermint.abci.RequestInfo", is(o) { return o && (o.$typeUrl === exports.RequestInfo.typeUrl || typeof o.version === "string" && typeof o.blockVersion === "bigint" && typeof o.p2pVersion === "bigint" && typeof o.abciVersion === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.RequestInfo.typeUrl || typeof o.version === "string" && typeof o.block_version === "bigint" && typeof o.p2p_version === "bigint" && typeof o.abci_version === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.version !== "") { writer.uint32(10).string(message.version); } if (message.blockVersion !== BigInt(0)) { writer.uint32(16).uint64(message.blockVersion); } if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } if (message.abciVersion !== "") { writer.uint32(34).string(message.abciVersion); } 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 = createBaseRequestInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.version = reader.string(); break; case 2: message.blockVersion = reader.uint64(); break; case 3: message.p2pVersion = reader.uint64(); break; case 4: message.abciVersion = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseRequestInfo(); message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object) { const message = createBaseRequestInfo(); if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.block_version !== undefined && object.block_version !== null) { message.blockVersion = BigInt(object.block_version); } if (object.p2p_version !== undefined && object.p2p_version !== null) { message.p2pVersion = BigInt(object.p2p_version); } if (object.abci_version !== undefined && object.abci_version !== null) { message.abciVersion = object.abci_version; } return message; }, toAmino(message) { const obj = {}; obj.version = message.version === "" ? undefined : message.version; obj.block_version = message.blockVersion !== BigInt(0) ? message.blockVersion?.toString() : undefined; obj.p2p_version = message.p2pVersion !== BigInt(0) ? message.p2pVersion?.toString() : undefined; obj.abci_version = message.abciVersion === "" ? undefined : message.abciVersion; return obj; }, fromAminoMsg(object) { return exports.RequestInfo.fromAmino(object.value); }, fromProtoMsg(message) { return exports.RequestInfo.decode(message.value); }, toProto(message) { return exports.RequestInfo.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/tendermint.abci.RequestInfo", value: exports.RequestInfo.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseRequestInitChain() { return { time: new Date(), chainId: "", consensusParams: undefined, validators: [], appStateBytes: new Uint8Array(), initialHeight: BigInt(0) }; } /** * @name RequestInitChain * @package tendermint.abci * @see proto type: tendermint.abci.RequestInitChain */ exports.RequestInitChain = { typeUrl: "/tendermint.abci.RequestInitChain", is(o) { return o && (o.$typeUrl === exports.RequestInitChain.typeUrl || timestamp_1.Timestamp.is(o.time) && typeof o.chainId === "string" && Array.isArray(o.validators) && (!o.validators.length || exports.ValidatorUpdate.is(o.validators[0])) && (o.appStateBytes instanceof Uint8Array || typeof o.appStateBytes === "string") && typeof o.initialHeight === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === exports.RequestInitChain.typeUrl || timestamp_1.Timestamp.isAmino(o.time) && typeof o.chain_id === "string" && Array.isArray(o.validators) && (!o.validators.length || exports.ValidatorUpdate.isAmino(o.validators[0])) && (o.app_state_bytes instanceof Uint8Array || typeof o.app_state_bytes === "string") && typeof o.initial_height === "bigint"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.time !== undefined) { timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.time), writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } if (message.consensusParams !== undefined) { params_1.ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); } for (const v of message.validators) { exports.ValidatorUpdate.encode(v, writer.uint32(34).fork()).ldelim(); } if (message.appStateBytes.length !== 0) { writer.uint32(42).bytes(message.appStateBytes); } if (message.initialHeight !== BigInt(0)) { writer.uint32(48).int64(message.initialHeight); } 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 = createBaseRequestInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.time = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32())); break; case 2: message.chainId = reader.string(); break; case 3: message.consensusParams = params_1.ConsensusParams.decode(reader, reader.uint32()); break; case 4: message.validators.push(exports.ValidatorUpdate.decode(reader, reader.uint32())); break; case 5: message.appStateBytes = reader.bytes(); break; case 6: message.initialHeight = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseRequestInitChain(); message.time = object.time ?? undefined; message.chainId = object.chainId ?? ""; message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? params_1.ConsensusParams.fromPartial(object.consensusParams) : undefined; message.validators = object.validators?.map(e => exports.ValidatorUpdate.fromPartial(e)) || []; message.appStateBytes = object.appStateBytes ?? new Uint8Array(); message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? BigInt(object.initialHeight.toString()) : BigInt(0); return message; }, fromAmino(object) { const message = createBaseRequestInitChain(); if (object.time !== undefined && object.time !== null) { message.time = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.fromAmino(object.time)); } if (object.chain_id !== undefined && object.chain_id !== null) { message.chainId = object.chain_id; } if (object.consensus_params !== undefined && object.consensus_params !== null) { message.consensusParams = params_1.ConsensusParams.fromAmino(object.consensus_params); } message.validators = object.validators?.map(e => exports.ValidatorUpdate.fromAmino(e)) || []; if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { message.appStateBytes = (0, helpers_1.bytesFromBase64)(object.app_state_bytes); } if (object.initial_height !== undefined && object.initial_height !== null) { message.initialHeight = BigInt(object.initial_height); } return message; }, toAmino(message) { const obj = {}; obj.time = message.time ? timestamp_1.Timestamp.toAmino((0, helpers_1.toTimestamp)(message.time)) : undefined; obj.chain_id = message.chainId === "" ? undefined : message.chainId; obj.consensus_params = message.consensusParams ? params_1.ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? exports.ValidatorUpdate.toAmino(e) : undefined); } else { obj.validators = message.validators; } obj.app_state_bytes = message.appStateBytes ? (0, helpers_1.base64FromBytes)(message.appStateBytes) : undefined; obj.initial_height = message.initialHeight !== BigInt(0) ? message.initialHeight?.toString() : undefined; return obj; }, fromAminoMsg(object) { return exports.RequestInitChain.fromAmino(object.value); }, fromProtoMsg(message) { return exports.RequestInitChain.decode(message.value); }, toProto(message) { return exports.RequestInitChain.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/tendermint.abci.RequestInitChain", value: exports.RequestInitChain.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.RequestInitChain.typeUrl)) { return; } params_1.ConsensusParams.registerTypeUrl(); exports.ValidatorUpdate.registerTypeUrl(); } }; function createBaseRequestQuery() { return { data: new Uint8Array(), path: "", height: BigInt(0), prove: false }; } /** * @name RequestQuery * @package tendermint.abci * @see proto type: tendermint.abci.RequestQuery */ exports.RequestQuery = { typeUrl: "/tendermint.abci.RequestQuery", is(o) { return o && (o.$typeUrl === exports.RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); }, isAmino(o) { return o && (o.$typeUrl === exports.RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { writer.uint32(32).bool(message.prove); } return writer; }, 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 = createBaseRequestQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.data = reader.bytes(); break; case 2: message.path = reader.string(); break; case 3: message.height = reader.int64(); break; case 4: message.prove = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.prove = object.prove ?? false; return message; }, fromAmino(object) { const message = createBaseRequestQuery(); if (object.data !== undefined && object.data !== null) { message.data = (0, helpers_1.bytesFromBase64)(object.data); } if (object.path !== undefined && object.path !== null) { message.path = object.path; } if (object.height !== undefined && object.height !== null) { message.height = BigInt(object.height); } if (object.prove !== undefined && object.prove !== null) { message.prove = object.prove; } return message; }, toAmino(message) { const obj = {}; obj.data = message.data ? (0, helpers_1.base64FromBytes)(message.data) : undefined; obj.path = message.path === "" ? undefined : message.path; obj.height = message.height !== BigInt(0) ? message.height?.toString() : undefined; obj.prove = message.prove