UNPKG

@kaiachain/kss-bridges-celer

Version:
1,493 lines (1,288 loc) 44 kB
// source: sgn/slashing/v1/slashing.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @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! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { if (this) { return this; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } if (typeof self !== 'undefined') { return self; } return Function('return this')(); }.call(null)); var gogoproto_gogo_pb = require('../../../gogoproto/gogo_pb.js'); goog.object.extend(proto, gogoproto_gogo_pb); var cosmos_proto_cosmos_pb = require('../../../cosmos_proto/cosmos_pb.js'); goog.object.extend(proto, cosmos_proto_cosmos_pb); var sgn_common_v1_common_pb = require('../../../sgn/common/v1/common_pb.js'); goog.object.extend(proto, sgn_common_v1_common_pb); goog.exportSymbol('proto.sgn.slashing.v1.AcctAmtPair', null, global); goog.exportSymbol('proto.sgn.slashing.v1.Params', null, global); goog.exportSymbol('proto.sgn.slashing.v1.QuerySlashParams', null, global); goog.exportSymbol('proto.sgn.slashing.v1.Slash', null, global); goog.exportSymbol('proto.sgn.slashing.v1.SlashOnChain', 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.sgn.slashing.v1.Params = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.sgn.slashing.v1.Params, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sgn.slashing.v1.Params.displayName = 'proto.sgn.slashing.v1.Params'; } /** * 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.sgn.slashing.v1.Slash = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.sgn.slashing.v1.Slash.repeatedFields_, null); }; goog.inherits(proto.sgn.slashing.v1.Slash, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sgn.slashing.v1.Slash.displayName = 'proto.sgn.slashing.v1.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.sgn.slashing.v1.SlashOnChain = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.sgn.slashing.v1.SlashOnChain.repeatedFields_, null); }; goog.inherits(proto.sgn.slashing.v1.SlashOnChain, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sgn.slashing.v1.SlashOnChain.displayName = 'proto.sgn.slashing.v1.SlashOnChain'; } /** * 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.sgn.slashing.v1.AcctAmtPair = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.sgn.slashing.v1.AcctAmtPair, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sgn.slashing.v1.AcctAmtPair.displayName = 'proto.sgn.slashing.v1.AcctAmtPair'; } /** * 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.sgn.slashing.v1.QuerySlashParams = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.sgn.slashing.v1.QuerySlashParams, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sgn.slashing.v1.QuerySlashParams.displayName = 'proto.sgn.slashing.v1.QuerySlashParams'; } 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.sgn.slashing.v1.Params.prototype.toObject = function(opt_includeInstance) { return proto.sgn.slashing.v1.Params.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.sgn.slashing.v1.Params} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.Params.toObject = function(includeInstance, msg) { var f, obj = { enableSlash: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), signedBlocksWindow: jspb.Message.getFieldWithDefault(msg, 2, 0), slashTimeout: jspb.Message.getFieldWithDefault(msg, 3, 0), slashFactorDoubleSign: jspb.Message.getFieldWithDefault(msg, 4, 0), slashFactorDowntime: jspb.Message.getFieldWithDefault(msg, 5, 0), jailPeriod: jspb.Message.getFieldWithDefault(msg, 6, 0), minSignedPerWindow: msg.getMinSignedPerWindow_asB64(), stakingContract: (f = msg.getStakingContract()) && sgn_common_v1_common_pb.ContractInfo.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.sgn.slashing.v1.Params} */ proto.sgn.slashing.v1.Params.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sgn.slashing.v1.Params; return proto.sgn.slashing.v1.Params.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sgn.slashing.v1.Params} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sgn.slashing.v1.Params} */ proto.sgn.slashing.v1.Params.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {boolean} */ (reader.readBool()); msg.setEnableSlash(value); break; case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setSignedBlocksWindow(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setSlashTimeout(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setSlashFactorDoubleSign(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setSlashFactorDowntime(value); break; case 6: var value = /** @type {number} */ (reader.readUint64()); msg.setJailPeriod(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setMinSignedPerWindow(value); break; case 8: var value = new sgn_common_v1_common_pb.ContractInfo; reader.readMessage(value,sgn_common_v1_common_pb.ContractInfo.deserializeBinaryFromReader); msg.setStakingContract(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.sgn.slashing.v1.Params.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sgn.slashing.v1.Params.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.sgn.slashing.v1.Params} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.Params.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getEnableSlash(); if (f) { writer.writeBool( 1, f ); } f = message.getSignedBlocksWindow(); if (f !== 0) { writer.writeInt64( 2, f ); } f = message.getSlashTimeout(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getSlashFactorDoubleSign(); if (f !== 0) { writer.writeUint64( 4, f ); } f = message.getSlashFactorDowntime(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getJailPeriod(); if (f !== 0) { writer.writeUint64( 6, f ); } f = message.getMinSignedPerWindow_asU8(); if (f.length > 0) { writer.writeBytes( 7, f ); } f = message.getStakingContract(); if (f != null) { writer.writeMessage( 8, f, sgn_common_v1_common_pb.ContractInfo.serializeBinaryToWriter ); } }; /** * optional bool enable_slash = 1; * @return {boolean} */ proto.sgn.slashing.v1.Params.prototype.getEnableSlash = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); }; /** * @param {boolean} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setEnableSlash = function(value) { return jspb.Message.setProto3BooleanField(this, 1, value); }; /** * optional int64 signed_blocks_window = 2; * @return {number} */ proto.sgn.slashing.v1.Params.prototype.getSignedBlocksWindow = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setSignedBlocksWindow = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 slash_timeout = 3; * @return {number} */ proto.sgn.slashing.v1.Params.prototype.getSlashTimeout = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setSlashTimeout = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 slash_factor_double_sign = 4; * @return {number} */ proto.sgn.slashing.v1.Params.prototype.getSlashFactorDoubleSign = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setSlashFactorDoubleSign = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint64 slash_factor_downtime = 5; * @return {number} */ proto.sgn.slashing.v1.Params.prototype.getSlashFactorDowntime = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setSlashFactorDowntime = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional uint64 jail_period = 6; * @return {number} */ proto.sgn.slashing.v1.Params.prototype.getJailPeriod = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setJailPeriod = function(value) { return jspb.Message.setProto3IntField(this, 6, value); }; /** * optional bytes min_signed_per_window = 7; * @return {!(string|Uint8Array)} */ proto.sgn.slashing.v1.Params.prototype.getMinSignedPerWindow = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes min_signed_per_window = 7; * This is a type-conversion wrapper around `getMinSignedPerWindow()` * @return {string} */ proto.sgn.slashing.v1.Params.prototype.getMinSignedPerWindow_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getMinSignedPerWindow())); }; /** * optional bytes min_signed_per_window = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getMinSignedPerWindow()` * @return {!Uint8Array} */ proto.sgn.slashing.v1.Params.prototype.getMinSignedPerWindow_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getMinSignedPerWindow())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setMinSignedPerWindow = function(value) { return jspb.Message.setProto3BytesField(this, 7, value); }; /** * optional sgn.common.v1.ContractInfo staking_contract = 8; * @return {?proto.sgn.common.v1.ContractInfo} */ proto.sgn.slashing.v1.Params.prototype.getStakingContract = function() { return /** @type{?proto.sgn.common.v1.ContractInfo} */ ( jspb.Message.getWrapperField(this, sgn_common_v1_common_pb.ContractInfo, 8)); }; /** * @param {?proto.sgn.common.v1.ContractInfo|undefined} value * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.setStakingContract = function(value) { return jspb.Message.setWrapperField(this, 8, value); }; /** * Clears the message field making it undefined. * @return {!proto.sgn.slashing.v1.Params} returns this */ proto.sgn.slashing.v1.Params.prototype.clearStakingContract = function() { return this.setStakingContract(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.sgn.slashing.v1.Params.prototype.hasStakingContract = function() { return jspb.Message.getField(this, 8) != null; }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.sgn.slashing.v1.Slash.repeatedFields_ = [3]; 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.sgn.slashing.v1.Slash.prototype.toObject = function(opt_includeInstance) { return proto.sgn.slashing.v1.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.sgn.slashing.v1.Slash} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.Slash.toObject = function(includeInstance, msg) { var f, obj = { slashOnChain: (f = msg.getSlashOnChain()) && proto.sgn.slashing.v1.SlashOnChain.toObject(includeInstance, f), slashBytes: msg.getSlashBytes_asB64(), signaturesList: jspb.Message.toObjectList(msg.getSignaturesList(), sgn_common_v1_common_pb.Signature.toObject, includeInstance), reason: jspb.Message.getFieldWithDefault(msg, 4, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.sgn.slashing.v1.Slash} */ proto.sgn.slashing.v1.Slash.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sgn.slashing.v1.Slash; return proto.sgn.slashing.v1.Slash.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sgn.slashing.v1.Slash} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sgn.slashing.v1.Slash} */ proto.sgn.slashing.v1.Slash.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.sgn.slashing.v1.SlashOnChain; reader.readMessage(value,proto.sgn.slashing.v1.SlashOnChain.deserializeBinaryFromReader); msg.setSlashOnChain(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSlashBytes(value); break; case 3: var value = new sgn_common_v1_common_pb.Signature; reader.readMessage(value,sgn_common_v1_common_pb.Signature.deserializeBinaryFromReader); msg.addSignatures(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setReason(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.sgn.slashing.v1.Slash.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sgn.slashing.v1.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.sgn.slashing.v1.Slash} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.Slash.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSlashOnChain(); if (f != null) { writer.writeMessage( 1, f, proto.sgn.slashing.v1.SlashOnChain.serializeBinaryToWriter ); } f = message.getSlashBytes_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getSignaturesList(); if (f.length > 0) { writer.writeRepeatedMessage( 3, f, sgn_common_v1_common_pb.Signature.serializeBinaryToWriter ); } f = message.getReason(); if (f.length > 0) { writer.writeString( 4, f ); } }; /** * optional SlashOnChain slash_on_chain = 1; * @return {?proto.sgn.slashing.v1.SlashOnChain} */ proto.sgn.slashing.v1.Slash.prototype.getSlashOnChain = function() { return /** @type{?proto.sgn.slashing.v1.SlashOnChain} */ ( jspb.Message.getWrapperField(this, proto.sgn.slashing.v1.SlashOnChain, 1)); }; /** * @param {?proto.sgn.slashing.v1.SlashOnChain|undefined} value * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.setSlashOnChain = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.clearSlashOnChain = function() { return this.setSlashOnChain(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.sgn.slashing.v1.Slash.prototype.hasSlashOnChain = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional bytes slash_bytes = 2; * @return {!(string|Uint8Array)} */ proto.sgn.slashing.v1.Slash.prototype.getSlashBytes = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes slash_bytes = 2; * This is a type-conversion wrapper around `getSlashBytes()` * @return {string} */ proto.sgn.slashing.v1.Slash.prototype.getSlashBytes_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSlashBytes())); }; /** * optional bytes slash_bytes = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSlashBytes()` * @return {!Uint8Array} */ proto.sgn.slashing.v1.Slash.prototype.getSlashBytes_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSlashBytes())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.setSlashBytes = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * repeated sgn.common.v1.Signature signatures = 3; * @return {!Array<!proto.sgn.common.v1.Signature>} */ proto.sgn.slashing.v1.Slash.prototype.getSignaturesList = function() { return /** @type{!Array<!proto.sgn.common.v1.Signature>} */ ( jspb.Message.getRepeatedWrapperField(this, sgn_common_v1_common_pb.Signature, 3)); }; /** * @param {!Array<!proto.sgn.common.v1.Signature>} value * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.setSignaturesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 3, value); }; /** * @param {!proto.sgn.common.v1.Signature=} opt_value * @param {number=} opt_index * @return {!proto.sgn.common.v1.Signature} */ proto.sgn.slashing.v1.Slash.prototype.addSignatures = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.sgn.common.v1.Signature, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.clearSignaturesList = function() { return this.setSignaturesList([]); }; /** * optional string reason = 4; * @return {string} */ proto.sgn.slashing.v1.Slash.prototype.getReason = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.sgn.slashing.v1.Slash} returns this */ proto.sgn.slashing.v1.Slash.prototype.setReason = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.SlashOnChain.prototype.toObject = function(opt_includeInstance) { return proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.SlashOnChain} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.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.sgn.slashing.v1.SlashOnChain} */ proto.sgn.slashing.v1.SlashOnChain.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sgn.slashing.v1.SlashOnChain; return proto.sgn.slashing.v1.SlashOnChain.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sgn.slashing.v1.SlashOnChain} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sgn.slashing.v1.SlashOnChain} */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.AcctAmtPair; reader.readMessage(value,proto.sgn.slashing.v1.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.sgn.slashing.v1.SlashOnChain.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sgn.slashing.v1.SlashOnChain.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.sgn.slashing.v1.SlashOnChain} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.AcctAmtPair.serializeBinaryToWriter ); } }; /** * optional bytes validator = 1; * @return {!(string|Uint8Array)} */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.SlashOnChain.prototype.getValidator_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getValidator())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setValidator = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 nonce = 2; * @return {number} */ proto.sgn.slashing.v1.SlashOnChain.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 slash_factor = 3; * @return {number} */ proto.sgn.slashing.v1.SlashOnChain.prototype.getSlashFactor = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setSlashFactor = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 expire_time = 4; * @return {number} */ proto.sgn.slashing.v1.SlashOnChain.prototype.getExpireTime = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setExpireTime = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint64 jail_period = 5; * @return {number} */ proto.sgn.slashing.v1.SlashOnChain.prototype.getJailPeriod = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setJailPeriod = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * repeated AcctAmtPair collectors = 6; * @return {!Array<!proto.sgn.slashing.v1.AcctAmtPair>} */ proto.sgn.slashing.v1.SlashOnChain.prototype.getCollectorsList = function() { return /** @type{!Array<!proto.sgn.slashing.v1.AcctAmtPair>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.sgn.slashing.v1.AcctAmtPair, 6)); }; /** * @param {!Array<!proto.sgn.slashing.v1.AcctAmtPair>} value * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.prototype.setCollectorsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 6, value); }; /** * @param {!proto.sgn.slashing.v1.AcctAmtPair=} opt_value * @param {number=} opt_index * @return {!proto.sgn.slashing.v1.AcctAmtPair} */ proto.sgn.slashing.v1.SlashOnChain.prototype.addCollectors = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.sgn.slashing.v1.AcctAmtPair, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.sgn.slashing.v1.SlashOnChain} returns this */ proto.sgn.slashing.v1.SlashOnChain.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.sgn.slashing.v1.AcctAmtPair.prototype.toObject = function(opt_includeInstance) { return proto.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair} */ proto.sgn.slashing.v1.AcctAmtPair.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sgn.slashing.v1.AcctAmtPair; return proto.sgn.slashing.v1.AcctAmtPair.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sgn.slashing.v1.AcctAmtPair} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sgn.slashing.v1.AcctAmtPair} */ proto.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.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.sgn.slashing.v1.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.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair.prototype.getAccount_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAccount())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sgn.slashing.v1.AcctAmtPair} returns this */ proto.sgn.slashing.v1.AcctAmtPair.prototype.setAccount = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes amount = 2; * @return {!(string|Uint8Array)} */ proto.sgn.slashing.v1.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.sgn.slashing.v1.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.sgn.slashing.v1.AcctAmtPair.prototype.getAmount_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAmount())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sgn.slashing.v1.AcctAmtPair} returns this */ proto.sgn.slashing.v1.AcctAmtPair.prototype.setAmount = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; 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.sgn.slashing.v1.QuerySlashParams.prototype.toObject = function(opt_includeInstance) { return proto.sgn.slashing.v1.QuerySlashParams.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.sgn.slashing.v1.QuerySlashParams} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.QuerySlashParams.toObject = function(includeInstance, msg) { var f, obj = { nonce: 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.sgn.slashing.v1.QuerySlashParams} */ proto.sgn.slashing.v1.QuerySlashParams.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sgn.slashing.v1.QuerySlashParams; return proto.sgn.slashing.v1.QuerySlashParams.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sgn.slashing.v1.QuerySlashParams} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sgn.slashing.v1.QuerySlashParams} */ proto.sgn.slashing.v1.QuerySlashParams.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint64()); msg.setNonce(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.sgn.slashing.v1.QuerySlashParams.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sgn.slashing.v1.QuerySlashParams.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.sgn.slashing.v1.QuerySlashParams} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sgn.slashing.v1.QuerySlashParams.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNonce(); if (f !== 0) { writer.writeUint64( 1, f ); } }; /** * optional uint64 nonce = 1; * @return {number} */ proto.sgn.slashing.v1.QuerySlashParams.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.sgn.slashing.v1.QuerySlashParams} returns this */ proto.sgn.slashing.v1.QuerySlashParams.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; goog.object.extend(exports, proto.sgn.slashing.v1);