UNPKG

@tronscan/client

Version:
1,597 lines (1,366 loc) 276 kB
/** * @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.AccountPermissionUpdateContract', 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.BuyStorageBytesContract', null, global); goog.exportSymbol('proto.protocol.BuyStorageContract', null, global); goog.exportSymbol('proto.protocol.ClearABIContract', null, global); goog.exportSymbol('proto.protocol.CreateSmartContract', null, global); goog.exportSymbol('proto.protocol.ExchangeCreateContract', null, global); goog.exportSymbol('proto.protocol.ExchangeInjectContract', null, global); goog.exportSymbol('proto.protocol.ExchangeTransactionContract', null, global); goog.exportSymbol('proto.protocol.ExchangeWithdrawContract', null, global); goog.exportSymbol('proto.protocol.FreezeBalanceContract', null, global); goog.exportSymbol('proto.protocol.ParticipateAssetIssueContract', null, global); goog.exportSymbol('proto.protocol.ProposalApproveContract', null, global); goog.exportSymbol('proto.protocol.ProposalCreateContract', null, global); goog.exportSymbol('proto.protocol.ProposalDeleteContract', null, global); goog.exportSymbol('proto.protocol.ResourceCode', null, global); goog.exportSymbol('proto.protocol.SellStorageContract', null, global); goog.exportSymbol('proto.protocol.SetAccountIdContract', null, global); goog.exportSymbol('proto.protocol.TransferAssetContract', null, global); goog.exportSymbol('proto.protocol.TransferContract', null, global); goog.exportSymbol('proto.protocol.TriggerSmartContract', 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.UpdateBrokerageContract', null, global); goog.exportSymbol('proto.protocol.UpdateEnergyLimitContract', null, global); goog.exportSymbol('proto.protocol.UpdateSettingContract', 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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.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 = { ownerAddress: msg.getOwnerAddress_asB64(), accountAddress: msg.getAccountAddress_asB64(), type: 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.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 {!Uint8Array} */ (reader.readBytes()); msg.setOwnerAddress(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAccountAddress(value); break; case 3: var value = /** @type {!proto.protocol.AccountType} */ (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.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.getOwnerAddress_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getAccountAddress_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getType(); if (f !== 0.0) { writer.writeEnum( 3, f ); } }; /** * optional bytes owner_address = 1; * @return {!(string|Uint8Array)} */ proto.protocol.AccountCreateContract.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.AccountCreateContract.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.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, 1, value); }; /** * optional bytes account_address = 2; * @return {!(string|Uint8Array)} */ proto.protocol.AccountCreateContract.prototype.getAccountAddress = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes account_address = 2; * This is a type-conversion wrapper around `getAccountAddress()` * @return {string} */ proto.protocol.AccountCreateContract.prototype.getAccountAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAccountAddress())); }; /** * optional bytes account_address = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAccountAddress()` * @return {!Uint8Array} */ proto.protocol.AccountCreateContract.prototype.getAccountAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAccountAddress())); }; /** @param {!(string|Uint8Array)} value */ proto.protocol.AccountCreateContract.prototype.setAccountAddress = function(value) { jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional AccountType type = 3; * @return {!proto.protocol.AccountType} */ proto.protocol.AccountCreateContract.prototype.getType = function() { return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** @param {!proto.protocol.AccountType} value */ proto.protocol.AccountCreateContract.prototype.setType = function(value) { jspb.Message.setProto3EnumField(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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.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.SetAccountIdContract = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.SetAccountIdContract, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.protocol.SetAccountIdContract.displayName = 'proto.protocol.SetAccountIdContract'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.SetAccountIdContract.prototype.toObject = function(opt_includeInstance) { return proto.protocol.SetAccountIdContract.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.SetAccountIdContract} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.protocol.SetAccountIdContract.toObject = function(includeInstance, msg) { var f, obj = { accountId: msg.getAccountId_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.SetAccountIdContract} */ proto.protocol.SetAccountIdContract.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.protocol.SetAccountIdContract; return proto.protocol.SetAccountIdContract.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.protocol.SetAccountIdContract} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.SetAccountIdContract} */ proto.protocol.SetAccountIdContract.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.setAccountId(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.SetAccountIdContract.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.protocol.SetAccountIdContract.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.SetAccountIdContract} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.protocol.SetAccountIdContract.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAccountId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getOwnerAddress_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes account_id = 1; * @return {!(string|Uint8Array)} */ proto.protocol.SetAccountIdContract.prototype.getAccountId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes account_id = 1; * This is a type-conversion wrapper around `getAccountId()` * @return {string} */ proto.protocol.SetAccountIdContract.prototype.getAccountId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAccountId())); }; /** * optional bytes account_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAccountId()` * @return {!Uint8Array} */ proto.protocol.SetAccountIdContract.prototype.getAccountId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAccountId())); }; /** @param {!(string|Uint8Array)} value */ proto.protocol.SetAccountIdContract.prototype.setAccountId = function(value) { jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes owner_address = 2; * @return {!(string|Uint8Array)} */ proto.protocol.SetAccountIdContract.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.SetAccountIdContract.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.SetAccountIdContract.prototype.getOwnerAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOwnerAddress())); }; /** @param {!(string|Uint8Array)} value */ proto.protocol.SetAccountIdContract.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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.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; } console.log('obj',obj) 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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.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<number>} * @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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.protocol.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<!Uint8Array>|Array<string>)} */ proto.protocol.VoteAssetContract.prototype.getVoteAddressList = function() { return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 2)); }; /** * repeated bytes vote_address = 2; * This is a type-conversion wrapper around `getVoteAddressList()` * @return {!Array.<string>} */ proto.protocol.VoteAssetContract.prototype.getVoteAddressList_asB64 = function() { return /** @type {!Array.<string>} */ (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.<!Uint8Array>} */ proto.protocol.VoteAssetContract.prototype.getVoteAddressList_asU8 = function() { return /** @type {!Array.<!Uint8Array>} */ (jspb.Message.bytesListAsU8( this.getVoteAddressList())); }; /** @param {!(Array<!Uint8Array>|Array<string>)} 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<number>} * @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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeIns