@emeraldpay/api
Version:
Common code for Emerald gRPC APIs
1,050 lines (904 loc) • 32.6 kB
JavaScript
// source: address.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.address.AddressCapability', null, global);
goog.exportSymbol('proto.emerald.address.AddressControl', null, global);
goog.exportSymbol('proto.emerald.address.DescribeRequest', null, global);
goog.exportSymbol('proto.emerald.address.DescribeResponse', null, global);
goog.exportSymbol('proto.emerald.address.DescribeXpubRequest', null, global);
goog.exportSymbol('proto.emerald.address.DescribeXpubResponse', 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.address.DescribeRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.emerald.address.DescribeRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.emerald.address.DescribeRequest.displayName = 'proto.emerald.address.DescribeRequest';
}
/**
* 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.address.DescribeResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.emerald.address.DescribeResponse.repeatedFields_, null);
};
goog.inherits(proto.emerald.address.DescribeResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.emerald.address.DescribeResponse.displayName = 'proto.emerald.address.DescribeResponse';
}
/**
* 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.address.DescribeXpubRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.emerald.address.DescribeXpubRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.emerald.address.DescribeXpubRequest.displayName = 'proto.emerald.address.DescribeXpubRequest';
}
/**
* 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.address.DescribeXpubResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.emerald.address.DescribeXpubResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.emerald.address.DescribeXpubResponse.displayName = 'proto.emerald.address.DescribeXpubResponse';
}
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.address.DescribeRequest.prototype.toObject = function(opt_includeInstance) {
return proto.emerald.address.DescribeRequest.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.address.DescribeRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeRequest.toObject = function(includeInstance, msg) {
var f, obj = {
chain: jspb.Message.getFieldWithDefault(msg, 1, 0),
address: (f = msg.getAddress()) && common_pb.SingleAddress.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.address.DescribeRequest}
*/
proto.emerald.address.DescribeRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.emerald.address.DescribeRequest;
return proto.emerald.address.DescribeRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.emerald.address.DescribeRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.emerald.address.DescribeRequest}
*/
proto.emerald.address.DescribeRequest.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.SingleAddress;
reader.readMessage(value,common_pb.SingleAddress.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.address.DescribeRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.emerald.address.DescribeRequest.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.address.DescribeRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeRequest.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.SingleAddress.serializeBinaryToWriter
);
}
};
/**
* optional emerald.ChainRef chain = 1;
* @return {!proto.emerald.ChainRef}
*/
proto.emerald.address.DescribeRequest.prototype.getChain = function() {
return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.emerald.ChainRef} value
* @return {!proto.emerald.address.DescribeRequest} returns this
*/
proto.emerald.address.DescribeRequest.prototype.setChain = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional emerald.SingleAddress address = 2;
* @return {?proto.emerald.SingleAddress}
*/
proto.emerald.address.DescribeRequest.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.address.DescribeRequest} returns this
*/
proto.emerald.address.DescribeRequest.prototype.setAddress = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeRequest} returns this
*/
proto.emerald.address.DescribeRequest.prototype.clearAddress = function() {
return this.setAddress(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeRequest.prototype.hasAddress = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.emerald.address.DescribeResponse.repeatedFields_ = [4];
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.address.DescribeResponse.prototype.toObject = function(opt_includeInstance) {
return proto.emerald.address.DescribeResponse.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.address.DescribeResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeResponse.toObject = function(includeInstance, msg) {
var f, obj = {
address: (f = msg.getAddress()) && common_pb.SingleAddress.toObject(includeInstance, f),
active: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
control: jspb.Message.getFieldWithDefault(msg, 3, 0),
capabilitiesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : 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.address.DescribeResponse}
*/
proto.emerald.address.DescribeResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.emerald.address.DescribeResponse;
return proto.emerald.address.DescribeResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.emerald.address.DescribeResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.emerald.address.DescribeResponse}
*/
proto.emerald.address.DescribeResponse.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 {boolean} */ (reader.readBool());
msg.setActive(value);
break;
case 3:
var value = /** @type {!proto.emerald.address.AddressControl} */ (reader.readEnum());
msg.setControl(value);
break;
case 4:
var values = /** @type {!Array<!proto.emerald.address.AddressCapability>} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]);
for (var i = 0; i < values.length; i++) {
msg.addCapabilities(values[i]);
}
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.emerald.address.DescribeResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.emerald.address.DescribeResponse.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.address.DescribeResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f != null) {
writer.writeMessage(
1,
f,
common_pb.SingleAddress.serializeBinaryToWriter
);
}
f = message.getActive();
if (f) {
writer.writeBool(
2,
f
);
}
f = message.getControl();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
f = message.getCapabilitiesList();
if (f.length > 0) {
writer.writePackedEnum(
4,
f
);
}
};
/**
* optional emerald.SingleAddress address = 1;
* @return {?proto.emerald.SingleAddress}
*/
proto.emerald.address.DescribeResponse.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.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.setAddress = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.clearAddress = function() {
return this.setAddress(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeResponse.prototype.hasAddress = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional bool active = 2;
* @return {boolean}
*/
proto.emerald.address.DescribeResponse.prototype.getActive = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};
/**
* @param {boolean} value
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.setActive = function(value) {
return jspb.Message.setProto3BooleanField(this, 2, value);
};
/**
* optional AddressControl control = 3;
* @return {!proto.emerald.address.AddressControl}
*/
proto.emerald.address.DescribeResponse.prototype.getControl = function() {
return /** @type {!proto.emerald.address.AddressControl} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {!proto.emerald.address.AddressControl} value
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.setControl = function(value) {
return jspb.Message.setProto3EnumField(this, 3, value);
};
/**
* repeated AddressCapability capabilities = 4;
* @return {!Array<!proto.emerald.address.AddressCapability>}
*/
proto.emerald.address.DescribeResponse.prototype.getCapabilitiesList = function() {
return /** @type {!Array<!proto.emerald.address.AddressCapability>} */ (jspb.Message.getRepeatedField(this, 4));
};
/**
* @param {!Array<!proto.emerald.address.AddressCapability>} value
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.setCapabilitiesList = function(value) {
return jspb.Message.setField(this, 4, value || []);
};
/**
* @param {!proto.emerald.address.AddressCapability} value
* @param {number=} opt_index
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.addCapabilities = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.emerald.address.DescribeResponse} returns this
*/
proto.emerald.address.DescribeResponse.prototype.clearCapabilitiesList = function() {
return this.setCapabilitiesList([]);
};
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.address.DescribeXpubRequest.prototype.toObject = function(opt_includeInstance) {
return proto.emerald.address.DescribeXpubRequest.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.address.DescribeXpubRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeXpubRequest.toObject = function(includeInstance, msg) {
var f, obj = {
chain: jspb.Message.getFieldWithDefault(msg, 1, 0),
address: (f = msg.getAddress()) && common_pb.XpubAddress.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.address.DescribeXpubRequest}
*/
proto.emerald.address.DescribeXpubRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.emerald.address.DescribeXpubRequest;
return proto.emerald.address.DescribeXpubRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.emerald.address.DescribeXpubRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.emerald.address.DescribeXpubRequest}
*/
proto.emerald.address.DescribeXpubRequest.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.XpubAddress;
reader.readMessage(value,common_pb.XpubAddress.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.address.DescribeXpubRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.emerald.address.DescribeXpubRequest.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.address.DescribeXpubRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeXpubRequest.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.XpubAddress.serializeBinaryToWriter
);
}
};
/**
* optional emerald.ChainRef chain = 1;
* @return {!proto.emerald.ChainRef}
*/
proto.emerald.address.DescribeXpubRequest.prototype.getChain = function() {
return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.emerald.ChainRef} value
* @return {!proto.emerald.address.DescribeXpubRequest} returns this
*/
proto.emerald.address.DescribeXpubRequest.prototype.setChain = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional emerald.XpubAddress address = 2;
* @return {?proto.emerald.XpubAddress}
*/
proto.emerald.address.DescribeXpubRequest.prototype.getAddress = function() {
return /** @type{?proto.emerald.XpubAddress} */ (
jspb.Message.getWrapperField(this, common_pb.XpubAddress, 2));
};
/**
* @param {?proto.emerald.XpubAddress|undefined} value
* @return {!proto.emerald.address.DescribeXpubRequest} returns this
*/
proto.emerald.address.DescribeXpubRequest.prototype.setAddress = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeXpubRequest} returns this
*/
proto.emerald.address.DescribeXpubRequest.prototype.clearAddress = function() {
return this.setAddress(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeXpubRequest.prototype.hasAddress = function() {
return jspb.Message.getField(this, 2) != null;
};
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.address.DescribeXpubResponse.prototype.toObject = function(opt_includeInstance) {
return proto.emerald.address.DescribeXpubResponse.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.address.DescribeXpubResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeXpubResponse.toObject = function(includeInstance, msg) {
var f, obj = {
chain: jspb.Message.getFieldWithDefault(msg, 1, 0),
address: (f = msg.getAddress()) && common_pb.XpubAddress.toObject(includeInstance, f),
lastAddress: (f = msg.getLastAddress()) && common_pb.SingleAddress.toObject(includeInstance, f),
lastIndex: (f = msg.getLastIndex()) && google_protobuf_wrappers_pb.UInt32Value.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.address.DescribeXpubResponse}
*/
proto.emerald.address.DescribeXpubResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.emerald.address.DescribeXpubResponse;
return proto.emerald.address.DescribeXpubResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.emerald.address.DescribeXpubResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.emerald.address.DescribeXpubResponse}
*/
proto.emerald.address.DescribeXpubResponse.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.XpubAddress;
reader.readMessage(value,common_pb.XpubAddress.deserializeBinaryFromReader);
msg.setAddress(value);
break;
case 3:
var value = new common_pb.SingleAddress;
reader.readMessage(value,common_pb.SingleAddress.deserializeBinaryFromReader);
msg.setLastAddress(value);
break;
case 4:
var value = new google_protobuf_wrappers_pb.UInt32Value;
reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader);
msg.setLastIndex(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.emerald.address.DescribeXpubResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.emerald.address.DescribeXpubResponse.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.address.DescribeXpubResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.emerald.address.DescribeXpubResponse.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.XpubAddress.serializeBinaryToWriter
);
}
f = message.getLastAddress();
if (f != null) {
writer.writeMessage(
3,
f,
common_pb.SingleAddress.serializeBinaryToWriter
);
}
f = message.getLastIndex();
if (f != null) {
writer.writeMessage(
4,
f,
google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter
);
}
};
/**
* optional emerald.ChainRef chain = 1;
* @return {!proto.emerald.ChainRef}
*/
proto.emerald.address.DescribeXpubResponse.prototype.getChain = function() {
return /** @type {!proto.emerald.ChainRef} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.emerald.ChainRef} value
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.setChain = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional emerald.XpubAddress address = 2;
* @return {?proto.emerald.XpubAddress}
*/
proto.emerald.address.DescribeXpubResponse.prototype.getAddress = function() {
return /** @type{?proto.emerald.XpubAddress} */ (
jspb.Message.getWrapperField(this, common_pb.XpubAddress, 2));
};
/**
* @param {?proto.emerald.XpubAddress|undefined} value
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.setAddress = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.clearAddress = function() {
return this.setAddress(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeXpubResponse.prototype.hasAddress = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional emerald.SingleAddress last_address = 3;
* @return {?proto.emerald.SingleAddress}
*/
proto.emerald.address.DescribeXpubResponse.prototype.getLastAddress = function() {
return /** @type{?proto.emerald.SingleAddress} */ (
jspb.Message.getWrapperField(this, common_pb.SingleAddress, 3));
};
/**
* @param {?proto.emerald.SingleAddress|undefined} value
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.setLastAddress = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.clearLastAddress = function() {
return this.setLastAddress(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeXpubResponse.prototype.hasLastAddress = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional google.protobuf.UInt32Value last_index = 4;
* @return {?proto.google.protobuf.UInt32Value}
*/
proto.emerald.address.DescribeXpubResponse.prototype.getLastIndex = function() {
return /** @type{?proto.google.protobuf.UInt32Value} */ (
jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 4));
};
/**
* @param {?proto.google.protobuf.UInt32Value|undefined} value
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.setLastIndex = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.emerald.address.DescribeXpubResponse} returns this
*/
proto.emerald.address.DescribeXpubResponse.prototype.clearLastIndex = function() {
return this.setLastIndex(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.emerald.address.DescribeXpubResponse.prototype.hasLastIndex = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* @enum {number}
*/
proto.emerald.address.AddressControl = {
CTRL_UNKNOWN: 0,
CTRL_PERSON: 1,
CTRL_CONTRACT: 2
};
/**
* @enum {number}
*/
proto.emerald.address.AddressCapability = {
CAP_INVALID: 0,
CAP_ERC20: 1
};
goog.object.extend(exports, proto.emerald.address);