UNPKG

@emeraldpay/api-node

Version:
1,626 lines (1,407 loc) 74.9 kB
// source: transaction.message.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { if (this) { return this; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } if (typeof self !== 'undefined') { return self; } return Function('return this')(); }.call(null)); var common_pb = require('./common_pb.js'); goog.object.extend(proto, common_pb); var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); goog.object.extend(proto, google_protobuf_wrappers_pb); goog.exportSymbol('proto.emerald.transaction.AddressAmount', null, global); goog.exportSymbol('proto.emerald.transaction.AddressTransaction', null, global); goog.exportSymbol('proto.emerald.transaction.AddressTxRequest', null, global); goog.exportSymbol('proto.emerald.transaction.AddressTxResponse', null, global); goog.exportSymbol('proto.emerald.transaction.Change', null, global); goog.exportSymbol('proto.emerald.transaction.ChangeType', null, global); goog.exportSymbol('proto.emerald.transaction.Direction', null, global); goog.exportSymbol('proto.emerald.transaction.GetTransactionsRequest', null, global); goog.exportSymbol('proto.emerald.transaction.SubscribeTransactionsRequest', 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.emerald.transaction.AddressAmount = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.emerald.transaction.AddressAmount, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.AddressAmount.displayName = 'proto.emerald.transaction.AddressAmount'; } /** * 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.emerald.transaction.AddressTxRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.emerald.transaction.AddressTxRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.AddressTxRequest.displayName = 'proto.emerald.transaction.AddressTxRequest'; } /** * 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.emerald.transaction.AddressTxResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.emerald.transaction.AddressTxResponse.repeatedFields_, null); }; goog.inherits(proto.emerald.transaction.AddressTxResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.AddressTxResponse.displayName = 'proto.emerald.transaction.AddressTxResponse'; } /** * 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.emerald.transaction.GetTransactionsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.emerald.transaction.GetTransactionsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.GetTransactionsRequest.displayName = 'proto.emerald.transaction.GetTransactionsRequest'; } /** * 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.emerald.transaction.SubscribeTransactionsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.emerald.transaction.SubscribeTransactionsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.SubscribeTransactionsRequest.displayName = 'proto.emerald.transaction.SubscribeTransactionsRequest'; } /** * 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.emerald.transaction.AddressTransaction = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.emerald.transaction.AddressTransaction.repeatedFields_, null); }; goog.inherits(proto.emerald.transaction.AddressTransaction, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.AddressTransaction.displayName = 'proto.emerald.transaction.AddressTransaction'; } /** * 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.emerald.transaction.Change = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.emerald.transaction.Change, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.emerald.transaction.Change.displayName = 'proto.emerald.transaction.Change'; } 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.emerald.transaction.AddressAmount.prototype.toObject = function(opt_includeInstance) { return proto.emerald.transaction.AddressAmount.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.emerald.transaction.AddressAmount} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressAmount.toObject = function(includeInstance, msg) { var f, obj = { address: (f = msg.getAddress()) && common_pb.SingleAddress.toObject(includeInstance, f), amount: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.emerald.transaction.AddressAmount} */ proto.emerald.transaction.AddressAmount.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.emerald.transaction.AddressAmount; return proto.emerald.transaction.AddressAmount.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.emerald.transaction.AddressAmount} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.emerald.transaction.AddressAmount} */ proto.emerald.transaction.AddressAmount.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new common_pb.SingleAddress; reader.readMessage(value,common_pb.SingleAddress.deserializeBinaryFromReader); msg.setAddress(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setAmount(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.emerald.transaction.AddressAmount.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.emerald.transaction.AddressAmount.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.emerald.transaction.AddressAmount} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressAmount.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAddress(); if (f != null) { writer.writeMessage( 1, f, common_pb.SingleAddress.serializeBinaryToWriter ); } f = message.getAmount(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional emerald.SingleAddress address = 1; * @return {?proto.emerald.SingleAddress} */ proto.emerald.transaction.AddressAmount.prototype.getAddress = function() { return /** @type{?proto.emerald.SingleAddress} */ ( jspb.Message.getWrapperField(this, common_pb.SingleAddress, 1)); }; /** * @param {?proto.emerald.SingleAddress|undefined} value * @return {!proto.emerald.transaction.AddressAmount} returns this */ proto.emerald.transaction.AddressAmount.prototype.setAddress = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.AddressAmount} returns this */ proto.emerald.transaction.AddressAmount.prototype.clearAddress = function() { return this.setAddress(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.AddressAmount.prototype.hasAddress = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional string amount = 2; * @return {string} */ proto.emerald.transaction.AddressAmount.prototype.getAmount = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.emerald.transaction.AddressAmount} returns this */ proto.emerald.transaction.AddressAmount.prototype.setAmount = function(value) { return jspb.Message.setProto3StringField(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.emerald.transaction.AddressTxRequest.prototype.toObject = function(opt_includeInstance) { return proto.emerald.transaction.AddressTxRequest.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.emerald.transaction.AddressTxRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressTxRequest.toObject = function(includeInstance, msg) { var f, obj = { blockchain: jspb.Message.getFieldWithDefault(msg, 1, 0), address: (f = msg.getAddress()) && common_pb.AnyAddress.toObject(includeInstance, f), cursor: jspb.Message.getFieldWithDefault(msg, 3, ""), limit: jspb.Message.getFieldWithDefault(msg, 4, 0), onlyUnspent: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.emerald.transaction.AddressTxRequest} */ proto.emerald.transaction.AddressTxRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.emerald.transaction.AddressTxRequest; return proto.emerald.transaction.AddressTxRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.emerald.transaction.AddressTxRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.emerald.transaction.AddressTxRequest} */ proto.emerald.transaction.AddressTxRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.emerald.ChainRef} */ (reader.readEnum()); msg.setBlockchain(value); break; case 2: var value = new common_pb.AnyAddress; reader.readMessage(value,common_pb.AnyAddress.deserializeBinaryFromReader); msg.setAddress(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setCursor(value); break; case 4: var value = /** @type {number} */ (reader.readUint32()); msg.setLimit(value); break; case 5: var value = /** @type {boolean} */ (reader.readBool()); msg.setOnlyUnspent(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.emerald.transaction.AddressTxRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.emerald.transaction.AddressTxRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.emerald.transaction.AddressTxRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressTxRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlockchain(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getAddress(); if (f != null) { writer.writeMessage( 2, f, common_pb.AnyAddress.serializeBinaryToWriter ); } f = message.getCursor(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getLimit(); if (f !== 0) { writer.writeUint32( 4, f ); } f = message.getOnlyUnspent(); if (f) { writer.writeBool( 5, f ); } }; /** * optional emerald.ChainRef blockchain = 1; * @return {!proto.emerald.ChainRef} */ proto.emerald.transaction.AddressTxRequest.prototype.getBlockchain = function() { return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.emerald.ChainRef} value * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.setBlockchain = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional emerald.AnyAddress address = 2; * @return {?proto.emerald.AnyAddress} */ proto.emerald.transaction.AddressTxRequest.prototype.getAddress = function() { return /** @type{?proto.emerald.AnyAddress} */ ( jspb.Message.getWrapperField(this, common_pb.AnyAddress, 2)); }; /** * @param {?proto.emerald.AnyAddress|undefined} value * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.setAddress = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.clearAddress = function() { return this.setAddress(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.AddressTxRequest.prototype.hasAddress = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional string cursor = 3; * @return {string} */ proto.emerald.transaction.AddressTxRequest.prototype.getCursor = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.setCursor = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional uint32 limit = 4; * @return {number} */ proto.emerald.transaction.AddressTxRequest.prototype.getLimit = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.setLimit = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional bool only_unspent = 5; * @return {boolean} */ proto.emerald.transaction.AddressTxRequest.prototype.getOnlyUnspent = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); }; /** * @param {boolean} value * @return {!proto.emerald.transaction.AddressTxRequest} returns this */ proto.emerald.transaction.AddressTxRequest.prototype.setOnlyUnspent = function(value) { return jspb.Message.setProto3BooleanField(this, 5, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.emerald.transaction.AddressTxResponse.repeatedFields_ = [11]; 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.emerald.transaction.AddressTxResponse.prototype.toObject = function(opt_includeInstance) { return proto.emerald.transaction.AddressTxResponse.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.emerald.transaction.AddressTxResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressTxResponse.toObject = function(includeInstance, msg) { var f, obj = { blockchain: jspb.Message.getFieldWithDefault(msg, 1, 0), address: (f = msg.getAddress()) && common_pb.SingleAddress.toObject(includeInstance, f), xpubIndex: (f = msg.getXpubIndex()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), txId: jspb.Message.getFieldWithDefault(msg, 4, ""), block: (f = msg.getBlock()) && common_pb.BlockInfo.toObject(includeInstance, f), mempool: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), cursor: jspb.Message.getFieldWithDefault(msg, 7, ""), removed: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), failed: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), changesList: jspb.Message.toObjectList(msg.getChangesList(), proto.emerald.transaction.Change.toObject, includeInstance), txIndexInBlock: jspb.Message.getFieldWithDefault(msg, 12, 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.emerald.transaction.AddressTxResponse} */ proto.emerald.transaction.AddressTxResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.emerald.transaction.AddressTxResponse; return proto.emerald.transaction.AddressTxResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.emerald.transaction.AddressTxResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.emerald.transaction.AddressTxResponse} */ proto.emerald.transaction.AddressTxResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.emerald.ChainRef} */ (reader.readEnum()); msg.setBlockchain(value); break; case 2: var value = new common_pb.SingleAddress; reader.readMessage(value,common_pb.SingleAddress.deserializeBinaryFromReader); msg.setAddress(value); break; case 3: var value = new google_protobuf_wrappers_pb.UInt32Value; reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); msg.setXpubIndex(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setTxId(value); break; case 5: var value = new common_pb.BlockInfo; reader.readMessage(value,common_pb.BlockInfo.deserializeBinaryFromReader); msg.setBlock(value); break; case 6: var value = /** @type {boolean} */ (reader.readBool()); msg.setMempool(value); break; case 7: var value = /** @type {string} */ (reader.readString()); msg.setCursor(value); break; case 8: var value = /** @type {boolean} */ (reader.readBool()); msg.setRemoved(value); break; case 10: var value = /** @type {boolean} */ (reader.readBool()); msg.setFailed(value); break; case 11: var value = new proto.emerald.transaction.Change; reader.readMessage(value,proto.emerald.transaction.Change.deserializeBinaryFromReader); msg.addChanges(value); break; case 12: var value = /** @type {number} */ (reader.readUint32()); msg.setTxIndexInBlock(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.emerald.transaction.AddressTxResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.emerald.transaction.AddressTxResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.emerald.transaction.AddressTxResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.AddressTxResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlockchain(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getAddress(); if (f != null) { writer.writeMessage( 2, f, common_pb.SingleAddress.serializeBinaryToWriter ); } f = message.getXpubIndex(); if (f != null) { writer.writeMessage( 3, f, google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter ); } f = message.getTxId(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getBlock(); if (f != null) { writer.writeMessage( 5, f, common_pb.BlockInfo.serializeBinaryToWriter ); } f = message.getMempool(); if (f) { writer.writeBool( 6, f ); } f = message.getCursor(); if (f.length > 0) { writer.writeString( 7, f ); } f = message.getRemoved(); if (f) { writer.writeBool( 8, f ); } f = message.getFailed(); if (f) { writer.writeBool( 10, f ); } f = message.getChangesList(); if (f.length > 0) { writer.writeRepeatedMessage( 11, f, proto.emerald.transaction.Change.serializeBinaryToWriter ); } f = message.getTxIndexInBlock(); if (f !== 0) { writer.writeUint32( 12, f ); } }; /** * optional emerald.ChainRef blockchain = 1; * @return {!proto.emerald.ChainRef} */ proto.emerald.transaction.AddressTxResponse.prototype.getBlockchain = function() { return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.emerald.ChainRef} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setBlockchain = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional emerald.SingleAddress address = 2; * @return {?proto.emerald.SingleAddress} */ proto.emerald.transaction.AddressTxResponse.prototype.getAddress = function() { return /** @type{?proto.emerald.SingleAddress} */ ( jspb.Message.getWrapperField(this, common_pb.SingleAddress, 2)); }; /** * @param {?proto.emerald.SingleAddress|undefined} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setAddress = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.clearAddress = function() { return this.setAddress(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.hasAddress = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional google.protobuf.UInt32Value xpub_index = 3; * @return {?proto.google.protobuf.UInt32Value} */ proto.emerald.transaction.AddressTxResponse.prototype.getXpubIndex = function() { return /** @type{?proto.google.protobuf.UInt32Value} */ ( jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 3)); }; /** * @param {?proto.google.protobuf.UInt32Value|undefined} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setXpubIndex = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.clearXpubIndex = function() { return this.setXpubIndex(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.hasXpubIndex = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional string tx_id = 4; * @return {string} */ proto.emerald.transaction.AddressTxResponse.prototype.getTxId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setTxId = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * optional emerald.BlockInfo block = 5; * @return {?proto.emerald.BlockInfo} */ proto.emerald.transaction.AddressTxResponse.prototype.getBlock = function() { return /** @type{?proto.emerald.BlockInfo} */ ( jspb.Message.getWrapperField(this, common_pb.BlockInfo, 5)); }; /** * @param {?proto.emerald.BlockInfo|undefined} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setBlock = function(value) { return jspb.Message.setWrapperField(this, 5, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.clearBlock = function() { return this.setBlock(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.hasBlock = function() { return jspb.Message.getField(this, 5) != null; }; /** * optional bool mempool = 6; * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.getMempool = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); }; /** * @param {boolean} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setMempool = function(value) { return jspb.Message.setProto3BooleanField(this, 6, value); }; /** * optional string cursor = 7; * @return {string} */ proto.emerald.transaction.AddressTxResponse.prototype.getCursor = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * @param {string} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setCursor = function(value) { return jspb.Message.setProto3StringField(this, 7, value); }; /** * optional bool removed = 8; * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.getRemoved = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); }; /** * @param {boolean} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setRemoved = function(value) { return jspb.Message.setProto3BooleanField(this, 8, value); }; /** * optional bool failed = 10; * @return {boolean} */ proto.emerald.transaction.AddressTxResponse.prototype.getFailed = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); }; /** * @param {boolean} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setFailed = function(value) { return jspb.Message.setProto3BooleanField(this, 10, value); }; /** * repeated Change changes = 11; * @return {!Array<!proto.emerald.transaction.Change>} */ proto.emerald.transaction.AddressTxResponse.prototype.getChangesList = function() { return /** @type{!Array<!proto.emerald.transaction.Change>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.emerald.transaction.Change, 11)); }; /** * @param {!Array<!proto.emerald.transaction.Change>} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setChangesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 11, value); }; /** * @param {!proto.emerald.transaction.Change=} opt_value * @param {number=} opt_index * @return {!proto.emerald.transaction.Change} */ proto.emerald.transaction.AddressTxResponse.prototype.addChanges = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.emerald.transaction.Change, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.clearChangesList = function() { return this.setChangesList([]); }; /** * optional uint32 tx_index_in_block = 12; * @return {number} */ proto.emerald.transaction.AddressTxResponse.prototype.getTxIndexInBlock = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); }; /** * @param {number} value * @return {!proto.emerald.transaction.AddressTxResponse} returns this */ proto.emerald.transaction.AddressTxResponse.prototype.setTxIndexInBlock = function(value) { return jspb.Message.setProto3IntField(this, 12, 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.emerald.transaction.GetTransactionsRequest.prototype.toObject = function(opt_includeInstance) { return proto.emerald.transaction.GetTransactionsRequest.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.emerald.transaction.GetTransactionsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.GetTransactionsRequest.toObject = function(includeInstance, msg) { var f, obj = { chain: jspb.Message.getFieldWithDefault(msg, 1, 0), address: (f = msg.getAddress()) && common_pb.AnyAddress.toObject(includeInstance, f), cursor: jspb.Message.getFieldWithDefault(msg, 3, ""), limit: jspb.Message.getFieldWithDefault(msg, 4, 0), unspentOnly: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.emerald.transaction.GetTransactionsRequest} */ proto.emerald.transaction.GetTransactionsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.emerald.transaction.GetTransactionsRequest; return proto.emerald.transaction.GetTransactionsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.emerald.transaction.GetTransactionsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.emerald.transaction.GetTransactionsRequest} */ proto.emerald.transaction.GetTransactionsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.emerald.ChainRef} */ (reader.readEnum()); msg.setChain(value); break; case 2: var value = new common_pb.AnyAddress; reader.readMessage(value,common_pb.AnyAddress.deserializeBinaryFromReader); msg.setAddress(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setCursor(value); break; case 4: var value = /** @type {number} */ (reader.readUint32()); msg.setLimit(value); break; case 5: var value = /** @type {boolean} */ (reader.readBool()); msg.setUnspentOnly(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.emerald.transaction.GetTransactionsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.emerald.transaction.GetTransactionsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.emerald.transaction.GetTransactionsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.GetTransactionsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getChain(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getAddress(); if (f != null) { writer.writeMessage( 2, f, common_pb.AnyAddress.serializeBinaryToWriter ); } f = message.getCursor(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getLimit(); if (f !== 0) { writer.writeUint32( 4, f ); } f = message.getUnspentOnly(); if (f) { writer.writeBool( 5, f ); } }; /** * optional emerald.ChainRef chain = 1; * @return {!proto.emerald.ChainRef} */ proto.emerald.transaction.GetTransactionsRequest.prototype.getChain = function() { return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.emerald.ChainRef} value * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.setChain = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional emerald.AnyAddress address = 2; * @return {?proto.emerald.AnyAddress} */ proto.emerald.transaction.GetTransactionsRequest.prototype.getAddress = function() { return /** @type{?proto.emerald.AnyAddress} */ ( jspb.Message.getWrapperField(this, common_pb.AnyAddress, 2)); }; /** * @param {?proto.emerald.AnyAddress|undefined} value * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.setAddress = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.clearAddress = function() { return this.setAddress(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.GetTransactionsRequest.prototype.hasAddress = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional string cursor = 3; * @return {string} */ proto.emerald.transaction.GetTransactionsRequest.prototype.getCursor = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.setCursor = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional uint32 limit = 4; * @return {number} */ proto.emerald.transaction.GetTransactionsRequest.prototype.getLimit = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.setLimit = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional bool unspent_only = 5; * @return {boolean} */ proto.emerald.transaction.GetTransactionsRequest.prototype.getUnspentOnly = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); }; /** * @param {boolean} value * @return {!proto.emerald.transaction.GetTransactionsRequest} returns this */ proto.emerald.transaction.GetTransactionsRequest.prototype.setUnspentOnly = function(value) { return jspb.Message.setProto3BooleanField(this, 5, 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.emerald.transaction.SubscribeTransactionsRequest.prototype.toObject = function(opt_includeInstance) { return proto.emerald.transaction.SubscribeTransactionsRequest.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.emerald.transaction.SubscribeTransactionsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.SubscribeTransactionsRequest.toObject = function(includeInstance, msg) { var f, obj = { chain: jspb.Message.getFieldWithDefault(msg, 1, 0), address: (f = msg.getAddress()) && common_pb.AnyAddress.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.emerald.transaction.SubscribeTransactionsRequest} */ proto.emerald.transaction.SubscribeTransactionsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.emerald.transaction.SubscribeTransactionsRequest; return proto.emerald.transaction.SubscribeTransactionsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.emerald.transaction.SubscribeTransactionsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.emerald.transaction.SubscribeTransactionsRequest} */ proto.emerald.transaction.SubscribeTransactionsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.emerald.ChainRef} */ (reader.readEnum()); msg.setChain(value); break; case 2: var value = new common_pb.AnyAddress; reader.readMessage(value,common_pb.AnyAddress.deserializeBinaryFromReader); msg.setAddress(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.emerald.transaction.SubscribeTransactionsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.emerald.transaction.SubscribeTransactionsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.emerald.transaction.SubscribeTransactionsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getChain(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getAddress(); if (f != null) { writer.writeMessage( 2, f, common_pb.AnyAddress.serializeBinaryToWriter ); } }; /** * optional emerald.ChainRef chain = 1; * @return {!proto.emerald.ChainRef} */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.getChain = function() { return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.emerald.ChainRef} value * @return {!proto.emerald.transaction.SubscribeTransactionsRequest} returns this */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.setChain = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional emerald.AnyAddress address = 2; * @return {?proto.emerald.AnyAddress} */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.getAddress = function() { return /** @type{?proto.emerald.AnyAddress} */ ( jspb.Message.getWrapperField(this, common_pb.AnyAddress, 2)); }; /** * @param {?proto.emerald.AnyAddress|undefined} value * @return {!proto.emerald.transaction.SubscribeTransactionsRequest} returns this */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.setAddress = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.emerald.transaction.SubscribeTransactionsRequest} returns this */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.clearAddress = function() { return this.setAddress(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.emerald.transaction.SubscribeTransactionsRequest.prototype.hasAddress = function() { return jspb.Message.getField(this, 2) != null; }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.emerald.transaction.AddressTransaction.repeatedFields_ = [11]; 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>