UNPKG

@kaiachain/kss-bridges-celer

Version:
399 lines (339 loc) 11.6 kB
// source: eth/farming.proto /** * @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.eth.FarmingRewards', 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.eth.FarmingRewards = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.eth.FarmingRewards.repeatedFields_, null); }; goog.inherits(proto.eth.FarmingRewards, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.eth.FarmingRewards.displayName = 'proto.eth.FarmingRewards'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.eth.FarmingRewards.repeatedFields_ = [3,4]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.eth.FarmingRewards.prototype.toObject = function(opt_includeInstance) { return proto.eth.FarmingRewards.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.eth.FarmingRewards} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.FarmingRewards.toObject = function(includeInstance, msg) { var f, obj = { recipient: msg.getRecipient_asB64(), chainId: msg.getChainId_asB64(), tokenAddressesList: msg.getTokenAddressesList_asB64(), cumulativeRewardAmountsList: msg.getCumulativeRewardAmountsList_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.eth.FarmingRewards} */ proto.eth.FarmingRewards.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.eth.FarmingRewards; return proto.eth.FarmingRewards.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.eth.FarmingRewards} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.eth.FarmingRewards} */ proto.eth.FarmingRewards.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.setRecipient(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setChainId(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.addTokenAddresses(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.addCumulativeRewardAmounts(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.eth.FarmingRewards.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.eth.FarmingRewards.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.eth.FarmingRewards} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.FarmingRewards.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getRecipient_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getChainId_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getTokenAddressesList_asU8(); if (f.length > 0) { writer.writeRepeatedBytes( 3, f ); } f = message.getCumulativeRewardAmountsList_asU8(); if (f.length > 0) { writer.writeRepeatedBytes( 4, f ); } }; /** * optional bytes recipient = 1; * @return {!(string|Uint8Array)} */ proto.eth.FarmingRewards.prototype.getRecipient = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes recipient = 1; * This is a type-conversion wrapper around `getRecipient()` * @return {string} */ proto.eth.FarmingRewards.prototype.getRecipient_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getRecipient())); }; /** * optional bytes recipient = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getRecipient()` * @return {!Uint8Array} */ proto.eth.FarmingRewards.prototype.getRecipient_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRecipient())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.setRecipient = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes chain_id = 2; * @return {!(string|Uint8Array)} */ proto.eth.FarmingRewards.prototype.getChainId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes chain_id = 2; * This is a type-conversion wrapper around `getChainId()` * @return {string} */ proto.eth.FarmingRewards.prototype.getChainId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getChainId())); }; /** * optional bytes chain_id = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getChainId()` * @return {!Uint8Array} */ proto.eth.FarmingRewards.prototype.getChainId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getChainId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.setChainId = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * repeated bytes token_addresses = 3; * @return {!(Array<!Uint8Array>|Array<string>)} */ proto.eth.FarmingRewards.prototype.getTokenAddressesList = function() { return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 3)); }; /** * repeated bytes token_addresses = 3; * This is a type-conversion wrapper around `getTokenAddressesList()` * @return {!Array<string>} */ proto.eth.FarmingRewards.prototype.getTokenAddressesList_asB64 = function() { return /** @type {!Array<string>} */ (jspb.Message.bytesListAsB64( this.getTokenAddressesList())); }; /** * repeated bytes token_addresses = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getTokenAddressesList()` * @return {!Array<!Uint8Array>} */ proto.eth.FarmingRewards.prototype.getTokenAddressesList_asU8 = function() { return /** @type {!Array<!Uint8Array>} */ (jspb.Message.bytesListAsU8( this.getTokenAddressesList())); }; /** * @param {!(Array<!Uint8Array>|Array<string>)} value * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.setTokenAddressesList = function(value) { return jspb.Message.setField(this, 3, value || []); }; /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.addTokenAddresses = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 3, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.clearTokenAddressesList = function() { return this.setTokenAddressesList([]); }; /** * repeated bytes cumulative_reward_amounts = 4; * @return {!(Array<!Uint8Array>|Array<string>)} */ proto.eth.FarmingRewards.prototype.getCumulativeRewardAmountsList = function() { return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 4)); }; /** * repeated bytes cumulative_reward_amounts = 4; * This is a type-conversion wrapper around `getCumulativeRewardAmountsList()` * @return {!Array<string>} */ proto.eth.FarmingRewards.prototype.getCumulativeRewardAmountsList_asB64 = function() { return /** @type {!Array<string>} */ (jspb.Message.bytesListAsB64( this.getCumulativeRewardAmountsList())); }; /** * repeated bytes cumulative_reward_amounts = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCumulativeRewardAmountsList()` * @return {!Array<!Uint8Array>} */ proto.eth.FarmingRewards.prototype.getCumulativeRewardAmountsList_asU8 = function() { return /** @type {!Array<!Uint8Array>} */ (jspb.Message.bytesListAsU8( this.getCumulativeRewardAmountsList())); }; /** * @param {!(Array<!Uint8Array>|Array<string>)} value * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.setCumulativeRewardAmountsList = function(value) { return jspb.Message.setField(this, 4, value || []); }; /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.addCumulativeRewardAmounts = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 4, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.eth.FarmingRewards} returns this */ proto.eth.FarmingRewards.prototype.clearCumulativeRewardAmountsList = function() { return this.setCumulativeRewardAmountsList([]); }; goog.object.extend(exports, proto.eth);