"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WhitelistedValidator = exports.WeightedAddress = exports.ValidatorStatusSDKType = exports.ValidatorStatus = exports.Params = exports.NetAmountState = exports.LiquidValidatorState = exports.LiquidValidator = void 0;
exports.validatorStatusFromJSON = validatorStatusFromJSON;
exports.validatorStatusToJSON = validatorStatusToJSON;
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _helpers = require("../../../helpers");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } //@ts-nocheck
/** ValidatorStatus enumerates the status of a liquid validator. */
var ValidatorStatus = exports.ValidatorStatus = /*#__PURE__*/function (ValidatorStatus) {
  /** VALIDATOR_STATUS_UNSPECIFIED - VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. */
  ValidatorStatus[ValidatorStatus["VALIDATOR_STATUS_UNSPECIFIED"] = 0] = "VALIDATOR_STATUS_UNSPECIFIED";
  /** VALIDATOR_STATUS_ACTIVE - VALIDATOR_STATUS_ACTIVE defines the active, valid status */
  ValidatorStatus[ValidatorStatus["VALIDATOR_STATUS_ACTIVE"] = 1] = "VALIDATOR_STATUS_ACTIVE";
  /** VALIDATOR_STATUS_INACTIVE - VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status */
  ValidatorStatus[ValidatorStatus["VALIDATOR_STATUS_INACTIVE"] = 2] = "VALIDATOR_STATUS_INACTIVE";
  ValidatorStatus[ValidatorStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
  return ValidatorStatus;
}({});
var ValidatorStatusSDKType = exports.ValidatorStatusSDKType = ValidatorStatus;
function validatorStatusFromJSON(object) {
  switch (object) {
    case 0:
    case "VALIDATOR_STATUS_UNSPECIFIED":
      return ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED;
    case 1:
    case "VALIDATOR_STATUS_ACTIVE":
      return ValidatorStatus.VALIDATOR_STATUS_ACTIVE;
    case 2:
    case "VALIDATOR_STATUS_INACTIVE":
      return ValidatorStatus.VALIDATOR_STATUS_INACTIVE;
    case -1:
    case "UNRECOGNIZED":
    default:
      return ValidatorStatus.UNRECOGNIZED;
  }
}
function validatorStatusToJSON(object) {
  switch (object) {
    case ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED:
      return "VALIDATOR_STATUS_UNSPECIFIED";
    case ValidatorStatus.VALIDATOR_STATUS_ACTIVE:
      return "VALIDATOR_STATUS_ACTIVE";
    case ValidatorStatus.VALIDATOR_STATUS_INACTIVE:
      return "VALIDATOR_STATUS_INACTIVE";
    case ValidatorStatus.UNRECOGNIZED:
    default:
      return "UNRECOGNIZED";
  }
}
/** Params defines the set of params for the liquidstake module. */

/** Params defines the set of params for the liquidstake module. */

/**
 * WeightedAddress represents an address with a weight assigned to it.
 * The weight is used to determine the proportion of autocompounding
 * rewards to be paid to the address.
 */

/**
 * WeightedAddress represents an address with a weight assigned to it.
 * The weight is used to determine the proportion of autocompounding
 * rewards to be paid to the address.
 */

/**
 * WhitelistedValidator consists of the validator operator address and the
 * target weight, which is a value for calculating the real weight to be derived
 * according to the active status.
 */

/**
 * WhitelistedValidator consists of the validator operator address and the
 * target weight, which is a value for calculating the real weight to be derived
 * according to the active status.
 */

/**
 * LiquidValidator defines a Validator that can be the target of LiquidStaking
 * and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to
 * deal with by maintaining consistency with the state of the staking module.
 */

/**
 * LiquidValidator defines a Validator that can be the target of LiquidStaking
 * and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to
 * deal with by maintaining consistency with the state of the staking module.
 */

/**
 * LiquidValidatorState is type LiquidValidator with state added to return to
 * query results.
 */

/**
 * LiquidValidatorState is type LiquidValidator with state added to return to
 * query results.
 */

/**
 * NetAmountState is type for net amount raw data and mint rate, This is a value
 * that depends on the several module state every time, so it is used only for
 * calculation and query and is not stored in kv.
 */

/**
 * NetAmountState is type for net amount raw data and mint rate, This is a value
 * that depends on the several module state every time, so it is used only for
 * calculation and query and is not stored in kv.
 */

function createBaseParams() {
  return {
    liquidBondDenom: "",
    whitelistedValidators: [],
    unstakeFeeRate: "",
    minLiquidStakeAmount: "",
    feeAccountAddress: "",
    autocompoundFeeRate: "",
    whitelistAdminAddress: "",
    modulePaused: false,
    weightedRewardsReceivers: []
  };
}
var Params = exports.Params = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.liquidBondDenom !== "") {
      writer.uint32(10).string(message.liquidBondDenom);
    }
    var _iterator = _createForOfIteratorHelper(message.whitelistedValidators),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        WhitelistedValidator.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    if (message.unstakeFeeRate !== "") {
      writer.uint32(26).string(message.unstakeFeeRate);
    }
    if (message.minLiquidStakeAmount !== "") {
      writer.uint32(34).string(message.minLiquidStakeAmount);
    }
    if (message.feeAccountAddress !== "") {
      writer.uint32(42).string(message.feeAccountAddress);
    }
    if (message.autocompoundFeeRate !== "") {
      writer.uint32(50).string(message.autocompoundFeeRate);
    }
    if (message.whitelistAdminAddress !== "") {
      writer.uint32(58).string(message.whitelistAdminAddress);
    }
    if (message.modulePaused === true) {
      writer.uint32(64).bool(message.modulePaused);
    }
    var _iterator2 = _createForOfIteratorHelper(message.weightedRewardsReceivers),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var _v = _step2.value;
        WeightedAddress.encode(_v, writer.uint32(74).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseParams();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.liquidBondDenom = reader.string();
          break;
        case 2:
          message.whitelistedValidators.push(WhitelistedValidator.decode(reader, reader.uint32()));
          break;
        case 3:
          message.unstakeFeeRate = reader.string();
          break;
        case 4:
          message.minLiquidStakeAmount = reader.string();
          break;
        case 5:
          message.feeAccountAddress = reader.string();
          break;
        case 6:
          message.autocompoundFeeRate = reader.string();
          break;
        case 7:
          message.whitelistAdminAddress = reader.string();
          break;
        case 8:
          message.modulePaused = reader.bool();
          break;
        case 9:
          message.weightedRewardsReceivers.push(WeightedAddress.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      liquidBondDenom: (0, _helpers.isSet)(object.liquidBondDenom) ? String(object.liquidBondDenom) : "",
      whitelistedValidators: Array.isArray(object === null || object === void 0 ? void 0 : object.whitelistedValidators) ? object.whitelistedValidators.map(function (e) {
        return WhitelistedValidator.fromJSON(e);
      }) : [],
      unstakeFeeRate: (0, _helpers.isSet)(object.unstakeFeeRate) ? String(object.unstakeFeeRate) : "",
      minLiquidStakeAmount: (0, _helpers.isSet)(object.minLiquidStakeAmount) ? String(object.minLiquidStakeAmount) : "",
      feeAccountAddress: (0, _helpers.isSet)(object.feeAccountAddress) ? String(object.feeAccountAddress) : "",
      autocompoundFeeRate: (0, _helpers.isSet)(object.autocompoundFeeRate) ? String(object.autocompoundFeeRate) : "",
      whitelistAdminAddress: (0, _helpers.isSet)(object.whitelistAdminAddress) ? String(object.whitelistAdminAddress) : "",
      modulePaused: (0, _helpers.isSet)(object.modulePaused) ? Boolean(object.modulePaused) : false,
      weightedRewardsReceivers: Array.isArray(object === null || object === void 0 ? void 0 : object.weightedRewardsReceivers) ? object.weightedRewardsReceivers.map(function (e) {
        return WeightedAddress.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.liquidBondDenom !== undefined && (obj.liquidBondDenom = message.liquidBondDenom);
    if (message.whitelistedValidators) {
      obj.whitelistedValidators = message.whitelistedValidators.map(function (e) {
        return e ? WhitelistedValidator.toJSON(e) : undefined;
      });
    } else {
      obj.whitelistedValidators = [];
    }
    message.unstakeFeeRate !== undefined && (obj.unstakeFeeRate = message.unstakeFeeRate);
    message.minLiquidStakeAmount !== undefined && (obj.minLiquidStakeAmount = message.minLiquidStakeAmount);
    message.feeAccountAddress !== undefined && (obj.feeAccountAddress = message.feeAccountAddress);
    message.autocompoundFeeRate !== undefined && (obj.autocompoundFeeRate = message.autocompoundFeeRate);
    message.whitelistAdminAddress !== undefined && (obj.whitelistAdminAddress = message.whitelistAdminAddress);
    message.modulePaused !== undefined && (obj.modulePaused = message.modulePaused);
    if (message.weightedRewardsReceivers) {
      obj.weightedRewardsReceivers = message.weightedRewardsReceivers.map(function (e) {
        return e ? WeightedAddress.toJSON(e) : undefined;
      });
    } else {
      obj.weightedRewardsReceivers = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$liquidBondDen, _object$whitelistedVa, _object$unstakeFeeRat, _object$minLiquidStak, _object$feeAccountAdd, _object$autocompoundF, _object$whitelistAdmi, _object$modulePaused, _object$weightedRewar;
    var message = createBaseParams();
    message.liquidBondDenom = (_object$liquidBondDen = object.liquidBondDenom) !== null && _object$liquidBondDen !== void 0 ? _object$liquidBondDen : "";
    message.whitelistedValidators = ((_object$whitelistedVa = object.whitelistedValidators) === null || _object$whitelistedVa === void 0 ? void 0 : _object$whitelistedVa.map(function (e) {
      return WhitelistedValidator.fromPartial(e);
    })) || [];
    message.unstakeFeeRate = (_object$unstakeFeeRat = object.unstakeFeeRate) !== null && _object$unstakeFeeRat !== void 0 ? _object$unstakeFeeRat : "";
    message.minLiquidStakeAmount = (_object$minLiquidStak = object.minLiquidStakeAmount) !== null && _object$minLiquidStak !== void 0 ? _object$minLiquidStak : "";
    message.feeAccountAddress = (_object$feeAccountAdd = object.feeAccountAddress) !== null && _object$feeAccountAdd !== void 0 ? _object$feeAccountAdd : "";
    message.autocompoundFeeRate = (_object$autocompoundF = object.autocompoundFeeRate) !== null && _object$autocompoundF !== void 0 ? _object$autocompoundF : "";
    message.whitelistAdminAddress = (_object$whitelistAdmi = object.whitelistAdminAddress) !== null && _object$whitelistAdmi !== void 0 ? _object$whitelistAdmi : "";
    message.modulePaused = (_object$modulePaused = object.modulePaused) !== null && _object$modulePaused !== void 0 ? _object$modulePaused : false;
    message.weightedRewardsReceivers = ((_object$weightedRewar = object.weightedRewardsReceivers) === null || _object$weightedRewar === void 0 ? void 0 : _object$weightedRewar.map(function (e) {
      return WeightedAddress.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseWeightedAddress() {
  return {
    address: "",
    weight: ""
  };
}
var WeightedAddress = exports.WeightedAddress = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.address !== "") {
      writer.uint32(10).string(message.address);
    }
    if (message.weight !== "") {
      writer.uint32(18).string(message.weight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseWeightedAddress();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.address = reader.string();
          break;
        case 2:
          message.weight = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      address: (0, _helpers.isSet)(object.address) ? String(object.address) : "",
      weight: (0, _helpers.isSet)(object.weight) ? String(object.weight) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.address !== undefined && (obj.address = message.address);
    message.weight !== undefined && (obj.weight = message.weight);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$address, _object$weight;
    var message = createBaseWeightedAddress();
    message.address = (_object$address = object.address) !== null && _object$address !== void 0 ? _object$address : "";
    message.weight = (_object$weight = object.weight) !== null && _object$weight !== void 0 ? _object$weight : "";
    return message;
  }
};
function createBaseWhitelistedValidator() {
  return {
    validatorAddress: "",
    targetWeight: ""
  };
}
var WhitelistedValidator = exports.WhitelistedValidator = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.validatorAddress !== "") {
      writer.uint32(10).string(message.validatorAddress);
    }
    if (message.targetWeight !== "") {
      writer.uint32(18).string(message.targetWeight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseWhitelistedValidator();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.validatorAddress = reader.string();
          break;
        case 2:
          message.targetWeight = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      validatorAddress: (0, _helpers.isSet)(object.validatorAddress) ? String(object.validatorAddress) : "",
      targetWeight: (0, _helpers.isSet)(object.targetWeight) ? String(object.targetWeight) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
    message.targetWeight !== undefined && (obj.targetWeight = message.targetWeight);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$validatorAddr, _object$targetWeight;
    var message = createBaseWhitelistedValidator();
    message.validatorAddress = (_object$validatorAddr = object.validatorAddress) !== null && _object$validatorAddr !== void 0 ? _object$validatorAddr : "";
    message.targetWeight = (_object$targetWeight = object.targetWeight) !== null && _object$targetWeight !== void 0 ? _object$targetWeight : "";
    return message;
  }
};
function createBaseLiquidValidator() {
  return {
    operatorAddress: ""
  };
}
var LiquidValidator = exports.LiquidValidator = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.operatorAddress !== "") {
      writer.uint32(10).string(message.operatorAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseLiquidValidator();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.operatorAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      operatorAddress: (0, _helpers.isSet)(object.operatorAddress) ? String(object.operatorAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$operatorAddre;
    var message = createBaseLiquidValidator();
    message.operatorAddress = (_object$operatorAddre = object.operatorAddress) !== null && _object$operatorAddre !== void 0 ? _object$operatorAddre : "";
    return message;
  }
};
function createBaseLiquidValidatorState() {
  return {
    operatorAddress: "",
    weight: "",
    status: 0,
    delShares: "",
    liquidTokens: ""
  };
}
var LiquidValidatorState = exports.LiquidValidatorState = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.operatorAddress !== "") {
      writer.uint32(10).string(message.operatorAddress);
    }
    if (message.weight !== "") {
      writer.uint32(18).string(message.weight);
    }
    if (message.status !== 0) {
      writer.uint32(24).int32(message.status);
    }
    if (message.delShares !== "") {
      writer.uint32(34).string(message.delShares);
    }
    if (message.liquidTokens !== "") {
      writer.uint32(42).string(message.liquidTokens);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseLiquidValidatorState();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.operatorAddress = reader.string();
          break;
        case 2:
          message.weight = reader.string();
          break;
        case 3:
          message.status = reader.int32();
          break;
        case 4:
          message.delShares = reader.string();
          break;
        case 5:
          message.liquidTokens = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      operatorAddress: (0, _helpers.isSet)(object.operatorAddress) ? String(object.operatorAddress) : "",
      weight: (0, _helpers.isSet)(object.weight) ? String(object.weight) : "",
      status: (0, _helpers.isSet)(object.status) ? validatorStatusFromJSON(object.status) : 0,
      delShares: (0, _helpers.isSet)(object.delShares) ? String(object.delShares) : "",
      liquidTokens: (0, _helpers.isSet)(object.liquidTokens) ? String(object.liquidTokens) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress);
    message.weight !== undefined && (obj.weight = message.weight);
    message.status !== undefined && (obj.status = validatorStatusToJSON(message.status));
    message.delShares !== undefined && (obj.delShares = message.delShares);
    message.liquidTokens !== undefined && (obj.liquidTokens = message.liquidTokens);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$operatorAddre2, _object$weight2, _object$status, _object$delShares, _object$liquidTokens;
    var message = createBaseLiquidValidatorState();
    message.operatorAddress = (_object$operatorAddre2 = object.operatorAddress) !== null && _object$operatorAddre2 !== void 0 ? _object$operatorAddre2 : "";
    message.weight = (_object$weight2 = object.weight) !== null && _object$weight2 !== void 0 ? _object$weight2 : "";
    message.status = (_object$status = object.status) !== null && _object$status !== void 0 ? _object$status : 0;
    message.delShares = (_object$delShares = object.delShares) !== null && _object$delShares !== void 0 ? _object$delShares : "";
    message.liquidTokens = (_object$liquidTokens = object.liquidTokens) !== null && _object$liquidTokens !== void 0 ? _object$liquidTokens : "";
    return message;
  }
};
function createBaseNetAmountState() {
  return {
    stakeRate: "",
    unstakeRate: "",
    stkixoTotalSupply: "",
    netAmount: "",
    totalDelShares: "",
    totalLiquidTokens: "",
    totalRemainingRewards: "",
    totalUnbondingBalance: "",
    proxyAccBalance: ""
  };
}
var NetAmountState = exports.NetAmountState = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.stakeRate !== "") {
      writer.uint32(10).string(message.stakeRate);
    }
    if (message.unstakeRate !== "") {
      writer.uint32(18).string(message.unstakeRate);
    }
    if (message.stkixoTotalSupply !== "") {
      writer.uint32(26).string(message.stkixoTotalSupply);
    }
    if (message.netAmount !== "") {
      writer.uint32(34).string(message.netAmount);
    }
    if (message.totalDelShares !== "") {
      writer.uint32(42).string(message.totalDelShares);
    }
    if (message.totalLiquidTokens !== "") {
      writer.uint32(50).string(message.totalLiquidTokens);
    }
    if (message.totalRemainingRewards !== "") {
      writer.uint32(58).string(message.totalRemainingRewards);
    }
    if (message.totalUnbondingBalance !== "") {
      writer.uint32(66).string(message.totalUnbondingBalance);
    }
    if (message.proxyAccBalance !== "") {
      writer.uint32(74).string(message.proxyAccBalance);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseNetAmountState();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.stakeRate = reader.string();
          break;
        case 2:
          message.unstakeRate = reader.string();
          break;
        case 3:
          message.stkixoTotalSupply = reader.string();
          break;
        case 4:
          message.netAmount = reader.string();
          break;
        case 5:
          message.totalDelShares = reader.string();
          break;
        case 6:
          message.totalLiquidTokens = reader.string();
          break;
        case 7:
          message.totalRemainingRewards = reader.string();
          break;
        case 8:
          message.totalUnbondingBalance = reader.string();
          break;
        case 9:
          message.proxyAccBalance = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      stakeRate: (0, _helpers.isSet)(object.stakeRate) ? String(object.stakeRate) : "",
      unstakeRate: (0, _helpers.isSet)(object.unstakeRate) ? String(object.unstakeRate) : "",
      stkixoTotalSupply: (0, _helpers.isSet)(object.stkixoTotalSupply) ? String(object.stkixoTotalSupply) : "",
      netAmount: (0, _helpers.isSet)(object.netAmount) ? String(object.netAmount) : "",
      totalDelShares: (0, _helpers.isSet)(object.totalDelShares) ? String(object.totalDelShares) : "",
      totalLiquidTokens: (0, _helpers.isSet)(object.totalLiquidTokens) ? String(object.totalLiquidTokens) : "",
      totalRemainingRewards: (0, _helpers.isSet)(object.totalRemainingRewards) ? String(object.totalRemainingRewards) : "",
      totalUnbondingBalance: (0, _helpers.isSet)(object.totalUnbondingBalance) ? String(object.totalUnbondingBalance) : "",
      proxyAccBalance: (0, _helpers.isSet)(object.proxyAccBalance) ? String(object.proxyAccBalance) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.stakeRate !== undefined && (obj.stakeRate = message.stakeRate);
    message.unstakeRate !== undefined && (obj.unstakeRate = message.unstakeRate);
    message.stkixoTotalSupply !== undefined && (obj.stkixoTotalSupply = message.stkixoTotalSupply);
    message.netAmount !== undefined && (obj.netAmount = message.netAmount);
    message.totalDelShares !== undefined && (obj.totalDelShares = message.totalDelShares);
    message.totalLiquidTokens !== undefined && (obj.totalLiquidTokens = message.totalLiquidTokens);
    message.totalRemainingRewards !== undefined && (obj.totalRemainingRewards = message.totalRemainingRewards);
    message.totalUnbondingBalance !== undefined && (obj.totalUnbondingBalance = message.totalUnbondingBalance);
    message.proxyAccBalance !== undefined && (obj.proxyAccBalance = message.proxyAccBalance);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$stakeRate, _object$unstakeRate, _object$stkixoTotalSu, _object$netAmount, _object$totalDelShare, _object$totalLiquidTo, _object$totalRemainin, _object$totalUnbondin, _object$proxyAccBalan;
    var message = createBaseNetAmountState();
    message.stakeRate = (_object$stakeRate = object.stakeRate) !== null && _object$stakeRate !== void 0 ? _object$stakeRate : "";
    message.unstakeRate = (_object$unstakeRate = object.unstakeRate) !== null && _object$unstakeRate !== void 0 ? _object$unstakeRate : "";
    message.stkixoTotalSupply = (_object$stkixoTotalSu = object.stkixoTotalSupply) !== null && _object$stkixoTotalSu !== void 0 ? _object$stkixoTotalSu : "";
    message.netAmount = (_object$netAmount = object.netAmount) !== null && _object$netAmount !== void 0 ? _object$netAmount : "";
    message.totalDelShares = (_object$totalDelShare = object.totalDelShares) !== null && _object$totalDelShare !== void 0 ? _object$totalDelShare : "";
    message.totalLiquidTokens = (_object$totalLiquidTo = object.totalLiquidTokens) !== null && _object$totalLiquidTo !== void 0 ? _object$totalLiquidTo : "";
    message.totalRemainingRewards = (_object$totalRemainin = object.totalRemainingRewards) !== null && _object$totalRemainin !== void 0 ? _object$totalRemainin : "";
    message.totalUnbondingBalance = (_object$totalUnbondin = object.totalUnbondingBalance) !== null && _object$totalUnbondin !== void 0 ? _object$totalUnbondin : "";
    message.proxyAccBalance = (_object$proxyAccBalan = object.proxyAccBalance) !== null && _object$proxyAccBalan !== void 0 ? _object$proxyAccBalan : "";
    return message;
  }
};