diff --git a/.gitignore b/.gitignore index 2737673..2709caa 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,4 @@ typings/ # IDE .idea -protocol +/protocol diff --git a/src/client/http.js b/src/client/http.js index 2f71b18..34a235a 100644 --- a/src/client/http.js +++ b/src/client/http.js @@ -32,8 +32,8 @@ function byteArrayToLong(/*byte[]*/byteArray) { class ApiClient { - constructor() { - this.apiUrl = process.env.API_URL; + constructor(options = {}) { + this.apiUrl = options.apiUrl || process.env.API_URL; this.signer = null; } diff --git a/src/protocol/core/Contract_pb.js b/src/protocol/core/Contract_pb.js new file mode 100644 index 0000000..bbcd3f1 --- /dev/null +++ b/src/protocol/core/Contract_pb.js @@ -0,0 +1,4616 @@ +/** + * @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')(); + +var core_Tron_pb = require('../core/Tron_pb.js'); +goog.exportSymbol('proto.protocol.AccountCreateContract', null, global); +goog.exportSymbol('proto.protocol.AccountUpdateContract', null, global); +goog.exportSymbol('proto.protocol.AssetIssueContract', null, global); +goog.exportSymbol('proto.protocol.AssetIssueContract.FrozenSupply', null, global); +goog.exportSymbol('proto.protocol.DeployContract', null, global); +goog.exportSymbol('proto.protocol.FreezeBalanceContract', null, global); +goog.exportSymbol('proto.protocol.ParticipateAssetIssueContract', null, global); +goog.exportSymbol('proto.protocol.TransferAssetContract', null, global); +goog.exportSymbol('proto.protocol.TransferContract', null, global); +goog.exportSymbol('proto.protocol.UnfreezeAssetContract', null, global); +goog.exportSymbol('proto.protocol.UnfreezeBalanceContract', null, global); +goog.exportSymbol('proto.protocol.UpdateAssetContract', null, global); +goog.exportSymbol('proto.protocol.VoteAssetContract', null, global); +goog.exportSymbol('proto.protocol.VoteWitnessContract', null, global); +goog.exportSymbol('proto.protocol.VoteWitnessContract.Vote', null, global); +goog.exportSymbol('proto.protocol.WithdrawBalanceContract', null, global); +goog.exportSymbol('proto.protocol.WitnessCreateContract', null, global); +goog.exportSymbol('proto.protocol.WitnessUpdateContract', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.AccountCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.AccountCreateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AccountCreateContract.displayName = 'proto.protocol.AccountCreateContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AccountCreateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AccountCreateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AccountCreateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountCreateContract.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + accountName: msg.getAccountName_asB64(), + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.AccountCreateContract} + */ +proto.protocol.AccountCreateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AccountCreateContract; + return proto.protocol.AccountCreateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AccountCreateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AccountCreateContract} + */ +proto.protocol.AccountCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountName(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AccountCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AccountCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AccountCreateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountCreateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getAccountName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional AccountType type = 1; + * @return {!proto.protocol.AccountType} + */ +proto.protocol.AccountCreateContract.prototype.getType = function() { + return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.AccountType} value */ +proto.protocol.AccountCreateContract.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bytes account_name = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountCreateContract.prototype.getAccountName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes account_name = 2; + * This is a type-conversion wrapper around `getAccountName()` + * @return {string} + */ +proto.protocol.AccountCreateContract.prototype.getAccountName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountName())); +}; + + +/** + * optional bytes account_name = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountName()` + * @return {!Uint8Array} + */ +proto.protocol.AccountCreateContract.prototype.getAccountName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountCreateContract.prototype.setAccountName = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes owner_address = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountCreateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes owner_address = 3; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountCreateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(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.protocol.AccountUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.AccountUpdateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AccountUpdateContract.displayName = 'proto.protocol.AccountUpdateContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AccountUpdateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AccountUpdateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AccountUpdateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountUpdateContract.toObject = function(includeInstance, msg) { + var f, obj = { + accountName: msg.getAccountName_asB64(), + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.AccountUpdateContract} + */ +proto.protocol.AccountUpdateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AccountUpdateContract; + return proto.protocol.AccountUpdateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AccountUpdateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AccountUpdateContract} + */ +proto.protocol.AccountUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AccountUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AccountUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AccountUpdateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountUpdateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccountName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes account_name = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountUpdateContract.prototype.getAccountName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes account_name = 1; + * This is a type-conversion wrapper around `getAccountName()` + * @return {string} + */ +proto.protocol.AccountUpdateContract.prototype.getAccountName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountName())); +}; + + +/** + * optional bytes account_name = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountName()` + * @return {!Uint8Array} + */ +proto.protocol.AccountUpdateContract.prototype.getAccountName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountUpdateContract.prototype.setAccountName = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes owner_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountUpdateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes owner_address = 2; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.AccountUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.AccountUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountUpdateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TransferContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TransferContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TransferContract.displayName = 'proto.protocol.TransferContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TransferContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TransferContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TransferContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TransferContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + amount: jspb.Message.getFieldWithDefault(msg, 3, 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.protocol.TransferContract} + */ +proto.protocol.TransferContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TransferContract; + return proto.protocol.TransferContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TransferContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TransferContract} + */ +proto.protocol.TransferContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setToAddress(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TransferContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TransferContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TransferContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TransferContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getToAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getAmount(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransferContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.TransferContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TransferContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransferContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes to_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransferContract.prototype.getToAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes to_address = 2; + * This is a type-conversion wrapper around `getToAddress()` + * @return {string} + */ +proto.protocol.TransferContract.prototype.getToAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getToAddress())); +}; + + +/** + * optional bytes to_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getToAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TransferContract.prototype.getToAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getToAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransferContract.prototype.setToAddress = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional int64 amount = 3; + * @return {number} + */ +proto.protocol.TransferContract.prototype.getAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransferContract.prototype.setAmount = function(value) { + jspb.Message.setProto3IntField(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.protocol.TransferAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TransferAssetContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TransferAssetContract.displayName = 'proto.protocol.TransferAssetContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TransferAssetContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TransferAssetContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TransferAssetContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TransferAssetContract.toObject = function(includeInstance, msg) { + var f, obj = { + assetName: msg.getAssetName_asB64(), + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + amount: 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.protocol.TransferAssetContract} + */ +proto.protocol.TransferAssetContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TransferAssetContract; + return proto.protocol.TransferAssetContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TransferAssetContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TransferAssetContract} + */ +proto.protocol.TransferAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setToAddress(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TransferAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TransferAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TransferAssetContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TransferAssetContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAssetName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getToAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getAmount(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional bytes asset_name = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransferAssetContract.prototype.getAssetName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes asset_name = 1; + * This is a type-conversion wrapper around `getAssetName()` + * @return {string} + */ +proto.protocol.TransferAssetContract.prototype.getAssetName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetName())); +}; + + +/** + * optional bytes asset_name = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetName()` + * @return {!Uint8Array} + */ +proto.protocol.TransferAssetContract.prototype.getAssetName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransferAssetContract.prototype.setAssetName = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes owner_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransferAssetContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes owner_address = 2; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.TransferAssetContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TransferAssetContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransferAssetContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes to_address = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransferAssetContract.prototype.getToAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes to_address = 3; + * This is a type-conversion wrapper around `getToAddress()` + * @return {string} + */ +proto.protocol.TransferAssetContract.prototype.getToAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getToAddress())); +}; + + +/** + * optional bytes to_address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getToAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TransferAssetContract.prototype.getToAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getToAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransferAssetContract.prototype.setToAddress = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 amount = 4; + * @return {number} + */ +proto.protocol.TransferAssetContract.prototype.getAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransferAssetContract.prototype.setAmount = 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.protocol.VoteAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.VoteAssetContract.repeatedFields_, null); +}; +goog.inherits(proto.protocol.VoteAssetContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.VoteAssetContract.displayName = 'proto.protocol.VoteAssetContract'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.VoteAssetContract.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.VoteAssetContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.VoteAssetContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.VoteAssetContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteAssetContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + voteAddressList: msg.getVoteAddressList_asB64(), + support: jspb.Message.getFieldWithDefault(msg, 3, false), + count: 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.protocol.VoteAssetContract} + */ +proto.protocol.VoteAssetContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.VoteAssetContract; + return proto.protocol.VoteAssetContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.VoteAssetContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.VoteAssetContract} + */ +proto.protocol.VoteAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addVoteAddress(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupport(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt32()); + msg.setCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.VoteAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.VoteAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.VoteAssetContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteAssetContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVoteAddressList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getSupport(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getCount(); + if (f !== 0) { + writer.writeInt32( + 5, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.VoteAssetContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.VoteAssetContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.VoteAssetContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.VoteAssetContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * repeated bytes vote_address = 2; + * @return {!(Array|Array)} + */ +proto.protocol.VoteAssetContract.prototype.getVoteAddressList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes vote_address = 2; + * This is a type-conversion wrapper around `getVoteAddressList()` + * @return {!Array.} + */ +proto.protocol.VoteAssetContract.prototype.getVoteAddressList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getVoteAddressList())); +}; + + +/** + * repeated bytes vote_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getVoteAddressList()` + * @return {!Array.} + */ +proto.protocol.VoteAssetContract.prototype.getVoteAddressList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getVoteAddressList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.VoteAssetContract.prototype.setVoteAddressList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.VoteAssetContract.prototype.addVoteAddress = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.protocol.VoteAssetContract.prototype.clearVoteAddressList = function() { + this.setVoteAddressList([]); +}; + + +/** + * optional bool support = 3; + * 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.protocol.VoteAssetContract.prototype.getSupport = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.VoteAssetContract.prototype.setSupport = function(value) { + jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional int32 count = 5; + * @return {number} + */ +proto.protocol.VoteAssetContract.prototype.getCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.VoteAssetContract.prototype.setCount = 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.protocol.VoteWitnessContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.VoteWitnessContract.repeatedFields_, null); +}; +goog.inherits(proto.protocol.VoteWitnessContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.VoteWitnessContract.displayName = 'proto.protocol.VoteWitnessContract'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.VoteWitnessContract.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.VoteWitnessContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.VoteWitnessContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.VoteWitnessContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteWitnessContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + votesList: jspb.Message.toObjectList(msg.getVotesList(), + proto.protocol.VoteWitnessContract.Vote.toObject, includeInstance), + support: jspb.Message.getFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.VoteWitnessContract} + */ +proto.protocol.VoteWitnessContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.VoteWitnessContract; + return proto.protocol.VoteWitnessContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.VoteWitnessContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.VoteWitnessContract} + */ +proto.protocol.VoteWitnessContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = new proto.protocol.VoteWitnessContract.Vote; + reader.readMessage(value,proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader); + msg.addVotes(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupport(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.VoteWitnessContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.VoteWitnessContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.VoteWitnessContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteWitnessContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter + ); + } + f = message.getSupport(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.VoteWitnessContract.Vote = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.VoteWitnessContract.Vote, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.VoteWitnessContract.Vote.displayName = 'proto.protocol.VoteWitnessContract.Vote'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.VoteWitnessContract.Vote.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.VoteWitnessContract.Vote} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteWitnessContract.Vote.toObject = function(includeInstance, msg) { + var f, obj = { + voteAddress: msg.getVoteAddress_asB64(), + voteCount: 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.protocol.VoteWitnessContract.Vote} + */ +proto.protocol.VoteWitnessContract.Vote.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.VoteWitnessContract.Vote; + return proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.VoteWitnessContract.Vote} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.VoteWitnessContract.Vote} + */ +proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setVoteAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVoteCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.VoteWitnessContract.Vote} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVoteAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVoteCount(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes vote_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes vote_address = 1; + * This is a type-conversion wrapper around `getVoteAddress()` + * @return {string} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getVoteAddress())); +}; + + +/** + * optional bytes vote_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getVoteAddress()` + * @return {!Uint8Array} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getVoteAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.VoteWitnessContract.Vote.prototype.setVoteAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 vote_count = 2; + * @return {number} + */ +proto.protocol.VoteWitnessContract.Vote.prototype.getVoteCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.VoteWitnessContract.Vote.prototype.setVoteCount = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.VoteWitnessContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.VoteWitnessContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.VoteWitnessContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.VoteWitnessContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * repeated Vote votes = 2; + * @return {!Array.} + */ +proto.protocol.VoteWitnessContract.prototype.getVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.VoteWitnessContract.Vote, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.VoteWitnessContract.prototype.setVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.VoteWitnessContract.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.VoteWitnessContract.Vote} + */ +proto.protocol.VoteWitnessContract.prototype.addVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.VoteWitnessContract.Vote, opt_index); +}; + + +proto.protocol.VoteWitnessContract.prototype.clearVotesList = function() { + this.setVotesList([]); +}; + + +/** + * optional bool support = 3; + * 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.protocol.VoteWitnessContract.prototype.getSupport = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.VoteWitnessContract.prototype.setSupport = function(value) { + jspb.Message.setProto3BooleanField(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.protocol.WitnessCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.WitnessCreateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.WitnessCreateContract.displayName = 'proto.protocol.WitnessCreateContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.WitnessCreateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.WitnessCreateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.WitnessCreateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WitnessCreateContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + url: msg.getUrl_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.WitnessCreateContract} + */ +proto.protocol.WitnessCreateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.WitnessCreateContract; + return proto.protocol.WitnessCreateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.WitnessCreateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.WitnessCreateContract} + */ +proto.protocol.WitnessCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.WitnessCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.WitnessCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.WitnessCreateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WitnessCreateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getUrl_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.WitnessCreateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.WitnessCreateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.WitnessCreateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.WitnessCreateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes url = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.WitnessCreateContract.prototype.getUrl = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes url = 2; + * This is a type-conversion wrapper around `getUrl()` + * @return {string} + */ +proto.protocol.WitnessCreateContract.prototype.getUrl_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getUrl())); +}; + + +/** + * optional bytes url = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getUrl()` + * @return {!Uint8Array} + */ +proto.protocol.WitnessCreateContract.prototype.getUrl_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getUrl())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.WitnessCreateContract.prototype.setUrl = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.WitnessUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.WitnessUpdateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.WitnessUpdateContract.displayName = 'proto.protocol.WitnessUpdateContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.WitnessUpdateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.WitnessUpdateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.WitnessUpdateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WitnessUpdateContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + updateUrl: msg.getUpdateUrl_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.WitnessUpdateContract} + */ +proto.protocol.WitnessUpdateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.WitnessUpdateContract; + return proto.protocol.WitnessUpdateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.WitnessUpdateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.WitnessUpdateContract} + */ +proto.protocol.WitnessUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 12: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setUpdateUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.WitnessUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.WitnessUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.WitnessUpdateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WitnessUpdateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getUpdateUrl_asU8(); + if (f.length > 0) { + writer.writeBytes( + 12, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.WitnessUpdateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes update_url = 12; + * @return {!(string|Uint8Array)} + */ +proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * optional bytes update_url = 12; + * This is a type-conversion wrapper around `getUpdateUrl()` + * @return {string} + */ +proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getUpdateUrl())); +}; + + +/** + * optional bytes update_url = 12; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getUpdateUrl()` + * @return {!Uint8Array} + */ +proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getUpdateUrl())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.WitnessUpdateContract.prototype.setUpdateUrl = function(value) { + jspb.Message.setProto3BytesField(this, 12, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.AssetIssueContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.AssetIssueContract.repeatedFields_, null); +}; +goog.inherits(proto.protocol.AssetIssueContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AssetIssueContract.displayName = 'proto.protocol.AssetIssueContract'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.AssetIssueContract.repeatedFields_ = [5]; + + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AssetIssueContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AssetIssueContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AssetIssueContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AssetIssueContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + name: msg.getName_asB64(), + abbr: msg.getAbbr_asB64(), + totalSupply: jspb.Message.getFieldWithDefault(msg, 4, 0), + frozenSupplyList: jspb.Message.toObjectList(msg.getFrozenSupplyList(), + proto.protocol.AssetIssueContract.FrozenSupply.toObject, includeInstance), + trxNum: jspb.Message.getFieldWithDefault(msg, 6, 0), + num: jspb.Message.getFieldWithDefault(msg, 8, 0), + startTime: jspb.Message.getFieldWithDefault(msg, 9, 0), + endTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + voteScore: jspb.Message.getFieldWithDefault(msg, 16, 0), + description: msg.getDescription_asB64(), + url: msg.getUrl_asB64(), + freeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 22, 0), + publicFreeAssetNetLimit: jspb.Message.getFieldWithDefault(msg, 23, 0), + publicFreeAssetNetUsage: jspb.Message.getFieldWithDefault(msg, 24, 0), + publicLatestFreeNetTime: jspb.Message.getFieldWithDefault(msg, 25, 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.protocol.AssetIssueContract} + */ +proto.protocol.AssetIssueContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AssetIssueContract; + return proto.protocol.AssetIssueContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AssetIssueContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AssetIssueContract} + */ +proto.protocol.AssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setName(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAbbr(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotalSupply(value); + break; + case 5: + var value = new proto.protocol.AssetIssueContract.FrozenSupply; + reader.readMessage(value,proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader); + msg.addFrozenSupply(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt32()); + msg.setTrxNum(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt32()); + msg.setNum(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStartTime(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEndTime(value); + break; + case 16: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVoteScore(value); + break; + case 20: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDescription(value); + break; + case 21: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setUrl(value); + break; + case 22: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFreeAssetNetLimit(value); + break; + case 23: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPublicFreeAssetNetLimit(value); + break; + case 24: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPublicFreeAssetNetUsage(value); + break; + case 25: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPublicLatestFreeNetTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AssetIssueContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AssetIssueContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AssetIssueContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getAbbr_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getTotalSupply(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getFrozenSupplyList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter + ); + } + f = message.getTrxNum(); + if (f !== 0) { + writer.writeInt32( + 6, + f + ); + } + f = message.getNum(); + if (f !== 0) { + writer.writeInt32( + 8, + f + ); + } + f = message.getStartTime(); + if (f !== 0) { + writer.writeInt64( + 9, + f + ); + } + f = message.getEndTime(); + if (f !== 0) { + writer.writeInt64( + 10, + f + ); + } + f = message.getVoteScore(); + if (f !== 0) { + writer.writeInt32( + 16, + f + ); + } + f = message.getDescription_asU8(); + if (f.length > 0) { + writer.writeBytes( + 20, + f + ); + } + f = message.getUrl_asU8(); + if (f.length > 0) { + writer.writeBytes( + 21, + f + ); + } + f = message.getFreeAssetNetLimit(); + if (f !== 0) { + writer.writeInt64( + 22, + f + ); + } + f = message.getPublicFreeAssetNetLimit(); + if (f !== 0) { + writer.writeInt64( + 23, + f + ); + } + f = message.getPublicFreeAssetNetUsage(); + if (f !== 0) { + writer.writeInt64( + 24, + f + ); + } + f = message.getPublicLatestFreeNetTime(); + if (f !== 0) { + writer.writeInt64( + 25, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.AssetIssueContract.FrozenSupply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.AssetIssueContract.FrozenSupply, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AssetIssueContract.FrozenSupply.displayName = 'proto.protocol.AssetIssueContract.FrozenSupply'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AssetIssueContract.FrozenSupply.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AssetIssueContract.FrozenSupply} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AssetIssueContract.FrozenSupply.toObject = function(includeInstance, msg) { + var f, obj = { + frozenAmount: jspb.Message.getFieldWithDefault(msg, 1, 0), + frozenDays: 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.protocol.AssetIssueContract.FrozenSupply} + */ +proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AssetIssueContract.FrozenSupply; + return proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AssetIssueContract.FrozenSupply} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AssetIssueContract.FrozenSupply} + */ +proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenAmount(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenDays(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AssetIssueContract.FrozenSupply} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrozenAmount(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getFrozenDays(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 frozen_amount = 1; + * @return {number} + */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 frozen_days = 2; + * @return {number} + */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenDays = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenDays = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AssetIssueContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.AssetIssueContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AssetIssueContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes name = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AssetIssueContract.prototype.getName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes name = 2; + * This is a type-conversion wrapper around `getName()` + * @return {string} + */ +proto.protocol.AssetIssueContract.prototype.getName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getName())); +}; + + +/** + * optional bytes name = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getName()` + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.getName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AssetIssueContract.prototype.setName = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes abbr = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AssetIssueContract.prototype.getAbbr = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes abbr = 3; + * This is a type-conversion wrapper around `getAbbr()` + * @return {string} + */ +proto.protocol.AssetIssueContract.prototype.getAbbr_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAbbr())); +}; + + +/** + * optional bytes abbr = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAbbr()` + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.getAbbr_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAbbr())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AssetIssueContract.prototype.setAbbr = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 total_supply = 4; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getTotalSupply = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setTotalSupply = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * repeated FrozenSupply frozen_supply = 5; + * @return {!Array.} + */ +proto.protocol.AssetIssueContract.prototype.getFrozenSupplyList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.AssetIssueContract.FrozenSupply, 5)); +}; + + +/** @param {!Array.} value */ +proto.protocol.AssetIssueContract.prototype.setFrozenSupplyList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.protocol.AssetIssueContract.FrozenSupply=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.AssetIssueContract.FrozenSupply} + */ +proto.protocol.AssetIssueContract.prototype.addFrozenSupply = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.AssetIssueContract.FrozenSupply, opt_index); +}; + + +proto.protocol.AssetIssueContract.prototype.clearFrozenSupplyList = function() { + this.setFrozenSupplyList([]); +}; + + +/** + * optional int32 trx_num = 6; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getTrxNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setTrxNum = function(value) { + jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional int32 num = 8; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setNum = function(value) { + jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional int64 start_time = 9; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getStartTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setStartTime = function(value) { + jspb.Message.setProto3IntField(this, 9, value); +}; + + +/** + * optional int64 end_time = 10; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getEndTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setEndTime = function(value) { + jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional int32 vote_score = 16; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getVoteScore = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setVoteScore = function(value) { + jspb.Message.setProto3IntField(this, 16, value); +}; + + +/** + * optional bytes description = 20; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AssetIssueContract.prototype.getDescription = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 20, "")); +}; + + +/** + * optional bytes description = 20; + * This is a type-conversion wrapper around `getDescription()` + * @return {string} + */ +proto.protocol.AssetIssueContract.prototype.getDescription_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDescription())); +}; + + +/** + * optional bytes description = 20; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDescription()` + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.getDescription_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDescription())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AssetIssueContract.prototype.setDescription = function(value) { + jspb.Message.setProto3BytesField(this, 20, value); +}; + + +/** + * optional bytes url = 21; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AssetIssueContract.prototype.getUrl = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 21, "")); +}; + + +/** + * optional bytes url = 21; + * This is a type-conversion wrapper around `getUrl()` + * @return {string} + */ +proto.protocol.AssetIssueContract.prototype.getUrl_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getUrl())); +}; + + +/** + * optional bytes url = 21; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getUrl()` + * @return {!Uint8Array} + */ +proto.protocol.AssetIssueContract.prototype.getUrl_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getUrl())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AssetIssueContract.prototype.setUrl = function(value) { + jspb.Message.setProto3BytesField(this, 21, value); +}; + + +/** + * optional int64 free_asset_net_limit = 22; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getFreeAssetNetLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 22, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setFreeAssetNetLimit = function(value) { + jspb.Message.setProto3IntField(this, 22, value); +}; + + +/** + * optional int64 public_free_asset_net_limit = 23; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 23, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetLimit = function(value) { + jspb.Message.setProto3IntField(this, 23, value); +}; + + +/** + * optional int64 public_free_asset_net_usage = 24; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 24, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetUsage = function(value) { + jspb.Message.setProto3IntField(this, 24, value); +}; + + +/** + * optional int64 public_latest_free_net_time = 25; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getPublicLatestFreeNetTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 25, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setPublicLatestFreeNetTime = function(value) { + jspb.Message.setProto3IntField(this, 25, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ParticipateAssetIssueContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ParticipateAssetIssueContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ParticipateAssetIssueContract.displayName = 'proto.protocol.ParticipateAssetIssueContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ParticipateAssetIssueContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ParticipateAssetIssueContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ParticipateAssetIssueContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + toAddress: msg.getToAddress_asB64(), + assetName: msg.getAssetName_asB64(), + amount: 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.protocol.ParticipateAssetIssueContract} + */ +proto.protocol.ParticipateAssetIssueContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ParticipateAssetIssueContract; + return proto.protocol.ParticipateAssetIssueContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ParticipateAssetIssueContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ParticipateAssetIssueContract} + */ +proto.protocol.ParticipateAssetIssueContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setToAddress(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetName(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ParticipateAssetIssueContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ParticipateAssetIssueContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ParticipateAssetIssueContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getToAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getAssetName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getAmount(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ParticipateAssetIssueContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes to_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes to_address = 2; + * This is a type-conversion wrapper around `getToAddress()` + * @return {string} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getToAddress())); +}; + + +/** + * optional bytes to_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getToAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getToAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ParticipateAssetIssueContract.prototype.setToAddress = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes asset_name = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes asset_name = 3; + * This is a type-conversion wrapper around `getAssetName()` + * @return {string} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetName())); +}; + + +/** + * optional bytes asset_name = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetName()` + * @return {!Uint8Array} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ParticipateAssetIssueContract.prototype.setAssetName = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 amount = 4; + * @return {number} + */ +proto.protocol.ParticipateAssetIssueContract.prototype.getAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ParticipateAssetIssueContract.prototype.setAmount = 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.protocol.DeployContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.DeployContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.DeployContract.displayName = 'proto.protocol.DeployContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.DeployContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.DeployContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.DeployContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DeployContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + script: msg.getScript_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.DeployContract} + */ +proto.protocol.DeployContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.DeployContract; + return proto.protocol.DeployContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.DeployContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.DeployContract} + */ +proto.protocol.DeployContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setScript(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.DeployContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.DeployContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.DeployContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DeployContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getScript_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.DeployContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.DeployContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.DeployContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.DeployContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes script = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.DeployContract.prototype.getScript = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes script = 2; + * This is a type-conversion wrapper around `getScript()` + * @return {string} + */ +proto.protocol.DeployContract.prototype.getScript_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getScript())); +}; + + +/** + * optional bytes script = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getScript()` + * @return {!Uint8Array} + */ +proto.protocol.DeployContract.prototype.getScript_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getScript())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.DeployContract.prototype.setScript = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.FreezeBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.FreezeBalanceContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.FreezeBalanceContract.displayName = 'proto.protocol.FreezeBalanceContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.FreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.FreezeBalanceContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.FreezeBalanceContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.FreezeBalanceContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), + frozenDuration: jspb.Message.getFieldWithDefault(msg, 3, 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.protocol.FreezeBalanceContract} + */ +proto.protocol.FreezeBalanceContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.FreezeBalanceContract; + return proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.FreezeBalanceContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.FreezeBalanceContract} + */ +proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenBalance(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenDuration(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.FreezeBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.FreezeBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.FreezeBalanceContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.FreezeBalanceContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getFrozenBalance(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getFrozenDuration(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.FreezeBalanceContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 frozen_balance = 2; + * @return {number} + */ +proto.protocol.FreezeBalanceContract.prototype.getFrozenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.FreezeBalanceContract.prototype.setFrozenBalance = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 frozen_duration = 3; + * @return {number} + */ +proto.protocol.FreezeBalanceContract.prototype.getFrozenDuration = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.FreezeBalanceContract.prototype.setFrozenDuration = function(value) { + jspb.Message.setProto3IntField(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.protocol.UnfreezeBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.UnfreezeBalanceContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.UnfreezeBalanceContract.displayName = 'proto.protocol.UnfreezeBalanceContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.UnfreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.UnfreezeBalanceContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.UnfreezeBalanceContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UnfreezeBalanceContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.UnfreezeBalanceContract} + */ +proto.protocol.UnfreezeBalanceContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.UnfreezeBalanceContract; + return proto.protocol.UnfreezeBalanceContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.UnfreezeBalanceContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.UnfreezeBalanceContract} + */ +proto.protocol.UnfreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.UnfreezeBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.UnfreezeBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.UnfreezeBalanceContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UnfreezeBalanceContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UnfreezeBalanceContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(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.protocol.UnfreezeAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.UnfreezeAssetContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.UnfreezeAssetContract.displayName = 'proto.protocol.UnfreezeAssetContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.UnfreezeAssetContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.UnfreezeAssetContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.UnfreezeAssetContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UnfreezeAssetContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.UnfreezeAssetContract} + */ +proto.protocol.UnfreezeAssetContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.UnfreezeAssetContract; + return proto.protocol.UnfreezeAssetContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.UnfreezeAssetContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.UnfreezeAssetContract} + */ +proto.protocol.UnfreezeAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.UnfreezeAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.UnfreezeAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.UnfreezeAssetContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UnfreezeAssetContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UnfreezeAssetContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(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.protocol.WithdrawBalanceContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.WithdrawBalanceContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.WithdrawBalanceContract.displayName = 'proto.protocol.WithdrawBalanceContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.WithdrawBalanceContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.WithdrawBalanceContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.WithdrawBalanceContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WithdrawBalanceContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.WithdrawBalanceContract} + */ +proto.protocol.WithdrawBalanceContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.WithdrawBalanceContract; + return proto.protocol.WithdrawBalanceContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.WithdrawBalanceContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.WithdrawBalanceContract} + */ +proto.protocol.WithdrawBalanceContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.WithdrawBalanceContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.WithdrawBalanceContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.WithdrawBalanceContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.WithdrawBalanceContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.WithdrawBalanceContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(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.protocol.UpdateAssetContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.UpdateAssetContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.UpdateAssetContract.displayName = 'proto.protocol.UpdateAssetContract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.UpdateAssetContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.UpdateAssetContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.UpdateAssetContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UpdateAssetContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + description: msg.getDescription_asB64(), + url: msg.getUrl_asB64(), + newLimit: jspb.Message.getFieldWithDefault(msg, 4, 0), + newPublicLimit: 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.protocol.UpdateAssetContract} + */ +proto.protocol.UpdateAssetContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.UpdateAssetContract; + return proto.protocol.UpdateAssetContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.UpdateAssetContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.UpdateAssetContract} + */ +proto.protocol.UpdateAssetContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDescription(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setUrl(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNewLimit(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNewPublicLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.UpdateAssetContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.UpdateAssetContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.UpdateAssetContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UpdateAssetContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getDescription_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getUrl_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getNewLimit(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getNewPublicLimit(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UpdateAssetContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.UpdateAssetContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.UpdateAssetContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UpdateAssetContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes description = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UpdateAssetContract.prototype.getDescription = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes description = 2; + * This is a type-conversion wrapper around `getDescription()` + * @return {string} + */ +proto.protocol.UpdateAssetContract.prototype.getDescription_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDescription())); +}; + + +/** + * optional bytes description = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDescription()` + * @return {!Uint8Array} + */ +proto.protocol.UpdateAssetContract.prototype.getDescription_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDescription())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UpdateAssetContract.prototype.setDescription = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes url = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UpdateAssetContract.prototype.getUrl = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes url = 3; + * This is a type-conversion wrapper around `getUrl()` + * @return {string} + */ +proto.protocol.UpdateAssetContract.prototype.getUrl_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getUrl())); +}; + + +/** + * optional bytes url = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getUrl()` + * @return {!Uint8Array} + */ +proto.protocol.UpdateAssetContract.prototype.getUrl_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getUrl())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UpdateAssetContract.prototype.setUrl = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 new_limit = 4; + * @return {number} + */ +proto.protocol.UpdateAssetContract.prototype.getNewLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.UpdateAssetContract.prototype.setNewLimit = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 new_public_limit = 5; + * @return {number} + */ +proto.protocol.UpdateAssetContract.prototype.getNewPublicLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.UpdateAssetContract.prototype.setNewPublicLimit = function(value) { + jspb.Message.setProto3IntField(this, 5, value); +}; + + +goog.object.extend(exports, proto.protocol); diff --git a/src/protocol/core/Discover_pb.js b/src/protocol/core/Discover_pb.js new file mode 100644 index 0000000..05d7584 --- /dev/null +++ b/src/protocol/core/Discover_pb.js @@ -0,0 +1,1209 @@ +/** + * @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.protocol.Endpoint', null, global); +goog.exportSymbol('proto.protocol.FindNeighbours', null, global); +goog.exportSymbol('proto.protocol.Neighbours', null, global); +goog.exportSymbol('proto.protocol.PingMessage', null, global); +goog.exportSymbol('proto.protocol.PongMessage', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Endpoint = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Endpoint, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Endpoint.displayName = 'proto.protocol.Endpoint'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Endpoint.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Endpoint.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Endpoint} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Endpoint.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + port: jspb.Message.getFieldWithDefault(msg, 2, 0), + nodeid: msg.getNodeid_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Endpoint} + */ +proto.protocol.Endpoint.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Endpoint; + return proto.protocol.Endpoint.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Endpoint} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Endpoint} + */ +proto.protocol.Endpoint.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setPort(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNodeid(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Endpoint.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Endpoint.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Endpoint} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Endpoint.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getPort(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getNodeid_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Endpoint.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Endpoint.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Endpoint.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Endpoint.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int32 port = 2; + * @return {number} + */ +proto.protocol.Endpoint.prototype.getPort = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Endpoint.prototype.setPort = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes nodeId = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Endpoint.prototype.getNodeid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes nodeId = 3; + * This is a type-conversion wrapper around `getNodeid()` + * @return {string} + */ +proto.protocol.Endpoint.prototype.getNodeid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNodeid())); +}; + + +/** + * optional bytes nodeId = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNodeid()` + * @return {!Uint8Array} + */ +proto.protocol.Endpoint.prototype.getNodeid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNodeid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Endpoint.prototype.setNodeid = function(value) { + jspb.Message.setProto3BytesField(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.protocol.PingMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.PingMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.PingMessage.displayName = 'proto.protocol.PingMessage'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.PingMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.PingMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.PingMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PingMessage.toObject = function(includeInstance, msg) { + var f, obj = { + from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f), + to: (f = msg.getTo()) && proto.protocol.Endpoint.toObject(includeInstance, f), + version: jspb.Message.getFieldWithDefault(msg, 3, 0), + timestamp: 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.protocol.PingMessage} + */ +proto.protocol.PingMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.PingMessage; + return proto.protocol.PingMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.PingMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.PingMessage} + */ +proto.protocol.PingMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); + break; + case 2: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.setTo(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.PingMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.PingMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.PingMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PingMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrom(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getTo(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.PingMessage.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.PingMessage.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.PingMessage.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.PingMessage.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Endpoint to = 2; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.PingMessage.prototype.getTo = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 2)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.PingMessage.prototype.setTo = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.PingMessage.prototype.clearTo = function() { + this.setTo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.PingMessage.prototype.hasTo = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int32 version = 3; + * @return {number} + */ +proto.protocol.PingMessage.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.PingMessage.prototype.setVersion = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 timestamp = 4; + * @return {number} + */ +proto.protocol.PingMessage.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.PingMessage.prototype.setTimestamp = 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.protocol.PongMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.PongMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.PongMessage.displayName = 'proto.protocol.PongMessage'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.PongMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.PongMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.PongMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PongMessage.toObject = function(includeInstance, msg) { + var f, obj = { + from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f), + echo: jspb.Message.getFieldWithDefault(msg, 2, 0), + timestamp: jspb.Message.getFieldWithDefault(msg, 3, 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.protocol.PongMessage} + */ +proto.protocol.PongMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.PongMessage; + return proto.protocol.PongMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.PongMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.PongMessage} + */ +proto.protocol.PongMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setEcho(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.PongMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.PongMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.PongMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PongMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrom(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getEcho(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.PongMessage.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.PongMessage.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.PongMessage.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.PongMessage.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional int32 echo = 2; + * @return {number} + */ +proto.protocol.PongMessage.prototype.getEcho = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.PongMessage.prototype.setEcho = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 timestamp = 3; + * @return {number} + */ +proto.protocol.PongMessage.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.PongMessage.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(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.protocol.FindNeighbours = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.FindNeighbours, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.FindNeighbours.displayName = 'proto.protocol.FindNeighbours'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.FindNeighbours.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.FindNeighbours.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.FindNeighbours} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.FindNeighbours.toObject = function(includeInstance, msg) { + var f, obj = { + from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f), + targetid: msg.getTargetid_asB64(), + timestamp: jspb.Message.getFieldWithDefault(msg, 3, 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.protocol.FindNeighbours} + */ +proto.protocol.FindNeighbours.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.FindNeighbours; + return proto.protocol.FindNeighbours.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.FindNeighbours} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.FindNeighbours} + */ +proto.protocol.FindNeighbours.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTargetid(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.FindNeighbours.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.FindNeighbours.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.FindNeighbours} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.FindNeighbours.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrom(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getTargetid_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.FindNeighbours.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.FindNeighbours.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.FindNeighbours.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.FindNeighbours.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes targetId = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.FindNeighbours.prototype.getTargetid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes targetId = 2; + * This is a type-conversion wrapper around `getTargetid()` + * @return {string} + */ +proto.protocol.FindNeighbours.prototype.getTargetid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTargetid())); +}; + + +/** + * optional bytes targetId = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTargetid()` + * @return {!Uint8Array} + */ +proto.protocol.FindNeighbours.prototype.getTargetid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTargetid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.FindNeighbours.prototype.setTargetid = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional int64 timestamp = 3; + * @return {number} + */ +proto.protocol.FindNeighbours.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.FindNeighbours.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(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.protocol.Neighbours = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Neighbours.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Neighbours, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Neighbours.displayName = 'proto.protocol.Neighbours'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Neighbours.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Neighbours.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Neighbours.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Neighbours} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Neighbours.toObject = function(includeInstance, msg) { + var f, obj = { + from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f), + neighboursList: jspb.Message.toObjectList(msg.getNeighboursList(), + proto.protocol.Endpoint.toObject, includeInstance), + timestamp: jspb.Message.getFieldWithDefault(msg, 3, 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.protocol.Neighbours} + */ +proto.protocol.Neighbours.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Neighbours; + return proto.protocol.Neighbours.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Neighbours} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Neighbours} + */ +proto.protocol.Neighbours.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); + break; + case 2: + var value = new proto.protocol.Endpoint; + reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader); + msg.addNeighbours(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Neighbours.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Neighbours.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Neighbours} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Neighbours.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrom(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getNeighboursList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.protocol.Endpoint.serializeBinaryToWriter + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.Neighbours.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.Neighbours.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.Neighbours.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Neighbours.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated Endpoint neighbours = 2; + * @return {!Array.} + */ +proto.protocol.Neighbours.prototype.getNeighboursList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Endpoint, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Neighbours.prototype.setNeighboursList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Endpoint=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Endpoint} + */ +proto.protocol.Neighbours.prototype.addNeighbours = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Endpoint, opt_index); +}; + + +proto.protocol.Neighbours.prototype.clearNeighboursList = function() { + this.setNeighboursList([]); +}; + + +/** + * optional int64 timestamp = 3; + * @return {number} + */ +proto.protocol.Neighbours.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Neighbours.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +goog.object.extend(exports, proto.protocol); diff --git a/src/protocol/core/TronInventoryItems_pb.js b/src/protocol/core/TronInventoryItems_pb.js new file mode 100644 index 0000000..d2744d7 --- /dev/null +++ b/src/protocol/core/TronInventoryItems_pb.js @@ -0,0 +1,229 @@ +/** + * @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.protocol.InventoryItems', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.InventoryItems = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.InventoryItems.repeatedFields_, null); +}; +goog.inherits(proto.protocol.InventoryItems, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.InventoryItems.displayName = 'proto.protocol.InventoryItems'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.InventoryItems.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.InventoryItems.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.InventoryItems.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.InventoryItems} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InventoryItems.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + itemsList: msg.getItemsList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.InventoryItems} + */ +proto.protocol.InventoryItems.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.InventoryItems; + return proto.protocol.InventoryItems.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.InventoryItems} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.InventoryItems} + */ +proto.protocol.InventoryItems.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addItems(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.InventoryItems.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.InventoryItems.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.InventoryItems} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InventoryItems.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getItemsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } +}; + + +/** + * optional int32 type = 1; + * @return {number} + */ +proto.protocol.InventoryItems.prototype.getType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.InventoryItems.prototype.setType = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated bytes items = 2; + * @return {!(Array|Array)} + */ +proto.protocol.InventoryItems.prototype.getItemsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes items = 2; + * This is a type-conversion wrapper around `getItemsList()` + * @return {!Array.} + */ +proto.protocol.InventoryItems.prototype.getItemsList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getItemsList())); +}; + + +/** + * repeated bytes items = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getItemsList()` + * @return {!Array.} + */ +proto.protocol.InventoryItems.prototype.getItemsList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getItemsList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.InventoryItems.prototype.setItemsList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.InventoryItems.prototype.addItems = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.protocol.InventoryItems.prototype.clearItemsList = function() { + this.setItemsList([]); +}; + + +goog.object.extend(exports, proto.protocol); diff --git a/src/protocol/core/Tron_pb.js b/src/protocol/core/Tron_pb.js new file mode 100644 index 0000000..84b433f --- /dev/null +++ b/src/protocol/core/Tron_pb.js @@ -0,0 +1,7735 @@ +/** + * @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')(); + +var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); +var core_Discover_pb = require('../core/Discover_pb.js'); +goog.exportSymbol('proto.protocol.Account', null, global); +goog.exportSymbol('proto.protocol.Account.Frozen', null, global); +goog.exportSymbol('proto.protocol.AccountId', null, global); +goog.exportSymbol('proto.protocol.AccountType', null, global); +goog.exportSymbol('proto.protocol.Block', null, global); +goog.exportSymbol('proto.protocol.BlockHeader', null, global); +goog.exportSymbol('proto.protocol.BlockHeader.raw', null, global); +goog.exportSymbol('proto.protocol.BlockInventory', null, global); +goog.exportSymbol('proto.protocol.BlockInventory.BlockId', null, global); +goog.exportSymbol('proto.protocol.BlockInventory.Type', null, global); +goog.exportSymbol('proto.protocol.ChainInventory', null, global); +goog.exportSymbol('proto.protocol.ChainInventory.BlockId', null, global); +goog.exportSymbol('proto.protocol.DisconnectMessage', null, global); +goog.exportSymbol('proto.protocol.DynamicProperties', null, global); +goog.exportSymbol('proto.protocol.HelloMessage', null, global); +goog.exportSymbol('proto.protocol.HelloMessage.BlockId', null, global); +goog.exportSymbol('proto.protocol.Inventory', null, global); +goog.exportSymbol('proto.protocol.Inventory.InventoryType', null, global); +goog.exportSymbol('proto.protocol.Items', null, global); +goog.exportSymbol('proto.protocol.Items.ItemType', null, global); +goog.exportSymbol('proto.protocol.ReasonCode', null, global); +goog.exportSymbol('proto.protocol.TXInput', null, global); +goog.exportSymbol('proto.protocol.TXInput.raw', null, global); +goog.exportSymbol('proto.protocol.TXOutput', null, global); +goog.exportSymbol('proto.protocol.TXOutputs', null, global); +goog.exportSymbol('proto.protocol.Transaction', null, global); +goog.exportSymbol('proto.protocol.Transaction.Contract', null, global); +goog.exportSymbol('proto.protocol.Transaction.Contract.ContractType', null, global); +goog.exportSymbol('proto.protocol.Transaction.Result', null, global); +goog.exportSymbol('proto.protocol.Transaction.Result.code', null, global); +goog.exportSymbol('proto.protocol.Transaction.raw', null, global); +goog.exportSymbol('proto.protocol.Transactions', null, global); +goog.exportSymbol('proto.protocol.Vote', null, global); +goog.exportSymbol('proto.protocol.Votes', null, global); +goog.exportSymbol('proto.protocol.Witness', null, global); +goog.exportSymbol('proto.protocol.acuthrity', null, global); +goog.exportSymbol('proto.protocol.permision', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.AccountId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.AccountId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AccountId.displayName = 'proto.protocol.AccountId'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AccountId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AccountId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AccountId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountId.toObject = function(includeInstance, msg) { + var f, obj = { + name: msg.getName_asB64(), + address: msg.getAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.AccountId} + */ +proto.protocol.AccountId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AccountId; + return proto.protocol.AccountId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AccountId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AccountId} + */ +proto.protocol.AccountId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AccountId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AccountId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AccountId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes name = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountId.prototype.getName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes name = 1; + * This is a type-conversion wrapper around `getName()` + * @return {string} + */ +proto.protocol.AccountId.prototype.getName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getName())); +}; + + +/** + * optional bytes name = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getName()` + * @return {!Uint8Array} + */ +proto.protocol.AccountId.prototype.getName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountId.prototype.setName = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountId.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes address = 2; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.AccountId.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.AccountId.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountId.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Vote = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Vote, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Vote.displayName = 'proto.protocol.Vote'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Vote.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Vote.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Vote} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Vote.toObject = function(includeInstance, msg) { + var f, obj = { + voteAddress: msg.getVoteAddress_asB64(), + voteCount: 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.protocol.Vote} + */ +proto.protocol.Vote.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Vote; + return proto.protocol.Vote.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Vote} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Vote} + */ +proto.protocol.Vote.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setVoteAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVoteCount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Vote.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Vote.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Vote} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Vote.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVoteAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVoteCount(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes vote_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Vote.prototype.getVoteAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes vote_address = 1; + * This is a type-conversion wrapper around `getVoteAddress()` + * @return {string} + */ +proto.protocol.Vote.prototype.getVoteAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getVoteAddress())); +}; + + +/** + * optional bytes vote_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getVoteAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Vote.prototype.getVoteAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getVoteAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Vote.prototype.setVoteAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 vote_count = 2; + * @return {number} + */ +proto.protocol.Vote.prototype.getVoteCount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Vote.prototype.setVoteCount = 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.protocol.Account = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Account.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Account, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Account.displayName = 'proto.protocol.Account'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Account.repeatedFields_ = [5,7,16]; + + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Account.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Account.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Account} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.toObject = function(includeInstance, msg) { + var f, obj = { + accountName: msg.getAccountName_asB64(), + type: jspb.Message.getFieldWithDefault(msg, 2, 0), + address: msg.getAddress_asB64(), + balance: jspb.Message.getFieldWithDefault(msg, 4, 0), + votesList: jspb.Message.toObjectList(msg.getVotesList(), + proto.protocol.Vote.toObject, includeInstance), + assetMap: (f = msg.getAssetMap()) ? f.toObject(includeInstance, undefined) : [], + frozenList: jspb.Message.toObjectList(msg.getFrozenList(), + proto.protocol.Account.Frozen.toObject, includeInstance), + netUsage: jspb.Message.getFieldWithDefault(msg, 8, 0), + createTime: jspb.Message.getFieldWithDefault(msg, 9, 0), + latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + allowance: jspb.Message.getFieldWithDefault(msg, 11, 0), + latestWithdrawTime: jspb.Message.getFieldWithDefault(msg, 12, 0), + code: msg.getCode_asB64(), + isWitness: jspb.Message.getFieldWithDefault(msg, 14, false), + isCommittee: jspb.Message.getFieldWithDefault(msg, 15, false), + frozenSupplyList: jspb.Message.toObjectList(msg.getFrozenSupplyList(), + proto.protocol.Account.Frozen.toObject, includeInstance), + assetIssuedName: msg.getAssetIssuedName_asB64(), + latestAssetOperationTimeMap: (f = msg.getLatestAssetOperationTimeMap()) ? f.toObject(includeInstance, undefined) : [], + freeNetUsage: jspb.Message.getFieldWithDefault(msg, 19, 0), + freeAssetNetUsageMap: (f = msg.getFreeAssetNetUsageMap()) ? f.toObject(includeInstance, undefined) : [], + latestConsumeTime: jspb.Message.getFieldWithDefault(msg, 21, 0), + latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 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.protocol.Account} + */ +proto.protocol.Account.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Account; + return proto.protocol.Account.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Account} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Account} + */ +proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountName(value); + break; + case 2: + var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); + msg.setType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBalance(value); + break; + case 5: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addVotes(value); + break; + case 6: + var value = msg.getAssetMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 7: + var value = new proto.protocol.Account.Frozen; + reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozen(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNetUsage(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCreateTime(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestOprationTime(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAllowance(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestWithdrawTime(value); + break; + case 13: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCode(value); + break; + case 14: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsWitness(value); + break; + case 15: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsCommittee(value); + break; + case 16: + var value = new proto.protocol.Account.Frozen; + reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozenSupply(value); + break; + case 17: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetIssuedName(value); + break; + case 18: + var value = msg.getLatestAssetOperationTimeMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 19: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFreeNetUsage(value); + break; + case 20: + var value = msg.getFreeAssetNetUsageMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 21: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestConsumeTime(value); + break; + case 22: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestConsumeFreeTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Account.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Account} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccountName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getBalance(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } + f = message.getAssetMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getFrozenList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.protocol.Account.Frozen.serializeBinaryToWriter + ); + } + f = message.getNetUsage(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getCreateTime(); + if (f !== 0) { + writer.writeInt64( + 9, + f + ); + } + f = message.getLatestOprationTime(); + if (f !== 0) { + writer.writeInt64( + 10, + f + ); + } + f = message.getAllowance(); + if (f !== 0) { + writer.writeInt64( + 11, + f + ); + } + f = message.getLatestWithdrawTime(); + if (f !== 0) { + writer.writeInt64( + 12, + f + ); + } + f = message.getCode_asU8(); + if (f.length > 0) { + writer.writeBytes( + 13, + f + ); + } + f = message.getIsWitness(); + if (f) { + writer.writeBool( + 14, + f + ); + } + f = message.getIsCommittee(); + if (f) { + writer.writeBool( + 15, + f + ); + } + f = message.getFrozenSupplyList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 16, + f, + proto.protocol.Account.Frozen.serializeBinaryToWriter + ); + } + f = message.getAssetIssuedName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 17, + f + ); + } + f = message.getLatestAssetOperationTimeMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(18, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getFreeNetUsage(); + if (f !== 0) { + writer.writeInt64( + 19, + f + ); + } + f = message.getFreeAssetNetUsageMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getLatestConsumeTime(); + if (f !== 0) { + writer.writeInt64( + 21, + f + ); + } + f = message.getLatestConsumeFreeTime(); + if (f !== 0) { + writer.writeInt64( + 22, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Account.Frozen = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Account.Frozen, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Account.Frozen.displayName = 'proto.protocol.Account.Frozen'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Account.Frozen.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Account.Frozen.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Account.Frozen} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.Frozen.toObject = function(includeInstance, msg) { + var f, obj = { + frozenBalance: jspb.Message.getFieldWithDefault(msg, 1, 0), + expireTime: 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.protocol.Account.Frozen} + */ +proto.protocol.Account.Frozen.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Account.Frozen; + return proto.protocol.Account.Frozen.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Account.Frozen} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.Frozen.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenBalance(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExpireTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Account.Frozen.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Account.Frozen.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Account.Frozen} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.Frozen.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrozenBalance(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getExpireTime(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 frozen_balance = 1; + * @return {number} + */ +proto.protocol.Account.Frozen.prototype.getFrozenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.Frozen.prototype.setFrozenBalance = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 expire_time = 2; + * @return {number} + */ +proto.protocol.Account.Frozen.prototype.getExpireTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.Frozen.prototype.setExpireTime = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes account_name = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAccountName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes account_name = 1; + * This is a type-conversion wrapper around `getAccountName()` + * @return {string} + */ +proto.protocol.Account.prototype.getAccountName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountName())); +}; + + +/** + * optional bytes account_name = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountName()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAccountName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAccountName = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional AccountType type = 2; + * @return {!proto.protocol.AccountType} + */ +proto.protocol.Account.prototype.getType = function() { + return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.protocol.AccountType} value */ +proto.protocol.Account.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional bytes address = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes address = 3; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Account.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 balance = 4; + * @return {number} + */ +proto.protocol.Account.prototype.getBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setBalance = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * repeated Vote votes = 5; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 5)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Account.prototype.addVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Account.prototype.clearVotesList = function() { + this.setVotesList([]); +}; + + +/** + * map asset = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getAssetMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearAssetMap = function() { + this.getAssetMap().clear(); +}; + + +/** + * repeated Frozen frozen = 7; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getFrozenList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 7)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setFrozenList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.protocol.Account.Frozen=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.prototype.addFrozen = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.protocol.Account.Frozen, opt_index); +}; + + +proto.protocol.Account.prototype.clearFrozenList = function() { + this.setFrozenList([]); +}; + + +/** + * optional int64 net_usage = 8; + * @return {number} + */ +proto.protocol.Account.prototype.getNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setNetUsage = function(value) { + jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional int64 create_time = 9; + * @return {number} + */ +proto.protocol.Account.prototype.getCreateTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setCreateTime = function(value) { + jspb.Message.setProto3IntField(this, 9, value); +}; + + +/** + * optional int64 latest_opration_time = 10; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestOprationTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestOprationTime = function(value) { + jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional int64 allowance = 11; + * @return {number} + */ +proto.protocol.Account.prototype.getAllowance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setAllowance = function(value) { + jspb.Message.setProto3IntField(this, 11, value); +}; + + +/** + * optional int64 latest_withdraw_time = 12; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestWithdrawTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestWithdrawTime = function(value) { + jspb.Message.setProto3IntField(this, 12, value); +}; + + +/** + * optional bytes code = 13; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getCode = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * optional bytes code = 13; + * This is a type-conversion wrapper around `getCode()` + * @return {string} + */ +proto.protocol.Account.prototype.getCode_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCode())); +}; + + +/** + * optional bytes code = 13; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCode()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getCode_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCode())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setCode = function(value) { + jspb.Message.setProto3BytesField(this, 13, value); +}; + + +/** + * optional bool is_witness = 14; + * 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.protocol.Account.prototype.getIsWitness = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 14, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Account.prototype.setIsWitness = function(value) { + jspb.Message.setProto3BooleanField(this, 14, value); +}; + + +/** + * optional bool is_committee = 15; + * 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.protocol.Account.prototype.getIsCommittee = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 15, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Account.prototype.setIsCommittee = function(value) { + jspb.Message.setProto3BooleanField(this, 15, value); +}; + + +/** + * repeated Frozen frozen_supply = 16; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getFrozenSupplyList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 16)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setFrozenSupplyList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 16, value); +}; + + +/** + * @param {!proto.protocol.Account.Frozen=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.prototype.addFrozenSupply = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 16, opt_value, proto.protocol.Account.Frozen, opt_index); +}; + + +proto.protocol.Account.prototype.clearFrozenSupplyList = function() { + this.setFrozenSupplyList([]); +}; + + +/** + * optional bytes asset_issued_name = 17; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAssetIssuedName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 17, "")); +}; + + +/** + * optional bytes asset_issued_name = 17; + * This is a type-conversion wrapper around `getAssetIssuedName()` + * @return {string} + */ +proto.protocol.Account.prototype.getAssetIssuedName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetIssuedName())); +}; + + +/** + * optional bytes asset_issued_name = 17; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetIssuedName()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAssetIssuedName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetIssuedName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAssetIssuedName = function(value) { + jspb.Message.setProto3BytesField(this, 17, value); +}; + + +/** + * map latest_asset_operation_time = 18; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getLatestAssetOperationTimeMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 18, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearLatestAssetOperationTimeMap = function() { + this.getLatestAssetOperationTimeMap().clear(); +}; + + +/** + * optional int64 free_net_usage = 19; + * @return {number} + */ +proto.protocol.Account.prototype.getFreeNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 19, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setFreeNetUsage = function(value) { + jspb.Message.setProto3IntField(this, 19, value); +}; + + +/** + * map free_asset_net_usage = 20; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getFreeAssetNetUsageMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 20, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearFreeAssetNetUsageMap = function() { + this.getFreeAssetNetUsageMap().clear(); +}; + + +/** + * optional int64 latest_consume_time = 21; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestConsumeTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 21, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestConsumeTime = function(value) { + jspb.Message.setProto3IntField(this, 21, value); +}; + + +/** + * optional int64 latest_consume_free_time = 22; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestConsumeFreeTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 22, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestConsumeFreeTime = function(value) { + jspb.Message.setProto3IntField(this, 22, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.acuthrity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.acuthrity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.acuthrity.displayName = 'proto.protocol.acuthrity'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.acuthrity.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.acuthrity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.acuthrity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.acuthrity.toObject = function(includeInstance, msg) { + var f, obj = { + account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f), + permissionName: msg.getPermissionName_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.acuthrity} + */ +proto.protocol.acuthrity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.acuthrity; + return proto.protocol.acuthrity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.acuthrity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.acuthrity} + */ +proto.protocol.acuthrity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.AccountId; + reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.acuthrity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.acuthrity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.acuthrity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.acuthrity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccount(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.AccountId.serializeBinaryToWriter + ); + } + f = message.getPermissionName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional AccountId account = 1; + * @return {?proto.protocol.AccountId} + */ +proto.protocol.acuthrity.prototype.getAccount = function() { + return /** @type{?proto.protocol.AccountId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +}; + + +/** @param {?proto.protocol.AccountId|undefined} value */ +proto.protocol.acuthrity.prototype.setAccount = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.acuthrity.prototype.clearAccount = function() { + this.setAccount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.acuthrity.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes permission_name = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.acuthrity.prototype.getPermissionName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes permission_name = 2; + * This is a type-conversion wrapper around `getPermissionName()` + * @return {string} + */ +proto.protocol.acuthrity.prototype.getPermissionName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPermissionName())); +}; + + +/** + * optional bytes permission_name = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPermissionName()` + * @return {!Uint8Array} + */ +proto.protocol.acuthrity.prototype.getPermissionName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPermissionName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.acuthrity.prototype.setPermissionName = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.permision = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.permision, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.permision.displayName = 'proto.protocol.permision'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.permision.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.permision.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.permision} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.permision.toObject = function(includeInstance, msg) { + var f, obj = { + account: (f = msg.getAccount()) && proto.protocol.AccountId.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.protocol.permision} + */ +proto.protocol.permision.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.permision; + return proto.protocol.permision.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.permision} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.permision} + */ +proto.protocol.permision.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.AccountId; + reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.permision.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.permision.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.permision} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.permision.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccount(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.AccountId.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AccountId account = 1; + * @return {?proto.protocol.AccountId} + */ +proto.protocol.permision.prototype.getAccount = function() { + return /** @type{?proto.protocol.AccountId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +}; + + +/** @param {?proto.protocol.AccountId|undefined} value */ +proto.protocol.permision.prototype.setAccount = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.permision.prototype.clearAccount = function() { + this.setAccount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.permision.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != 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.protocol.Witness = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Witness, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Witness.displayName = 'proto.protocol.Witness'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Witness.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Witness} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Witness.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64(), + url: jspb.Message.getFieldWithDefault(msg, 4, ""), + totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), + totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), + latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), + isjobs: jspb.Message.getFieldWithDefault(msg, 9, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Witness} + */ +proto.protocol.Witness.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Witness; + return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Witness} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Witness} + */ +proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVotecount(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkey(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotalproduced(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotalmissed(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestblocknum(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestslotnum(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsjobs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Witness.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Witness} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Witness.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVotecount(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getTotalproduced(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getTotalmissed(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getLatestblocknum(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getLatestslotnum(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getIsjobs(); + if (f) { + writer.writeBool( + 9, + f + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Witness.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Witness.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Witness.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 voteCount = 2; + * @return {number} + */ +proto.protocol.Witness.prototype.getVotecount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setVotecount = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes pubKey = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Witness.prototype.getPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes pubKey = 3; + * This is a type-conversion wrapper around `getPubkey()` + * @return {string} + */ +proto.protocol.Witness.prototype.getPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkey())); +}; + + +/** + * optional bytes pubKey = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkey()` + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.getPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Witness.prototype.setPubkey = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional string url = 4; + * @return {string} + */ +proto.protocol.Witness.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.protocol.Witness.prototype.setUrl = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional int64 totalProduced = 5; + * @return {number} + */ +proto.protocol.Witness.prototype.getTotalproduced = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setTotalproduced = function(value) { + jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int64 totalMissed = 6; + * @return {number} + */ +proto.protocol.Witness.prototype.getTotalmissed = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setTotalmissed = function(value) { + jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional int64 latestBlockNum = 7; + * @return {number} + */ +proto.protocol.Witness.prototype.getLatestblocknum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setLatestblocknum = function(value) { + jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional int64 latestSlotNum = 8; + * @return {number} + */ +proto.protocol.Witness.prototype.getLatestslotnum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setLatestslotnum = function(value) { + jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional bool isJobs = 9; + * 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.protocol.Witness.prototype.getIsjobs = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 9, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Witness.prototype.setIsjobs = function(value) { + jspb.Message.setProto3BooleanField(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.protocol.Votes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Votes.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Votes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Votes.displayName = 'proto.protocol.Votes'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Votes.repeatedFields_ = [2,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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Votes.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Votes.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Votes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Votes.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + oldVotesList: jspb.Message.toObjectList(msg.getOldVotesList(), + proto.protocol.Vote.toObject, includeInstance), + newVotesList: jspb.Message.toObjectList(msg.getNewVotesList(), + proto.protocol.Vote.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Votes} + */ +proto.protocol.Votes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Votes; + return proto.protocol.Votes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Votes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Votes} + */ +proto.protocol.Votes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addOldVotes(value); + break; + case 3: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addNewVotes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Votes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Votes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Votes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Votes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOldVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } + f = message.getNewVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Votes.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Votes.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Votes.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Votes.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * repeated Vote old_votes = 2; + * @return {!Array.} + */ +proto.protocol.Votes.prototype.getOldVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Votes.prototype.setOldVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Votes.prototype.addOldVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Votes.prototype.clearOldVotesList = function() { + this.setOldVotesList([]); +}; + + +/** + * repeated Vote new_votes = 3; + * @return {!Array.} + */ +proto.protocol.Votes.prototype.getNewVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 3)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Votes.prototype.setNewVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Votes.prototype.addNewVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Votes.prototype.clearNewVotesList = function() { + this.setNewVotesList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXOutput = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXOutput, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXOutput.displayName = 'proto.protocol.TXOutput'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXOutput.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXOutput.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXOutput} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutput.toObject = function(includeInstance, msg) { + var f, obj = { + value: jspb.Message.getFieldWithDefault(msg, 1, 0), + pubkeyhash: msg.getPubkeyhash_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutput.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXOutput; + return proto.protocol.TXOutput.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXOutput} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutput.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setValue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkeyhash(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXOutput.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXOutput.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXOutput} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutput.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getPubkeyhash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int64 value = 1; + * @return {number} + */ +proto.protocol.TXOutput.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TXOutput.prototype.setValue = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bytes pubKeyHash = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes pubKeyHash = 2; + * This is a type-conversion wrapper around `getPubkeyhash()` + * @return {string} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkeyhash())); +}; + + +/** + * optional bytes pubKeyHash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkeyhash()` + * @return {!Uint8Array} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkeyhash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXOutput.prototype.setPubkeyhash = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXInput = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXInput, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXInput.displayName = 'proto.protocol.TXInput'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXInput.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXInput.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXInput} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.toObject = function(includeInstance, msg) { + var f, obj = { + rawData: (f = msg.getRawData()) && proto.protocol.TXInput.raw.toObject(includeInstance, f), + signature: msg.getSignature_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXInput} + */ +proto.protocol.TXInput.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXInput; + return proto.protocol.TXInput.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXInput} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXInput} + */ +proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.TXInput.raw; + reader.readMessage(value,proto.protocol.TXInput.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXInput.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXInput.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXInput} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRawData(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.TXInput.raw.serializeBinaryToWriter + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXInput.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXInput.raw, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXInput.raw.displayName = 'proto.protocol.TXInput.raw'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXInput.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXInput.raw.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXInput.raw} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.raw.toObject = function(includeInstance, msg) { + var f, obj = { + txid: msg.getTxid_asB64(), + vout: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.raw.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXInput.raw; + return proto.protocol.TXInput.raw.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXInput.raw} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTxid(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVout(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXInput.raw.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXInput.raw} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.raw.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTxid_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVout(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional bytes txID = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.raw.prototype.getTxid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes txID = 1; + * This is a type-conversion wrapper around `getTxid()` + * @return {string} + */ +proto.protocol.TXInput.raw.prototype.getTxid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTxid())); +}; + + +/** + * optional bytes txID = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTxid()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.getTxid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTxid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.raw.prototype.setTxid = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 vout = 2; + * @return {number} + */ +proto.protocol.TXInput.raw.prototype.getVout = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TXInput.raw.prototype.setVout = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes pubKey = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.raw.prototype.getPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes pubKey = 3; + * This is a type-conversion wrapper around `getPubkey()` + * @return {string} + */ +proto.protocol.TXInput.raw.prototype.getPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkey())); +}; + + +/** + * optional bytes pubKey = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkey()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.getPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.raw.prototype.setPubkey = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional raw raw_data = 1; + * @return {?proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.prototype.getRawData = function() { + return /** @type{?proto.protocol.TXInput.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.TXInput.raw, 1)); +}; + + +/** @param {?proto.protocol.TXInput.raw|undefined} value */ +proto.protocol.TXInput.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.TXInput.prototype.clearRawData = function() { + this.setRawData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.TXInput.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes signature = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes signature = 4; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.protocol.TXInput.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.prototype.setSignature = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXOutputs = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TXOutputs.repeatedFields_, null); +}; +goog.inherits(proto.protocol.TXOutputs, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXOutputs.displayName = 'proto.protocol.TXOutputs'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.TXOutputs.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXOutputs.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXOutputs.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXOutputs} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutputs.toObject = function(includeInstance, msg) { + var f, obj = { + outputsList: jspb.Message.toObjectList(msg.getOutputsList(), + proto.protocol.TXOutput.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXOutputs} + */ +proto.protocol.TXOutputs.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXOutputs; + return proto.protocol.TXOutputs.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXOutputs} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXOutputs} + */ +proto.protocol.TXOutputs.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.TXOutput; + reader.readMessage(value,proto.protocol.TXOutput.deserializeBinaryFromReader); + msg.addOutputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXOutputs.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXOutputs.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXOutputs} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutputs.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOutputsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.TXOutput.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated TXOutput outputs = 1; + * @return {!Array.} + */ +proto.protocol.TXOutputs.prototype.getOutputsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXOutput, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.TXOutputs.prototype.setOutputsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.TXOutput=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutputs.prototype.addOutputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.TXOutput, opt_index); +}; + + +proto.protocol.TXOutputs.prototype.clearOutputsList = function() { + this.setOutputsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Transaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.displayName = 'proto.protocol.Transaction'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transaction.repeatedFields_ = [2,5]; + + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.toObject = function(includeInstance, msg) { + var f, obj = { + rawData: (f = msg.getRawData()) && proto.protocol.Transaction.raw.toObject(includeInstance, f), + signatureList: msg.getSignatureList_asB64(), + retList: jspb.Message.toObjectList(msg.getRetList(), + proto.protocol.Transaction.Result.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Transaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction; + return proto.protocol.Transaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Transaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction.raw; + reader.readMessage(value,proto.protocol.Transaction.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addSignature(value); + break; + case 5: + var value = new proto.protocol.Transaction.Result; + reader.readMessage(value,proto.protocol.Transaction.Result.deserializeBinaryFromReader); + msg.addRet(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRawData(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Transaction.raw.serializeBinaryToWriter + ); + } + f = message.getSignatureList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getRetList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.Transaction.Result.serializeBinaryToWriter + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction.Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Transaction.Contract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.Contract.displayName = 'proto.protocol.Transaction.Contract'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.Contract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.Contract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction.Contract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Contract.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + parameter: (f = msg.getParameter()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + provider: msg.getProvider_asB64(), + contractname: msg.getContractname_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Transaction.Contract} + */ +proto.protocol.Transaction.Contract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction.Contract; + return proto.protocol.Transaction.Contract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction.Contract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction.Contract} + */ +proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setParameter(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProvider(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractname(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction.Contract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Contract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getParameter(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getProvider_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getContractname_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.protocol.Transaction.Contract.ContractType = { + ACCOUNTCREATECONTRACT: 0, + TRANSFERCONTRACT: 1, + TRANSFERASSETCONTRACT: 2, + VOTEASSETCONTRACT: 3, + VOTEWITNESSCONTRACT: 4, + WITNESSCREATECONTRACT: 5, + ASSETISSUECONTRACT: 6, + DEPLOYCONTRACT: 7, + WITNESSUPDATECONTRACT: 8, + PARTICIPATEASSETISSUECONTRACT: 9, + ACCOUNTUPDATECONTRACT: 10, + FREEZEBALANCECONTRACT: 11, + UNFREEZEBALANCECONTRACT: 12, + WITHDRAWBALANCECONTRACT: 13, + UNFREEZEASSETCONTRACT: 14, + UPDATEASSETCONTRACT: 15, + CUSTOMCONTRACT: 20 +}; + +/** + * optional ContractType type = 1; + * @return {!proto.protocol.Transaction.Contract.ContractType} + */ +proto.protocol.Transaction.Contract.prototype.getType = function() { + return /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Contract.ContractType} value */ +proto.protocol.Transaction.Contract.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional google.protobuf.Any parameter = 2; + * @return {?proto.google.protobuf.Any} + */ +proto.protocol.Transaction.Contract.prototype.getParameter = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); +}; + + +/** @param {?proto.google.protobuf.Any|undefined} value */ +proto.protocol.Transaction.Contract.prototype.setParameter = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.Transaction.Contract.prototype.clearParameter = function() { + this.setParameter(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Transaction.Contract.prototype.hasParameter = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional bytes provider = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.Contract.prototype.getProvider = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes provider = 3; + * This is a type-conversion wrapper around `getProvider()` + * @return {string} + */ +proto.protocol.Transaction.Contract.prototype.getProvider_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProvider())); +}; + + +/** + * optional bytes provider = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProvider()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Contract.prototype.getProvider_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProvider())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.Contract.prototype.setProvider = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional bytes ContractName = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.Contract.prototype.getContractname = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes ContractName = 4; + * This is a type-conversion wrapper around `getContractname()` + * @return {string} + */ +proto.protocol.Transaction.Contract.prototype.getContractname_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractname())); +}; + + +/** + * optional bytes ContractName = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractname()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Contract.prototype.getContractname_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractname())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.Contract.prototype.setContractname = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction.Result = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Transaction.Result, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.Result.displayName = 'proto.protocol.Transaction.Result'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.Result.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.Result.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction.Result} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Result.toObject = function(includeInstance, msg) { + var f, obj = { + fee: jspb.Message.getFieldWithDefault(msg, 1, 0), + ret: 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.protocol.Transaction.Result} + */ +proto.protocol.Transaction.Result.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction.Result; + return proto.protocol.Transaction.Result.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction.Result} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction.Result} + */ +proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFee(value); + break; + case 2: + var value = /** @type {!proto.protocol.Transaction.Result.code} */ (reader.readEnum()); + msg.setRet(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Result.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.Result.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction.Result} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Result.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFee(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getRet(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.protocol.Transaction.Result.code = { + SUCESS: 0, + FAILED: 1 +}; + +/** + * optional int64 fee = 1; + * @return {number} + */ +proto.protocol.Transaction.Result.prototype.getFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.Result.prototype.setFee = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional code ret = 2; + * @return {!proto.protocol.Transaction.Result.code} + */ +proto.protocol.Transaction.Result.prototype.getRet = function() { + return /** @type {!proto.protocol.Transaction.Result.code} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Result.code} value */ +proto.protocol.Transaction.Result.prototype.setRet = function(value) { + jspb.Message.setProto3EnumField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.raw.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Transaction.raw, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.raw.displayName = 'proto.protocol.Transaction.raw'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transaction.raw.repeatedFields_ = [9,11]; + + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.raw.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction.raw} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.raw.toObject = function(includeInstance, msg) { + var f, obj = { + refBlockBytes: msg.getRefBlockBytes_asB64(), + refBlockNum: jspb.Message.getFieldWithDefault(msg, 3, 0), + refBlockHash: msg.getRefBlockHash_asB64(), + expiration: jspb.Message.getFieldWithDefault(msg, 8, 0), + authsList: jspb.Message.toObjectList(msg.getAuthsList(), + proto.protocol.acuthrity.toObject, includeInstance), + data: msg.getData_asB64(), + contractList: jspb.Message.toObjectList(msg.getContractList(), + proto.protocol.Transaction.Contract.toObject, includeInstance), + scripts: msg.getScripts_asB64(), + timestamp: jspb.Message.getFieldWithDefault(msg, 14, 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.protocol.Transaction.raw} + */ +proto.protocol.Transaction.raw.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction.raw; + return proto.protocol.Transaction.raw.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction.raw} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction.raw} + */ +proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRefBlockBytes(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setRefBlockNum(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRefBlockHash(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExpiration(value); + break; + case 9: + var value = new proto.protocol.acuthrity; + reader.readMessage(value,proto.protocol.acuthrity.deserializeBinaryFromReader); + msg.addAuths(value); + break; + case 10: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 11: + var value = new proto.protocol.Transaction.Contract; + reader.readMessage(value,proto.protocol.Transaction.Contract.deserializeBinaryFromReader); + msg.addContract(value); + break; + case 12: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setScripts(value); + break; + case 14: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.raw.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.raw.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction.raw} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.raw.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRefBlockBytes_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getRefBlockNum(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getRefBlockHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getExpiration(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getAuthsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 9, + f, + proto.protocol.acuthrity.serializeBinaryToWriter + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 10, + f + ); + } + f = message.getContractList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 11, + f, + proto.protocol.Transaction.Contract.serializeBinaryToWriter + ); + } + f = message.getScripts_asU8(); + if (f.length > 0) { + writer.writeBytes( + 12, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 14, + f + ); + } +}; + + +/** + * optional bytes ref_block_bytes = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockBytes = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes ref_block_bytes = 1; + * This is a type-conversion wrapper around `getRefBlockBytes()` + * @return {string} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRefBlockBytes())); +}; + + +/** + * optional bytes ref_block_bytes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRefBlockBytes()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRefBlockBytes())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.raw.prototype.setRefBlockBytes = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 ref_block_num = 3; + * @return {number} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.raw.prototype.setRefBlockNum = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bytes ref_block_hash = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes ref_block_hash = 4; + * This is a type-conversion wrapper around `getRefBlockHash()` + * @return {string} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRefBlockHash())); +}; + + +/** + * optional bytes ref_block_hash = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRefBlockHash()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.raw.prototype.getRefBlockHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRefBlockHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.raw.prototype.setRefBlockHash = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional int64 expiration = 8; + * @return {number} + */ +proto.protocol.Transaction.raw.prototype.getExpiration = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.raw.prototype.setExpiration = function(value) { + jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * repeated acuthrity auths = 9; + * @return {!Array.} + */ +proto.protocol.Transaction.raw.prototype.getAuthsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.acuthrity, 9)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transaction.raw.prototype.setAuthsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 9, value); +}; + + +/** + * @param {!proto.protocol.acuthrity=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.acuthrity} + */ +proto.protocol.Transaction.raw.prototype.addAuths = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.protocol.acuthrity, opt_index); +}; + + +proto.protocol.Transaction.raw.prototype.clearAuthsList = function() { + this.setAuthsList([]); +}; + + +/** + * optional bytes data = 10; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.raw.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * optional bytes data = 10; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.protocol.Transaction.raw.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 10; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.raw.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.raw.prototype.setData = function(value) { + jspb.Message.setProto3BytesField(this, 10, value); +}; + + +/** + * repeated Contract contract = 11; + * @return {!Array.} + */ +proto.protocol.Transaction.raw.prototype.getContractList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Contract, 11)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transaction.raw.prototype.setContractList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 11, value); +}; + + +/** + * @param {!proto.protocol.Transaction.Contract=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction.Contract} + */ +proto.protocol.Transaction.raw.prototype.addContract = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.protocol.Transaction.Contract, opt_index); +}; + + +proto.protocol.Transaction.raw.prototype.clearContractList = function() { + this.setContractList([]); +}; + + +/** + * optional bytes scripts = 12; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.raw.prototype.getScripts = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * optional bytes scripts = 12; + * This is a type-conversion wrapper around `getScripts()` + * @return {string} + */ +proto.protocol.Transaction.raw.prototype.getScripts_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getScripts())); +}; + + +/** + * optional bytes scripts = 12; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getScripts()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.raw.prototype.getScripts_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getScripts())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.raw.prototype.setScripts = function(value) { + jspb.Message.setProto3BytesField(this, 12, value); +}; + + +/** + * optional int64 timestamp = 14; + * @return {number} + */ +proto.protocol.Transaction.raw.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.raw.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(this, 14, value); +}; + + +/** + * optional raw raw_data = 1; + * @return {?proto.protocol.Transaction.raw} + */ +proto.protocol.Transaction.prototype.getRawData = function() { + return /** @type{?proto.protocol.Transaction.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Transaction.raw, 1)); +}; + + +/** @param {?proto.protocol.Transaction.raw|undefined} value */ +proto.protocol.Transaction.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.Transaction.prototype.clearRawData = function() { + this.setRawData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Transaction.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated bytes signature = 2; + * @return {!(Array|Array)} + */ +proto.protocol.Transaction.prototype.getSignatureList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes signature = 2; + * This is a type-conversion wrapper around `getSignatureList()` + * @return {!Array.} + */ +proto.protocol.Transaction.prototype.getSignatureList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getSignatureList())); +}; + + +/** + * repeated bytes signature = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignatureList()` + * @return {!Array.} + */ +proto.protocol.Transaction.prototype.getSignatureList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getSignatureList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.Transaction.prototype.setSignatureList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.Transaction.prototype.addSignature = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.protocol.Transaction.prototype.clearSignatureList = function() { + this.setSignatureList([]); +}; + + +/** + * repeated Result ret = 5; + * @return {!Array.} + */ +proto.protocol.Transaction.prototype.getRetList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Result, 5)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transaction.prototype.setRetList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.protocol.Transaction.Result=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction.Result} + */ +proto.protocol.Transaction.prototype.addRet = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Transaction.Result, opt_index); +}; + + +proto.protocol.Transaction.prototype.clearRetList = function() { + this.setRetList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transactions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transactions.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Transactions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transactions.displayName = 'proto.protocol.Transactions'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transactions.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transactions.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transactions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transactions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transactions.toObject = function(includeInstance, msg) { + var f, obj = { + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.protocol.Transaction.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Transactions} + */ +proto.protocol.Transactions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transactions; + return proto.protocol.Transactions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transactions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transactions} + */ +proto.protocol.Transactions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transactions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transactions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transactions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transactions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Transaction transactions = 1; + * @return {!Array.} + */ +proto.protocol.Transactions.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transactions.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Transactions.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); +}; + + +proto.protocol.Transactions.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BlockHeader = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BlockHeader, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BlockHeader.displayName = 'proto.protocol.BlockHeader'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BlockHeader.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockHeader.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BlockHeader} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockHeader.toObject = function(includeInstance, msg) { + var f, obj = { + rawData: (f = msg.getRawData()) && proto.protocol.BlockHeader.raw.toObject(includeInstance, f), + witnessSignature: msg.getWitnessSignature_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.BlockHeader} + */ +proto.protocol.BlockHeader.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BlockHeader; + return proto.protocol.BlockHeader.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BlockHeader} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BlockHeader} + */ +proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.BlockHeader.raw; + reader.readMessage(value,proto.protocol.BlockHeader.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWitnessSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BlockHeader.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BlockHeader} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRawData(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.BlockHeader.raw.serializeBinaryToWriter + ); + } + f = message.getWitnessSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BlockHeader.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BlockHeader.raw, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BlockHeader.raw.displayName = 'proto.protocol.BlockHeader.raw'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BlockHeader.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockHeader.raw.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BlockHeader.raw} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockHeader.raw.toObject = function(includeInstance, msg) { + var f, obj = { + timestamp: jspb.Message.getFieldWithDefault(msg, 1, 0), + txtrieroot: msg.getTxtrieroot_asB64(), + parenthash: msg.getParenthash_asB64(), + number: jspb.Message.getFieldWithDefault(msg, 7, 0), + witnessId: jspb.Message.getFieldWithDefault(msg, 8, 0), + witnessAddress: msg.getWitnessAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.BlockHeader.raw} + */ +proto.protocol.BlockHeader.raw.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BlockHeader.raw; + return proto.protocol.BlockHeader.raw.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BlockHeader.raw} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BlockHeader.raw} + */ +proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTxtrieroot(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setParenthash(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setWitnessId(value); + break; + case 9: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWitnessAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.raw.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BlockHeader.raw.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BlockHeader.raw} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockHeader.raw.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getTxtrieroot_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getParenthash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getWitnessId(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getWitnessAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 9, + f + ); + } +}; + + +/** + * optional int64 timestamp = 1; + * @return {number} + */ +proto.protocol.BlockHeader.raw.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockHeader.raw.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bytes txTrieRoot = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes txTrieRoot = 2; + * This is a type-conversion wrapper around `getTxtrieroot()` + * @return {string} + */ +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTxtrieroot())); +}; + + +/** + * optional bytes txTrieRoot = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTxtrieroot()` + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTxtrieroot())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockHeader.raw.prototype.setTxtrieroot = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes parentHash = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes parentHash = 3; + * This is a type-conversion wrapper around `getParenthash()` + * @return {string} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getParenthash())); +}; + + +/** + * optional bytes parentHash = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getParenthash()` + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getParenthash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockHeader.raw.prototype.setParenthash = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional int64 number = 7; + * @return {number} + */ +proto.protocol.BlockHeader.raw.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockHeader.raw.prototype.setNumber = function(value) { + jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional int64 witness_id = 8; + * @return {number} + */ +proto.protocol.BlockHeader.raw.prototype.getWitnessId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockHeader.raw.prototype.setWitnessId = function(value) { + jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional bytes witness_address = 9; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * optional bytes witness_address = 9; + * This is a type-conversion wrapper around `getWitnessAddress()` + * @return {string} + */ +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWitnessAddress())); +}; + + +/** + * optional bytes witness_address = 9; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWitnessAddress()` + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWitnessAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockHeader.raw.prototype.setWitnessAddress = function(value) { + jspb.Message.setProto3BytesField(this, 9, value); +}; + + +/** + * optional raw raw_data = 1; + * @return {?proto.protocol.BlockHeader.raw} + */ +proto.protocol.BlockHeader.prototype.getRawData = function() { + return /** @type{?proto.protocol.BlockHeader.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.BlockHeader.raw, 1)); +}; + + +/** @param {?proto.protocol.BlockHeader.raw|undefined} value */ +proto.protocol.BlockHeader.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.BlockHeader.prototype.clearRawData = function() { + this.setRawData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.BlockHeader.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes witness_signature = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockHeader.prototype.getWitnessSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes witness_signature = 2; + * This is a type-conversion wrapper around `getWitnessSignature()` + * @return {string} + */ +proto.protocol.BlockHeader.prototype.getWitnessSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWitnessSignature())); +}; + + +/** + * optional bytes witness_signature = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWitnessSignature()` + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.prototype.getWitnessSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWitnessSignature())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockHeader.prototype.setWitnessSignature = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Block = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Block.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Block, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Block.displayName = 'proto.protocol.Block'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Block.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Block.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Block.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Block} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Block.toObject = function(includeInstance, msg) { + var f, obj = { + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.protocol.Transaction.toObject, includeInstance), + blockHeader: (f = msg.getBlockHeader()) && proto.protocol.BlockHeader.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.protocol.Block} + */ +proto.protocol.Block.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Block; + return proto.protocol.Block.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Block} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Block} + */ +proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + case 2: + var value = new proto.protocol.BlockHeader; + reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader); + msg.setBlockHeader(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Block.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Block.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Block} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Block.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } + f = message.getBlockHeader(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.protocol.BlockHeader.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Transaction transactions = 1; + * @return {!Array.} + */ +proto.protocol.Block.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Block.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Block.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); +}; + + +proto.protocol.Block.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); +}; + + +/** + * optional BlockHeader block_header = 2; + * @return {?proto.protocol.BlockHeader} + */ +proto.protocol.Block.prototype.getBlockHeader = function() { + return /** @type{?proto.protocol.BlockHeader} */ ( + jspb.Message.getWrapperField(this, proto.protocol.BlockHeader, 2)); +}; + + +/** @param {?proto.protocol.BlockHeader|undefined} value */ +proto.protocol.Block.prototype.setBlockHeader = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.Block.prototype.clearBlockHeader = function() { + this.setBlockHeader(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Block.prototype.hasBlockHeader = 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.protocol.ChainInventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.ChainInventory.repeatedFields_, null); +}; +goog.inherits(proto.protocol.ChainInventory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ChainInventory.displayName = 'proto.protocol.ChainInventory'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.ChainInventory.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ChainInventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainInventory.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ChainInventory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.toObject = function(includeInstance, msg) { + var f, obj = { + idsList: jspb.Message.toObjectList(msg.getIdsList(), + proto.protocol.ChainInventory.BlockId.toObject, includeInstance), + remainNum: 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.protocol.ChainInventory} + */ +proto.protocol.ChainInventory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ChainInventory; + return proto.protocol.ChainInventory.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ChainInventory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ChainInventory} + */ +proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.ChainInventory.BlockId; + reader.readMessage(value,proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader); + msg.addIds(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setRemainNum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ChainInventory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainInventory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainInventory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter + ); + } + f = message.getRemainNum(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ChainInventory.BlockId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ChainInventory.BlockId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ChainInventory.BlockId.displayName = 'proto.protocol.ChainInventory.BlockId'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ChainInventory.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainInventory.BlockId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ChainInventory.BlockId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.BlockId.toObject = function(includeInstance, msg) { + var f, obj = { + hash: msg.getHash_asB64(), + number: 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.protocol.ChainInventory.BlockId} + */ +proto.protocol.ChainInventory.BlockId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ChainInventory.BlockId; + return proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ChainInventory.BlockId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ChainInventory.BlockId} + */ +proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ChainInventory.BlockId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainInventory.BlockId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ChainInventory.BlockId.prototype.setHash = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 number = 2; + * @return {number} + */ +proto.protocol.ChainInventory.BlockId.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ChainInventory.BlockId.prototype.setNumber = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated BlockId ids = 1; + * @return {!Array.} + */ +proto.protocol.ChainInventory.prototype.getIdsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.ChainInventory.BlockId, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.ChainInventory.prototype.setIdsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.ChainInventory.BlockId=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.ChainInventory.BlockId} + */ +proto.protocol.ChainInventory.prototype.addIds = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.ChainInventory.BlockId, opt_index); +}; + + +proto.protocol.ChainInventory.prototype.clearIdsList = function() { + this.setIdsList([]); +}; + + +/** + * optional int64 remain_num = 2; + * @return {number} + */ +proto.protocol.ChainInventory.prototype.getRemainNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ChainInventory.prototype.setRemainNum = 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.protocol.BlockInventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.BlockInventory.repeatedFields_, null); +}; +goog.inherits(proto.protocol.BlockInventory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BlockInventory.displayName = 'proto.protocol.BlockInventory'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.BlockInventory.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BlockInventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockInventory.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BlockInventory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockInventory.toObject = function(includeInstance, msg) { + var f, obj = { + idsList: jspb.Message.toObjectList(msg.getIdsList(), + proto.protocol.BlockInventory.BlockId.toObject, includeInstance), + type: 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.protocol.BlockInventory} + */ +proto.protocol.BlockInventory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BlockInventory; + return proto.protocol.BlockInventory.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BlockInventory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BlockInventory} + */ +proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.BlockInventory.BlockId; + reader.readMessage(value,proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader); + msg.addIds(value); + break; + case 2: + var value = /** @type {!proto.protocol.BlockInventory.Type} */ (reader.readEnum()); + msg.setType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BlockInventory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BlockInventory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BlockInventory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockInventory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.protocol.BlockInventory.Type = { + SYNC: 0, + ADVTISE: 1, + FETCH: 2 +}; + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BlockInventory.BlockId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BlockInventory.BlockId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BlockInventory.BlockId.displayName = 'proto.protocol.BlockInventory.BlockId'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BlockInventory.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockInventory.BlockId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BlockInventory.BlockId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockInventory.BlockId.toObject = function(includeInstance, msg) { + var f, obj = { + hash: msg.getHash_asB64(), + number: 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.protocol.BlockInventory.BlockId} + */ +proto.protocol.BlockInventory.BlockId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BlockInventory.BlockId; + return proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BlockInventory.BlockId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BlockInventory.BlockId} + */ +proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BlockInventory.BlockId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BlockInventory.BlockId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockInventory.BlockId.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protocol.BlockInventory.BlockId.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protocol.BlockInventory.BlockId.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockInventory.BlockId.prototype.setHash = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 number = 2; + * @return {number} + */ +proto.protocol.BlockInventory.BlockId.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockInventory.BlockId.prototype.setNumber = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated BlockId ids = 1; + * @return {!Array.} + */ +proto.protocol.BlockInventory.prototype.getIdsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockInventory.BlockId, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.BlockInventory.prototype.setIdsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.BlockInventory.BlockId=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.BlockInventory.BlockId} + */ +proto.protocol.BlockInventory.prototype.addIds = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.BlockInventory.BlockId, opt_index); +}; + + +proto.protocol.BlockInventory.prototype.clearIdsList = function() { + this.setIdsList([]); +}; + + +/** + * optional Type type = 2; + * @return {!proto.protocol.BlockInventory.Type} + */ +proto.protocol.BlockInventory.prototype.getType = function() { + return /** @type {!proto.protocol.BlockInventory.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.protocol.BlockInventory.Type} value */ +proto.protocol.BlockInventory.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Inventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Inventory.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Inventory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Inventory.displayName = 'proto.protocol.Inventory'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Inventory.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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Inventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Inventory.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Inventory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Inventory.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + idsList: msg.getIdsList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Inventory} + */ +proto.protocol.Inventory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Inventory; + return proto.protocol.Inventory.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Inventory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Inventory} + */ +proto.protocol.Inventory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.Inventory.InventoryType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Inventory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Inventory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Inventory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Inventory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.protocol.Inventory.InventoryType = { + TRX: 0, + BLOCK: 1 +}; + +/** + * optional InventoryType type = 1; + * @return {!proto.protocol.Inventory.InventoryType} + */ +proto.protocol.Inventory.prototype.getType = function() { + return /** @type {!proto.protocol.Inventory.InventoryType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.Inventory.InventoryType} value */ +proto.protocol.Inventory.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * repeated bytes ids = 2; + * @return {!(Array|Array)} + */ +proto.protocol.Inventory.prototype.getIdsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes ids = 2; + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array.} + */ +proto.protocol.Inventory.prototype.getIdsList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getIdsList())); +}; + + +/** + * repeated bytes ids = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array.} + */ +proto.protocol.Inventory.prototype.getIdsList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getIdsList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.Inventory.prototype.setIdsList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.Inventory.prototype.addIds = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.protocol.Inventory.prototype.clearIdsList = function() { + this.setIdsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Items = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Items.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Items, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Items.displayName = 'proto.protocol.Items'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Items.repeatedFields_ = [2,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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Items.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Items.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Items} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Items.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + blocksList: jspb.Message.toObjectList(msg.getBlocksList(), + proto.protocol.Block.toObject, includeInstance), + blockHeadersList: jspb.Message.toObjectList(msg.getBlockHeadersList(), + proto.protocol.BlockHeader.toObject, includeInstance), + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.protocol.Transaction.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Items} + */ +proto.protocol.Items.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Items; + return proto.protocol.Items.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Items} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Items} + */ +proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.Items.ItemType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = new proto.protocol.Block; + reader.readMessage(value,proto.protocol.Block.deserializeBinaryFromReader); + msg.addBlocks(value); + break; + case 3: + var value = new proto.protocol.BlockHeader; + reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader); + msg.addBlockHeaders(value); + break; + case 4: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Items.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Items.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Items} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Items.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getBlocksList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.protocol.Block.serializeBinaryToWriter + ); + } + f = message.getBlockHeadersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.protocol.BlockHeader.serializeBinaryToWriter + ); + } + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.protocol.Items.ItemType = { + ERR: 0, + TRX: 1, + BLOCK: 2, + BLOCKHEADER: 3 +}; + +/** + * optional ItemType type = 1; + * @return {!proto.protocol.Items.ItemType} + */ +proto.protocol.Items.prototype.getType = function() { + return /** @type {!proto.protocol.Items.ItemType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.Items.ItemType} value */ +proto.protocol.Items.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * repeated Block blocks = 2; + * @return {!Array.} + */ +proto.protocol.Items.prototype.getBlocksList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Block, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setBlocksList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Block=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Block} + */ +proto.protocol.Items.prototype.addBlocks = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Block, opt_index); +}; + + +proto.protocol.Items.prototype.clearBlocksList = function() { + this.setBlocksList([]); +}; + + +/** + * repeated BlockHeader block_headers = 3; + * @return {!Array.} + */ +proto.protocol.Items.prototype.getBlockHeadersList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockHeader, 3)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setBlockHeadersList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.protocol.BlockHeader=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.BlockHeader} + */ +proto.protocol.Items.prototype.addBlockHeaders = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.BlockHeader, opt_index); +}; + + +proto.protocol.Items.prototype.clearBlockHeadersList = function() { + this.setBlockHeadersList([]); +}; + + +/** + * repeated Transaction transactions = 4; + * @return {!Array.} + */ +proto.protocol.Items.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 4)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Items.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.Transaction, opt_index); +}; + + +proto.protocol.Items.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.DynamicProperties = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.DynamicProperties, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.DynamicProperties.displayName = 'proto.protocol.DynamicProperties'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.DynamicProperties.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.DynamicProperties.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.DynamicProperties} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DynamicProperties.toObject = function(includeInstance, msg) { + var f, obj = { + lastSolidityBlockNum: jspb.Message.getFieldWithDefault(msg, 1, 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.protocol.DynamicProperties} + */ +proto.protocol.DynamicProperties.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.DynamicProperties; + return proto.protocol.DynamicProperties.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.DynamicProperties} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.DynamicProperties} + */ +proto.protocol.DynamicProperties.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLastSolidityBlockNum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.DynamicProperties.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.DynamicProperties.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.DynamicProperties} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DynamicProperties.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLastSolidityBlockNum(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } +}; + + +/** + * optional int64 last_solidity_block_num = 1; + * @return {number} + */ +proto.protocol.DynamicProperties.prototype.getLastSolidityBlockNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.DynamicProperties.prototype.setLastSolidityBlockNum = function(value) { + jspb.Message.setProto3IntField(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.protocol.DisconnectMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.DisconnectMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.DisconnectMessage.displayName = 'proto.protocol.DisconnectMessage'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.DisconnectMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.DisconnectMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.DisconnectMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DisconnectMessage.toObject = function(includeInstance, msg) { + var f, obj = { + reason: jspb.Message.getFieldWithDefault(msg, 1, 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.protocol.DisconnectMessage} + */ +proto.protocol.DisconnectMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.DisconnectMessage; + return proto.protocol.DisconnectMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.DisconnectMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.DisconnectMessage} + */ +proto.protocol.DisconnectMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.ReasonCode} */ (reader.readEnum()); + msg.setReason(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.DisconnectMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.DisconnectMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.DisconnectMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.DisconnectMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReason(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * optional ReasonCode reason = 1; + * @return {!proto.protocol.ReasonCode} + */ +proto.protocol.DisconnectMessage.prototype.getReason = function() { + return /** @type {!proto.protocol.ReasonCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.ReasonCode} value */ +proto.protocol.DisconnectMessage.prototype.setReason = function(value) { + jspb.Message.setProto3EnumField(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.protocol.HelloMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.HelloMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.HelloMessage.displayName = 'proto.protocol.HelloMessage'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.HelloMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.HelloMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.HelloMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.HelloMessage.toObject = function(includeInstance, msg) { + var f, obj = { + from: (f = msg.getFrom()) && core_Discover_pb.Endpoint.toObject(includeInstance, f), + version: jspb.Message.getFieldWithDefault(msg, 2, 0), + timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0), + genesisblockid: (f = msg.getGenesisblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), + solidblockid: (f = msg.getSolidblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), + headblockid: (f = msg.getHeadblockid()) && proto.protocol.HelloMessage.BlockId.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.protocol.HelloMessage} + */ +proto.protocol.HelloMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.HelloMessage; + return proto.protocol.HelloMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.HelloMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.HelloMessage} + */ +proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new core_Discover_pb.Endpoint; + reader.readMessage(value,core_Discover_pb.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + case 4: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setGenesisblockid(value); + break; + case 5: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setSolidblockid(value); + break; + case 6: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setHeadblockid(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.HelloMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.HelloMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.HelloMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.HelloMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrom(); + if (f != null) { + writer.writeMessage( + 1, + f, + core_Discover_pb.Endpoint.serializeBinaryToWriter + ); + } + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getGenesisblockid(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } + f = message.getSolidblockid(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } + f = message.getHeadblockid(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.HelloMessage.BlockId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.HelloMessage.BlockId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.HelloMessage.BlockId.displayName = 'proto.protocol.HelloMessage.BlockId'; +} + + +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_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.HelloMessage.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.HelloMessage.BlockId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.HelloMessage.BlockId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.HelloMessage.BlockId.toObject = function(includeInstance, msg) { + var f, obj = { + hash: msg.getHash_asB64(), + number: 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.protocol.HelloMessage.BlockId} + */ +proto.protocol.HelloMessage.BlockId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.HelloMessage.BlockId; + return proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.HelloMessage.BlockId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.HelloMessage.BlockId} + */ +proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.HelloMessage.BlockId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.HelloMessage.BlockId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.HelloMessage.BlockId.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protocol.HelloMessage.BlockId.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protocol.HelloMessage.BlockId.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.HelloMessage.BlockId.prototype.setHash = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int64 number = 2; + * @return {number} + */ +proto.protocol.HelloMessage.BlockId.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.HelloMessage.BlockId.prototype.setNumber = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} + */ +proto.protocol.HelloMessage.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, core_Discover_pb.Endpoint, 1)); +}; + + +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.HelloMessage.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.HelloMessage.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.HelloMessage.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional int32 version = 2; + * @return {number} + */ +proto.protocol.HelloMessage.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.HelloMessage.prototype.setVersion = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 timestamp = 3; + * @return {number} + */ +proto.protocol.HelloMessage.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.HelloMessage.prototype.setTimestamp = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional BlockId genesisBlockId = 4; + * @return {?proto.protocol.HelloMessage.BlockId} + */ +proto.protocol.HelloMessage.prototype.getGenesisblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 4)); +}; + + +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setGenesisblockid = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.protocol.HelloMessage.prototype.clearGenesisblockid = function() { + this.setGenesisblockid(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.HelloMessage.prototype.hasGenesisblockid = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional BlockId solidBlockId = 5; + * @return {?proto.protocol.HelloMessage.BlockId} + */ +proto.protocol.HelloMessage.prototype.getSolidblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 5)); +}; + + +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setSolidblockid = function(value) { + jspb.Message.setWrapperField(this, 5, value); +}; + + +proto.protocol.HelloMessage.prototype.clearSolidblockid = function() { + this.setSolidblockid(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.HelloMessage.prototype.hasSolidblockid = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional BlockId headBlockId = 6; + * @return {?proto.protocol.HelloMessage.BlockId} + */ +proto.protocol.HelloMessage.prototype.getHeadblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 6)); +}; + + +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setHeadblockid = function(value) { + jspb.Message.setWrapperField(this, 6, value); +}; + + +proto.protocol.HelloMessage.prototype.clearHeadblockid = function() { + this.setHeadblockid(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.HelloMessage.prototype.hasHeadblockid = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * @enum {number} + */ +proto.protocol.AccountType = { + NORMAL: 0, + ASSETISSUE: 1, + CONTRACT: 2 +}; + +/** + * @enum {number} + */ +proto.protocol.ReasonCode = { + REQUESTED: 0, + BAD_PROTOCOL: 2, + TOO_MANY_PEERS: 4, + DUPLICATE_PEER: 5, + INCOMPATIBLE_PROTOCOL: 6, + NULL_IDENTITY: 7, + PEER_QUITING: 8, + UNEXPECTED_IDENTITY: 9, + LOCAL_IDENTITY: 10, + PING_TIMEOUT: 11, + USER_REASON: 16, + RESET: 17, + SYNC_FAIL: 18, + FETCH_FAIL: 19, + BAD_TX: 20, + BAD_BLOCK: 21, + FORKED: 22, + UNLINKABLE: 23, + INCOMPATIBLE_VERSION: 24, + INCOMPATIBLE_CHAIN: 25, + TIME_OUT: 32, + CONNECT_FAIL: 33, + UNKNOWN: 255 +}; + +goog.object.extend(exports, proto.protocol); diff --git a/src/signer/chromeExtensionSigner.js b/src/signer/chromeExtensionSigner.js new file mode 100644 index 0000000..2e5acf5 --- /dev/null +++ b/src/signer/chromeExtensionSigner.js @@ -0,0 +1,84 @@ +const byteArray2hexStr = require("../utils/bytes").byteArray2hexStr; + +const TRONSCAN_TRANSACTION = "TRONSCAN_TRANSACTION"; +const TRONSCAN_TRANSACTION_RESPONSE = "TRONSCAN_TRANSACTION_RESPONSE"; +const TRONSCAN_PING = "TRONSCAN_PING"; +const TRONSCAN_PONG = "TRONSCAN_PONG"; +const TRONSCAN_REQUEST_ACCOUNT = "TRONSCAN_REQUEST_ACCOUNT"; + +class ChromeExtensionSigner { + + constructor() { + this.callbackId = 0; + } + + async isExtensionAvailable() { + let check = await this.sendMessage({ + type: TRONSCAN_PING, + }); + + return check.type === TRONSCAN_PONG; + } + + async getAccount() { + let {account} = await this.sendMessage({ + type: TRONSCAN_REQUEST_ACCOUNT, + }); + + return account; + } + + /** + * Send a message to the chrome extension + * + * @param data + * @returns {Promise} + */ + sendMessage(data) { + return new Promise(resolve => { + let callbackId = this.callbackId++; + + let responseCallback = (event) => { + console.log("CLIENT RESPONSE", event); + if ((event.data._fromClient !== true) && (event.data.callbackId === callbackId)) { + window.removeEventListener("message", responseCallback); + console.log("RESPONSE", event.data, event); + resolve(event.data); + } + }; + + window.addEventListener("message", responseCallback); + + window.postMessage(Object.assign({ + callbackId: callbackId, + _fromClient: true, + }, data), "*"); + }); + } + + /** + * Signs the given transaction object + * + * @param transactionObj Transaction + * @returns {Promise} + */ + async signTransaction(transactionObj) { + + let {transaction, rejected} = await this.sendMessage({ + type: TRONSCAN_TRANSACTION, + transaction: { + hex: byteArray2hexStr(transactionObj.serializeBinary()), + } + }); + + if (rejected === true) { + throw new Error("Rejected transaction"); + } + + return transaction; + } +} + +module.exports = { + ChromeExtensionSigner, +};