xud
Version:
Exchange Union Daemon
4,703 lines • 136 kB
JavaScript
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.xudp2p.Address', null, global);
goog.exportSymbol('proto.xudp2p.DisconnectingPacket', null, global);
goog.exportSymbol('proto.xudp2p.GetNodesPacket', null, global);
goog.exportSymbol('proto.xudp2p.GetOrdersPacket', null, global);
goog.exportSymbol('proto.xudp2p.LndUris', null, global);
goog.exportSymbol('proto.xudp2p.Node', null, global);
goog.exportSymbol('proto.xudp2p.NodeState', null, global);
goog.exportSymbol('proto.xudp2p.NodeStateUpdatePacket', null, global);
goog.exportSymbol('proto.xudp2p.NodesPacket', null, global);
goog.exportSymbol('proto.xudp2p.Order', null, global);
goog.exportSymbol('proto.xudp2p.OrderInvalidationPacket', null, global);
goog.exportSymbol('proto.xudp2p.OrderPacket', null, global);
goog.exportSymbol('proto.xudp2p.OrdersPacket', null, global);
goog.exportSymbol('proto.xudp2p.PingPacket', null, global);
goog.exportSymbol('proto.xudp2p.PongPacket', null, global);
goog.exportSymbol('proto.xudp2p.SanitySwapAckPacket', null, global);
goog.exportSymbol('proto.xudp2p.SanitySwapInitPacket', null, global);
goog.exportSymbol('proto.xudp2p.SessionAckPacket', null, global);
goog.exportSymbol('proto.xudp2p.SessionInitPacket', null, global);
goog.exportSymbol('proto.xudp2p.SwapAcceptedPacket', null, global);
goog.exportSymbol('proto.xudp2p.SwapFailedPacket', null, global);
goog.exportSymbol('proto.xudp2p.SwapRequestPacket', 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.xudp2p.Address = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.Address, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.Address.displayName = 'proto.xudp2p.Address';
}
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.xudp2p.Address.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.Address.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.xudp2p.Address} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Address.toObject = function(includeInstance, msg) {
var f, obj = {
host: jspb.Message.getFieldWithDefault(msg, 1, ""),
port: jspb.Message.getFieldWithDefault(msg, 2, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.Address}
*/
proto.xudp2p.Address.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.Address;
return proto.xudp2p.Address.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.Address} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.Address}
*/
proto.xudp2p.Address.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.setHost(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint32());
msg.setPort(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.Address.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.Address.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.Address} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Address.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getHost();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPort();
if (f !== 0) {
writer.writeUint32(
2,
f
);
}
};
/**
* optional string host = 1;
* @return {string}
*/
proto.xudp2p.Address.prototype.getHost = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.Address.prototype.setHost = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint32 port = 2;
* @return {number}
*/
proto.xudp2p.Address.prototype.getPort = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {number} value */
proto.xudp2p.Address.prototype.setPort = function(value) {
jspb.Message.setProto3IntField(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.xudp2p.Order = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.Order, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.Order.displayName = 'proto.xudp2p.Order';
}
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.xudp2p.Order.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.Order.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.xudp2p.Order} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Order.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
pairId: jspb.Message.getFieldWithDefault(msg, 2, ""),
price: +jspb.Message.getFieldWithDefault(msg, 3, 0.0),
quantity: jspb.Message.getFieldWithDefault(msg, 4, 0),
isBuy: jspb.Message.getFieldWithDefault(msg, 5, false),
replaceOrderId: jspb.Message.getFieldWithDefault(msg, 6, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.Order}
*/
proto.xudp2p.Order.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.Order;
return proto.xudp2p.Order.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.Order} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.Order}
*/
proto.xudp2p.Order.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPairId(value);
break;
case 3:
var value = /** @type {number} */ (reader.readDouble());
msg.setPrice(value);
break;
case 4:
var value = /** @type {number} */ (reader.readUint64());
msg.setQuantity(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsBuy(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setReplaceOrderId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.Order.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.Order.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.Order} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Order.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPairId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getPrice();
if (f !== 0.0) {
writer.writeDouble(
3,
f
);
}
f = message.getQuantity();
if (f !== 0) {
writer.writeUint64(
4,
f
);
}
f = message.getIsBuy();
if (f) {
writer.writeBool(
5,
f
);
}
f = message.getReplaceOrderId();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.Order.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.Order.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string pair_id = 2;
* @return {string}
*/
proto.xudp2p.Order.prototype.getPairId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.Order.prototype.setPairId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional double price = 3;
* @return {number}
*/
proto.xudp2p.Order.prototype.getPrice = function() {
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 3, 0.0));
};
/** @param {number} value */
proto.xudp2p.Order.prototype.setPrice = function(value) {
jspb.Message.setProto3FloatField(this, 3, value);
};
/**
* optional uint64 quantity = 4;
* @return {number}
*/
proto.xudp2p.Order.prototype.getQuantity = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/** @param {number} value */
proto.xudp2p.Order.prototype.setQuantity = function(value) {
jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional bool is_buy = 5;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.xudp2p.Order.prototype.getIsBuy = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 5, false));
};
/** @param {boolean} value */
proto.xudp2p.Order.prototype.setIsBuy = function(value) {
jspb.Message.setProto3BooleanField(this, 5, value);
};
/**
* optional string replace_order_id = 6;
* @return {string}
*/
proto.xudp2p.Order.prototype.getReplaceOrderId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/** @param {string} value */
proto.xudp2p.Order.prototype.setReplaceOrderId = function(value) {
jspb.Message.setProto3StringField(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.xudp2p.Node = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.Node.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.Node, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.Node.displayName = 'proto.xudp2p.Node';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.Node.repeatedFields_ = [2];
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.xudp2p.Node.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.Node.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.xudp2p.Node} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Node.toObject = function(includeInstance, msg) {
var f, obj = {
nodePubKey: jspb.Message.getFieldWithDefault(msg, 1, ""),
addressesList: jspb.Message.toObjectList(msg.getAddressesList(),
proto.xudp2p.Address.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.xudp2p.Node}
*/
proto.xudp2p.Node.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.Node;
return proto.xudp2p.Node.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.Node} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.Node}
*/
proto.xudp2p.Node.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.setNodePubKey(value);
break;
case 2:
var value = new proto.xudp2p.Address;
reader.readMessage(value,proto.xudp2p.Address.deserializeBinaryFromReader);
msg.addAddresses(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.Node.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.Node.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.Node} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.Node.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getNodePubKey();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getAddressesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.xudp2p.Address.serializeBinaryToWriter
);
}
};
/**
* optional string node_pub_key = 1;
* @return {string}
*/
proto.xudp2p.Node.prototype.getNodePubKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.Node.prototype.setNodePubKey = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated Address addresses = 2;
* @return {!Array<!proto.xudp2p.Address>}
*/
proto.xudp2p.Node.prototype.getAddressesList = function() {
return /** @type{!Array<!proto.xudp2p.Address>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xudp2p.Address, 2));
};
/** @param {!Array<!proto.xudp2p.Address>} value */
proto.xudp2p.Node.prototype.setAddressesList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.xudp2p.Address=} opt_value
* @param {number=} opt_index
* @return {!proto.xudp2p.Address}
*/
proto.xudp2p.Node.prototype.addAddresses = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.xudp2p.Address, opt_index);
};
proto.xudp2p.Node.prototype.clearAddressesList = function() {
this.setAddressesList([]);
};
/**
* 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.xudp2p.LndUris = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.LndUris.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.LndUris, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.LndUris.displayName = 'proto.xudp2p.LndUris';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.LndUris.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.xudp2p.LndUris.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.LndUris.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.xudp2p.LndUris} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.LndUris.toObject = function(includeInstance, msg) {
var f, obj = {
lndUriList: jspb.Message.getRepeatedField(msg, 1)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.LndUris}
*/
proto.xudp2p.LndUris.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.LndUris;
return proto.xudp2p.LndUris.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.LndUris} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.LndUris}
*/
proto.xudp2p.LndUris.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.addLndUri(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.LndUris.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.LndUris.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.LndUris} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.LndUris.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLndUriList();
if (f.length > 0) {
writer.writeRepeatedString(
1,
f
);
}
};
/**
* repeated string lnd_uri = 1;
* @return {!Array<string>}
*/
proto.xudp2p.LndUris.prototype.getLndUriList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
};
/** @param {!Array<string>} value */
proto.xudp2p.LndUris.prototype.setLndUriList = function(value) {
jspb.Message.setField(this, 1, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.xudp2p.LndUris.prototype.addLndUri = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 1, value, opt_index);
};
proto.xudp2p.LndUris.prototype.clearLndUriList = function() {
this.setLndUriList([]);
};
/**
* 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.xudp2p.NodeState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.NodeState.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.NodeState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.NodeState.displayName = 'proto.xudp2p.NodeState';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.NodeState.repeatedFields_ = [3,4];
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.xudp2p.NodeState.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.NodeState.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.xudp2p.NodeState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodeState.toObject = function(includeInstance, msg) {
var f, obj = {
addressesList: jspb.Message.toObjectList(msg.getAddressesList(),
proto.xudp2p.Address.toObject, includeInstance),
pairsList: jspb.Message.getRepeatedField(msg, 4),
lndPubKeysMap: (f = msg.getLndPubKeysMap()) ? f.toObject(includeInstance, undefined) : [],
tokenIdentifiersMap: (f = msg.getTokenIdentifiersMap()) ? f.toObject(includeInstance, undefined) : [],
lndUrisMap: (f = msg.getLndUrisMap()) ? f.toObject(includeInstance, proto.xudp2p.LndUris.toObject) : [],
connextIdentifier: jspb.Message.getFieldWithDefault(msg, 9, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.NodeState}
*/
proto.xudp2p.NodeState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.NodeState;
return proto.xudp2p.NodeState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.NodeState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.NodeState}
*/
proto.xudp2p.NodeState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 3:
var value = new proto.xudp2p.Address;
reader.readMessage(value,proto.xudp2p.Address.deserializeBinaryFromReader);
msg.addAddresses(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.addPairs(value);
break;
case 6:
var value = msg.getLndPubKeysMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "");
});
break;
case 7:
var value = msg.getTokenIdentifiersMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "");
});
break;
case 8:
var value = msg.getLndUrisMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.xudp2p.LndUris.deserializeBinaryFromReader, "");
});
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setConnextIdentifier(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.NodeState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.NodeState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.NodeState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodeState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddressesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
proto.xudp2p.Address.serializeBinaryToWriter
);
}
f = message.getPairsList();
if (f.length > 0) {
writer.writeRepeatedString(
4,
f
);
}
f = message.getLndPubKeysMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
f = message.getTokenIdentifiersMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
f = message.getLndUrisMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.xudp2p.LndUris.serializeBinaryToWriter);
}
f = message.getConnextIdentifier();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
};
/**
* repeated Address addresses = 3;
* @return {!Array<!proto.xudp2p.Address>}
*/
proto.xudp2p.NodeState.prototype.getAddressesList = function() {
return /** @type{!Array<!proto.xudp2p.Address>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xudp2p.Address, 3));
};
/** @param {!Array<!proto.xudp2p.Address>} value */
proto.xudp2p.NodeState.prototype.setAddressesList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.xudp2p.Address=} opt_value
* @param {number=} opt_index
* @return {!proto.xudp2p.Address}
*/
proto.xudp2p.NodeState.prototype.addAddresses = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.xudp2p.Address, opt_index);
};
proto.xudp2p.NodeState.prototype.clearAddressesList = function() {
this.setAddressesList([]);
};
/**
* repeated string pairs = 4;
* @return {!Array<string>}
*/
proto.xudp2p.NodeState.prototype.getPairsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
};
/** @param {!Array<string>} value */
proto.xudp2p.NodeState.prototype.setPairsList = function(value) {
jspb.Message.setField(this, 4, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.xudp2p.NodeState.prototype.addPairs = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 4, value, opt_index);
};
proto.xudp2p.NodeState.prototype.clearPairsList = function() {
this.setPairsList([]);
};
/**
* map<string, string> lnd_pub_keys = 6;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.xudp2p.NodeState.prototype.getLndPubKeysMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 6, opt_noLazyCreate,
null));
};
proto.xudp2p.NodeState.prototype.clearLndPubKeysMap = function() {
this.getLndPubKeysMap().clear();
};
/**
* map<string, string> token_identifiers = 7;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.xudp2p.NodeState.prototype.getTokenIdentifiersMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 7, opt_noLazyCreate,
null));
};
proto.xudp2p.NodeState.prototype.clearTokenIdentifiersMap = function() {
this.getTokenIdentifiersMap().clear();
};
/**
* map<string, LndUris> lnd_uris = 8;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,!proto.xudp2p.LndUris>}
*/
proto.xudp2p.NodeState.prototype.getLndUrisMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,!proto.xudp2p.LndUris>} */ (
jspb.Message.getMapField(this, 8, opt_noLazyCreate,
proto.xudp2p.LndUris));
};
proto.xudp2p.NodeState.prototype.clearLndUrisMap = function() {
this.getLndUrisMap().clear();
};
/**
* optional string connext_identifier = 9;
* @return {string}
*/
proto.xudp2p.NodeState.prototype.getConnextIdentifier = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
};
/** @param {string} value */
proto.xudp2p.NodeState.prototype.setConnextIdentifier = function(value) {
jspb.Message.setProto3StringField(this, 9, 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.xudp2p.PingPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.PingPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.PingPacket.displayName = 'proto.xudp2p.PingPacket';
}
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.xudp2p.PingPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.PingPacket.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.xudp2p.PingPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.PingPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.PingPacket}
*/
proto.xudp2p.PingPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.PingPacket;
return proto.xudp2p.PingPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.PingPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.PingPacket}
*/
proto.xudp2p.PingPacket.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.setId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.PingPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.PingPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.PingPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.PingPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.PingPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.PingPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, 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.xudp2p.PongPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.PongPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.PongPacket.displayName = 'proto.xudp2p.PongPacket';
}
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.xudp2p.PongPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.PongPacket.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.xudp2p.PongPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.PongPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.PongPacket}
*/
proto.xudp2p.PongPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.PongPacket;
return proto.xudp2p.PongPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.PongPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.PongPacket}
*/
proto.xudp2p.PongPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.PongPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.PongPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.PongPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.PongPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.PongPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.PongPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.PongPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.PongPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(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.xudp2p.OrderPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.OrderPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.OrderPacket.displayName = 'proto.xudp2p.OrderPacket';
}
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.xudp2p.OrderPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.OrderPacket.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.xudp2p.OrderPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrderPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
order: (f = msg.getOrder()) && proto.xudp2p.Order.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.OrderPacket}
*/
proto.xudp2p.OrderPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.OrderPacket;
return proto.xudp2p.OrderPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.OrderPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.OrderPacket}
*/
proto.xudp2p.OrderPacket.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.setId(value);
break;
case 2:
var value = new proto.xudp2p.Order;
reader.readMessage(value,proto.xudp2p.Order.deserializeBinaryFromReader);
msg.setOrder(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.OrderPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.OrderPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.OrderPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrderPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getOrder();
if (f != null) {
writer.writeMessage(
2,
f,
proto.xudp2p.Order.serializeBinaryToWriter
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.OrderPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.OrderPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional Order order = 2;
* @return {?proto.xudp2p.Order}
*/
proto.xudp2p.OrderPacket.prototype.getOrder = function() {
return /** @type{?proto.xudp2p.Order} */ (
jspb.Message.getWrapperField(this, proto.xudp2p.Order, 2));
};
/** @param {?proto.xudp2p.Order|undefined} value */
proto.xudp2p.OrderPacket.prototype.setOrder = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.xudp2p.OrderPacket.prototype.clearOrder = function() {
this.setOrder(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xudp2p.OrderPacket.prototype.hasOrder = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* 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.xudp2p.OrderInvalidationPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.OrderInvalidationPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.OrderInvalidationPacket.displayName = 'proto.xudp2p.OrderInvalidationPacket';
}
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.xudp2p.OrderInvalidationPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.OrderInvalidationPacket.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.xudp2p.OrderInvalidationPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrderInvalidationPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
orderId: jspb.Message.getFieldWithDefault(msg, 2, ""),
pairId: jspb.Message.getFieldWithDefault(msg, 3, ""),
quantity: jspb.Message.getFieldWithDefault(msg, 4, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.OrderInvalidationPacket}
*/
proto.xudp2p.OrderInvalidationPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.OrderInvalidationPacket;
return proto.xudp2p.OrderInvalidationPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.OrderInvalidationPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.OrderInvalidationPacket}
*/
proto.xudp2p.OrderInvalidationPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setOrderId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setPairId(value);
break;
case 4:
var value = /** @type {number} */ (reader.readUint64());
msg.setQuantity(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.OrderInvalidationPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.OrderInvalidationPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.OrderInvalidationPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrderInvalidationPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getOrderId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getPairId();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getQuantity();
if (f !== 0) {
writer.writeUint64(
4,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.OrderInvalidationPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.OrderInvalidationPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string order_id = 2;
* @return {string}
*/
proto.xudp2p.OrderInvalidationPacket.prototype.getOrderId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.OrderInvalidationPacket.prototype.setOrderId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string pair_id = 3;
* @return {string}
*/
proto.xudp2p.OrderInvalidationPacket.prototype.getPairId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.OrderInvalidationPacket.prototype.setPairId = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional uint64 quantity = 4;
* @return {number}
*/
proto.xudp2p.OrderInvalidationPacket.prototype.getQuantity = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/** @param {number} value */
proto.xudp2p.OrderInvalidationPacket.prototype.setQuantity = function(value) {
jspb.Message.setProto3IntField(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.xudp2p.GetOrdersPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.GetOrdersPacket.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.GetOrdersPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.GetOrdersPacket.displayName = 'proto.xudp2p.GetOrdersPacket';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.GetOrdersPacket.repeatedFields_ = [2];
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.xudp2p.GetOrdersPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.GetOrdersPacket.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.xudp2p.GetOrdersPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.GetOrdersPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
pairIdsList: jspb.Message.getRepeatedField(msg, 2)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.GetOrdersPacket}
*/
proto.xudp2p.GetOrdersPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.GetOrdersPacket;
return proto.xudp2p.GetOrdersPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.GetOrdersPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.GetOrdersPacket}
*/
proto.xudp2p.GetOrdersPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.addPairIds(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.GetOrdersPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.GetOrdersPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.GetOrdersPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.GetOrdersPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPairIdsList();
if (f.length > 0) {
writer.writeRepeatedString(
2,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.GetOrdersPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.GetOrdersPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated string pair_ids = 2;
* @return {!Array<string>}
*/
proto.xudp2p.GetOrdersPacket.prototype.getPairIdsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
};
/** @param {!Array<string>} value */
proto.xudp2p.GetOrdersPacket.prototype.setPairIdsList = function(value) {
jspb.Message.setField(this, 2, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.xudp2p.GetOrdersPacket.prototype.addPairIds = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 2, value, opt_index);
};
proto.xudp2p.GetOrdersPacket.prototype.clearPairIdsList = function() {
this.setPairIdsList([]);
};
/**
* 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.xudp2p.OrdersPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.OrdersPacket.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.OrdersPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.OrdersPacket.displayName = 'proto.xudp2p.OrdersPacket';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.OrdersPacket.repeatedFields_ = [3];
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.xudp2p.OrdersPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.OrdersPacket.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.xudp2p.OrdersPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrdersPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, ""),
ordersList: jspb.Message.toObjectList(msg.getOrdersList(),
proto.xudp2p.Order.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.xudp2p.OrdersPacket}
*/
proto.xudp2p.OrdersPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.OrdersPacket;
return proto.xudp2p.OrdersPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.OrdersPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.OrdersPacket}
*/
proto.xudp2p.OrdersPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
case 3:
var value = new proto.xudp2p.Order;
reader.readMessage(value,proto.xudp2p.Order.deserializeBinaryFromReader);
msg.addOrders(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.OrdersPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.OrdersPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.OrdersPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.OrdersPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getOrdersList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
proto.xudp2p.Order.serializeBinaryToWriter
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.OrdersPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.OrdersPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.OrdersPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.OrdersPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* repeated Order orders = 3;
* @return {!Array<!proto.xudp2p.Order>}
*/
proto.xudp2p.OrdersPacket.prototype.getOrdersList = function() {
return /** @type{!Array<!proto.xudp2p.Order>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xudp2p.Order, 3));
};
/** @param {!Array<!proto.xudp2p.Order>} value */
proto.xudp2p.OrdersPacket.prototype.setOrdersList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.xudp2p.Order=} opt_value
* @param {number=} opt_index
* @return {!proto.xudp2p.Order}
*/
proto.xudp2p.OrdersPacket.prototype.addOrders = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.xudp2p.Order, opt_index);
};
proto.xudp2p.OrdersPacket.prototype.clearOrdersList = function() {
this.setOrdersList([]);
};
/**
* 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.xudp2p.NodeStateUpdatePacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.NodeStateUpdatePacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.NodeStateUpdatePacket.displayName = 'proto.xudp2p.NodeStateUpdatePacket';
}
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.xudp2p.NodeStateUpdatePacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.NodeStateUpdatePacket.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.xudp2p.NodeStateUpdatePacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodeStateUpdatePacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
nodeState: (f = msg.getNodeState()) && proto.xudp2p.NodeState.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.NodeStateUpdatePacket}
*/
proto.xudp2p.NodeStateUpdatePacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.NodeStateUpdatePacket;
return proto.xudp2p.NodeStateUpdatePacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.NodeStateUpdatePacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.NodeStateUpdatePacket}
*/
proto.xudp2p.NodeStateUpdatePacket.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.setId(value);
break;
case 5:
var value = new proto.xudp2p.NodeState;
reader.readMessage(value,proto.xudp2p.NodeState.deserializeBinaryFromReader);
msg.setNodeState(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.NodeStateUpdatePacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.NodeStateUpdatePacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.NodeStateUpdatePacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodeStateUpdatePacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getNodeState();
if (f != null) {
writer.writeMessage(
5,
f,
proto.xudp2p.NodeState.serializeBinaryToWriter
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.NodeStateUpdatePacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.NodeStateUpdatePacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional NodeState node_state = 5;
* @return {?proto.xudp2p.NodeState}
*/
proto.xudp2p.NodeStateUpdatePacket.prototype.getNodeState = function() {
return /** @type{?proto.xudp2p.NodeState} */ (
jspb.Message.getWrapperField(this, proto.xudp2p.NodeState, 5));
};
/** @param {?proto.xudp2p.NodeState|undefined} value */
proto.xudp2p.NodeStateUpdatePacket.prototype.setNodeState = function(value) {
jspb.Message.setWrapperField(this, 5, value);
};
proto.xudp2p.NodeStateUpdatePacket.prototype.clearNodeState = function() {
this.setNodeState(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xudp2p.NodeStateUpdatePacket.prototype.hasNodeState = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* 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.xudp2p.SessionInitPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SessionInitPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SessionInitPacket.displayName = 'proto.xudp2p.SessionInitPacket';
}
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.xudp2p.SessionInitPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SessionInitPacket.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.xudp2p.SessionInitPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SessionInitPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
sign: jspb.Message.getFieldWithDefault(msg, 2, ""),
peerPubKey: jspb.Message.getFieldWithDefault(msg, 3, ""),
ephemeralPubKey: jspb.Message.getFieldWithDefault(msg, 4, ""),
nodeState: (f = msg.getNodeState()) && proto.xudp2p.NodeState.toObject(includeInstance, f),
version: jspb.Message.getFieldWithDefault(msg, 6, ""),
nodePubKey: jspb.Message.getFieldWithDefault(msg, 7, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SessionInitPacket}
*/
proto.xudp2p.SessionInitPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SessionInitPacket;
return proto.xudp2p.SessionInitPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SessionInitPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SessionInitPacket}
*/
proto.xudp2p.SessionInitPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSign(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setPeerPubKey(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setEphemeralPubKey(value);
break;
case 5:
var value = new proto.xudp2p.NodeState;
reader.readMessage(value,proto.xudp2p.NodeState.deserializeBinaryFromReader);
msg.setNodeState(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setVersion(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setNodePubKey(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SessionInitPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SessionInitPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SessionInitPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SessionInitPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getSign();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getPeerPubKey();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getEphemeralPubKey();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getNodeState();
if (f != null) {
writer.writeMessage(
5,
f,
proto.xudp2p.NodeState.serializeBinaryToWriter
);
}
f = message.getVersion();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
f = message.getNodePubKey();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string sign = 2;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getSign = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setSign = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string peer_pub_key = 3;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getPeerPubKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setPeerPubKey = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string ephemeral_pub_key = 4;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getEphemeralPubKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setEphemeralPubKey = function(value) {
jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional NodeState node_state = 5;
* @return {?proto.xudp2p.NodeState}
*/
proto.xudp2p.SessionInitPacket.prototype.getNodeState = function() {
return /** @type{?proto.xudp2p.NodeState} */ (
jspb.Message.getWrapperField(this, proto.xudp2p.NodeState, 5));
};
/** @param {?proto.xudp2p.NodeState|undefined} value */
proto.xudp2p.SessionInitPacket.prototype.setNodeState = function(value) {
jspb.Message.setWrapperField(this, 5, value);
};
proto.xudp2p.SessionInitPacket.prototype.clearNodeState = function() {
this.setNodeState(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xudp2p.SessionInitPacket.prototype.hasNodeState = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* optional string version = 6;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setVersion = function(value) {
jspb.Message.setProto3StringField(this, 6, value);
};
/**
* optional string node_pub_key = 7;
* @return {string}
*/
proto.xudp2p.SessionInitPacket.prototype.getNodePubKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/** @param {string} value */
proto.xudp2p.SessionInitPacket.prototype.setNodePubKey = function(value) {
jspb.Message.setProto3StringField(this, 7, 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.xudp2p.SessionAckPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SessionAckPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SessionAckPacket.displayName = 'proto.xudp2p.SessionAckPacket';
}
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.xudp2p.SessionAckPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SessionAckPacket.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.xudp2p.SessionAckPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SessionAckPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, ""),
ephemeralPubKey: jspb.Message.getFieldWithDefault(msg, 3, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SessionAckPacket}
*/
proto.xudp2p.SessionAckPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SessionAckPacket;
return proto.xudp2p.SessionAckPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SessionAckPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SessionAckPacket}
*/
proto.xudp2p.SessionAckPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setEphemeralPubKey(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SessionAckPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SessionAckPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SessionAckPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SessionAckPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getEphemeralPubKey();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SessionAckPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SessionAckPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.SessionAckPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SessionAckPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string ephemeral_pub_key = 3;
* @return {string}
*/
proto.xudp2p.SessionAckPacket.prototype.getEphemeralPubKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SessionAckPacket.prototype.setEphemeralPubKey = function(value) {
jspb.Message.setProto3StringField(this, 3, 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.xudp2p.DisconnectingPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.DisconnectingPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.DisconnectingPacket.displayName = 'proto.xudp2p.DisconnectingPacket';
}
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.xudp2p.DisconnectingPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.DisconnectingPacket.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.xudp2p.DisconnectingPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.DisconnectingPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reason: jspb.Message.getFieldWithDefault(msg, 2, 0),
payload: jspb.Message.getFieldWithDefault(msg, 3, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.DisconnectingPacket}
*/
proto.xudp2p.DisconnectingPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.DisconnectingPacket;
return proto.xudp2p.DisconnectingPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.DisconnectingPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.DisconnectingPacket}
*/
proto.xudp2p.DisconnectingPacket.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.setId(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint32());
msg.setReason(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setPayload(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.DisconnectingPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.DisconnectingPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.DisconnectingPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.DisconnectingPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReason();
if (f !== 0) {
writer.writeUint32(
2,
f
);
}
f = message.getPayload();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.DisconnectingPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.DisconnectingPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint32 reason = 2;
* @return {number}
*/
proto.xudp2p.DisconnectingPacket.prototype.getReason = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {number} value */
proto.xudp2p.DisconnectingPacket.prototype.setReason = function(value) {
jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional string payload = 3;
* @return {string}
*/
proto.xudp2p.DisconnectingPacket.prototype.getPayload = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.DisconnectingPacket.prototype.setPayload = function(value) {
jspb.Message.setProto3StringField(this, 3, 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.xudp2p.GetNodesPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.GetNodesPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.GetNodesPacket.displayName = 'proto.xudp2p.GetNodesPacket';
}
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.xudp2p.GetNodesPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.GetNodesPacket.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.xudp2p.GetNodesPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.GetNodesPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.GetNodesPacket}
*/
proto.xudp2p.GetNodesPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.GetNodesPacket;
return proto.xudp2p.GetNodesPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.GetNodesPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.GetNodesPacket}
*/
proto.xudp2p.GetNodesPacket.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.setId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.GetNodesPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.GetNodesPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.GetNodesPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.GetNodesPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.GetNodesPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.GetNodesPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, 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.xudp2p.NodesPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xudp2p.NodesPacket.repeatedFields_, null);
};
goog.inherits(proto.xudp2p.NodesPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.NodesPacket.displayName = 'proto.xudp2p.NodesPacket';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xudp2p.NodesPacket.repeatedFields_ = [3];
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.xudp2p.NodesPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.NodesPacket.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.xudp2p.NodesPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodesPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, ""),
nodesList: jspb.Message.toObjectList(msg.getNodesList(),
proto.xudp2p.Node.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.xudp2p.NodesPacket}
*/
proto.xudp2p.NodesPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.NodesPacket;
return proto.xudp2p.NodesPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.NodesPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.NodesPacket}
*/
proto.xudp2p.NodesPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
case 3:
var value = new proto.xudp2p.Node;
reader.readMessage(value,proto.xudp2p.Node.deserializeBinaryFromReader);
msg.addNodes(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.NodesPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.NodesPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.NodesPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.NodesPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getNodesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
proto.xudp2p.Node.serializeBinaryToWriter
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.NodesPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.NodesPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.NodesPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.NodesPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* repeated Node nodes = 3;
* @return {!Array<!proto.xudp2p.Node>}
*/
proto.xudp2p.NodesPacket.prototype.getNodesList = function() {
return /** @type{!Array<!proto.xudp2p.Node>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xudp2p.Node, 3));
};
/** @param {!Array<!proto.xudp2p.Node>} value */
proto.xudp2p.NodesPacket.prototype.setNodesList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.xudp2p.Node=} opt_value
* @param {number=} opt_index
* @return {!proto.xudp2p.Node}
*/
proto.xudp2p.NodesPacket.prototype.addNodes = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.xudp2p.Node, opt_index);
};
proto.xudp2p.NodesPacket.prototype.clearNodesList = function() {
this.setNodesList([]);
};
/**
* 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.xudp2p.SanitySwapInitPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SanitySwapInitPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SanitySwapInitPacket.displayName = 'proto.xudp2p.SanitySwapInitPacket';
}
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.xudp2p.SanitySwapInitPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SanitySwapInitPacket.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.xudp2p.SanitySwapInitPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SanitySwapInitPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
currency: jspb.Message.getFieldWithDefault(msg, 2, ""),
rHash: jspb.Message.getFieldWithDefault(msg, 3, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SanitySwapInitPacket}
*/
proto.xudp2p.SanitySwapInitPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SanitySwapInitPacket;
return proto.xudp2p.SanitySwapInitPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SanitySwapInitPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SanitySwapInitPacket}
*/
proto.xudp2p.SanitySwapInitPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setCurrency(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setRHash(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SanitySwapInitPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SanitySwapInitPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SanitySwapInitPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SanitySwapInitPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getCurrency();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getRHash();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SanitySwapInitPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SanitySwapInitPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string currency = 2;
* @return {string}
*/
proto.xudp2p.SanitySwapInitPacket.prototype.getCurrency = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SanitySwapInitPacket.prototype.setCurrency = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string r_hash = 3;
* @return {string}
*/
proto.xudp2p.SanitySwapInitPacket.prototype.getRHash = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SanitySwapInitPacket.prototype.setRHash = function(value) {
jspb.Message.setProto3StringField(this, 3, 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.xudp2p.SanitySwapAckPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SanitySwapAckPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SanitySwapAckPacket.displayName = 'proto.xudp2p.SanitySwapAckPacket';
}
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.xudp2p.SanitySwapAckPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SanitySwapAckPacket.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.xudp2p.SanitySwapAckPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SanitySwapAckPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SanitySwapAckPacket}
*/
proto.xudp2p.SanitySwapAckPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SanitySwapAckPacket;
return proto.xudp2p.SanitySwapAckPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SanitySwapAckPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SanitySwapAckPacket}
*/
proto.xudp2p.SanitySwapAckPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SanitySwapAckPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SanitySwapAckPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SanitySwapAckPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SanitySwapAckPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SanitySwapAckPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SanitySwapAckPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.SanitySwapAckPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SanitySwapAckPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(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.xudp2p.SwapRequestPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SwapRequestPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SwapRequestPacket.displayName = 'proto.xudp2p.SwapRequestPacket';
}
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.xudp2p.SwapRequestPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SwapRequestPacket.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.xudp2p.SwapRequestPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapRequestPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
proposedQuantity: jspb.Message.getFieldWithDefault(msg, 2, 0),
pairId: jspb.Message.getFieldWithDefault(msg, 3, ""),
orderId: jspb.Message.getFieldWithDefault(msg, 4, ""),
rHash: jspb.Message.getFieldWithDefault(msg, 5, ""),
takerCltvDelta: jspb.Message.getFieldWithDefault(msg, 6, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SwapRequestPacket}
*/
proto.xudp2p.SwapRequestPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SwapRequestPacket;
return proto.xudp2p.SwapRequestPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SwapRequestPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SwapRequestPacket}
*/
proto.xudp2p.SwapRequestPacket.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.setId(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint64());
msg.setProposedQuantity(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setPairId(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setOrderId(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setRHash(value);
break;
case 6:
var value = /** @type {number} */ (reader.readUint32());
msg.setTakerCltvDelta(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SwapRequestPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SwapRequestPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SwapRequestPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapRequestPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getProposedQuantity();
if (f !== 0) {
writer.writeUint64(
2,
f
);
}
f = message.getPairId();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getOrderId();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getRHash();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getTakerCltvDelta();
if (f !== 0) {
writer.writeUint32(
6,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SwapRequestPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SwapRequestPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint64 proposed_quantity = 2;
* @return {number}
*/
proto.xudp2p.SwapRequestPacket.prototype.getProposedQuantity = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {number} value */
proto.xudp2p.SwapRequestPacket.prototype.setProposedQuantity = function(value) {
jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional string pair_id = 3;
* @return {string}
*/
proto.xudp2p.SwapRequestPacket.prototype.getPairId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SwapRequestPacket.prototype.setPairId = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string order_id = 4;
* @return {string}
*/
proto.xudp2p.SwapRequestPacket.prototype.getOrderId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/** @param {string} value */
proto.xudp2p.SwapRequestPacket.prototype.setOrderId = function(value) {
jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string r_hash = 5;
* @return {string}
*/
proto.xudp2p.SwapRequestPacket.prototype.getRHash = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/** @param {string} value */
proto.xudp2p.SwapRequestPacket.prototype.setRHash = function(value) {
jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional uint32 taker_cltv_delta = 6;
* @return {number}
*/
proto.xudp2p.SwapRequestPacket.prototype.getTakerCltvDelta = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/** @param {number} value */
proto.xudp2p.SwapRequestPacket.prototype.setTakerCltvDelta = function(value) {
jspb.Message.setProto3IntField(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.xudp2p.SwapAcceptedPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SwapAcceptedPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SwapAcceptedPacket.displayName = 'proto.xudp2p.SwapAcceptedPacket';
}
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.xudp2p.SwapAcceptedPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SwapAcceptedPacket.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.xudp2p.SwapAcceptedPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapAcceptedPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, ""),
rHash: jspb.Message.getFieldWithDefault(msg, 3, ""),
quantity: +jspb.Message.getFieldWithDefault(msg, 4, 0.0),
makerCltvDelta: jspb.Message.getFieldWithDefault(msg, 5, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SwapAcceptedPacket}
*/
proto.xudp2p.SwapAcceptedPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SwapAcceptedPacket;
return proto.xudp2p.SwapAcceptedPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SwapAcceptedPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SwapAcceptedPacket}
*/
proto.xudp2p.SwapAcceptedPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setRHash(value);
break;
case 4:
var value = /** @type {number} */ (reader.readDouble());
msg.setQuantity(value);
break;
case 5:
var value = /** @type {number} */ (reader.readUint32());
msg.setMakerCltvDelta(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SwapAcceptedPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SwapAcceptedPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapAcceptedPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getRHash();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getQuantity();
if (f !== 0.0) {
writer.writeDouble(
4,
f
);
}
f = message.getMakerCltvDelta();
if (f !== 0) {
writer.writeUint32(
5,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SwapAcceptedPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SwapAcceptedPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string r_hash = 3;
* @return {string}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.getRHash = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SwapAcceptedPacket.prototype.setRHash = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional double quantity = 4;
* @return {number}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.getQuantity = function() {
return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 4, 0.0));
};
/** @param {number} value */
proto.xudp2p.SwapAcceptedPacket.prototype.setQuantity = function(value) {
jspb.Message.setProto3FloatField(this, 4, value);
};
/**
* optional uint32 maker_cltv_delta = 5;
* @return {number}
*/
proto.xudp2p.SwapAcceptedPacket.prototype.getMakerCltvDelta = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/** @param {number} value */
proto.xudp2p.SwapAcceptedPacket.prototype.setMakerCltvDelta = function(value) {
jspb.Message.setProto3IntField(this, 5, 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.xudp2p.SwapFailedPacket = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xudp2p.SwapFailedPacket, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.xudp2p.SwapFailedPacket.displayName = 'proto.xudp2p.SwapFailedPacket';
}
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.xudp2p.SwapFailedPacket.prototype.toObject = function(opt_includeInstance) {
return proto.xudp2p.SwapFailedPacket.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.xudp2p.SwapFailedPacket} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapFailedPacket.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
reqId: jspb.Message.getFieldWithDefault(msg, 2, ""),
rHash: jspb.Message.getFieldWithDefault(msg, 3, ""),
errorMessage: jspb.Message.getFieldWithDefault(msg, 4, ""),
failureReason: jspb.Message.getFieldWithDefault(msg, 5, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.xudp2p.SwapFailedPacket}
*/
proto.xudp2p.SwapFailedPacket.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xudp2p.SwapFailedPacket;
return proto.xudp2p.SwapFailedPacket.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xudp2p.SwapFailedPacket} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xudp2p.SwapFailedPacket}
*/
proto.xudp2p.SwapFailedPacket.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setReqId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setRHash(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setErrorMessage(value);
break;
case 5:
var value = /** @type {number} */ (reader.readUint32());
msg.setFailureReason(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xudp2p.SwapFailedPacket.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xudp2p.SwapFailedPacket.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.xudp2p.SwapFailedPacket} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xudp2p.SwapFailedPacket.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReqId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getRHash();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getErrorMessage();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getFailureReason();
if (f !== 0) {
writer.writeUint32(
5,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.xudp2p.SwapFailedPacket.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.xudp2p.SwapFailedPacket.prototype.setId = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string req_id = 2;
* @return {string}
*/
proto.xudp2p.SwapFailedPacket.prototype.getReqId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.xudp2p.SwapFailedPacket.prototype.setReqId = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string r_hash = 3;
* @return {string}
*/
proto.xudp2p.SwapFailedPacket.prototype.getRHash = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.xudp2p.SwapFailedPacket.prototype.setRHash = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string error_message = 4;
* @return {string}
*/
proto.xudp2p.SwapFailedPacket.prototype.getErrorMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/** @param {string} value */
proto.xudp2p.SwapFailedPacket.prototype.setErrorMessage = function(value) {
jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional uint32 failure_reason = 5;
* @return {number}
*/
proto.xudp2p.SwapFailedPacket.prototype.getFailureReason = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/** @param {number} value */
proto.xudp2p.SwapFailedPacket.prototype.setFailureReason = function(value) {
jspb.Message.setProto3IntField(this, 5, value);
};
goog.object.extend(exports, proto.xudp2p);