UNPKG

bifcore-sdk-nodejs-bop

Version:
1,629 lines (1,389 loc) 147 kB
/* eslint-disable */ /** * @fileoverview * @enhanceable * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var common_pb = require('./common_pb.js'); var chain_pb = require('./chain_pb.js'); goog.exportSymbol('proto.protocol.ChainContractLog', null, global); goog.exportSymbol('proto.protocol.ChainHello', null, global); goog.exportSymbol('proto.protocol.ChainMessageType', null, global); goog.exportSymbol('proto.protocol.ChainPeerMessage', null, global); goog.exportSymbol('proto.protocol.ChainResponse', null, global); goog.exportSymbol('proto.protocol.ChainStatus', null, global); goog.exportSymbol('proto.protocol.ChainSubscribeTx', null, global); goog.exportSymbol('proto.protocol.ChainTxStatus', null, global); goog.exportSymbol('proto.protocol.ChainTxStatus.TxStatus', null, global); goog.exportSymbol('proto.protocol.DontHave', null, global); goog.exportSymbol('proto.protocol.EntryList', null, global); goog.exportSymbol('proto.protocol.GetLedgers', null, global); goog.exportSymbol('proto.protocol.Hello', null, global); goog.exportSymbol('proto.protocol.HelloResponse', null, global); goog.exportSymbol('proto.protocol.LedgerTxs', null, global); goog.exportSymbol('proto.protocol.LedgerUpgradeNotify', null, global); goog.exportSymbol('proto.protocol.Ledgers', null, global); goog.exportSymbol('proto.protocol.Ledgers.SyncCode', null, global); goog.exportSymbol('proto.protocol.OVERLAY_MESSAGE_TYPE', null, global); goog.exportSymbol('proto.protocol.Peer', null, global); goog.exportSymbol('proto.protocol.Peers', null, global); goog.exportSymbol('proto.protocol.TransactionEnvResult', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.Hello = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.Hello, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.Hello.displayName = 'proto.protocol.Hello'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.Hello.prototype.toObject = function (opt_includeInstance) { return proto.protocol.Hello.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.Hello} msg The msg instance to transform. * @return {!Object} */ proto.protocol.Hello.toObject = function (includeInstance, msg) { var f, obj = { networkId: msg.getNetworkId(), ledgerVersion: msg.getLedgerVersion(), overlayVersion: msg.getOverlayVersion(), buchainVersion: msg.getBuchainVersion(), listeningPort: msg.getListeningPort(), nodeAddress: msg.getNodeAddress(), nodeRand: msg.getNodeRand(), license: msg.getLicense() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.Hello} */ proto.protocol.Hello.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.Hello; return proto.protocol.Hello.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.Hello} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.Hello} */ proto.protocol.Hello.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readInt64()); msg.setNetworkId(value); break; case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setLedgerVersion(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setOverlayVersion(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setBuchainVersion(value); break; case 5: var value = /** @type {number} */ (reader.readInt64()); msg.setListeningPort(value); break; case 6: var value = /** @type {string} */ (reader.readString()); msg.setNodeAddress(value); break; case 7: var value = /** @type {string} */ (reader.readString()); msg.setNodeRand(value); break; case 8: var value = /** @type {string} */ (reader.readString()); msg.setLicense(value); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.Hello} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.Hello.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.Hello.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.Hello.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getNetworkId(); if (f !== 0) { writer.writeInt64( 1, f ); } f = this.getLedgerVersion(); if (f !== 0) { writer.writeInt64( 2, f ); } f = this.getOverlayVersion(); if (f !== 0) { writer.writeInt64( 3, f ); } f = this.getBuchainVersion(); if (f.length > 0) { writer.writeString( 4, f ); } f = this.getListeningPort(); if (f !== 0) { writer.writeInt64( 5, f ); } f = this.getNodeAddress(); if (f.length > 0) { writer.writeString( 6, f ); } f = this.getNodeRand(); if (f.length > 0) { writer.writeString( 7, f ); } f = this.getLicense(); if (f.length > 0) { writer.writeString( 8, f ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.Hello} The clone. */ proto.protocol.Hello.prototype.cloneMessage = function () { return /** @type {!proto.protocol.Hello} */ (jspb.Message.cloneMessage(this)); }; /** * optional int64 network_id = 1; * @return {number} */ proto.protocol.Hello.prototype.getNetworkId = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); }; /** @param {number} value */ proto.protocol.Hello.prototype.setNetworkId = function (value) { jspb.Message.setField(this, 1, value); }; /** * optional int64 ledger_version = 2; * @return {number} */ proto.protocol.Hello.prototype.getLedgerVersion = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); }; /** @param {number} value */ proto.protocol.Hello.prototype.setLedgerVersion = function (value) { jspb.Message.setField(this, 2, value); }; /** * optional int64 overlay_version = 3; * @return {number} */ proto.protocol.Hello.prototype.getOverlayVersion = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); }; /** @param {number} value */ proto.protocol.Hello.prototype.setOverlayVersion = function (value) { jspb.Message.setField(this, 3, value); }; /** * optional string buchain_version = 4; * @return {string} */ proto.protocol.Hello.prototype.getBuchainVersion = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 4, "")); }; /** @param {string} value */ proto.protocol.Hello.prototype.setBuchainVersion = function (value) { jspb.Message.setField(this, 4, value); }; /** * optional int64 listening_port = 5; * @return {number} */ proto.protocol.Hello.prototype.getListeningPort = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 5, 0)); }; /** @param {number} value */ proto.protocol.Hello.prototype.setListeningPort = function (value) { jspb.Message.setField(this, 5, value); }; /** * optional string node_address = 6; * @return {string} */ proto.protocol.Hello.prototype.getNodeAddress = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 6, "")); }; /** @param {string} value */ proto.protocol.Hello.prototype.setNodeAddress = function (value) { jspb.Message.setField(this, 6, value); }; /** * optional string node_rand = 7; * @return {string} */ proto.protocol.Hello.prototype.getNodeRand = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 7, "")); }; /** @param {string} value */ proto.protocol.Hello.prototype.setNodeRand = function (value) { jspb.Message.setField(this, 7, value); }; /** * optional string license = 8; * @return {string} */ proto.protocol.Hello.prototype.getLicense = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 8, "")); }; /** @param {string} value */ proto.protocol.Hello.prototype.setLicense = function (value) { jspb.Message.setField(this, 8, value); }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.HelloResponse = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.HelloResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.HelloResponse.displayName = 'proto.protocol.HelloResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.HelloResponse.prototype.toObject = function (opt_includeInstance) { return proto.protocol.HelloResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.HelloResponse} msg The msg instance to transform. * @return {!Object} */ proto.protocol.HelloResponse.toObject = function (includeInstance, msg) { var f, obj = { errorCode: msg.getErrorCode(), errorDesc: msg.getErrorDesc() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.HelloResponse} */ proto.protocol.HelloResponse.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.HelloResponse; return proto.protocol.HelloResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.HelloResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.HelloResponse} */ proto.protocol.HelloResponse.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.protocol.ERRORCODE} */ (reader.readEnum()); msg.setErrorCode(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setErrorDesc(value); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.HelloResponse} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.HelloResponse.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.HelloResponse.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.HelloResponse.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getErrorCode(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = this.getErrorDesc(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.HelloResponse} The clone. */ proto.protocol.HelloResponse.prototype.cloneMessage = function () { return /** @type {!proto.protocol.HelloResponse} */ (jspb.Message.cloneMessage(this)); }; /** * optional ERRORCODE error_code = 1; * @return {!proto.protocol.ERRORCODE} */ proto.protocol.HelloResponse.prototype.getErrorCode = function () { return /** @type {!proto.protocol.ERRORCODE} */ (jspb.Message.getFieldProto3(this, 1, 0)); }; /** @param {!proto.protocol.ERRORCODE} value */ proto.protocol.HelloResponse.prototype.setErrorCode = function (value) { jspb.Message.setField(this, 1, value); }; /** * optional string error_desc = 2; * @return {string} */ proto.protocol.HelloResponse.prototype.getErrorDesc = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, "")); }; /** @param {string} value */ proto.protocol.HelloResponse.prototype.setErrorDesc = function (value) { jspb.Message.setField(this, 2, value); }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.Peer = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.Peer, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.Peer.displayName = 'proto.protocol.Peer'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.Peer.prototype.toObject = function (opt_includeInstance) { return proto.protocol.Peer.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.Peer} msg The msg instance to transform. * @return {!Object} */ proto.protocol.Peer.toObject = function (includeInstance, msg) { var f, obj = { ip: msg.getIp(), port: msg.getPort(), numFailures: msg.getNumFailures(), nextAttemptTime: msg.getNextAttemptTime(), activeTime: msg.getActiveTime(), connectionId: msg.getConnectionId() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.Peer} */ proto.protocol.Peer.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.Peer; return proto.protocol.Peer.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.Peer} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.Peer} */ proto.protocol.Peer.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setIp(value); break; case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setPort(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setNumFailures(value); break; case 4: var value = /** @type {number} */ (reader.readInt64()); msg.setNextAttemptTime(value); break; case 5: var value = /** @type {number} */ (reader.readInt64()); msg.setActiveTime(value); break; case 6: var value = /** @type {number} */ (reader.readInt64()); msg.setConnectionId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.Peer} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.Peer.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.Peer.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.Peer.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getIp(); if (f.length > 0) { writer.writeString( 1, f ); } f = this.getPort(); if (f !== 0) { writer.writeInt64( 2, f ); } f = this.getNumFailures(); if (f !== 0) { writer.writeInt64( 3, f ); } f = this.getNextAttemptTime(); if (f !== 0) { writer.writeInt64( 4, f ); } f = this.getActiveTime(); if (f !== 0) { writer.writeInt64( 5, f ); } f = this.getConnectionId(); if (f !== 0) { writer.writeInt64( 6, f ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.Peer} The clone. */ proto.protocol.Peer.prototype.cloneMessage = function () { return /** @type {!proto.protocol.Peer} */ (jspb.Message.cloneMessage(this)); }; /** * optional string ip = 1; * @return {string} */ proto.protocol.Peer.prototype.getIp = function () { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); }; /** @param {string} value */ proto.protocol.Peer.prototype.setIp = function (value) { jspb.Message.setField(this, 1, value); }; /** * optional int64 port = 2; * @return {number} */ proto.protocol.Peer.prototype.getPort = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); }; /** @param {number} value */ proto.protocol.Peer.prototype.setPort = function (value) { jspb.Message.setField(this, 2, value); }; /** * optional int64 num_failures = 3; * @return {number} */ proto.protocol.Peer.prototype.getNumFailures = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); }; /** @param {number} value */ proto.protocol.Peer.prototype.setNumFailures = function (value) { jspb.Message.setField(this, 3, value); }; /** * optional int64 next_attempt_time = 4; * @return {number} */ proto.protocol.Peer.prototype.getNextAttemptTime = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 4, 0)); }; /** @param {number} value */ proto.protocol.Peer.prototype.setNextAttemptTime = function (value) { jspb.Message.setField(this, 4, value); }; /** * optional int64 active_time = 5; * @return {number} */ proto.protocol.Peer.prototype.getActiveTime = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 5, 0)); }; /** @param {number} value */ proto.protocol.Peer.prototype.setActiveTime = function (value) { jspb.Message.setField(this, 5, value); }; /** * optional int64 connection_id = 6; * @return {number} */ proto.protocol.Peer.prototype.getConnectionId = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 6, 0)); }; /** @param {number} value */ proto.protocol.Peer.prototype.setConnectionId = function (value) { jspb.Message.setField(this, 6, value); }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.Peers = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Peers.repeatedFields_, null); }; goog.inherits(proto.protocol.Peers, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.Peers.displayName = 'proto.protocol.Peers'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.protocol.Peers.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.Peers.prototype.toObject = function (opt_includeInstance) { return proto.protocol.Peers.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.Peers} msg The msg instance to transform. * @return {!Object} */ proto.protocol.Peers.toObject = function (includeInstance, msg) { var f, obj = { peersList: jspb.Message.toObjectList(msg.getPeersList(), proto.protocol.Peer.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.Peers} */ proto.protocol.Peers.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.Peers; return proto.protocol.Peers.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.Peers} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.Peers} */ proto.protocol.Peers.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.protocol.Peer; reader.readMessage(value, proto.protocol.Peer.deserializeBinaryFromReader); msg.getPeersList().push(value); msg.setPeersList(msg.getPeersList()); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.Peers} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.Peers.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.Peers.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.Peers.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getPeersList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.protocol.Peer.serializeBinaryToWriter ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.Peers} The clone. */ proto.protocol.Peers.prototype.cloneMessage = function () { return /** @type {!proto.protocol.Peers} */ (jspb.Message.cloneMessage(this)); }; /** * repeated Peer peers = 1; * If you change this array by adding, removing or replacing elements, or if you * replace the array itself, then you must call the setter to update it. * @return {!Array.<!proto.protocol.Peer>} */ proto.protocol.Peers.prototype.getPeersList = function () { return /** @type{!Array.<!proto.protocol.Peer>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.protocol.Peer, 1)); }; /** @param {Array.<!proto.protocol.Peer>} value */ proto.protocol.Peers.prototype.setPeersList = function (value) { jspb.Message.setRepeatedWrapperField(this, 1, value); }; proto.protocol.Peers.prototype.clearPeersList = function () { this.setPeersList([]); }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.GetLedgers = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.GetLedgers, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.GetLedgers.displayName = 'proto.protocol.GetLedgers'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.GetLedgers.prototype.toObject = function (opt_includeInstance) { return proto.protocol.GetLedgers.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.GetLedgers} msg The msg instance to transform. * @return {!Object} */ proto.protocol.GetLedgers.toObject = function (includeInstance, msg) { var f, obj = { begin: msg.getBegin(), end: msg.getEnd(), timestamp: msg.getTimestamp(), chainId: msg.getChainId() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.GetLedgers} */ proto.protocol.GetLedgers.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.GetLedgers; return proto.protocol.GetLedgers.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.GetLedgers} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.GetLedgers} */ proto.protocol.GetLedgers.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readInt64()); msg.setBegin(value); break; case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setEnd(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setTimestamp(value); break; case 4: var value = /** @type {number} */ (reader.readInt64()); msg.setChainId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.GetLedgers} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.GetLedgers.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.GetLedgers.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.GetLedgers.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getBegin(); if (f !== 0) { writer.writeInt64( 1, f ); } f = this.getEnd(); if (f !== 0) { writer.writeInt64( 2, f ); } f = this.getTimestamp(); if (f !== 0) { writer.writeInt64( 3, f ); } f = this.getChainId(); if (f !== 0) { writer.writeInt64( 4, f ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.GetLedgers} The clone. */ proto.protocol.GetLedgers.prototype.cloneMessage = function () { return /** @type {!proto.protocol.GetLedgers} */ (jspb.Message.cloneMessage(this)); }; /** * optional int64 begin = 1; * @return {number} */ proto.protocol.GetLedgers.prototype.getBegin = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); }; /** @param {number} value */ proto.protocol.GetLedgers.prototype.setBegin = function (value) { jspb.Message.setField(this, 1, value); }; /** * optional int64 end = 2; * @return {number} */ proto.protocol.GetLedgers.prototype.getEnd = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); }; /** @param {number} value */ proto.protocol.GetLedgers.prototype.setEnd = function (value) { jspb.Message.setField(this, 2, value); }; /** * optional int64 timestamp = 3; * @return {number} */ proto.protocol.GetLedgers.prototype.getTimestamp = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); }; /** @param {number} value */ proto.protocol.GetLedgers.prototype.setTimestamp = function (value) { jspb.Message.setField(this, 3, value); }; /** * optional int64 chain_id = 4; * @return {number} */ proto.protocol.GetLedgers.prototype.getChainId = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 4, 0)); }; /** @param {number} value */ proto.protocol.GetLedgers.prototype.setChainId = function (value) { jspb.Message.setField(this, 4, value); }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.Ledgers = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Ledgers.repeatedFields_, null); }; goog.inherits(proto.protocol.Ledgers, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.Ledgers.displayName = 'proto.protocol.Ledgers'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.protocol.Ledgers.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.Ledgers.prototype.toObject = function (opt_includeInstance) { return proto.protocol.Ledgers.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.protocol.Ledgers} msg The msg instance to transform. * @return {!Object} */ proto.protocol.Ledgers.toObject = function (includeInstance, msg) { var f, obj = { valuesList: jspb.Message.toObjectList(msg.getValuesList(), chain_pb.ConsensusValue.toObject, includeInstance), syncCode: msg.getSyncCode(), maxSeq: msg.getMaxSeq(), proof: msg.getProof_asB64(), chainId: msg.getChainId() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.protocol.Ledgers} */ proto.protocol.Ledgers.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.Ledgers; return proto.protocol.Ledgers.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.Ledgers} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.Ledgers} */ proto.protocol.Ledgers.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new chain_pb.ConsensusValue; reader.readMessage(value, chain_pb.ConsensusValue.deserializeBinaryFromReader); msg.getValuesList().push(value); msg.setValuesList(msg.getValuesList()); break; case 2: var value = /** @type {!proto.protocol.Ledgers.SyncCode} */ (reader.readEnum()); msg.setSyncCode(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setMaxSeq(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setProof(value); break; case 5: var value = /** @type {number} */ (reader.readInt64()); msg.setChainId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. * @param {!proto.protocol.Ledgers} message * @param {!jspb.BinaryWriter} writer */ proto.protocol.Ledgers.serializeBinaryToWriter = function (message, writer) { message.serializeBinaryToWriter(writer); }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.protocol.Ledgers.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); }; /** * Serializes the message to binary data (in protobuf wire format), * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ proto.protocol.Ledgers.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getValuesList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, chain_pb.ConsensusValue.serializeBinaryToWriter ); } f = this.getSyncCode(); if (f !== 0.0) { writer.writeEnum( 2, f ); } f = this.getMaxSeq(); if (f !== 0) { writer.writeInt64( 3, f ); } f = this.getProof_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = this.getChainId(); if (f !== 0) { writer.writeInt64( 5, f ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. * @return {!proto.protocol.Ledgers} The clone. */ proto.protocol.Ledgers.prototype.cloneMessage = function () { return /** @type {!proto.protocol.Ledgers} */ (jspb.Message.cloneMessage(this)); }; /** * repeated ConsensusValue values = 1; * If you change this array by adding, removing or replacing elements, or if you * replace the array itself, then you must call the setter to update it. * @return {!Array.<!proto.protocol.ConsensusValue>} */ proto.protocol.Ledgers.prototype.getValuesList = function () { return /** @type{!Array.<!proto.protocol.ConsensusValue>} */ ( jspb.Message.getRepeatedWrapperField(this, chain_pb.ConsensusValue, 1)); }; /** @param {Array.<!proto.protocol.ConsensusValue>} value */ proto.protocol.Ledgers.prototype.setValuesList = function (value) { jspb.Message.setRepeatedWrapperField(this, 1, value); }; proto.protocol.Ledgers.prototype.clearValuesList = function () { this.setValuesList([]); }; /** * optional SyncCode sync_code = 2; * @return {!proto.protocol.Ledgers.SyncCode} */ proto.protocol.Ledgers.prototype.getSyncCode = function () { return /** @type {!proto.protocol.Ledgers.SyncCode} */ (jspb.Message.getFieldProto3(this, 2, 0)); }; /** @param {!proto.protocol.Ledgers.SyncCode} value */ proto.protocol.Ledgers.prototype.setSyncCode = function (value) { jspb.Message.setField(this, 2, value); }; /** * optional int64 max_seq = 3; * @return {number} */ proto.protocol.Ledgers.prototype.getMaxSeq = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); }; /** @param {number} value */ proto.protocol.Ledgers.prototype.setMaxSeq = function (value) { jspb.Message.setField(this, 3, value); }; /** * optional bytes proof = 4; * @return {!(string|Uint8Array)} */ proto.protocol.Ledgers.prototype.getProof = function () { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 4, "")); }; /** * optional bytes proof = 4; * This is a type-conversion wrapper around `getProof()` * @return {string} */ proto.protocol.Ledgers.prototype.getProof_asB64 = function () { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getProof())); }; /** * optional bytes proof = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getProof()` * @return {!Uint8Array} */ proto.protocol.Ledgers.prototype.getProof_asU8 = function () { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getProof())); }; /** @param {!(string|Uint8Array)} value */ proto.protocol.Ledgers.prototype.setProof = function (value) { jspb.Message.setField(this, 4, value); }; /** * optional int64 chain_id = 5; * @return {number} */ proto.protocol.Ledgers.prototype.getChainId = function () { return /** @type {number} */ (jspb.Message.getFieldProto3(this, 5, 0)); }; /** @param {number} value */ proto.protocol.Ledgers.prototype.setChainId = function (value) { jspb.Message.setField(this, 5, value); }; /** * @enum {number} */ proto.protocol.Ledgers.SyncCode = { OK: 0, OUT_OF_SYNC: 1, OUT_OF_LEDGERS: 2, BUSY: 3, REFUSE: 4, INTERNAL: 5 }; /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.protocol.DontHave = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.DontHave, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.DontHave.displayName = 'proto.protocol.DontHave'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_de