UNPKG

nkn-sdk

Version:
1,679 lines (1,473 loc) 110 kB
// source: src/common/pb/transaction.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.transaction.Coinbase', null, global); goog.exportSymbol('proto.transaction.DeleteName', null, global); goog.exportSymbol('proto.transaction.GenerateID', null, global); goog.exportSymbol('proto.transaction.IssueAsset', null, global); goog.exportSymbol('proto.transaction.NanoPay', null, global); goog.exportSymbol('proto.transaction.Payload', null, global); goog.exportSymbol('proto.transaction.PayloadType', null, global); goog.exportSymbol('proto.transaction.Program', null, global); goog.exportSymbol('proto.transaction.RegisterName', null, global); goog.exportSymbol('proto.transaction.SigChainTxn', null, global); goog.exportSymbol('proto.transaction.Subscribe', null, global); goog.exportSymbol('proto.transaction.Transaction', null, global); goog.exportSymbol('proto.transaction.TransferAsset', null, global); goog.exportSymbol('proto.transaction.TransferName', null, global); goog.exportSymbol('proto.transaction.UnsignedTx', null, global); goog.exportSymbol('proto.transaction.Unsubscribe', 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.transaction.UnsignedTx = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.UnsignedTx, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.UnsignedTx.displayName = 'proto.transaction.UnsignedTx'; } /** * 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.transaction.Transaction = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.transaction.Transaction.repeatedFields_, null); }; goog.inherits(proto.transaction.Transaction, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Transaction.displayName = 'proto.transaction.Transaction'; } /** * 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.transaction.Program = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.Program, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Program.displayName = 'proto.transaction.Program'; } /** * 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.transaction.Payload = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.Payload, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Payload.displayName = 'proto.transaction.Payload'; } /** * 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.transaction.Coinbase = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.Coinbase, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Coinbase.displayName = 'proto.transaction.Coinbase'; } /** * 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.transaction.SigChainTxn = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.SigChainTxn, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.SigChainTxn.displayName = 'proto.transaction.SigChainTxn'; } /** * 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.transaction.RegisterName = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.RegisterName, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.RegisterName.displayName = 'proto.transaction.RegisterName'; } /** * 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.transaction.TransferName = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.TransferName, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.TransferName.displayName = 'proto.transaction.TransferName'; } /** * 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.transaction.DeleteName = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.DeleteName, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.DeleteName.displayName = 'proto.transaction.DeleteName'; } /** * 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.transaction.Subscribe = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.Subscribe, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Subscribe.displayName = 'proto.transaction.Subscribe'; } /** * 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.transaction.Unsubscribe = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.Unsubscribe, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.Unsubscribe.displayName = 'proto.transaction.Unsubscribe'; } /** * 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.transaction.TransferAsset = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.TransferAsset, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.TransferAsset.displayName = 'proto.transaction.TransferAsset'; } /** * 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.transaction.GenerateID = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.GenerateID, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.GenerateID.displayName = 'proto.transaction.GenerateID'; } /** * 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.transaction.NanoPay = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.NanoPay, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.NanoPay.displayName = 'proto.transaction.NanoPay'; } /** * 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.transaction.IssueAsset = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.transaction.IssueAsset, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.transaction.IssueAsset.displayName = 'proto.transaction.IssueAsset'; } 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.transaction.UnsignedTx.prototype.toObject = function(opt_includeInstance) { return proto.transaction.UnsignedTx.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.transaction.UnsignedTx} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.UnsignedTx.toObject = function(includeInstance, msg) { var f, obj = { payload: (f = msg.getPayload()) && proto.transaction.Payload.toObject(includeInstance, f), nonce: jspb.Message.getFieldWithDefault(msg, 2, 0), fee: jspb.Message.getFieldWithDefault(msg, 3, 0), attributes: msg.getAttributes_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.transaction.UnsignedTx} */ proto.transaction.UnsignedTx.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.UnsignedTx; return proto.transaction.UnsignedTx.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.UnsignedTx} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.UnsignedTx} */ proto.transaction.UnsignedTx.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.transaction.Payload; reader.readMessage(value,proto.transaction.Payload.deserializeBinaryFromReader); msg.setPayload(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setNonce(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setFee(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAttributes(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.UnsignedTx.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.UnsignedTx.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.UnsignedTx} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.UnsignedTx.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPayload(); if (f != null) { writer.writeMessage( 1, f, proto.transaction.Payload.serializeBinaryToWriter ); } f = message.getNonce(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getFee(); if (f !== 0) { writer.writeInt64( 3, f ); } f = message.getAttributes_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional Payload payload = 1; * @return {?proto.transaction.Payload} */ proto.transaction.UnsignedTx.prototype.getPayload = function() { return /** @type{?proto.transaction.Payload} */ ( jspb.Message.getWrapperField(this, proto.transaction.Payload, 1)); }; /** * @param {?proto.transaction.Payload|undefined} value * @return {!proto.transaction.UnsignedTx} returns this */ proto.transaction.UnsignedTx.prototype.setPayload = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.transaction.UnsignedTx} returns this */ proto.transaction.UnsignedTx.prototype.clearPayload = function() { return this.setPayload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.transaction.UnsignedTx.prototype.hasPayload = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional uint64 nonce = 2; * @return {number} */ proto.transaction.UnsignedTx.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.transaction.UnsignedTx} returns this */ proto.transaction.UnsignedTx.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional int64 fee = 3; * @return {number} */ proto.transaction.UnsignedTx.prototype.getFee = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.transaction.UnsignedTx} returns this */ proto.transaction.UnsignedTx.prototype.setFee = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional bytes attributes = 4; * @return {!(string|Uint8Array)} */ proto.transaction.UnsignedTx.prototype.getAttributes = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes attributes = 4; * This is a type-conversion wrapper around `getAttributes()` * @return {string} */ proto.transaction.UnsignedTx.prototype.getAttributes_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAttributes())); }; /** * optional bytes attributes = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAttributes()` * @return {!Uint8Array} */ proto.transaction.UnsignedTx.prototype.getAttributes_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAttributes())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.UnsignedTx} returns this */ proto.transaction.UnsignedTx.prototype.setAttributes = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.transaction.Transaction.repeatedFields_ = [2]; 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.transaction.Transaction.prototype.toObject = function(opt_includeInstance) { return proto.transaction.Transaction.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.transaction.Transaction} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Transaction.toObject = function(includeInstance, msg) { var f, obj = { unsignedTx: (f = msg.getUnsignedTx()) && proto.transaction.UnsignedTx.toObject(includeInstance, f), programsList: jspb.Message.toObjectList(msg.getProgramsList(), proto.transaction.Program.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.transaction.Transaction} */ proto.transaction.Transaction.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.Transaction; return proto.transaction.Transaction.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.Transaction} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.Transaction} */ proto.transaction.Transaction.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.transaction.UnsignedTx; reader.readMessage(value,proto.transaction.UnsignedTx.deserializeBinaryFromReader); msg.setUnsignedTx(value); break; case 2: var value = new proto.transaction.Program; reader.readMessage(value,proto.transaction.Program.deserializeBinaryFromReader); msg.addPrograms(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.Transaction.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.Transaction.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.Transaction} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Transaction.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUnsignedTx(); if (f != null) { writer.writeMessage( 1, f, proto.transaction.UnsignedTx.serializeBinaryToWriter ); } f = message.getProgramsList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, proto.transaction.Program.serializeBinaryToWriter ); } }; /** * optional UnsignedTx unsigned_tx = 1; * @return {?proto.transaction.UnsignedTx} */ proto.transaction.Transaction.prototype.getUnsignedTx = function() { return /** @type{?proto.transaction.UnsignedTx} */ ( jspb.Message.getWrapperField(this, proto.transaction.UnsignedTx, 1)); }; /** * @param {?proto.transaction.UnsignedTx|undefined} value * @return {!proto.transaction.Transaction} returns this */ proto.transaction.Transaction.prototype.setUnsignedTx = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.transaction.Transaction} returns this */ proto.transaction.Transaction.prototype.clearUnsignedTx = function() { return this.setUnsignedTx(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.transaction.Transaction.prototype.hasUnsignedTx = function() { return jspb.Message.getField(this, 1) != null; }; /** * repeated Program programs = 2; * @return {!Array<!proto.transaction.Program>} */ proto.transaction.Transaction.prototype.getProgramsList = function() { return /** @type{!Array<!proto.transaction.Program>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.transaction.Program, 2)); }; /** * @param {!Array<!proto.transaction.Program>} value * @return {!proto.transaction.Transaction} returns this */ proto.transaction.Transaction.prototype.setProgramsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.transaction.Program=} opt_value * @param {number=} opt_index * @return {!proto.transaction.Program} */ proto.transaction.Transaction.prototype.addPrograms = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.transaction.Program, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.transaction.Transaction} returns this */ proto.transaction.Transaction.prototype.clearProgramsList = function() { return this.setProgramsList([]); }; 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.transaction.Program.prototype.toObject = function(opt_includeInstance) { return proto.transaction.Program.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.transaction.Program} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Program.toObject = function(includeInstance, msg) { var f, obj = { code: msg.getCode_asB64(), parameter: msg.getParameter_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.transaction.Program} */ proto.transaction.Program.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.Program; return proto.transaction.Program.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.Program} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.Program} */ proto.transaction.Program.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.setCode(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setParameter(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.Program.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.Program.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.Program} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Program.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCode_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getParameter_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes code = 1; * @return {!(string|Uint8Array)} */ proto.transaction.Program.prototype.getCode = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes code = 1; * This is a type-conversion wrapper around `getCode()` * @return {string} */ proto.transaction.Program.prototype.getCode_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCode())); }; /** * optional bytes code = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCode()` * @return {!Uint8Array} */ proto.transaction.Program.prototype.getCode_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCode())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.Program} returns this */ proto.transaction.Program.prototype.setCode = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes parameter = 2; * @return {!(string|Uint8Array)} */ proto.transaction.Program.prototype.getParameter = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes parameter = 2; * This is a type-conversion wrapper around `getParameter()` * @return {string} */ proto.transaction.Program.prototype.getParameter_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getParameter())); }; /** * optional bytes parameter = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getParameter()` * @return {!Uint8Array} */ proto.transaction.Program.prototype.getParameter_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getParameter())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.Program} returns this */ proto.transaction.Program.prototype.setParameter = 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.transaction.Payload.prototype.toObject = function(opt_includeInstance) { return proto.transaction.Payload.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.transaction.Payload} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Payload.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 1, 0), data: msg.getData_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.transaction.Payload} */ proto.transaction.Payload.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.Payload; return proto.transaction.Payload.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.Payload} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.Payload} */ proto.transaction.Payload.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.transaction.PayloadType} */ (reader.readEnum()); msg.setType(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setData(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.Payload.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.Payload.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.Payload} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Payload.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getData_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional PayloadType type = 1; * @return {!proto.transaction.PayloadType} */ proto.transaction.Payload.prototype.getType = function() { return /** @type {!proto.transaction.PayloadType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.transaction.PayloadType} value * @return {!proto.transaction.Payload} returns this */ proto.transaction.Payload.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional bytes data = 2; * @return {!(string|Uint8Array)} */ proto.transaction.Payload.prototype.getData = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes data = 2; * This is a type-conversion wrapper around `getData()` * @return {string} */ proto.transaction.Payload.prototype.getData_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getData())); }; /** * optional bytes data = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getData()` * @return {!Uint8Array} */ proto.transaction.Payload.prototype.getData_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getData())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.Payload} returns this */ proto.transaction.Payload.prototype.setData = 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.transaction.Coinbase.prototype.toObject = function(opt_includeInstance) { return proto.transaction.Coinbase.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.transaction.Coinbase} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Coinbase.toObject = function(includeInstance, msg) { var f, obj = { sender: msg.getSender_asB64(), recipient: msg.getRecipient_asB64(), amount: jspb.Message.getFieldWithDefault(msg, 3, 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.transaction.Coinbase} */ proto.transaction.Coinbase.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.Coinbase; return proto.transaction.Coinbase.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.Coinbase} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.Coinbase} */ proto.transaction.Coinbase.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.setSender(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setRecipient(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setAmount(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.Coinbase.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.Coinbase.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.Coinbase} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.Coinbase.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSender_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getRecipient_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getAmount(); if (f !== 0) { writer.writeInt64( 3, f ); } }; /** * optional bytes sender = 1; * @return {!(string|Uint8Array)} */ proto.transaction.Coinbase.prototype.getSender = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes sender = 1; * This is a type-conversion wrapper around `getSender()` * @return {string} */ proto.transaction.Coinbase.prototype.getSender_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSender())); }; /** * optional bytes sender = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSender()` * @return {!Uint8Array} */ proto.transaction.Coinbase.prototype.getSender_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSender())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.Coinbase} returns this */ proto.transaction.Coinbase.prototype.setSender = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes recipient = 2; * @return {!(string|Uint8Array)} */ proto.transaction.Coinbase.prototype.getRecipient = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes recipient = 2; * This is a type-conversion wrapper around `getRecipient()` * @return {string} */ proto.transaction.Coinbase.prototype.getRecipient_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getRecipient())); }; /** * optional bytes recipient = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getRecipient()` * @return {!Uint8Array} */ proto.transaction.Coinbase.prototype.getRecipient_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRecipient())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.Coinbase} returns this */ proto.transaction.Coinbase.prototype.setRecipient = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional int64 amount = 3; * @return {number} */ proto.transaction.Coinbase.prototype.getAmount = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.transaction.Coinbase} returns this */ proto.transaction.Coinbase.prototype.setAmount = function(value) { return jspb.Message.setProto3IntField(this, 3, 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.transaction.SigChainTxn.prototype.toObject = function(opt_includeInstance) { return proto.transaction.SigChainTxn.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.transaction.SigChainTxn} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.SigChainTxn.toObject = function(includeInstance, msg) { var f, obj = { sigChain: msg.getSigChain_asB64(), submitter: msg.getSubmitter_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.transaction.SigChainTxn} */ proto.transaction.SigChainTxn.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.transaction.SigChainTxn; return proto.transaction.SigChainTxn.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.transaction.SigChainTxn} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.transaction.SigChainTxn} */ proto.transaction.SigChainTxn.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.setSigChain(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setSubmitter(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.transaction.SigChainTxn.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.transaction.SigChainTxn.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.transaction.SigChainTxn} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.transaction.SigChainTxn.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSigChain_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getSubmitter_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes sig_chain = 1; * @return {!(string|Uint8Array)} */ proto.transaction.SigChainTxn.prototype.getSigChain = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes sig_chain = 1; * This is a type-conversion wrapper around `getSigChain()` * @return {string} */ proto.transaction.SigChainTxn.prototype.getSigChain_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSigChain())); }; /** * optional bytes sig_chain = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSigChain()` * @return {!Uint8Array} */ proto.transaction.SigChainTxn.prototype.getSigChain_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSigChain())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.SigChainTxn} returns this */ proto.transaction.SigChainTxn.prototype.setSigChain = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes submitter = 2; * @return {!(string|Uint8Array)} */ proto.transaction.SigChainTxn.prototype.getSubmitter = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes submitter = 2; * This is a type-conversion wrapper around `getSubmitter()` * @return {string} */ proto.transaction.SigChainTxn.prototype.getSubmitter_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getSubmitter())); }; /** * optional bytes submitter = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSubmitter()` * @return {!Uint8Array} */ proto.transaction.SigChainTxn.prototype.getSubmitter_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getSubmitter())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.transaction.SigChainTxn} returns this */ proto.transaction.SigChainTxn.prototype.setSubmitter = 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/compil