@kaiachain/kss-bridges-celer
Version:
TypeScript client and use-cases for cBridge
1,145 lines (985 loc) • 37.2 kB
JavaScript
// source: sgn/farming/v1/genesis.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 gogoproto_gogo_pb = require('../../../gogoproto/gogo_pb.js');
goog.object.extend(proto, gogoproto_gogo_pb);
var sgn_farming_v1_farming_pb = require('../../../sgn/farming/v1/farming_pb.js');
goog.object.extend(proto, sgn_farming_v1_farming_pb);
var sgn_common_v1_common_pb = require('../../../sgn/common/v1/common_pb.js');
goog.object.extend(proto, sgn_common_v1_common_pb);
goog.exportSymbol('proto.sgn.farming.v1.GenesisState', null, global);
goog.exportSymbol('proto.sgn.farming.v1.PoolCurrentRewardsRecord', null, global);
goog.exportSymbol('proto.sgn.farming.v1.PoolHistoricalRewardsRecord', null, global);
goog.exportSymbol('proto.sgn.farming.v1.StakeInfoRecord', 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.sgn.farming.v1.PoolHistoricalRewardsRecord = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.sgn.farming.v1.PoolHistoricalRewardsRecord, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.displayName = 'proto.sgn.farming.v1.PoolHistoricalRewardsRecord';
}
/**
* 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.sgn.farming.v1.PoolCurrentRewardsRecord = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.sgn.farming.v1.PoolCurrentRewardsRecord, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.displayName = 'proto.sgn.farming.v1.PoolCurrentRewardsRecord';
}
/**
* 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.sgn.farming.v1.StakeInfoRecord = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.sgn.farming.v1.StakeInfoRecord, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.farming.v1.StakeInfoRecord.displayName = 'proto.sgn.farming.v1.StakeInfoRecord';
}
/**
* 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.sgn.farming.v1.GenesisState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.sgn.farming.v1.GenesisState.repeatedFields_, null);
};
goog.inherits(proto.sgn.farming.v1.GenesisState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.farming.v1.GenesisState.displayName = 'proto.sgn.farming.v1.GenesisState';
}
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.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.farming.v1.PoolHistoricalRewardsRecord.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.sgn.farming.v1.PoolHistoricalRewardsRecord} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.toObject = function(includeInstance, msg) {
var f, obj = {
poolName: jspb.Message.getFieldWithDefault(msg, 1, ""),
period: jspb.Message.getFieldWithDefault(msg, 2, 0),
rewards: (f = msg.getRewards()) && sgn_farming_v1_farming_pb.PoolHistoricalRewards.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.sgn.farming.v1.PoolHistoricalRewardsRecord}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.farming.v1.PoolHistoricalRewardsRecord;
return proto.sgn.farming.v1.PoolHistoricalRewardsRecord.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.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.setPoolName(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint64());
msg.setPeriod(value);
break;
case 3:
var value = new sgn_farming_v1_farming_pb.PoolHistoricalRewards;
reader.readMessage(value,sgn_farming_v1_farming_pb.PoolHistoricalRewards.deserializeBinaryFromReader);
msg.setRewards(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPoolName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPeriod();
if (f !== 0) {
writer.writeUint64(
2,
f
);
}
f = message.getRewards();
if (f != null) {
writer.writeMessage(
3,
f,
sgn_farming_v1_farming_pb.PoolHistoricalRewards.serializeBinaryToWriter
);
}
};
/**
* optional string pool_name = 1;
* @return {string}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.getPoolName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.setPoolName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint64 period = 2;
* @return {number}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.getPeriod = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.setPeriod = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional PoolHistoricalRewards rewards = 3;
* @return {?proto.sgn.farming.v1.PoolHistoricalRewards}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.getRewards = function() {
return /** @type{?proto.sgn.farming.v1.PoolHistoricalRewards} */ (
jspb.Message.getWrapperField(this, sgn_farming_v1_farming_pb.PoolHistoricalRewards, 3));
};
/**
* @param {?proto.sgn.farming.v1.PoolHistoricalRewards|undefined} value
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.setRewards = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.clearRewards = function() {
return this.setRewards(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.prototype.hasRewards = 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.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.farming.v1.PoolCurrentRewardsRecord.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.sgn.farming.v1.PoolCurrentRewardsRecord} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.toObject = function(includeInstance, msg) {
var f, obj = {
poolName: jspb.Message.getFieldWithDefault(msg, 1, ""),
rewards: (f = msg.getRewards()) && sgn_farming_v1_farming_pb.PoolCurrentRewards.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.sgn.farming.v1.PoolCurrentRewardsRecord}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.farming.v1.PoolCurrentRewardsRecord;
return proto.sgn.farming.v1.PoolCurrentRewardsRecord.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.farming.v1.PoolCurrentRewardsRecord} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.farming.v1.PoolCurrentRewardsRecord}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.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.setPoolName(value);
break;
case 2:
var value = new sgn_farming_v1_farming_pb.PoolCurrentRewards;
reader.readMessage(value,sgn_farming_v1_farming_pb.PoolCurrentRewards.deserializeBinaryFromReader);
msg.setRewards(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.farming.v1.PoolCurrentRewardsRecord.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.farming.v1.PoolCurrentRewardsRecord} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPoolName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getRewards();
if (f != null) {
writer.writeMessage(
2,
f,
sgn_farming_v1_farming_pb.PoolCurrentRewards.serializeBinaryToWriter
);
}
};
/**
* optional string pool_name = 1;
* @return {string}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.getPoolName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.sgn.farming.v1.PoolCurrentRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.setPoolName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional PoolCurrentRewards rewards = 2;
* @return {?proto.sgn.farming.v1.PoolCurrentRewards}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.getRewards = function() {
return /** @type{?proto.sgn.farming.v1.PoolCurrentRewards} */ (
jspb.Message.getWrapperField(this, sgn_farming_v1_farming_pb.PoolCurrentRewards, 2));
};
/**
* @param {?proto.sgn.farming.v1.PoolCurrentRewards|undefined} value
* @return {!proto.sgn.farming.v1.PoolCurrentRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.setRewards = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.farming.v1.PoolCurrentRewardsRecord} returns this
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.clearRewards = function() {
return this.setRewards(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.farming.v1.PoolCurrentRewardsRecord.prototype.hasRewards = 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.sgn.farming.v1.StakeInfoRecord.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.farming.v1.StakeInfoRecord.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.sgn.farming.v1.StakeInfoRecord} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.StakeInfoRecord.toObject = function(includeInstance, msg) {
var f, obj = {
poolName: jspb.Message.getFieldWithDefault(msg, 1, ""),
stakerAddress: jspb.Message.getFieldWithDefault(msg, 2, ""),
stakeInfo: (f = msg.getStakeInfo()) && sgn_farming_v1_farming_pb.StakeInfo.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.sgn.farming.v1.StakeInfoRecord}
*/
proto.sgn.farming.v1.StakeInfoRecord.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.farming.v1.StakeInfoRecord;
return proto.sgn.farming.v1.StakeInfoRecord.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.farming.v1.StakeInfoRecord} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.farming.v1.StakeInfoRecord}
*/
proto.sgn.farming.v1.StakeInfoRecord.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.setPoolName(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setStakerAddress(value);
break;
case 3:
var value = new sgn_farming_v1_farming_pb.StakeInfo;
reader.readMessage(value,sgn_farming_v1_farming_pb.StakeInfo.deserializeBinaryFromReader);
msg.setStakeInfo(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.farming.v1.StakeInfoRecord.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.farming.v1.StakeInfoRecord} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.StakeInfoRecord.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPoolName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getStakerAddress();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getStakeInfo();
if (f != null) {
writer.writeMessage(
3,
f,
sgn_farming_v1_farming_pb.StakeInfo.serializeBinaryToWriter
);
}
};
/**
* optional string pool_name = 1;
* @return {string}
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.getPoolName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.sgn.farming.v1.StakeInfoRecord} returns this
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.setPoolName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string staker_address = 2;
* @return {string}
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.getStakerAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.sgn.farming.v1.StakeInfoRecord} returns this
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.setStakerAddress = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional StakeInfo stake_info = 3;
* @return {?proto.sgn.farming.v1.StakeInfo}
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.getStakeInfo = function() {
return /** @type{?proto.sgn.farming.v1.StakeInfo} */ (
jspb.Message.getWrapperField(this, sgn_farming_v1_farming_pb.StakeInfo, 3));
};
/**
* @param {?proto.sgn.farming.v1.StakeInfo|undefined} value
* @return {!proto.sgn.farming.v1.StakeInfoRecord} returns this
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.setStakeInfo = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.farming.v1.StakeInfoRecord} returns this
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.clearStakeInfo = function() {
return this.setStakeInfo(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.farming.v1.StakeInfoRecord.prototype.hasStakeInfo = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.sgn.farming.v1.GenesisState.repeatedFields_ = [2,3,4,5,6];
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.sgn.farming.v1.GenesisState.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.farming.v1.GenesisState.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.sgn.farming.v1.GenesisState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.GenesisState.toObject = function(includeInstance, msg) {
var f, obj = {
params: (f = msg.getParams()) && sgn_farming_v1_farming_pb.Params.toObject(includeInstance, f),
poolsList: jspb.Message.toObjectList(msg.getPoolsList(),
sgn_farming_v1_farming_pb.FarmingPool.toObject, includeInstance),
stakeInfosList: jspb.Message.toObjectList(msg.getStakeInfosList(),
sgn_farming_v1_farming_pb.StakeInfo.toObject, includeInstance),
poolHistoricalRewardsList: jspb.Message.toObjectList(msg.getPoolHistoricalRewardsList(),
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.toObject, includeInstance),
poolCurrentRewardsList: jspb.Message.toObjectList(msg.getPoolCurrentRewardsList(),
proto.sgn.farming.v1.PoolCurrentRewardsRecord.toObject, includeInstance),
rewardContractsList: jspb.Message.toObjectList(msg.getRewardContractsList(),
sgn_common_v1_common_pb.ContractInfo.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.sgn.farming.v1.GenesisState}
*/
proto.sgn.farming.v1.GenesisState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.farming.v1.GenesisState;
return proto.sgn.farming.v1.GenesisState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.farming.v1.GenesisState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.farming.v1.GenesisState}
*/
proto.sgn.farming.v1.GenesisState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new sgn_farming_v1_farming_pb.Params;
reader.readMessage(value,sgn_farming_v1_farming_pb.Params.deserializeBinaryFromReader);
msg.setParams(value);
break;
case 2:
var value = new sgn_farming_v1_farming_pb.FarmingPool;
reader.readMessage(value,sgn_farming_v1_farming_pb.FarmingPool.deserializeBinaryFromReader);
msg.addPools(value);
break;
case 3:
var value = new sgn_farming_v1_farming_pb.StakeInfo;
reader.readMessage(value,sgn_farming_v1_farming_pb.StakeInfo.deserializeBinaryFromReader);
msg.addStakeInfos(value);
break;
case 4:
var value = new proto.sgn.farming.v1.PoolHistoricalRewardsRecord;
reader.readMessage(value,proto.sgn.farming.v1.PoolHistoricalRewardsRecord.deserializeBinaryFromReader);
msg.addPoolHistoricalRewards(value);
break;
case 5:
var value = new proto.sgn.farming.v1.PoolCurrentRewardsRecord;
reader.readMessage(value,proto.sgn.farming.v1.PoolCurrentRewardsRecord.deserializeBinaryFromReader);
msg.addPoolCurrentRewards(value);
break;
case 6:
var value = new sgn_common_v1_common_pb.ContractInfo;
reader.readMessage(value,sgn_common_v1_common_pb.ContractInfo.deserializeBinaryFromReader);
msg.addRewardContracts(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.farming.v1.GenesisState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.farming.v1.GenesisState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.farming.v1.GenesisState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.farming.v1.GenesisState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getParams();
if (f != null) {
writer.writeMessage(
1,
f,
sgn_farming_v1_farming_pb.Params.serializeBinaryToWriter
);
}
f = message.getPoolsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
sgn_farming_v1_farming_pb.FarmingPool.serializeBinaryToWriter
);
}
f = message.getStakeInfosList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
sgn_farming_v1_farming_pb.StakeInfo.serializeBinaryToWriter
);
}
f = message.getPoolHistoricalRewardsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
f,
proto.sgn.farming.v1.PoolHistoricalRewardsRecord.serializeBinaryToWriter
);
}
f = message.getPoolCurrentRewardsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
5,
f,
proto.sgn.farming.v1.PoolCurrentRewardsRecord.serializeBinaryToWriter
);
}
f = message.getRewardContractsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
6,
f,
sgn_common_v1_common_pb.ContractInfo.serializeBinaryToWriter
);
}
};
/**
* optional Params params = 1;
* @return {?proto.sgn.farming.v1.Params}
*/
proto.sgn.farming.v1.GenesisState.prototype.getParams = function() {
return /** @type{?proto.sgn.farming.v1.Params} */ (
jspb.Message.getWrapperField(this, sgn_farming_v1_farming_pb.Params, 1));
};
/**
* @param {?proto.sgn.farming.v1.Params|undefined} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setParams = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearParams = function() {
return this.setParams(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.farming.v1.GenesisState.prototype.hasParams = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* repeated FarmingPool pools = 2;
* @return {!Array<!proto.sgn.farming.v1.FarmingPool>}
*/
proto.sgn.farming.v1.GenesisState.prototype.getPoolsList = function() {
return /** @type{!Array<!proto.sgn.farming.v1.FarmingPool>} */ (
jspb.Message.getRepeatedWrapperField(this, sgn_farming_v1_farming_pb.FarmingPool, 2));
};
/**
* @param {!Array<!proto.sgn.farming.v1.FarmingPool>} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setPoolsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.sgn.farming.v1.FarmingPool=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.farming.v1.FarmingPool}
*/
proto.sgn.farming.v1.GenesisState.prototype.addPools = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.sgn.farming.v1.FarmingPool, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearPoolsList = function() {
return this.setPoolsList([]);
};
/**
* repeated StakeInfo stake_infos = 3;
* @return {!Array<!proto.sgn.farming.v1.StakeInfo>}
*/
proto.sgn.farming.v1.GenesisState.prototype.getStakeInfosList = function() {
return /** @type{!Array<!proto.sgn.farming.v1.StakeInfo>} */ (
jspb.Message.getRepeatedWrapperField(this, sgn_farming_v1_farming_pb.StakeInfo, 3));
};
/**
* @param {!Array<!proto.sgn.farming.v1.StakeInfo>} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setStakeInfosList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.sgn.farming.v1.StakeInfo=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.farming.v1.StakeInfo}
*/
proto.sgn.farming.v1.GenesisState.prototype.addStakeInfos = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.sgn.farming.v1.StakeInfo, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearStakeInfosList = function() {
return this.setStakeInfosList([]);
};
/**
* repeated PoolHistoricalRewardsRecord pool_historical_rewards = 4;
* @return {!Array<!proto.sgn.farming.v1.PoolHistoricalRewardsRecord>}
*/
proto.sgn.farming.v1.GenesisState.prototype.getPoolHistoricalRewardsList = function() {
return /** @type{!Array<!proto.sgn.farming.v1.PoolHistoricalRewardsRecord>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.sgn.farming.v1.PoolHistoricalRewardsRecord, 4));
};
/**
* @param {!Array<!proto.sgn.farming.v1.PoolHistoricalRewardsRecord>} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setPoolHistoricalRewardsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.farming.v1.PoolHistoricalRewardsRecord}
*/
proto.sgn.farming.v1.GenesisState.prototype.addPoolHistoricalRewards = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.sgn.farming.v1.PoolHistoricalRewardsRecord, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearPoolHistoricalRewardsList = function() {
return this.setPoolHistoricalRewardsList([]);
};
/**
* repeated PoolCurrentRewardsRecord pool_current_rewards = 5;
* @return {!Array<!proto.sgn.farming.v1.PoolCurrentRewardsRecord>}
*/
proto.sgn.farming.v1.GenesisState.prototype.getPoolCurrentRewardsList = function() {
return /** @type{!Array<!proto.sgn.farming.v1.PoolCurrentRewardsRecord>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.sgn.farming.v1.PoolCurrentRewardsRecord, 5));
};
/**
* @param {!Array<!proto.sgn.farming.v1.PoolCurrentRewardsRecord>} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setPoolCurrentRewardsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 5, value);
};
/**
* @param {!proto.sgn.farming.v1.PoolCurrentRewardsRecord=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.farming.v1.PoolCurrentRewardsRecord}
*/
proto.sgn.farming.v1.GenesisState.prototype.addPoolCurrentRewards = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.sgn.farming.v1.PoolCurrentRewardsRecord, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearPoolCurrentRewardsList = function() {
return this.setPoolCurrentRewardsList([]);
};
/**
* repeated sgn.common.v1.ContractInfo reward_contracts = 6;
* @return {!Array<!proto.sgn.common.v1.ContractInfo>}
*/
proto.sgn.farming.v1.GenesisState.prototype.getRewardContractsList = function() {
return /** @type{!Array<!proto.sgn.common.v1.ContractInfo>} */ (
jspb.Message.getRepeatedWrapperField(this, sgn_common_v1_common_pb.ContractInfo, 6));
};
/**
* @param {!Array<!proto.sgn.common.v1.ContractInfo>} value
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.setRewardContractsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 6, value);
};
/**
* @param {!proto.sgn.common.v1.ContractInfo=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.common.v1.ContractInfo}
*/
proto.sgn.farming.v1.GenesisState.prototype.addRewardContracts = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.sgn.common.v1.ContractInfo, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.farming.v1.GenesisState} returns this
*/
proto.sgn.farming.v1.GenesisState.prototype.clearRewardContractsList = function() {
return this.setRewardContractsList([]);
};
goog.object.extend(exports, proto.sgn.farming.v1);