@routerprotocol/chain-api
Version:
Router Chain API Query client with generated gRPC bindings.
695 lines (599 loc) • 22.1 kB
JavaScript
// source: cosmos/base/store/v1beta1/commit_info.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('return this')();
var gogoproto_gogo_pb = require('../../../../gogoproto/gogo_pb.js');
goog.object.extend(proto, gogoproto_gogo_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
goog.exportSymbol('proto.cosmos.base.store.v1beta1.CommitID', null, global);
goog.exportSymbol('proto.cosmos.base.store.v1beta1.CommitInfo', null, global);
goog.exportSymbol('proto.cosmos.base.store.v1beta1.StoreInfo', 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.cosmos.base.store.v1beta1.CommitInfo = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.cosmos.base.store.v1beta1.CommitInfo.repeatedFields_, null);
};
goog.inherits(proto.cosmos.base.store.v1beta1.CommitInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.store.v1beta1.CommitInfo.displayName = 'proto.cosmos.base.store.v1beta1.CommitInfo';
}
/**
* 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.cosmos.base.store.v1beta1.StoreInfo = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.store.v1beta1.StoreInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.store.v1beta1.StoreInfo.displayName = 'proto.cosmos.base.store.v1beta1.StoreInfo';
}
/**
* 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.cosmos.base.store.v1beta1.CommitID = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.store.v1beta1.CommitID, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.store.v1beta1.CommitID.displayName = 'proto.cosmos.base.store.v1beta1.CommitID';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.cosmos.base.store.v1beta1.CommitInfo.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.cosmos.base.store.v1beta1.CommitInfo.prototype.toObject = function(opt_includeInstance) {
return proto.cosmos.base.store.v1beta1.CommitInfo.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.cosmos.base.store.v1beta1.CommitInfo} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.CommitInfo.toObject = function(includeInstance, msg) {
var f, obj = {
version: jspb.Message.getFieldWithDefault(msg, 1, 0),
storeInfosList: jspb.Message.toObjectList(msg.getStoreInfosList(),
proto.cosmos.base.store.v1beta1.StoreInfo.toObject, includeInstance),
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.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.cosmos.base.store.v1beta1.CommitInfo}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.store.v1beta1.CommitInfo;
return proto.cosmos.base.store.v1beta1.CommitInfo.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.store.v1beta1.CommitInfo} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setVersion(value);
break;
case 2:
var value = new proto.cosmos.base.store.v1beta1.StoreInfo;
reader.readMessage(value,proto.cosmos.base.store.v1beta1.StoreInfo.deserializeBinaryFromReader);
msg.addStoreInfos(value);
break;
case 3:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTimestamp(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.store.v1beta1.CommitInfo.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.store.v1beta1.CommitInfo} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.CommitInfo.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getVersion();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = message.getStoreInfosList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.cosmos.base.store.v1beta1.StoreInfo.serializeBinaryToWriter
);
}
f = message.getTimestamp();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
};
/**
* optional int64 version = 1;
* @return {number}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.getVersion = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo} returns this
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.setVersion = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* repeated StoreInfo store_infos = 2;
* @return {!Array<!proto.cosmos.base.store.v1beta1.StoreInfo>}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.getStoreInfosList = function() {
return /** @type{!Array<!proto.cosmos.base.store.v1beta1.StoreInfo>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.cosmos.base.store.v1beta1.StoreInfo, 2));
};
/**
* @param {!Array<!proto.cosmos.base.store.v1beta1.StoreInfo>} value
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo} returns this
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.setStoreInfosList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.cosmos.base.store.v1beta1.StoreInfo=} opt_value
* @param {number=} opt_index
* @return {!proto.cosmos.base.store.v1beta1.StoreInfo}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.addStoreInfos = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.cosmos.base.store.v1beta1.StoreInfo, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo} returns this
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.clearStoreInfosList = function() {
return this.setStoreInfosList([]);
};
/**
* optional google.protobuf.Timestamp timestamp = 3;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.getTimestamp = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo} returns this
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.setTimestamp = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.store.v1beta1.CommitInfo} returns this
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.store.v1beta1.CommitInfo.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 3) != 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.cosmos.base.store.v1beta1.StoreInfo.prototype.toObject = function(opt_includeInstance) {
return proto.cosmos.base.store.v1beta1.StoreInfo.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.cosmos.base.store.v1beta1.StoreInfo} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.StoreInfo.toObject = function(includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
commitId: (f = msg.getCommitId()) && proto.cosmos.base.store.v1beta1.CommitID.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.cosmos.base.store.v1beta1.StoreInfo}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.store.v1beta1.StoreInfo;
return proto.cosmos.base.store.v1beta1.StoreInfo.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.store.v1beta1.StoreInfo} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.store.v1beta1.StoreInfo}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 2:
var value = new proto.cosmos.base.store.v1beta1.CommitID;
reader.readMessage(value,proto.cosmos.base.store.v1beta1.CommitID.deserializeBinaryFromReader);
msg.setCommitId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.store.v1beta1.StoreInfo.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.store.v1beta1.StoreInfo} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.StoreInfo.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getCommitId();
if (f != null) {
writer.writeMessage(
2,
f,
proto.cosmos.base.store.v1beta1.CommitID.serializeBinaryToWriter
);
}
};
/**
* optional string name = 1;
* @return {string}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.cosmos.base.store.v1beta1.StoreInfo} returns this
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional CommitID commit_id = 2;
* @return {?proto.cosmos.base.store.v1beta1.CommitID}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.getCommitId = function() {
return /** @type{?proto.cosmos.base.store.v1beta1.CommitID} */ (
jspb.Message.getWrapperField(this, proto.cosmos.base.store.v1beta1.CommitID, 2));
};
/**
* @param {?proto.cosmos.base.store.v1beta1.CommitID|undefined} value
* @return {!proto.cosmos.base.store.v1beta1.StoreInfo} returns this
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.setCommitId = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.store.v1beta1.StoreInfo} returns this
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.clearCommitId = function() {
return this.setCommitId(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.store.v1beta1.StoreInfo.prototype.hasCommitId = 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.cosmos.base.store.v1beta1.CommitID.prototype.toObject = function(opt_includeInstance) {
return proto.cosmos.base.store.v1beta1.CommitID.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.cosmos.base.store.v1beta1.CommitID} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.CommitID.toObject = function(includeInstance, msg) {
var f, obj = {
version: jspb.Message.getFieldWithDefault(msg, 1, 0),
hash: msg.getHash_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.cosmos.base.store.v1beta1.CommitID}
*/
proto.cosmos.base.store.v1beta1.CommitID.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.store.v1beta1.CommitID;
return proto.cosmos.base.store.v1beta1.CommitID.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.store.v1beta1.CommitID} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.store.v1beta1.CommitID}
*/
proto.cosmos.base.store.v1beta1.CommitID.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setVersion(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setHash(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.store.v1beta1.CommitID.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.store.v1beta1.CommitID} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.store.v1beta1.CommitID.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getVersion();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = message.getHash_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
};
/**
* optional int64 version = 1;
* @return {number}
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.getVersion = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.cosmos.base.store.v1beta1.CommitID} returns this
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.setVersion = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional bytes hash = 2;
* @return {!(string|Uint8Array)}
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.getHash = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes hash = 2;
* This is a type-conversion wrapper around `getHash()`
* @return {string}
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.getHash_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getHash()));
};
/**
* optional bytes hash = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getHash()`
* @return {!Uint8Array}
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.getHash_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getHash()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.cosmos.base.store.v1beta1.CommitID} returns this
*/
proto.cosmos.base.store.v1beta1.CommitID.prototype.setHash = function(value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};
goog.object.extend(exports, proto.cosmos.base.store.v1beta1);