/** * @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.cash.z.wallet.sdk.rpc.CompactBlock', null, global); goog.exportSymbol('proto.cash.z.wallet.sdk.rpc.CompactOutput', null, global); goog.exportSymbol('proto.cash.z.wallet.sdk.rpc.CompactSpend', null, global); goog.exportSymbol('proto.cash.z.wallet.sdk.rpc.CompactTx', 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.cash.z.wallet.sdk.rpc.CompactBlock = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.cash.z.wallet.sdk.rpc.CompactBlock.repeatedFields_, null); }; goog.inherits(proto.cash.z.wallet.sdk.rpc.CompactBlock, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.cash.z.wallet.sdk.rpc.CompactBlock.displayName = 'proto.cash.z.wallet.sdk.rpc.CompactBlock'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.cash.z.wallet.sdk.rpc.CompactBlock.repeatedFields_ = [7]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.toObject = function(opt_includeInstance) { return proto.cash.z.wallet.sdk.rpc.CompactBlock.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cash.z.wallet.sdk.rpc.CompactBlock} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactBlock.toObject = function(includeInstance, msg) { var f, obj = { protoversion: jspb.Message.getFieldWithDefault(msg, 1, 0), height: jspb.Message.getFieldWithDefault(msg, 2, 0), hash: msg.getHash_asB64(), prevhash: msg.getPrevhash_asB64(), time: jspb.Message.getFieldWithDefault(msg, 5, 0), header: msg.getHeader_asB64(), vtxList: jspb.Message.toObjectList(msg.getVtxList(), proto.cash.z.wallet.sdk.rpc.CompactTx.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.cash.z.wallet.sdk.rpc.CompactBlock} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cash.z.wallet.sdk.rpc.CompactBlock; return proto.cash.z.wallet.sdk.rpc.CompactBlock.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cash.z.wallet.sdk.rpc.CompactBlock} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cash.z.wallet.sdk.rpc.CompactBlock} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.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.setProtoversion(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setHash(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPrevhash(value); break; case 5: var value = /** @type {number} */ (reader.readUint32()); msg.setTime(value); break; case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setHeader(value); break; case 7: var value = new proto.cash.z.wallet.sdk.rpc.CompactTx; reader.readMessage(value,proto.cash.z.wallet.sdk.rpc.CompactTx.deserializeBinaryFromReader); msg.addVtx(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cash.z.wallet.sdk.rpc.CompactBlock.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cash.z.wallet.sdk.rpc.CompactBlock} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactBlock.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getProtoversion(); if (f !== 0) { writer.writeUint32( 1, f ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getHash_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } f = message.getPrevhash_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = message.getTime(); if (f !== 0) { writer.writeUint32( 5, f ); } f = message.getHeader_asU8(); if (f.length > 0) { writer.writeBytes( 6, f ); } f = message.getVtxList(); if (f.length > 0) { writer.writeRepeatedMessage( 7, f, proto.cash.z.wallet.sdk.rpc.CompactTx.serializeBinaryToWriter ); } }; /** * optional uint32 protoVersion = 1; * @return {number} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getProtoversion = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** @param {number} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setProtoversion = function(value) { jspb.Message.setProto3IntField(this, 1, value); }; /** * optional uint64 height = 2; * @return {number} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {number} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setHeight = function(value) { jspb.Message.setProto3IntField(this, 2, value); }; /** * optional bytes hash = 3; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHash = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes hash = 3; * This is a type-conversion wrapper around `getHash()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHash())); }; /** * optional bytes hash = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHash())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setHash = function(value) { jspb.Message.setProto3BytesField(this, 3, value); }; /** * optional bytes prevHash = 4; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getPrevhash = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes prevHash = 4; * This is a type-conversion wrapper around `getPrevhash()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getPrevhash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getPrevhash())); }; /** * optional bytes prevHash = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getPrevhash()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getPrevhash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getPrevhash())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setPrevhash = function(value) { jspb.Message.setProto3BytesField(this, 4, value); }; /** * optional uint32 time = 5; * @return {number} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getTime = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** @param {number} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setTime = function(value) { jspb.Message.setProto3IntField(this, 5, value); }; /** * optional bytes header = 6; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHeader = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * optional bytes header = 6; * This is a type-conversion wrapper around `getHeader()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHeader_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHeader())); }; /** * optional bytes header = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHeader()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getHeader_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHeader())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setHeader = function(value) { jspb.Message.setProto3BytesField(this, 6, value); }; /** * repeated CompactTx vtx = 7; * @return {!Array} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.getVtxList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.cash.z.wallet.sdk.rpc.CompactTx, 7)); }; /** @param {!Array} value */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.setVtxList = function(value) { jspb.Message.setRepeatedWrapperField(this, 7, value); }; /** * @param {!proto.cash.z.wallet.sdk.rpc.CompactTx=} opt_value * @param {number=} opt_index * @return {!proto.cash.z.wallet.sdk.rpc.CompactTx} */ proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.addVtx = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.cash.z.wallet.sdk.rpc.CompactTx, opt_index); }; proto.cash.z.wallet.sdk.rpc.CompactBlock.prototype.clearVtxList = function() { this.setVtxList([]); }; /** * 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.cash.z.wallet.sdk.rpc.CompactTx = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.cash.z.wallet.sdk.rpc.CompactTx.repeatedFields_, null); }; goog.inherits(proto.cash.z.wallet.sdk.rpc.CompactTx, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.cash.z.wallet.sdk.rpc.CompactTx.displayName = 'proto.cash.z.wallet.sdk.rpc.CompactTx'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.cash.z.wallet.sdk.rpc.CompactTx.repeatedFields_ = [4,5]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.toObject = function(opt_includeInstance) { return proto.cash.z.wallet.sdk.rpc.CompactTx.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cash.z.wallet.sdk.rpc.CompactTx} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactTx.toObject = function(includeInstance, msg) { var f, obj = { index: jspb.Message.getFieldWithDefault(msg, 1, 0), hash: msg.getHash_asB64(), fee: jspb.Message.getFieldWithDefault(msg, 3, 0), spendsList: jspb.Message.toObjectList(msg.getSpendsList(), proto.cash.z.wallet.sdk.rpc.CompactSpend.toObject, includeInstance), outputsList: jspb.Message.toObjectList(msg.getOutputsList(), proto.cash.z.wallet.sdk.rpc.CompactOutput.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.cash.z.wallet.sdk.rpc.CompactTx} */ proto.cash.z.wallet.sdk.rpc.CompactTx.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cash.z.wallet.sdk.rpc.CompactTx; return proto.cash.z.wallet.sdk.rpc.CompactTx.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cash.z.wallet.sdk.rpc.CompactTx} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cash.z.wallet.sdk.rpc.CompactTx} */ proto.cash.z.wallet.sdk.rpc.CompactTx.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.setIndex(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setHash(value); break; case 3: var value = /** @type {number} */ (reader.readUint32()); msg.setFee(value); break; case 4: var value = new proto.cash.z.wallet.sdk.rpc.CompactSpend; reader.readMessage(value,proto.cash.z.wallet.sdk.rpc.CompactSpend.deserializeBinaryFromReader); msg.addSpends(value); break; case 5: var value = new proto.cash.z.wallet.sdk.rpc.CompactOutput; reader.readMessage(value,proto.cash.z.wallet.sdk.rpc.CompactOutput.deserializeBinaryFromReader); msg.addOutputs(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cash.z.wallet.sdk.rpc.CompactTx.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cash.z.wallet.sdk.rpc.CompactTx} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactTx.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIndex(); if (f !== 0) { writer.writeUint64( 1, f ); } f = message.getHash_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getFee(); if (f !== 0) { writer.writeUint32( 3, f ); } f = message.getSpendsList(); if (f.length > 0) { writer.writeRepeatedMessage( 4, f, proto.cash.z.wallet.sdk.rpc.CompactSpend.serializeBinaryToWriter ); } f = message.getOutputsList(); if (f.length > 0) { writer.writeRepeatedMessage( 5, f, proto.cash.z.wallet.sdk.rpc.CompactOutput.serializeBinaryToWriter ); } }; /** * optional uint64 index = 1; * @return {number} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getIndex = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** @param {number} value */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.setIndex = function(value) { jspb.Message.setProto3IntField(this, 1, value); }; /** * optional bytes hash = 2; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getHash = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes hash = 2; * This is a type-conversion wrapper around `getHash()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHash())); }; /** * optional bytes hash = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHash())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.setHash = function(value) { jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional uint32 fee = 3; * @return {number} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getFee = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** @param {number} value */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.setFee = function(value) { jspb.Message.setProto3IntField(this, 3, value); }; /** * repeated CompactSpend spends = 4; * @return {!Array} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getSpendsList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.cash.z.wallet.sdk.rpc.CompactSpend, 4)); }; /** @param {!Array} value */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.setSpendsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 4, value); }; /** * @param {!proto.cash.z.wallet.sdk.rpc.CompactSpend=} opt_value * @param {number=} opt_index * @return {!proto.cash.z.wallet.sdk.rpc.CompactSpend} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.addSpends = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.cash.z.wallet.sdk.rpc.CompactSpend, opt_index); }; proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.clearSpendsList = function() { this.setSpendsList([]); }; /** * repeated CompactOutput outputs = 5; * @return {!Array} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.getOutputsList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.cash.z.wallet.sdk.rpc.CompactOutput, 5)); }; /** @param {!Array} value */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.setOutputsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 5, value); }; /** * @param {!proto.cash.z.wallet.sdk.rpc.CompactOutput=} opt_value * @param {number=} opt_index * @return {!proto.cash.z.wallet.sdk.rpc.CompactOutput} */ proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.addOutputs = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.cash.z.wallet.sdk.rpc.CompactOutput, opt_index); }; proto.cash.z.wallet.sdk.rpc.CompactTx.prototype.clearOutputsList = function() { this.setOutputsList([]); }; /** * 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.cash.z.wallet.sdk.rpc.CompactSpend = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.cash.z.wallet.sdk.rpc.CompactSpend, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.cash.z.wallet.sdk.rpc.CompactSpend.displayName = 'proto.cash.z.wallet.sdk.rpc.CompactSpend'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.toObject = function(opt_includeInstance) { return proto.cash.z.wallet.sdk.rpc.CompactSpend.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cash.z.wallet.sdk.rpc.CompactSpend} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactSpend.toObject = function(includeInstance, msg) { var f, obj = { nf: msg.getNf_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.cash.z.wallet.sdk.rpc.CompactSpend} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cash.z.wallet.sdk.rpc.CompactSpend; return proto.cash.z.wallet.sdk.rpc.CompactSpend.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cash.z.wallet.sdk.rpc.CompactSpend} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cash.z.wallet.sdk.rpc.CompactSpend} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.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.setNf(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cash.z.wallet.sdk.rpc.CompactSpend.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cash.z.wallet.sdk.rpc.CompactSpend} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactSpend.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNf_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } }; /** * optional bytes nf = 1; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.getNf = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes nf = 1; * This is a type-conversion wrapper around `getNf()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.getNf_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getNf())); }; /** * optional bytes nf = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getNf()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.getNf_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getNf())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactSpend.prototype.setNf = function(value) { jspb.Message.setProto3BytesField(this, 1, value); }; /** * 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.cash.z.wallet.sdk.rpc.CompactOutput = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.cash.z.wallet.sdk.rpc.CompactOutput, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.cash.z.wallet.sdk.rpc.CompactOutput.displayName = 'proto.cash.z.wallet.sdk.rpc.CompactOutput'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.toObject = function(opt_includeInstance) { return proto.cash.z.wallet.sdk.rpc.CompactOutput.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cash.z.wallet.sdk.rpc.CompactOutput} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactOutput.toObject = function(includeInstance, msg) { var f, obj = { cmu: msg.getCmu_asB64(), epk: msg.getEpk_asB64(), ciphertext: msg.getCiphertext_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.cash.z.wallet.sdk.rpc.CompactOutput} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cash.z.wallet.sdk.rpc.CompactOutput; return proto.cash.z.wallet.sdk.rpc.CompactOutput.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cash.z.wallet.sdk.rpc.CompactOutput} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cash.z.wallet.sdk.rpc.CompactOutput} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.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.setCmu(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setEpk(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCiphertext(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cash.z.wallet.sdk.rpc.CompactOutput.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cash.z.wallet.sdk.rpc.CompactOutput} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cash.z.wallet.sdk.rpc.CompactOutput.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCmu_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getEpk_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getCiphertext_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } }; /** * optional bytes cmu = 1; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCmu = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes cmu = 1; * This is a type-conversion wrapper around `getCmu()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCmu_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCmu())); }; /** * optional bytes cmu = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCmu()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCmu_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCmu())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.setCmu = function(value) { jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes epk = 2; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getEpk = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes epk = 2; * This is a type-conversion wrapper around `getEpk()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getEpk_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getEpk())); }; /** * optional bytes epk = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getEpk()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getEpk_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getEpk())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.setEpk = function(value) { jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional bytes ciphertext = 3; * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCiphertext = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes ciphertext = 3; * This is a type-conversion wrapper around `getCiphertext()` * @return {string} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCiphertext_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCiphertext())); }; /** * optional bytes ciphertext = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCiphertext()` * @return {!Uint8Array} */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.getCiphertext_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCiphertext())); }; /** @param {!(string|Uint8Array)} value */ proto.cash.z.wallet.sdk.rpc.CompactOutput.prototype.setCiphertext = function(value) { jspb.Message.setProto3BytesField(this, 3, value); }; goog.object.extend(exports, proto.cash.z.wallet.sdk.rpc);