UNPKG

nkn-sdk

Version:
998 lines (857 loc) 26.9 kB
// source: src/common/pb/sigchain.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 = (typeof globalThis !== 'undefined' && globalThis) || (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || (typeof self !== 'undefined' && self) || (function () { return this; }).call(null) || Function('return this')(); goog.exportSymbol('proto.sigchain.SigAlgo', null, global); goog.exportSymbol('proto.sigchain.SigChain', null, global); goog.exportSymbol('proto.sigchain.SigChainElem', 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.sigchain.SigChainElem = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.sigchain.SigChainElem, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sigchain.SigChainElem.displayName = 'proto.sigchain.SigChainElem'; } /** * 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.sigchain.SigChain = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.sigchain.SigChain.repeatedFields_, null); }; goog.inherits(proto.sigchain.SigChain, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.sigchain.SigChain.displayName = 'proto.sigchain.SigChain'; } 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.sigchain.SigChainElem.prototype.toObject = function(opt_includeInstance) { return proto.sigchain.SigChainElem.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.sigchain.SigChainElem} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sigchain.SigChainElem.toObject = function(includeInstance, msg) { var f, obj = { id: msg.getId_asB64(), nextPubkey: msg.getNextPubkey_asB64(), mining: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), signature: msg.getSignature_asB64(), sigAlgo: jspb.Message.getFieldWithDefault(msg, 5, 0), vrf: msg.getVrf_asB64(), proof: msg.getProof_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.sigchain.SigChainElem} */ proto.sigchain.SigChainElem.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sigchain.SigChainElem; return proto.sigchain.SigChainElem.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sigchain.SigChainElem} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sigchain.SigChainElem} */ proto.sigchain.SigChainElem.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.setId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setNextPubkey(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setMining(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSignature(value); break; case 5: var value = /** @type {!proto.sigchain.SigAlgo} */ (reader.readEnum()); msg.setSigAlgo(value); break; case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setVrf(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setProof(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sigchain.SigChainElem.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.sigchain.SigChainElem} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sigchain.SigChainElem.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getNextPubkey_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getMining(); if (f) { writer.writeBool( 3, f ); } f = message.getSignature_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = message.getSigAlgo(); if (f !== 0.0) { writer.writeEnum( 5, f ); } f = message.getVrf_asU8(); if (f.length > 0) { writer.writeBytes( 6, f ); } f = message.getProof_asU8(); if (f.length > 0) { writer.writeBytes( 7, f ); } }; /** * optional bytes id = 1; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChainElem.prototype.getId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes id = 1; * This is a type-conversion wrapper around `getId()` * @return {string} */ proto.sigchain.SigChainElem.prototype.getId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getId())); }; /** * optional bytes id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getId()` * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.getId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes next_pubkey = 2; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChainElem.prototype.getNextPubkey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes next_pubkey = 2; * This is a type-conversion wrapper around `getNextPubkey()` * @return {string} */ proto.sigchain.SigChainElem.prototype.getNextPubkey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getNextPubkey())); }; /** * optional bytes next_pubkey = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getNextPubkey()` * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.getNextPubkey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getNextPubkey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setNextPubkey = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional bool mining = 3; * @return {boolean} */ proto.sigchain.SigChainElem.prototype.getMining = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** * @param {boolean} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setMining = function(value) { return jspb.Message.setProto3BooleanField(this, 3, value); }; /** * optional bytes signature = 4; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChainElem.prototype.getSignature = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes signature = 4; * This is a type-conversion wrapper around `getSignature()` * @return {string} */ proto.sigchain.SigChainElem.prototype.getSignature_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSignature())); }; /** * optional bytes signature = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSignature()` * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.getSignature_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSignature())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setSignature = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; /** * optional SigAlgo sig_algo = 5; * @return {!proto.sigchain.SigAlgo} */ proto.sigchain.SigChainElem.prototype.getSigAlgo = function() { return /** @type {!proto.sigchain.SigAlgo} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {!proto.sigchain.SigAlgo} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setSigAlgo = function(value) { return jspb.Message.setProto3EnumField(this, 5, value); }; /** * optional bytes vrf = 6; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChainElem.prototype.getVrf = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * optional bytes vrf = 6; * This is a type-conversion wrapper around `getVrf()` * @return {string} */ proto.sigchain.SigChainElem.prototype.getVrf_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getVrf())); }; /** * optional bytes vrf = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getVrf()` * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.getVrf_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getVrf())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setVrf = function(value) { return jspb.Message.setProto3BytesField(this, 6, value); }; /** * optional bytes proof = 7; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChainElem.prototype.getProof = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes proof = 7; * This is a type-conversion wrapper around `getProof()` * @return {string} */ proto.sigchain.SigChainElem.prototype.getProof_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getProof())); }; /** * optional bytes proof = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getProof()` * @return {!Uint8Array} */ proto.sigchain.SigChainElem.prototype.getProof_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getProof())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChainElem} returns this */ proto.sigchain.SigChainElem.prototype.setProof = function(value) { return jspb.Message.setProto3BytesField(this, 7, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.sigchain.SigChain.repeatedFields_ = [8]; 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.sigchain.SigChain.prototype.toObject = function(opt_includeInstance) { return proto.sigchain.SigChain.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.sigchain.SigChain} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sigchain.SigChain.toObject = function(includeInstance, msg) { var f, obj = { nonce: jspb.Message.getFieldWithDefault(msg, 1, 0), dataSize: jspb.Message.getFieldWithDefault(msg, 2, 0), blockHash: msg.getBlockHash_asB64(), srcId: msg.getSrcId_asB64(), srcPubkey: msg.getSrcPubkey_asB64(), destId: msg.getDestId_asB64(), destPubkey: msg.getDestPubkey_asB64(), elemsList: jspb.Message.toObjectList(msg.getElemsList(), proto.sigchain.SigChainElem.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.sigchain.SigChain} */ proto.sigchain.SigChain.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.sigchain.SigChain; return proto.sigchain.SigChain.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.sigchain.SigChain} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.sigchain.SigChain} */ proto.sigchain.SigChain.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint32()); msg.setNonce(value); break; case 2: var value = /** @type {number} */ (reader.readUint32()); msg.setDataSize(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setBlockHash(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSrcId(value); break; case 5: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSrcPubkey(value); break; case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setDestId(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setDestPubkey(value); break; case 8: var value = new proto.sigchain.SigChainElem; reader.readMessage(value,proto.sigchain.SigChainElem.deserializeBinaryFromReader); msg.addElems(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.sigchain.SigChain.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.sigchain.SigChain} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.sigchain.SigChain.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNonce(); if (f !== 0) { writer.writeUint32( 1, f ); } f = message.getDataSize(); if (f !== 0) { writer.writeUint32( 2, f ); } f = message.getBlockHash_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } f = message.getSrcId_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = message.getSrcPubkey_asU8(); if (f.length > 0) { writer.writeBytes( 5, f ); } f = message.getDestId_asU8(); if (f.length > 0) { writer.writeBytes( 6, f ); } f = message.getDestPubkey_asU8(); if (f.length > 0) { writer.writeBytes( 7, f ); } f = message.getElemsList(); if (f.length > 0) { writer.writeRepeatedMessage( 8, f, proto.sigchain.SigChainElem.serializeBinaryToWriter ); } }; /** * optional uint32 nonce = 1; * @return {number} */ proto.sigchain.SigChain.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional uint32 data_size = 2; * @return {number} */ proto.sigchain.SigChain.prototype.getDataSize = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setDataSize = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional bytes block_hash = 3; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChain.prototype.getBlockHash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes block_hash = 3; * This is a type-conversion wrapper around `getBlockHash()` * @return {string} */ proto.sigchain.SigChain.prototype.getBlockHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBlockHash())); }; /** * optional bytes block_hash = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getBlockHash()` * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.getBlockHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBlockHash())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setBlockHash = function(value) { return jspb.Message.setProto3BytesField(this, 3, value); }; /** * optional bytes src_id = 4; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChain.prototype.getSrcId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes src_id = 4; * This is a type-conversion wrapper around `getSrcId()` * @return {string} */ proto.sigchain.SigChain.prototype.getSrcId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSrcId())); }; /** * optional bytes src_id = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSrcId()` * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.getSrcId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSrcId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setSrcId = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; /** * optional bytes src_pubkey = 5; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChain.prototype.getSrcPubkey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * optional bytes src_pubkey = 5; * This is a type-conversion wrapper around `getSrcPubkey()` * @return {string} */ proto.sigchain.SigChain.prototype.getSrcPubkey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSrcPubkey())); }; /** * optional bytes src_pubkey = 5; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSrcPubkey()` * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.getSrcPubkey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSrcPubkey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setSrcPubkey = function(value) { return jspb.Message.setProto3BytesField(this, 5, value); }; /** * optional bytes dest_id = 6; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChain.prototype.getDestId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * optional bytes dest_id = 6; * This is a type-conversion wrapper around `getDestId()` * @return {string} */ proto.sigchain.SigChain.prototype.getDestId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getDestId())); }; /** * optional bytes dest_id = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getDestId()` * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.getDestId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getDestId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setDestId = function(value) { return jspb.Message.setProto3BytesField(this, 6, value); }; /** * optional bytes dest_pubkey = 7; * @return {!(string|Uint8Array)} */ proto.sigchain.SigChain.prototype.getDestPubkey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes dest_pubkey = 7; * This is a type-conversion wrapper around `getDestPubkey()` * @return {string} */ proto.sigchain.SigChain.prototype.getDestPubkey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getDestPubkey())); }; /** * optional bytes dest_pubkey = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getDestPubkey()` * @return {!Uint8Array} */ proto.sigchain.SigChain.prototype.getDestPubkey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getDestPubkey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setDestPubkey = function(value) { return jspb.Message.setProto3BytesField(this, 7, value); }; /** * repeated SigChainElem elems = 8; * @return {!Array<!proto.sigchain.SigChainElem>} */ proto.sigchain.SigChain.prototype.getElemsList = function() { return /** @type{!Array<!proto.sigchain.SigChainElem>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.sigchain.SigChainElem, 8)); }; /** * @param {!Array<!proto.sigchain.SigChainElem>} value * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.setElemsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 8, value); }; /** * @param {!proto.sigchain.SigChainElem=} opt_value * @param {number=} opt_index * @return {!proto.sigchain.SigChainElem} */ proto.sigchain.SigChain.prototype.addElems = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.sigchain.SigChainElem, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.sigchain.SigChain} returns this */ proto.sigchain.SigChain.prototype.clearElemsList = function() { return this.setElemsList([]); }; /** * @enum {number} */ proto.sigchain.SigAlgo = { SIGNATURE: 0, VRF: 1 }; goog.object.extend(exports, proto.sigchain);