"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.RebalancedLiquidStakeEvent = exports.LiquidUnstakeEvent = exports.LiquidStakeParamsUpdatedEvent = exports.LiquidStakeEvent = exports.AutocompoundStakingRewardsEvent = exports.AddLiquidValidatorEvent = void 0;
var _liquidstake = require("./liquidstake");
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); }
//@ts-nocheck

/** LiquidStakeParamsUpdatedEvent is triggered when a the Params is updated. */

/** LiquidStakeParamsUpdatedEvent is triggered when a the Params is updated. */

/** LiquidStakeEvent is triggered when a liquid stake is performed. */

/** LiquidStakeEvent is triggered when a liquid stake is performed. */

/** LiquidUnstakeEvent is triggered when a liquid unstake is performed. */

/** LiquidUnstakeEvent is triggered when a liquid unstake is performed. */

/** LiquidRedelegateEvent is triggered when a liquid validator is added. */

/** LiquidRedelegateEvent is triggered when a liquid validator is added. */

/** RebalancedEvent is triggered after a rebalance is performed. */

/** RebalancedEvent is triggered after a rebalance is performed. */

/** AutocompoundEvent is triggered after a epoch is triggered for autocompound. */

/** AutocompoundEvent is triggered after a epoch is triggered for autocompound. */

function createBaseLiquidStakeParamsUpdatedEvent() {
  return {
    params: undefined,
    authority: ""
  };
}
var LiquidStakeParamsUpdatedEvent = exports.LiquidStakeParamsUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.params !== undefined) {
      _liquidstake.Params.encode(message.params, writer.uint32(10).fork()).ldelim();
    }
    if (message.authority !== "") {
      writer.uint32(18).string(message.authority);
    }
    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 = createBaseLiquidStakeParamsUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.params = _liquidstake.Params.decode(reader, reader.uint32());
          break;
        case 2:
          message.authority = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      params: (0, _helpers.isSet)(object.params) ? _liquidstake.Params.fromJSON(object.params) : undefined,
      authority: (0, _helpers.isSet)(object.authority) ? String(object.authority) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.params !== undefined && (obj.params = message.params ? _liquidstake.Params.toJSON(message.params) : undefined);
    message.authority !== undefined && (obj.authority = message.authority);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$authority;
    var message = createBaseLiquidStakeParamsUpdatedEvent();
    message.params = object.params !== undefined && object.params !== null ? _liquidstake.Params.fromPartial(object.params) : undefined;
    message.authority = (_object$authority = object.authority) !== null && _object$authority !== void 0 ? _object$authority : "";
    return message;
  }
};
function createBaseLiquidStakeEvent() {
  return {
    delegator: "",
    liquidAmount: "",
    stkIxoMintedAmount: ""
  };
}
var LiquidStakeEvent = exports.LiquidStakeEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.delegator !== "") {
      writer.uint32(10).string(message.delegator);
    }
    if (message.liquidAmount !== "") {
      writer.uint32(18).string(message.liquidAmount);
    }
    if (message.stkIxoMintedAmount !== "") {
      writer.uint32(26).string(message.stkIxoMintedAmount);
    }
    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 = createBaseLiquidStakeEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.delegator = reader.string();
          break;
        case 2:
          message.liquidAmount = reader.string();
          break;
        case 3:
          message.stkIxoMintedAmount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      delegator: (0, _helpers.isSet)(object.delegator) ? String(object.delegator) : "",
      liquidAmount: (0, _helpers.isSet)(object.liquidAmount) ? String(object.liquidAmount) : "",
      stkIxoMintedAmount: (0, _helpers.isSet)(object.stkIxoMintedAmount) ? String(object.stkIxoMintedAmount) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.delegator !== undefined && (obj.delegator = message.delegator);
    message.liquidAmount !== undefined && (obj.liquidAmount = message.liquidAmount);
    message.stkIxoMintedAmount !== undefined && (obj.stkIxoMintedAmount = message.stkIxoMintedAmount);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$delegator, _object$liquidAmount, _object$stkIxoMintedA;
    var message = createBaseLiquidStakeEvent();
    message.delegator = (_object$delegator = object.delegator) !== null && _object$delegator !== void 0 ? _object$delegator : "";
    message.liquidAmount = (_object$liquidAmount = object.liquidAmount) !== null && _object$liquidAmount !== void 0 ? _object$liquidAmount : "";
    message.stkIxoMintedAmount = (_object$stkIxoMintedA = object.stkIxoMintedAmount) !== null && _object$stkIxoMintedA !== void 0 ? _object$stkIxoMintedA : "";
    return message;
  }
};
function createBaseLiquidUnstakeEvent() {
  return {
    delegator: "",
    unstakeAmount: "",
    unbondingAmount: "",
    unbondedAmount: "",
    completionTime: ""
  };
}
var LiquidUnstakeEvent = exports.LiquidUnstakeEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.delegator !== "") {
      writer.uint32(10).string(message.delegator);
    }
    if (message.unstakeAmount !== "") {
      writer.uint32(18).string(message.unstakeAmount);
    }
    if (message.unbondingAmount !== "") {
      writer.uint32(26).string(message.unbondingAmount);
    }
    if (message.unbondedAmount !== "") {
      writer.uint32(34).string(message.unbondedAmount);
    }
    if (message.completionTime !== "") {
      writer.uint32(42).string(message.completionTime);
    }
    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 = createBaseLiquidUnstakeEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.delegator = reader.string();
          break;
        case 2:
          message.unstakeAmount = reader.string();
          break;
        case 3:
          message.unbondingAmount = reader.string();
          break;
        case 4:
          message.unbondedAmount = reader.string();
          break;
        case 5:
          message.completionTime = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      delegator: (0, _helpers.isSet)(object.delegator) ? String(object.delegator) : "",
      unstakeAmount: (0, _helpers.isSet)(object.unstakeAmount) ? String(object.unstakeAmount) : "",
      unbondingAmount: (0, _helpers.isSet)(object.unbondingAmount) ? String(object.unbondingAmount) : "",
      unbondedAmount: (0, _helpers.isSet)(object.unbondedAmount) ? String(object.unbondedAmount) : "",
      completionTime: (0, _helpers.isSet)(object.completionTime) ? String(object.completionTime) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.delegator !== undefined && (obj.delegator = message.delegator);
    message.unstakeAmount !== undefined && (obj.unstakeAmount = message.unstakeAmount);
    message.unbondingAmount !== undefined && (obj.unbondingAmount = message.unbondingAmount);
    message.unbondedAmount !== undefined && (obj.unbondedAmount = message.unbondedAmount);
    message.completionTime !== undefined && (obj.completionTime = message.completionTime);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$delegator2, _object$unstakeAmount, _object$unbondingAmou, _object$unbondedAmoun, _object$completionTim;
    var message = createBaseLiquidUnstakeEvent();
    message.delegator = (_object$delegator2 = object.delegator) !== null && _object$delegator2 !== void 0 ? _object$delegator2 : "";
    message.unstakeAmount = (_object$unstakeAmount = object.unstakeAmount) !== null && _object$unstakeAmount !== void 0 ? _object$unstakeAmount : "";
    message.unbondingAmount = (_object$unbondingAmou = object.unbondingAmount) !== null && _object$unbondingAmou !== void 0 ? _object$unbondingAmou : "";
    message.unbondedAmount = (_object$unbondedAmoun = object.unbondedAmount) !== null && _object$unbondedAmoun !== void 0 ? _object$unbondedAmoun : "";
    message.completionTime = (_object$completionTim = object.completionTime) !== null && _object$completionTim !== void 0 ? _object$completionTim : "";
    return message;
  }
};
function createBaseAddLiquidValidatorEvent() {
  return {
    validator: ""
  };
}
var AddLiquidValidatorEvent = exports.AddLiquidValidatorEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.validator !== "") {
      writer.uint32(10).string(message.validator);
    }
    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 = createBaseAddLiquidValidatorEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.validator = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      validator: (0, _helpers.isSet)(object.validator) ? String(object.validator) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.validator !== undefined && (obj.validator = message.validator);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$validator;
    var message = createBaseAddLiquidValidatorEvent();
    message.validator = (_object$validator = object.validator) !== null && _object$validator !== void 0 ? _object$validator : "";
    return message;
  }
};
function createBaseRebalancedLiquidStakeEvent() {
  return {
    delegator: "",
    redelegationCount: "",
    redelegationFailCount: ""
  };
}
var RebalancedLiquidStakeEvent = exports.RebalancedLiquidStakeEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.delegator !== "") {
      writer.uint32(10).string(message.delegator);
    }
    if (message.redelegationCount !== "") {
      writer.uint32(18).string(message.redelegationCount);
    }
    if (message.redelegationFailCount !== "") {
      writer.uint32(26).string(message.redelegationFailCount);
    }
    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 = createBaseRebalancedLiquidStakeEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.delegator = reader.string();
          break;
        case 2:
          message.redelegationCount = reader.string();
          break;
        case 3:
          message.redelegationFailCount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      delegator: (0, _helpers.isSet)(object.delegator) ? String(object.delegator) : "",
      redelegationCount: (0, _helpers.isSet)(object.redelegationCount) ? String(object.redelegationCount) : "",
      redelegationFailCount: (0, _helpers.isSet)(object.redelegationFailCount) ? String(object.redelegationFailCount) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.delegator !== undefined && (obj.delegator = message.delegator);
    message.redelegationCount !== undefined && (obj.redelegationCount = message.redelegationCount);
    message.redelegationFailCount !== undefined && (obj.redelegationFailCount = message.redelegationFailCount);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$delegator3, _object$redelegationC, _object$redelegationF;
    var message = createBaseRebalancedLiquidStakeEvent();
    message.delegator = (_object$delegator3 = object.delegator) !== null && _object$delegator3 !== void 0 ? _object$delegator3 : "";
    message.redelegationCount = (_object$redelegationC = object.redelegationCount) !== null && _object$redelegationC !== void 0 ? _object$redelegationC : "";
    message.redelegationFailCount = (_object$redelegationF = object.redelegationFailCount) !== null && _object$redelegationF !== void 0 ? _object$redelegationF : "";
    return message;
  }
};
function createBaseAutocompoundStakingRewardsEvent() {
  return {
    delegator: "",
    totalAmount: "",
    feeAmount: "",
    redelegateAmount: "",
    weightedRewardsAmount: ""
  };
}
var AutocompoundStakingRewardsEvent = exports.AutocompoundStakingRewardsEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.delegator !== "") {
      writer.uint32(10).string(message.delegator);
    }
    if (message.totalAmount !== "") {
      writer.uint32(18).string(message.totalAmount);
    }
    if (message.feeAmount !== "") {
      writer.uint32(26).string(message.feeAmount);
    }
    if (message.redelegateAmount !== "") {
      writer.uint32(34).string(message.redelegateAmount);
    }
    if (message.weightedRewardsAmount !== "") {
      writer.uint32(42).string(message.weightedRewardsAmount);
    }
    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 = createBaseAutocompoundStakingRewardsEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.delegator = reader.string();
          break;
        case 2:
          message.totalAmount = reader.string();
          break;
        case 3:
          message.feeAmount = reader.string();
          break;
        case 4:
          message.redelegateAmount = reader.string();
          break;
        case 5:
          message.weightedRewardsAmount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      delegator: (0, _helpers.isSet)(object.delegator) ? String(object.delegator) : "",
      totalAmount: (0, _helpers.isSet)(object.totalAmount) ? String(object.totalAmount) : "",
      feeAmount: (0, _helpers.isSet)(object.feeAmount) ? String(object.feeAmount) : "",
      redelegateAmount: (0, _helpers.isSet)(object.redelegateAmount) ? String(object.redelegateAmount) : "",
      weightedRewardsAmount: (0, _helpers.isSet)(object.weightedRewardsAmount) ? String(object.weightedRewardsAmount) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.delegator !== undefined && (obj.delegator = message.delegator);
    message.totalAmount !== undefined && (obj.totalAmount = message.totalAmount);
    message.feeAmount !== undefined && (obj.feeAmount = message.feeAmount);
    message.redelegateAmount !== undefined && (obj.redelegateAmount = message.redelegateAmount);
    message.weightedRewardsAmount !== undefined && (obj.weightedRewardsAmount = message.weightedRewardsAmount);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$delegator4, _object$totalAmount, _object$feeAmount, _object$redelegateAmo, _object$weightedRewar;
    var message = createBaseAutocompoundStakingRewardsEvent();
    message.delegator = (_object$delegator4 = object.delegator) !== null && _object$delegator4 !== void 0 ? _object$delegator4 : "";
    message.totalAmount = (_object$totalAmount = object.totalAmount) !== null && _object$totalAmount !== void 0 ? _object$totalAmount : "";
    message.feeAmount = (_object$feeAmount = object.feeAmount) !== null && _object$feeAmount !== void 0 ? _object$feeAmount : "";
    message.redelegateAmount = (_object$redelegateAmo = object.redelegateAmount) !== null && _object$redelegateAmo !== void 0 ? _object$redelegateAmo : "";
    message.weightedRewardsAmount = (_object$weightedRewar = object.weightedRewardsAmount) !== null && _object$weightedRewar !== void 0 ? _object$weightedRewar : "";
    return message;
  }
};