UNPKG

rchain-client-api

Version:
953 lines (801 loc) 717 kB
/*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"); var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.coop = (function() { var coop = {}; coop.rchain = (function() { var rchain = {}; rchain.casper = (function() { var casper = {}; casper.protocol = (function() { var protocol = {}; protocol.DeployService = (function() { function DeployService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (DeployService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DeployService; DeployService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; Object.defineProperty(DeployService.prototype.doDeploy = function doDeploy(request, callback) { return this.rpcCall(doDeploy, $root.coop.rchain.casper.protocol.DeployData, $root.Either, request, callback); }, "name", { value: "DoDeploy" }); Object.defineProperty(DeployService.prototype.getBlock = function getBlock(request, callback) { return this.rpcCall(getBlock, $root.coop.rchain.casper.protocol.BlockQuery, $root.Either, request, callback); }, "name", { value: "getBlock" }); Object.defineProperty(DeployService.prototype.visualizeDag = function visualizeDag(request, callback) { return this.rpcCall(visualizeDag, $root.coop.rchain.casper.protocol.VisualizeDagQuery, $root.Either, request, callback); }, "name", { value: "visualizeDag" }); Object.defineProperty(DeployService.prototype.machineVerifiableDag = function machineVerifiableDag(request, callback) { return this.rpcCall(machineVerifiableDag, $root.coop.rchain.casper.protocol.MachineVerifyQuery, $root.Either, request, callback); }, "name", { value: "machineVerifiableDag" }); Object.defineProperty(DeployService.prototype.showMainChain = function showMainChain(request, callback) { return this.rpcCall(showMainChain, $root.coop.rchain.casper.protocol.BlocksQuery, $root.Either, request, callback); }, "name", { value: "showMainChain" }); Object.defineProperty(DeployService.prototype.getBlocks = function getBlocks(request, callback) { return this.rpcCall(getBlocks, $root.coop.rchain.casper.protocol.BlocksQuery, $root.Either, request, callback); }, "name", { value: "getBlocks" }); Object.defineProperty(DeployService.prototype.listenForDataAtName = function listenForDataAtName(request, callback) { return this.rpcCall(listenForDataAtName, $root.coop.rchain.casper.protocol.DataAtNameQuery, $root.Either, request, callback); }, "name", { value: "listenForDataAtName" }); Object.defineProperty(DeployService.prototype.listenForContinuationAtName = function listenForContinuationAtName(request, callback) { return this.rpcCall(listenForContinuationAtName, $root.coop.rchain.casper.protocol.ContinuationAtNameQuery, $root.Either, request, callback); }, "name", { value: "listenForContinuationAtName" }); Object.defineProperty(DeployService.prototype.findBlockWithDeploy = function findBlockWithDeploy(request, callback) { return this.rpcCall(findBlockWithDeploy, $root.coop.rchain.casper.protocol.FindDeployInBlockQuery, $root.Either, request, callback); }, "name", { value: "findBlockWithDeploy" }); Object.defineProperty(DeployService.prototype.findDeploy = function findDeploy(request, callback) { return this.rpcCall(findDeploy, $root.coop.rchain.casper.protocol.FindDeployQuery, $root.Either, request, callback); }, "name", { value: "findDeploy" }); Object.defineProperty(DeployService.prototype.previewPrivateNames = function previewPrivateNames(request, callback) { return this.rpcCall(previewPrivateNames, $root.coop.rchain.casper.protocol.PrivateNamePreviewQuery, $root.Either, request, callback); }, "name", { value: "previewPrivateNames" }); Object.defineProperty(DeployService.prototype.lastFinalizedBlock = function lastFinalizedBlock(request, callback) { return this.rpcCall(lastFinalizedBlock, $root.coop.rchain.casper.protocol.LastFinalizedBlockQuery, $root.Either, request, callback); }, "name", { value: "lastFinalizedBlock" }); return DeployService; })(); protocol.FindDeployQuery = (function() { function FindDeployQuery(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]]; } FindDeployQuery.prototype.deployId = $util.newBuffer([]); FindDeployQuery.create = function create(properties) { return new FindDeployQuery(properties); }; FindDeployQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deployId != null && message.hasOwnProperty("deployId")) writer.uint32(10).bytes(message.deployId); return writer; }; FindDeployQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; FindDeployQuery.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.coop.rchain.casper.protocol.FindDeployQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.deployId = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }; FindDeployQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; FindDeployQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deployId != null && message.hasOwnProperty("deployId")) if (!(message.deployId && typeof message.deployId.length === "number" || $util.isString(message.deployId))) return "deployId: buffer expected"; return null; }; FindDeployQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.FindDeployQuery) return object; var message = new $root.coop.rchain.casper.protocol.FindDeployQuery(); if (object.deployId != null) if (typeof object.deployId === "string") $util.base64.decode(object.deployId, message.deployId = $util.newBuffer($util.base64.length(object.deployId)), 0); else if (object.deployId.length) message.deployId = object.deployId; return message; }; FindDeployQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) if (options.bytes === String) object.deployId = ""; else { object.deployId = []; if (options.bytes !== Array) object.deployId = $util.newBuffer(object.deployId); } if (message.deployId != null && message.hasOwnProperty("deployId")) object.deployId = options.bytes === String ? $util.base64.encode(message.deployId, 0, message.deployId.length) : options.bytes === Array ? Array.prototype.slice.call(message.deployId) : message.deployId; return object; }; FindDeployQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FindDeployQuery; })(); protocol.FindDeployInBlockQuery = (function() { function FindDeployInBlockQuery(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]]; } FindDeployInBlockQuery.prototype.user = $util.newBuffer([]); FindDeployInBlockQuery.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; FindDeployInBlockQuery.create = function create(properties) { return new FindDeployInBlockQuery(properties); }; FindDeployInBlockQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.user != null && message.hasOwnProperty("user")) writer.uint32(10).bytes(message.user); if (message.timestamp != null && message.hasOwnProperty("timestamp")) writer.uint32(16).int64(message.timestamp); return writer; }; FindDeployInBlockQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; FindDeployInBlockQuery.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.coop.rchain.casper.protocol.FindDeployInBlockQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.user = reader.bytes(); break; case 2: message.timestamp = reader.int64(); break; default: reader.skipType(tag & 7); break; } } return message; }; FindDeployInBlockQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; FindDeployInBlockQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.user != null && message.hasOwnProperty("user")) if (!(message.user && typeof message.user.length === "number" || $util.isString(message.user))) return "user: buffer expected"; if (message.timestamp != null && message.hasOwnProperty("timestamp")) if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) return "timestamp: integer|Long expected"; return null; }; FindDeployInBlockQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.FindDeployInBlockQuery) return object; var message = new $root.coop.rchain.casper.protocol.FindDeployInBlockQuery(); if (object.user != null) if (typeof object.user === "string") $util.base64.decode(object.user, message.user = $util.newBuffer($util.base64.length(object.user)), 0); else if (object.user.length) message.user = object.user; if (object.timestamp != null) if ($util.Long) (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; else if (typeof object.timestamp === "string") message.timestamp = parseInt(object.timestamp, 10); else if (typeof object.timestamp === "number") message.timestamp = object.timestamp; else if (typeof object.timestamp === "object") message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; FindDeployInBlockQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if (options.bytes === String) object.user = ""; else { object.user = []; if (options.bytes !== Array) object.user = $util.newBuffer(object.user); } if ($util.Long) { var long = new $util.Long(0, 0, false); object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.timestamp = options.longs === String ? "0" : 0; } if (message.user != null && message.hasOwnProperty("user")) object.user = options.bytes === String ? $util.base64.encode(message.user, 0, message.user.length) : options.bytes === Array ? Array.prototype.slice.call(message.user) : message.user; if (message.timestamp != null && message.hasOwnProperty("timestamp")) if (typeof message.timestamp === "number") object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; else object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; FindDeployInBlockQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FindDeployInBlockQuery; })(); protocol.BlockQuery = (function() { function BlockQuery(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]]; } BlockQuery.prototype.hash = ""; BlockQuery.create = function create(properties) { return new BlockQuery(properties); }; BlockQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.hash != null && message.hasOwnProperty("hash")) writer.uint32(10).string(message.hash); return writer; }; BlockQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; BlockQuery.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.coop.rchain.casper.protocol.BlockQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.hash = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; BlockQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; BlockQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.hash != null && message.hasOwnProperty("hash")) if (!$util.isString(message.hash)) return "hash: string expected"; return null; }; BlockQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.BlockQuery) return object; var message = new $root.coop.rchain.casper.protocol.BlockQuery(); if (object.hash != null) message.hash = String(object.hash); return message; }; BlockQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.hash = ""; if (message.hash != null && message.hasOwnProperty("hash")) object.hash = message.hash; return object; }; BlockQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return BlockQuery; })(); protocol.BlocksQuery = (function() { function BlocksQuery(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]]; } BlocksQuery.prototype.depth = 0; BlocksQuery.create = function create(properties) { return new BlocksQuery(properties); }; BlocksQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.depth != null && message.hasOwnProperty("depth")) writer.uint32(8).int32(message.depth); return writer; }; BlocksQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; BlocksQuery.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.coop.rchain.casper.protocol.BlocksQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.depth = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; BlocksQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; BlocksQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.depth != null && message.hasOwnProperty("depth")) if (!$util.isInteger(message.depth)) return "depth: integer expected"; return null; }; BlocksQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.BlocksQuery) return object; var message = new $root.coop.rchain.casper.protocol.BlocksQuery(); if (object.depth != null) message.depth = object.depth | 0; return message; }; BlocksQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.depth = 0; if (message.depth != null && message.hasOwnProperty("depth")) object.depth = message.depth; return object; }; BlocksQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return BlocksQuery; })(); protocol.DataAtNameQuery = (function() { function DataAtNameQuery(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]]; } DataAtNameQuery.prototype.depth = 0; DataAtNameQuery.prototype.name = null; DataAtNameQuery.create = function create(properties) { return new DataAtNameQuery(properties); }; DataAtNameQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.depth != null && message.hasOwnProperty("depth")) writer.uint32(8).int32(message.depth); if (message.name != null && message.hasOwnProperty("name")) $root.Par.encode(message.name, writer.uint32(18).fork()).ldelim(); return writer; }; DataAtNameQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; DataAtNameQuery.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.coop.rchain.casper.protocol.DataAtNameQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.depth = reader.int32(); break; case 2: message.name = $root.Par.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; DataAtNameQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; DataAtNameQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.depth != null && message.hasOwnProperty("depth")) if (!$util.isInteger(message.depth)) return "depth: integer expected"; if (message.name != null && message.hasOwnProperty("name")) { var error = $root.Par.verify(message.name); if (error) return "name." + error; } return null; }; DataAtNameQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.DataAtNameQuery) return object; var message = new $root.coop.rchain.casper.protocol.DataAtNameQuery(); if (object.depth != null) message.depth = object.depth | 0; if (object.name != null) { if (typeof object.name !== "object") throw TypeError(".coop.rchain.casper.protocol.DataAtNameQuery.name: object expected"); message.name = $root.Par.fromObject(object.name); } return message; }; DataAtNameQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.depth = 0; object.name = null; } if (message.depth != null && message.hasOwnProperty("depth")) object.depth = message.depth; if (message.name != null && message.hasOwnProperty("name")) object.name = $root.Par.toObject(message.name, options); return object; }; DataAtNameQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DataAtNameQuery; })(); protocol.ContinuationAtNameQuery = (function() { function ContinuationAtNameQuery(properties) { this.names = []; 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]]; } ContinuationAtNameQuery.prototype.depth = 0; ContinuationAtNameQuery.prototype.names = $util.emptyArray; ContinuationAtNameQuery.create = function create(properties) { return new ContinuationAtNameQuery(properties); }; ContinuationAtNameQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.depth != null && message.hasOwnProperty("depth")) writer.uint32(8).int32(message.depth); if (message.names != null && message.names.length) for (var i = 0; i < message.names.length; ++i) $root.Par.encode(message.names[i], writer.uint32(18).fork()).ldelim(); return writer; }; ContinuationAtNameQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; ContinuationAtNameQuery.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.coop.rchain.casper.protocol.ContinuationAtNameQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.depth = reader.int32(); break; case 2: if (!(message.names && message.names.length)) message.names = []; message.names.push($root.Par.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; ContinuationAtNameQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; ContinuationAtNameQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.depth != null && message.hasOwnProperty("depth")) if (!$util.isInteger(message.depth)) return "depth: integer expected"; if (message.names != null && message.hasOwnProperty("names")) { if (!Array.isArray(message.names)) return "names: array expected"; for (var i = 0; i < message.names.length; ++i) { var error = $root.Par.verify(message.names[i]); if (error) return "names." + error; } } return null; }; ContinuationAtNameQuery.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.ContinuationAtNameQuery) return object; var message = new $root.coop.rchain.casper.protocol.ContinuationAtNameQuery(); if (object.depth != null) message.depth = object.depth | 0; if (object.names) { if (!Array.isArray(object.names)) throw TypeError(".coop.rchain.casper.protocol.ContinuationAtNameQuery.names: array expected"); message.names = []; for (var i = 0; i < object.names.length; ++i) { if (typeof object.names[i] !== "object") throw TypeError(".coop.rchain.casper.protocol.ContinuationAtNameQuery.names: object expected"); message.names[i] = $root.Par.fromObject(object.names[i]); } } return message; }; ContinuationAtNameQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.names = []; if (options.defaults) object.depth = 0; if (message.depth != null && message.hasOwnProperty("depth")) object.depth = message.depth; if (message.names && message.names.length) { object.names = []; for (var j = 0; j < message.names.length; ++j) object.names[j] = $root.Par.toObject(message.names[j], options); } return object; }; ContinuationAtNameQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ContinuationAtNameQuery; })(); protocol.DeployServiceResponse = (function() { function DeployServiceResponse(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]]; } DeployServiceResponse.prototype.message = ""; DeployServiceResponse.create = function create(properties) { return new DeployServiceResponse(properties); }; DeployServiceResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.message != null && message.hasOwnProperty("message")) writer.uint32(10).string(message.message); return writer; }; DeployServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; DeployServiceResponse.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.coop.rchain.casper.protocol.DeployServiceResponse(); 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; }; DeployServiceResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; DeployServiceResponse.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; }; DeployServiceResponse.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.DeployServiceResponse) return object; var message = new $root.coop.rchain.casper.protocol.DeployServiceResponse(); if (object.message != null) message.message = String(object.message); return message; }; DeployServiceResponse.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; }; DeployServiceResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeployServiceResponse; })(); protocol.BlockQueryResponse = (function() { function BlockQueryResponse(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]]; } BlockQueryResponse.prototype.blockInfo = null; BlockQueryResponse.create = function create(properties) { return new BlockQueryResponse(properties); }; BlockQueryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.blockInfo != null && message.hasOwnProperty("blockInfo")) $root.coop.rchain.casper.protocol.BlockInfo.encode(message.blockInfo, writer.uint32(10).fork()).ldelim(); return writer; }; BlockQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; BlockQueryResponse.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.coop.rchain.casper.protocol.BlockQueryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockInfo = $root.coop.rchain.casper.protocol.BlockInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; BlockQueryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; BlockQueryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.blockInfo != null && message.hasOwnProperty("blockInfo")) { var error = $root.coop.rchain.casper.protocol.BlockInfo.verify(message.blockInfo); if (error) return "blockInfo." + error; } return null; }; BlockQueryResponse.fromObject = function fromObject(object) { if (object instanceof $root.coop.rchain.casper.protocol.BlockQueryResponse) return object; var message = new $root.coop.rchain.casper.protocol.BlockQueryResponse(); if (object.blockInfo != null) { if (typeof object.blockInfo !== "object") throw TypeError(".coop.rchain.casper.protocol.BlockQueryResponse.blockInfo: object expected"); message.blockInfo = $root.coop.rchain.casper.protocol.BlockInfo.fromObject(object.blockInfo); } return message; }; BlockQueryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.blockInfo = null; if (message.blockInfo != null && message.hasOwnProperty("blockInfo")) object.blockInfo = $root.coop.rchain.casper.protocol.BlockInfo.toObject(message.blockInfo, options); return object; }; BlockQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return BlockQueryResponse; })(); protocol.LightBlockQueryResponse = (function() { function LightBlockQueryResponse(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]]; } LightBlockQueryResponse.prototype.blockInfo = null; LightBlockQueryResponse.create = function create(properties) { return new LightBlockQueryResponse(properties); }; LightBlockQueryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.blockInfo != null && message.hasOwnProperty("blockInfo")) $root.coop.rchain.casper.protocol.LightBlockInfo.encode(message.blockInfo, writer.uint32(10).fork()).ldelim(); return writer; }; LightBlockQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; LightBlockQueryResponse.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.coop.rchain.casper.protocol.LightBlockQueryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.blockInfo = $root.coop.rchain.casper.protocol.LightBlockInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; LightBlockQueryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return