UNPKG

leap-node

Version:

[![codecov](https://codecov.io/gh/leapdao/leap-node/branch/master/graph/badge.svg)](https://codecov.io/gh/leapdao/leap-node) [![Docker Repository on Quay](https://quay.io/repository/leapdao/leap-node/status "Docker Repository on Quay")](https://quay.io/re

1,164 lines (1,091 loc) 1.1 MB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.abci = (function() { /** * Namespace abci. * @exports abci * @namespace */ var abci = {}; abci.Request = (function() { /** * Properties of a Request. * @memberof abci * @interface IRequest * @property {abci.IRequestEcho|null} [echo] Request echo * @property {abci.IRequestFlush|null} [flush] Request flush * @property {abci.IRequestInfo|null} [info] Request info * @property {abci.IRequestSetOption|null} [setOption] Request setOption * @property {abci.IRequestInitChain|null} [initChain] Request initChain * @property {abci.IRequestQuery|null} [query] Request query * @property {abci.IRequestBeginBlock|null} [beginBlock] Request beginBlock * @property {abci.IRequestCheckTx|null} [checkTx] Request checkTx * @property {abci.IRequestDeliverTx|null} [deliverTx] Request deliverTx * @property {abci.IRequestEndBlock|null} [endBlock] Request endBlock * @property {abci.IRequestCommit|null} [commit] Request commit * @property {abci.IRequestCheckBridge|null} [checkBridge] Request checkBridge */ /** * Constructs a new Request. * @memberof abci * @classdesc Represents a Request. * @implements IRequest * @constructor * @param {abci.IRequest=} [properties] Properties to set */ function Request(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Request echo. * @member {abci.IRequestEcho|null|undefined} echo * @memberof abci.Request * @instance */ Request.prototype.echo = null; /** * Request flush. * @member {abci.IRequestFlush|null|undefined} flush * @memberof abci.Request * @instance */ Request.prototype.flush = null; /** * Request info. * @member {abci.IRequestInfo|null|undefined} info * @memberof abci.Request * @instance */ Request.prototype.info = null; /** * Request setOption. * @member {abci.IRequestSetOption|null|undefined} setOption * @memberof abci.Request * @instance */ Request.prototype.setOption = null; /** * Request initChain. * @member {abci.IRequestInitChain|null|undefined} initChain * @memberof abci.Request * @instance */ Request.prototype.initChain = null; /** * Request query. * @member {abci.IRequestQuery|null|undefined} query * @memberof abci.Request * @instance */ Request.prototype.query = null; /** * Request beginBlock. * @member {abci.IRequestBeginBlock|null|undefined} beginBlock * @memberof abci.Request * @instance */ Request.prototype.beginBlock = null; /** * Request checkTx. * @member {abci.IRequestCheckTx|null|undefined} checkTx * @memberof abci.Request * @instance */ Request.prototype.checkTx = null; /** * Request deliverTx. * @member {abci.IRequestDeliverTx|null|undefined} deliverTx * @memberof abci.Request * @instance */ Request.prototype.deliverTx = null; /** * Request endBlock. * @member {abci.IRequestEndBlock|null|undefined} endBlock * @memberof abci.Request * @instance */ Request.prototype.endBlock = null; /** * Request commit. * @member {abci.IRequestCommit|null|undefined} commit * @memberof abci.Request * @instance */ Request.prototype.commit = null; /** * Request checkBridge. * @member {abci.IRequestCheckBridge|null|undefined} checkBridge * @memberof abci.Request * @instance */ Request.prototype.checkBridge = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Request value. * @member {"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"checkBridge"|undefined} value * @memberof abci.Request * @instance */ Object.defineProperty(Request.prototype, "value", { get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "checkBridge"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new Request instance using the specified properties. * @function create * @memberof abci.Request * @static * @param {abci.IRequest=} [properties] Properties to set * @returns {abci.Request} Request instance */ Request.create = function create(properties) { return new Request(properties); }; /** * Encodes the specified Request message. Does not implicitly {@link abci.Request.verify|verify} messages. * @function encode * @memberof abci.Request * @static * @param {abci.IRequest} message Request message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Request.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.echo != null && message.hasOwnProperty("echo")) $root.abci.RequestEcho.encode(message.echo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.flush != null && message.hasOwnProperty("flush")) $root.abci.RequestFlush.encode(message.flush, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.info != null && message.hasOwnProperty("info")) $root.abci.RequestInfo.encode(message.info, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.setOption != null && message.hasOwnProperty("setOption")) $root.abci.RequestSetOption.encode(message.setOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.initChain != null && message.hasOwnProperty("initChain")) $root.abci.RequestInitChain.encode(message.initChain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.query != null && message.hasOwnProperty("query")) $root.abci.RequestQuery.encode(message.query, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) $root.abci.RequestBeginBlock.encode(message.beginBlock, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.checkTx != null && message.hasOwnProperty("checkTx")) $root.abci.RequestCheckTx.encode(message.checkTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.endBlock != null && message.hasOwnProperty("endBlock")) $root.abci.RequestEndBlock.encode(message.endBlock, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.commit != null && message.hasOwnProperty("commit")) $root.abci.RequestCommit.encode(message.commit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.checkBridge != null && message.hasOwnProperty("checkBridge")) $root.abci.RequestCheckBridge.encode(message.checkBridge, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) $root.abci.RequestDeliverTx.encode(message.deliverTx, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; /** * Encodes the specified Request message, length delimited. Does not implicitly {@link abci.Request.verify|verify} messages. * @function encodeDelimited * @memberof abci.Request * @static * @param {abci.IRequest} message Request message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Request.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Request message from the specified reader or buffer. * @function decode * @memberof abci.Request * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {abci.Request} Request * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Request.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.abci.Request(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.echo = $root.abci.RequestEcho.decode(reader, reader.uint32()); break; case 3: message.flush = $root.abci.RequestFlush.decode(reader, reader.uint32()); break; case 4: message.info = $root.abci.RequestInfo.decode(reader, reader.uint32()); break; case 5: message.setOption = $root.abci.RequestSetOption.decode(reader, reader.uint32()); break; case 6: message.initChain = $root.abci.RequestInitChain.decode(reader, reader.uint32()); break; case 7: message.query = $root.abci.RequestQuery.decode(reader, reader.uint32()); break; case 8: message.beginBlock = $root.abci.RequestBeginBlock.decode(reader, reader.uint32()); break; case 9: message.checkTx = $root.abci.RequestCheckTx.decode(reader, reader.uint32()); break; case 19: message.deliverTx = $root.abci.RequestDeliverTx.decode(reader, reader.uint32()); break; case 11: message.endBlock = $root.abci.RequestEndBlock.decode(reader, reader.uint32()); break; case 12: message.commit = $root.abci.RequestCommit.decode(reader, reader.uint32()); break; case 13: message.checkBridge = $root.abci.RequestCheckBridge.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Request message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof abci.Request * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {abci.Request} Request * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Request.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Request message. * @function verify * @memberof abci.Request * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Request.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.echo != null && message.hasOwnProperty("echo")) { properties.value = 1; { var error = $root.abci.RequestEcho.verify(message.echo); if (error) return "echo." + error; } } if (message.flush != null && message.hasOwnProperty("flush")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestFlush.verify(message.flush); if (error) return "flush." + error; } } if (message.info != null && message.hasOwnProperty("info")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestInfo.verify(message.info); if (error) return "info." + error; } } if (message.setOption != null && message.hasOwnProperty("setOption")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestSetOption.verify(message.setOption); if (error) return "setOption." + error; } } if (message.initChain != null && message.hasOwnProperty("initChain")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestInitChain.verify(message.initChain); if (error) return "initChain." + error; } } if (message.query != null && message.hasOwnProperty("query")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestQuery.verify(message.query); if (error) return "query." + error; } } if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestBeginBlock.verify(message.beginBlock); if (error) return "beginBlock." + error; } } if (message.checkTx != null && message.hasOwnProperty("checkTx")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestCheckTx.verify(message.checkTx); if (error) return "checkTx." + error; } } if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestDeliverTx.verify(message.deliverTx); if (error) return "deliverTx." + error; } } if (message.endBlock != null && message.hasOwnProperty("endBlock")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestEndBlock.verify(message.endBlock); if (error) return "endBlock." + error; } } if (message.commit != null && message.hasOwnProperty("commit")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestCommit.verify(message.commit); if (error) return "commit." + error; } } if (message.checkBridge != null && message.hasOwnProperty("checkBridge")) { if (properties.value === 1) return "value: multiple values"; properties.value = 1; { var error = $root.abci.RequestCheckBridge.verify(message.checkBridge); if (error) return "checkBridge." + error; } } return null; }; /** * Creates a Request message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof abci.Request * @static * @param {Object.<string,*>} object Plain object * @returns {abci.Request} Request */ Request.fromObject = function fromObject(object) { if (object instanceof $root.abci.Request) return object; var message = new $root.abci.Request(); if (object.echo != null) { if (typeof object.echo !== "object") throw TypeError(".abci.Request.echo: object expected"); message.echo = $root.abci.RequestEcho.fromObject(object.echo); } if (object.flush != null) { if (typeof object.flush !== "object") throw TypeError(".abci.Request.flush: object expected"); message.flush = $root.abci.RequestFlush.fromObject(object.flush); } if (object.info != null) { if (typeof object.info !== "object") throw TypeError(".abci.Request.info: object expected"); message.info = $root.abci.RequestInfo.fromObject(object.info); } if (object.setOption != null) { if (typeof object.setOption !== "object") throw TypeError(".abci.Request.setOption: object expected"); message.setOption = $root.abci.RequestSetOption.fromObject(object.setOption); } if (object.initChain != null) { if (typeof object.initChain !== "object") throw TypeError(".abci.Request.initChain: object expected"); message.initChain = $root.abci.RequestInitChain.fromObject(object.initChain); } if (object.query != null) { if (typeof object.query !== "object") throw TypeError(".abci.Request.query: object expected"); message.query = $root.abci.RequestQuery.fromObject(object.query); } if (object.beginBlock != null) { if (typeof object.beginBlock !== "object") throw TypeError(".abci.Request.beginBlock: object expected"); message.beginBlock = $root.abci.RequestBeginBlock.fromObject(object.beginBlock); } if (object.checkTx != null) { if (typeof object.checkTx !== "object") throw TypeError(".abci.Request.checkTx: object expected"); message.checkTx = $root.abci.RequestCheckTx.fromObject(object.checkTx); } if (object.deliverTx != null) { if (typeof object.deliverTx !== "object") throw TypeError(".abci.Request.deliverTx: object expected"); message.deliverTx = $root.abci.RequestDeliverTx.fromObject(object.deliverTx); } if (object.endBlock != null) { if (typeof object.endBlock !== "object") throw TypeError(".abci.Request.endBlock: object expected"); message.endBlock = $root.abci.RequestEndBlock.fromObject(object.endBlock); } if (object.commit != null) { if (typeof object.commit !== "object") throw TypeError(".abci.Request.commit: object expected"); message.commit = $root.abci.RequestCommit.fromObject(object.commit); } if (object.checkBridge != null) { if (typeof object.checkBridge !== "object") throw TypeError(".abci.Request.checkBridge: object expected"); message.checkBridge = $root.abci.RequestCheckBridge.fromObject(object.checkBridge); } return message; }; /** * Creates a plain object from a Request message. Also converts values to other types if specified. * @function toObject * @memberof abci.Request * @static * @param {abci.Request} message Request * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ Request.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.echo != null && message.hasOwnProperty("echo")) { object.echo = $root.abci.RequestEcho.toObject(message.echo, options); if (options.oneofs) object.value = "echo"; } if (message.flush != null && message.hasOwnProperty("flush")) { object.flush = $root.abci.RequestFlush.toObject(message.flush, options); if (options.oneofs) object.value = "flush"; } if (message.info != null && message.hasOwnProperty("info")) { object.info = $root.abci.RequestInfo.toObject(message.info, options); if (options.oneofs) object.value = "info"; } if (message.setOption != null && message.hasOwnProperty("setOption")) { object.setOption = $root.abci.RequestSetOption.toObject(message.setOption, options); if (options.oneofs) object.value = "setOption"; } if (message.initChain != null && message.hasOwnProperty("initChain")) { object.initChain = $root.abci.RequestInitChain.toObject(message.initChain, options); if (options.oneofs) object.value = "initChain"; } if (message.query != null && message.hasOwnProperty("query")) { object.query = $root.abci.RequestQuery.toObject(message.query, options); if (options.oneofs) object.value = "query"; } if (message.beginBlock != null && message.hasOwnProperty("beginBlock")) { object.beginBlock = $root.abci.RequestBeginBlock.toObject(message.beginBlock, options); if (options.oneofs) object.value = "beginBlock"; } if (message.checkTx != null && message.hasOwnProperty("checkTx")) { object.checkTx = $root.abci.RequestCheckTx.toObject(message.checkTx, options); if (options.oneofs) object.value = "checkTx"; } if (message.endBlock != null && message.hasOwnProperty("endBlock")) { object.endBlock = $root.abci.RequestEndBlock.toObject(message.endBlock, options); if (options.oneofs) object.value = "endBlock"; } if (message.commit != null && message.hasOwnProperty("commit")) { object.commit = $root.abci.RequestCommit.toObject(message.commit, options); if (options.oneofs) object.value = "commit"; } if (message.checkBridge != null && message.hasOwnProperty("checkBridge")) { object.checkBridge = $root.abci.RequestCheckBridge.toObject(message.checkBridge, options); if (options.oneofs) object.value = "checkBridge"; } if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) { object.deliverTx = $root.abci.RequestDeliverTx.toObject(message.deliverTx, options); if (options.oneofs) object.value = "deliverTx"; } return object; }; /** * Converts this Request to JSON. * @function toJSON * @memberof abci.Request * @instance * @returns {Object.<string,*>} JSON object */ Request.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Request; })(); abci.RequestEcho = (function() { /** * Properties of a RequestEcho. * @memberof abci * @interface IRequestEcho * @property {string|null} [message] RequestEcho message */ /** * Constructs a new RequestEcho. * @memberof abci * @classdesc Represents a RequestEcho. * @implements IRequestEcho * @constructor * @param {abci.IRequestEcho=} [properties] Properties to set */ function RequestEcho(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * RequestEcho message. * @member {string} message * @memberof abci.RequestEcho * @instance */ RequestEcho.prototype.message = ""; /** * Creates a new RequestEcho instance using the specified properties. * @function create * @memberof abci.RequestEcho * @static * @param {abci.IRequestEcho=} [properties] Properties to set * @returns {abci.RequestEcho} RequestEcho instance */ RequestEcho.create = function create(properties) { return new RequestEcho(properties); }; /** * Encodes the specified RequestEcho message. Does not implicitly {@link abci.RequestEcho.verify|verify} messages. * @function encode * @memberof abci.RequestEcho * @static * @param {abci.IRequestEcho} message RequestEcho message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestEcho.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.message != null && message.hasOwnProperty("message")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); return writer; }; /** * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link abci.RequestEcho.verify|verify} messages. * @function encodeDelimited * @memberof abci.RequestEcho * @static * @param {abci.IRequestEcho} message RequestEcho message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestEcho.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a RequestEcho message from the specified reader or buffer. * @function decode * @memberof abci.RequestEcho * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {abci.RequestEcho} RequestEcho * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestEcho.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.abci.RequestEcho(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.message = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a RequestEcho message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof abci.RequestEcho * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {abci.RequestEcho} RequestEcho * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestEcho.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a RequestEcho message. * @function verify * @memberof abci.RequestEcho * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ RequestEcho.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; return null; }; /** * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof abci.RequestEcho * @static * @param {Object.<string,*>} object Plain object * @returns {abci.RequestEcho} RequestEcho */ RequestEcho.fromObject = function fromObject(object) { if (object instanceof $root.abci.RequestEcho) return object; var message = new $root.abci.RequestEcho(); if (object.message != null) message.message = String(object.message); return message; }; /** * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. * @function toObject * @memberof abci.RequestEcho * @static * @param {abci.RequestEcho} message RequestEcho * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ RequestEcho.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.message = ""; if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; return object; }; /** * Converts this RequestEcho to JSON. * @function toJSON * @memberof abci.RequestEcho * @instance * @returns {Object.<string,*>} JSON object */ RequestEcho.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return RequestEcho; })(); abci.RequestFlush = (function() { /** * Properties of a RequestFlush. * @memberof abci * @interface IRequestFlush */ /** * Constructs a new RequestFlush. * @memberof abci * @classdesc Represents a RequestFlush. * @implements IRequestFlush * @constructor * @param {abci.IRequestFlush=} [properties] Properties to set */ function RequestFlush(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Creates a new RequestFlush instance using the specified properties. * @function create * @memberof abci.RequestFlush * @static * @param {abci.IRequestFlush=} [properties] Properties to set * @returns {abci.RequestFlush} RequestFlush instance */ RequestFlush.create = function create(properties) { return new RequestFlush(properties); }; /** * Encodes the specified RequestFlush message. Does not implicitly {@link abci.RequestFlush.verify|verify} messages. * @function encode * @memberof abci.RequestFlush * @static * @param {abci.IRequestFlush} message RequestFlush message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestFlush.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link abci.RequestFlush.verify|verify} messages. * @function encodeDelimited * @memberof abci.RequestFlush * @static * @param {abci.IRequestFlush} message RequestFlush message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestFlush.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a RequestFlush message from the specified reader or buffer. * @function decode * @memberof abci.RequestFlush * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {abci.RequestFlush} RequestFlush * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestFlush.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.abci.RequestFlush(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a RequestFlush message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof abci.RequestFlush * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {abci.RequestFlush} RequestFlush * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestFlush.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a RequestFlush message. * @function verify * @memberof abci.RequestFlush * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ RequestFlush.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof abci.RequestFlush * @static * @param {Object.<string,*>} object Plain object * @returns {abci.RequestFlush} RequestFlush */ RequestFlush.fromObject = function fromObject(object) { if (object instanceof $root.abci.RequestFlush) return object; return new $root.abci.RequestFlush(); }; /** * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. * @function toObject * @memberof abci.RequestFlush * @static * @param {abci.RequestFlush} message RequestFlush * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ RequestFlush.toObject = function toObject() { return {}; }; /** * Converts this RequestFlush to JSON. * @function toJSON * @memberof abci.RequestFlush * @instance * @returns {Object.<string,*>} JSON object */ RequestFlush.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return RequestFlush; })(); abci.RequestInfo = (function() { /** * Properties of a RequestInfo. * @memberof abci * @interface IRequestInfo * @property {string|null} [version] RequestInfo version * @property {number|Long|null} [blockVersion] RequestInfo blockVersion * @property {number|Long|null} [p2pVersion] RequestInfo p2pVersion */ /** * Constructs a new RequestInfo. * @memberof abci * @classdesc Represents a RequestInfo. * @implements IRequestInfo * @constructor * @param {abci.IRequestInfo=} [properties] Properties to set */ function RequestInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * RequestInfo version. * @member {string} version * @memberof abci.RequestInfo * @instance */ RequestInfo.prototype.version = ""; /** * RequestInfo blockVersion. * @member {number|Long} blockVersion * @memberof abci.RequestInfo * @instance */ RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * RequestInfo p2pVersion. * @member {number|Long} p2pVersion * @memberof abci.RequestInfo * @instance */ RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * Creates a new RequestInfo instance using the specified properties. * @function create * @memberof abci.RequestInfo * @static * @param {abci.IRequestInfo=} [properties] Properties to set * @returns {abci.RequestInfo} RequestInfo instance */ RequestInfo.create = function create(properties) { return new RequestInfo(properties); }; /** * Encodes the specified RequestInfo message. Does not implicitly {@link abci.RequestInfo.verify|verify} messages. * @function encode * @memberof abci.RequestInfo * @static * @param {abci.IRequestInfo} message RequestInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.version != null && message.hasOwnProperty("version")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockVersion); if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2pVersion); return writer; }; /** * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link abci.RequestInfo.verify|verify} messages. * @function encodeDelimited * @memberof abci.RequestInfo * @static * @param {abci.IRequestInfo} message RequestInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a RequestInfo message from the specified reader or buffer. * @function decode * @memberof abci.RequestInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {abci.RequestInfo} RequestInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.abci.RequestInfo(); while (reader.pos < end) { var 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; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a RequestInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof abci.RequestInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {abci.RequestInfo} RequestInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RequestInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a RequestInfo message. * @function verify * @memberof abci.RequestInfo * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ RequestInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.version != null && message.hasOwnProperty("version")) if (!$util.isString(message.version)) return "version: string expected"; if (message.blockVersion != null && message.hasOwnProperty("blockVersion")) if (!$util.isInteger(message.blockVersion) && !(message.blockVersion && $util.isInteger(message.blockVersion.low) && $util.isInteger(message.blockVersion.high))) return "blockVersion: integer|Long expected"; if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion")) if (!$util.isInteger(message.p2pVersion) && !(message.p2pVersion && $util.isInteger(message.p2pVersion.low) && $util.isInteger(message.p2pVersion.high))) return "p2pVersion: integer|Long expected"; return null; }; /** * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof abci.RequestInfo * @static * @param {Object.<string,*>} object Plain object * @returns {abci.RequestInfo} RequestInfo */ RequestInfo.fromObject = function fromObject(object) { if (object instanceof $root.abci.RequestInfo) return object; var message = new $root.abci.RequestInfo(); if (object.version != null) message.version = String(object.version); if (object.blockVersion != null) if ($util.Long) (message.blockVersion = $util.Long.fromValue(object.blockVersion)).unsigned = true; else if (typeof object.blockVersion === "string") message.blockVersion = parseInt(object.blockVersion, 10); else if (typeof object.blockVersion === "number") message.blockVersion = object.blockVersion; else if (typeof object.blockVersion === "object") message.blockVersion = new $util.LongBits(object.blockVersion.low >>> 0, object.blockVersion.high >>> 0).toNumber(true); if (object.p2pVersion != null) if ($util.Long) (message.p2pVersion = $util.Long.fromValue(object.p2pVersion)).unsigned = true; else if (typeof object.p2pVersion === "string") message.p2pVersion = parseInt(object.p2pVersion, 10); else if (typeof object.p2pVersion === "number") message.p2pVersion = object.p2pVersion; else if (typeof object.p2pVersion === "object") message.p2pVersion = new $util.LongBits(object.p2pVersion.low >>> 0, object.p2pVersion.high >>> 0).toNumber(true); return message; }; /** * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. * @function toObject * @memberof abci.RequestInfo * @static * @param {abci.RequestInfo} message RequestInfo * @