github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/tendermint/crypto/keys_pb.js (about) 1 // source: tendermint/crypto/keys.proto 2 /** 3 * @fileoverview 4 * @enhanceable 5 * @suppress {missingRequire} reports error on implicit type usages. 6 * @suppress {messageConventions} JS Compiler reports an error if a variable or 7 * field starts with 'MSG_' and isn't a translatable message. 8 * @public 9 */ 10 // GENERATED CODE -- DO NOT EDIT! 11 /* eslint-disable */ 12 // @ts-nocheck 13 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = Function('return this')(); 17 18 var gogoproto_gogo_pb = require('../../gogoproto/gogo_pb.js'); 19 goog.object.extend(proto, gogoproto_gogo_pb); 20 goog.exportSymbol('proto.tendermint.crypto.PublicKey', null, global); 21 goog.exportSymbol('proto.tendermint.crypto.PublicKey.SumCase', null, global); 22 /** 23 * Generated by JsPbCodeGenerator. 24 * @param {Array=} opt_data Optional initial data array, typically from a 25 * server response, or constructed directly in Javascript. The array is used 26 * in place and becomes part of the constructed object. It is not cloned. 27 * If no data is provided, the constructed object will be empty, but still 28 * valid. 29 * @extends {jspb.Message} 30 * @constructor 31 */ 32 proto.tendermint.crypto.PublicKey = function(opt_data) { 33 jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tendermint.crypto.PublicKey.oneofGroups_); 34 }; 35 goog.inherits(proto.tendermint.crypto.PublicKey, jspb.Message); 36 if (goog.DEBUG && !COMPILED) { 37 /** 38 * @public 39 * @override 40 */ 41 proto.tendermint.crypto.PublicKey.displayName = 'proto.tendermint.crypto.PublicKey'; 42 } 43 44 /** 45 * Oneof group definitions for this message. Each group defines the field 46 * numbers belonging to that group. When of these fields' value is set, all 47 * other fields in the group are cleared. During deserialization, if multiple 48 * fields are encountered for a group, only the last value seen will be kept. 49 * @private {!Array<!Array<number>>} 50 * @const 51 */ 52 proto.tendermint.crypto.PublicKey.oneofGroups_ = [[1,2]]; 53 54 /** 55 * @enum {number} 56 */ 57 proto.tendermint.crypto.PublicKey.SumCase = { 58 SUM_NOT_SET: 0, 59 ED25519: 1, 60 SECP256K1: 2 61 }; 62 63 /** 64 * @return {proto.tendermint.crypto.PublicKey.SumCase} 65 */ 66 proto.tendermint.crypto.PublicKey.prototype.getSumCase = function() { 67 return /** @type {proto.tendermint.crypto.PublicKey.SumCase} */(jspb.Message.computeOneofCase(this, proto.tendermint.crypto.PublicKey.oneofGroups_[0])); 68 }; 69 70 71 72 if (jspb.Message.GENERATE_TO_OBJECT) { 73 /** 74 * Creates an object representation of this proto. 75 * Field names that are reserved in JavaScript and will be renamed to pb_name. 76 * Optional fields that are not set will be set to undefined. 77 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 78 * For the list of reserved names please see: 79 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 80 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 81 * JSPB instance for transitional soy proto support: 82 * http://goto/soy-param-migration 83 * @return {!Object} 84 */ 85 proto.tendermint.crypto.PublicKey.prototype.toObject = function(opt_includeInstance) { 86 return proto.tendermint.crypto.PublicKey.toObject(opt_includeInstance, this); 87 }; 88 89 90 /** 91 * Static version of the {@see toObject} method. 92 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 93 * the JSPB instance for transitional soy proto support: 94 * http://goto/soy-param-migration 95 * @param {!proto.tendermint.crypto.PublicKey} msg The msg instance to transform. 96 * @return {!Object} 97 * @suppress {unusedLocalVariables} f is only used for nested messages 98 */ 99 proto.tendermint.crypto.PublicKey.toObject = function(includeInstance, msg) { 100 var f, obj = { 101 ed25519: msg.getEd25519_asB64(), 102 secp256k1: msg.getSecp256k1_asB64() 103 }; 104 105 if (includeInstance) { 106 obj.$jspbMessageInstance = msg; 107 } 108 return obj; 109 }; 110 } 111 112 113 /** 114 * Deserializes binary data (in protobuf wire format). 115 * @param {jspb.ByteSource} bytes The bytes to deserialize. 116 * @return {!proto.tendermint.crypto.PublicKey} 117 */ 118 proto.tendermint.crypto.PublicKey.deserializeBinary = function(bytes) { 119 var reader = new jspb.BinaryReader(bytes); 120 var msg = new proto.tendermint.crypto.PublicKey; 121 return proto.tendermint.crypto.PublicKey.deserializeBinaryFromReader(msg, reader); 122 }; 123 124 125 /** 126 * Deserializes binary data (in protobuf wire format) from the 127 * given reader into the given message object. 128 * @param {!proto.tendermint.crypto.PublicKey} msg The message object to deserialize into. 129 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 130 * @return {!proto.tendermint.crypto.PublicKey} 131 */ 132 proto.tendermint.crypto.PublicKey.deserializeBinaryFromReader = function(msg, reader) { 133 while (reader.nextField()) { 134 if (reader.isEndGroup()) { 135 break; 136 } 137 var field = reader.getFieldNumber(); 138 switch (field) { 139 case 1: 140 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 141 msg.setEd25519(value); 142 break; 143 case 2: 144 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 145 msg.setSecp256k1(value); 146 break; 147 default: 148 reader.skipField(); 149 break; 150 } 151 } 152 return msg; 153 }; 154 155 156 /** 157 * Serializes the message to binary data (in protobuf wire format). 158 * @return {!Uint8Array} 159 */ 160 proto.tendermint.crypto.PublicKey.prototype.serializeBinary = function() { 161 var writer = new jspb.BinaryWriter(); 162 proto.tendermint.crypto.PublicKey.serializeBinaryToWriter(this, writer); 163 return writer.getResultBuffer(); 164 }; 165 166 167 /** 168 * Serializes the given message to binary data (in protobuf wire 169 * format), writing to the given BinaryWriter. 170 * @param {!proto.tendermint.crypto.PublicKey} message 171 * @param {!jspb.BinaryWriter} writer 172 * @suppress {unusedLocalVariables} f is only used for nested messages 173 */ 174 proto.tendermint.crypto.PublicKey.serializeBinaryToWriter = function(message, writer) { 175 var f = undefined; 176 f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); 177 if (f != null) { 178 writer.writeBytes( 179 1, 180 f 181 ); 182 } 183 f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); 184 if (f != null) { 185 writer.writeBytes( 186 2, 187 f 188 ); 189 } 190 }; 191 192 193 /** 194 * optional bytes ed25519 = 1; 195 * @return {!(string|Uint8Array)} 196 */ 197 proto.tendermint.crypto.PublicKey.prototype.getEd25519 = function() { 198 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 199 }; 200 201 202 /** 203 * optional bytes ed25519 = 1; 204 * This is a type-conversion wrapper around `getEd25519()` 205 * @return {string} 206 */ 207 proto.tendermint.crypto.PublicKey.prototype.getEd25519_asB64 = function() { 208 return /** @type {string} */ (jspb.Message.bytesAsB64( 209 this.getEd25519())); 210 }; 211 212 213 /** 214 * optional bytes ed25519 = 1; 215 * Note that Uint8Array is not supported on all browsers. 216 * @see http://caniuse.com/Uint8Array 217 * This is a type-conversion wrapper around `getEd25519()` 218 * @return {!Uint8Array} 219 */ 220 proto.tendermint.crypto.PublicKey.prototype.getEd25519_asU8 = function() { 221 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 222 this.getEd25519())); 223 }; 224 225 226 /** 227 * @param {!(string|Uint8Array)} value 228 * @return {!proto.tendermint.crypto.PublicKey} returns this 229 */ 230 proto.tendermint.crypto.PublicKey.prototype.setEd25519 = function(value) { 231 return jspb.Message.setOneofField(this, 1, proto.tendermint.crypto.PublicKey.oneofGroups_[0], value); 232 }; 233 234 235 /** 236 * Clears the field making it undefined. 237 * @return {!proto.tendermint.crypto.PublicKey} returns this 238 */ 239 proto.tendermint.crypto.PublicKey.prototype.clearEd25519 = function() { 240 return jspb.Message.setOneofField(this, 1, proto.tendermint.crypto.PublicKey.oneofGroups_[0], undefined); 241 }; 242 243 244 /** 245 * Returns whether this field is set. 246 * @return {boolean} 247 */ 248 proto.tendermint.crypto.PublicKey.prototype.hasEd25519 = function() { 249 return jspb.Message.getField(this, 1) != null; 250 }; 251 252 253 /** 254 * optional bytes secp256k1 = 2; 255 * @return {!(string|Uint8Array)} 256 */ 257 proto.tendermint.crypto.PublicKey.prototype.getSecp256k1 = function() { 258 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 259 }; 260 261 262 /** 263 * optional bytes secp256k1 = 2; 264 * This is a type-conversion wrapper around `getSecp256k1()` 265 * @return {string} 266 */ 267 proto.tendermint.crypto.PublicKey.prototype.getSecp256k1_asB64 = function() { 268 return /** @type {string} */ (jspb.Message.bytesAsB64( 269 this.getSecp256k1())); 270 }; 271 272 273 /** 274 * optional bytes secp256k1 = 2; 275 * Note that Uint8Array is not supported on all browsers. 276 * @see http://caniuse.com/Uint8Array 277 * This is a type-conversion wrapper around `getSecp256k1()` 278 * @return {!Uint8Array} 279 */ 280 proto.tendermint.crypto.PublicKey.prototype.getSecp256k1_asU8 = function() { 281 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 282 this.getSecp256k1())); 283 }; 284 285 286 /** 287 * @param {!(string|Uint8Array)} value 288 * @return {!proto.tendermint.crypto.PublicKey} returns this 289 */ 290 proto.tendermint.crypto.PublicKey.prototype.setSecp256k1 = function(value) { 291 return jspb.Message.setOneofField(this, 2, proto.tendermint.crypto.PublicKey.oneofGroups_[0], value); 292 }; 293 294 295 /** 296 * Clears the field making it undefined. 297 * @return {!proto.tendermint.crypto.PublicKey} returns this 298 */ 299 proto.tendermint.crypto.PublicKey.prototype.clearSecp256k1 = function() { 300 return jspb.Message.setOneofField(this, 2, proto.tendermint.crypto.PublicKey.oneofGroups_[0], undefined); 301 }; 302 303 304 /** 305 * Returns whether this field is set. 306 * @return {boolean} 307 */ 308 proto.tendermint.crypto.PublicKey.prototype.hasSecp256k1 = function() { 309 return jspb.Message.getField(this, 2) != null; 310 }; 311 312 313 goog.object.extend(exports, proto.tendermint.crypto);