UNPKG

@kaiachain/kss-bridges-celer

Version:
832 lines (716 loc) 23 kB
// source: eth/staking.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.AcctAmtPair', null, global); goog.exportSymbol('proto.eth.Slash', null, global); goog.exportSymbol('proto.eth.StakingReward', 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.StakingReward = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.eth.StakingReward, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.eth.StakingReward.displayName = 'proto.eth.StakingReward'; } /** * 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.Slash = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.eth.Slash.repeatedFields_, null); }; goog.inherits(proto.eth.Slash, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.eth.Slash.displayName = 'proto.eth.Slash'; } /** * 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.AcctAmtPair = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.eth.AcctAmtPair, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.eth.AcctAmtPair.displayName = 'proto.eth.AcctAmtPair'; } 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.StakingReward.prototype.toObject = function(opt_includeInstance) { return proto.eth.StakingReward.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.StakingReward} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.StakingReward.toObject = function(includeInstance, msg) { var f, obj = { recipient: msg.getRecipient_asB64(), cumulativeRewardAmount: msg.getCumulativeRewardAmount_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.StakingReward} */ proto.eth.StakingReward.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.eth.StakingReward; return proto.eth.StakingReward.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.eth.StakingReward} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.eth.StakingReward} */ proto.eth.StakingReward.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.setCumulativeRewardAmount(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.eth.StakingReward.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.eth.StakingReward.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.StakingReward} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.StakingReward.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getRecipient_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getCumulativeRewardAmount_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes recipient = 1; * @return {!(string|Uint8Array)} */ proto.eth.StakingReward.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.StakingReward.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.StakingReward.prototype.getRecipient_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRecipient())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.StakingReward} returns this */ proto.eth.StakingReward.prototype.setRecipient = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes cumulative_reward_amount = 2; * @return {!(string|Uint8Array)} */ proto.eth.StakingReward.prototype.getCumulativeRewardAmount = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes cumulative_reward_amount = 2; * This is a type-conversion wrapper around `getCumulativeRewardAmount()` * @return {string} */ proto.eth.StakingReward.prototype.getCumulativeRewardAmount_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCumulativeRewardAmount())); }; /** * optional bytes cumulative_reward_amount = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCumulativeRewardAmount()` * @return {!Uint8Array} */ proto.eth.StakingReward.prototype.getCumulativeRewardAmount_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCumulativeRewardAmount())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.StakingReward} returns this */ proto.eth.StakingReward.prototype.setCumulativeRewardAmount = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.eth.Slash.repeatedFields_ = [6]; 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.Slash.prototype.toObject = function(opt_includeInstance) { return proto.eth.Slash.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.Slash} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.Slash.toObject = function(includeInstance, msg) { var f, obj = { validator: msg.getValidator_asB64(), nonce: jspb.Message.getFieldWithDefault(msg, 2, 0), slashFactor: jspb.Message.getFieldWithDefault(msg, 3, 0), expireTime: jspb.Message.getFieldWithDefault(msg, 4, 0), jailPeriod: jspb.Message.getFieldWithDefault(msg, 5, 0), collectorsList: jspb.Message.toObjectList(msg.getCollectorsList(), proto.eth.AcctAmtPair.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.eth.Slash} */ proto.eth.Slash.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.eth.Slash; return proto.eth.Slash.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.eth.Slash} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.eth.Slash} */ proto.eth.Slash.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.setValidator(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setNonce(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setSlashFactor(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setExpireTime(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setJailPeriod(value); break; case 6: var value = new proto.eth.AcctAmtPair; reader.readMessage(value,proto.eth.AcctAmtPair.deserializeBinaryFromReader); msg.addCollectors(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.eth.Slash.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.eth.Slash.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.Slash} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.Slash.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getValidator_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getNonce(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getSlashFactor(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getExpireTime(); if (f !== 0) { writer.writeUint64( 4, f ); } f = message.getJailPeriod(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getCollectorsList(); if (f.length > 0) { writer.writeRepeatedMessage( 6, f, proto.eth.AcctAmtPair.serializeBinaryToWriter ); } }; /** * optional bytes validator = 1; * @return {!(string|Uint8Array)} */ proto.eth.Slash.prototype.getValidator = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes validator = 1; * This is a type-conversion wrapper around `getValidator()` * @return {string} */ proto.eth.Slash.prototype.getValidator_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getValidator())); }; /** * optional bytes validator = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getValidator()` * @return {!Uint8Array} */ proto.eth.Slash.prototype.getValidator_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getValidator())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setValidator = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 nonce = 2; * @return {number} */ proto.eth.Slash.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 slash_factor = 3; * @return {number} */ proto.eth.Slash.prototype.getSlashFactor = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setSlashFactor = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 expire_time = 4; * @return {number} */ proto.eth.Slash.prototype.getExpireTime = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setExpireTime = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint64 jail_period = 5; * @return {number} */ proto.eth.Slash.prototype.getJailPeriod = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setJailPeriod = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * repeated AcctAmtPair collectors = 6; * @return {!Array<!proto.eth.AcctAmtPair>} */ proto.eth.Slash.prototype.getCollectorsList = function() { return /** @type{!Array<!proto.eth.AcctAmtPair>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.eth.AcctAmtPair, 6)); }; /** * @param {!Array<!proto.eth.AcctAmtPair>} value * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.setCollectorsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 6, value); }; /** * @param {!proto.eth.AcctAmtPair=} opt_value * @param {number=} opt_index * @return {!proto.eth.AcctAmtPair} */ proto.eth.Slash.prototype.addCollectors = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.eth.AcctAmtPair, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.eth.Slash} returns this */ proto.eth.Slash.prototype.clearCollectorsList = function() { return this.setCollectorsList([]); }; 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.AcctAmtPair.prototype.toObject = function(opt_includeInstance) { return proto.eth.AcctAmtPair.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.AcctAmtPair} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.AcctAmtPair.toObject = function(includeInstance, msg) { var f, obj = { account: msg.getAccount_asB64(), amount: msg.getAmount_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.AcctAmtPair} */ proto.eth.AcctAmtPair.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.eth.AcctAmtPair; return proto.eth.AcctAmtPair.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.eth.AcctAmtPair} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.eth.AcctAmtPair} */ proto.eth.AcctAmtPair.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.setAccount(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAmount(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.eth.AcctAmtPair.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.eth.AcctAmtPair.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.AcctAmtPair} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.eth.AcctAmtPair.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAccount_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getAmount_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes account = 1; * @return {!(string|Uint8Array)} */ proto.eth.AcctAmtPair.prototype.getAccount = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes account = 1; * This is a type-conversion wrapper around `getAccount()` * @return {string} */ proto.eth.AcctAmtPair.prototype.getAccount_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAccount())); }; /** * optional bytes account = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAccount()` * @return {!Uint8Array} */ proto.eth.AcctAmtPair.prototype.getAccount_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAccount())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.AcctAmtPair} returns this */ proto.eth.AcctAmtPair.prototype.setAccount = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes amount = 2; * @return {!(string|Uint8Array)} */ proto.eth.AcctAmtPair.prototype.getAmount = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes amount = 2; * This is a type-conversion wrapper around `getAmount()` * @return {string} */ proto.eth.AcctAmtPair.prototype.getAmount_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAmount())); }; /** * optional bytes amount = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAmount()` * @return {!Uint8Array} */ proto.eth.AcctAmtPair.prototype.getAmount_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAmount())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.eth.AcctAmtPair} returns this */ proto.eth.AcctAmtPair.prototype.setAmount = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; goog.object.extend(exports, proto.eth);