//@ts-nocheck
import { Params } from "./liquidstake";
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../helpers";
/** 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: ""
  };
}
export const LiquidStakeParamsUpdatedEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.params !== undefined) {
      Params.encode(message.params, writer.uint32(10).fork()).ldelim();
    }
    if (message.authority !== "") {
      writer.uint32(18).string(message.authority);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseLiquidStakeParamsUpdatedEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.params = Params.decode(reader, reader.uint32());
          break;
        case 2:
          message.authority = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
      authority: isSet(object.authority) ? String(object.authority) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
    message.authority !== undefined && (obj.authority = message.authority);
    return obj;
  },
  fromPartial(object) {
    var _object$authority;
    const message = createBaseLiquidStakeParamsUpdatedEvent();
    message.params = object.params !== undefined && object.params !== null ? 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: ""
  };
}
export const LiquidStakeEvent = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseLiquidStakeEvent();
    while (reader.pos < end) {
      const 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(object) {
    return {
      delegator: isSet(object.delegator) ? String(object.delegator) : "",
      liquidAmount: isSet(object.liquidAmount) ? String(object.liquidAmount) : "",
      stkIxoMintedAmount: isSet(object.stkIxoMintedAmount) ? String(object.stkIxoMintedAmount) : ""
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$delegator, _object$liquidAmount, _object$stkIxoMintedA;
    const 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: ""
  };
}
export const LiquidUnstakeEvent = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseLiquidUnstakeEvent();
    while (reader.pos < end) {
      const 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(object) {
    return {
      delegator: isSet(object.delegator) ? String(object.delegator) : "",
      unstakeAmount: isSet(object.unstakeAmount) ? String(object.unstakeAmount) : "",
      unbondingAmount: isSet(object.unbondingAmount) ? String(object.unbondingAmount) : "",
      unbondedAmount: isSet(object.unbondedAmount) ? String(object.unbondedAmount) : "",
      completionTime: isSet(object.completionTime) ? String(object.completionTime) : ""
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$delegator2, _object$unstakeAmount, _object$unbondingAmou, _object$unbondedAmoun, _object$completionTim;
    const 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: ""
  };
}
export const AddLiquidValidatorEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.validator !== "") {
      writer.uint32(10).string(message.validator);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseAddLiquidValidatorEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.validator = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      validator: isSet(object.validator) ? String(object.validator) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.validator !== undefined && (obj.validator = message.validator);
    return obj;
  },
  fromPartial(object) {
    var _object$validator;
    const message = createBaseAddLiquidValidatorEvent();
    message.validator = (_object$validator = object.validator) !== null && _object$validator !== void 0 ? _object$validator : "";
    return message;
  }
};
function createBaseRebalancedLiquidStakeEvent() {
  return {
    delegator: "",
    redelegationCount: "",
    redelegationFailCount: ""
  };
}
export const RebalancedLiquidStakeEvent = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseRebalancedLiquidStakeEvent();
    while (reader.pos < end) {
      const 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(object) {
    return {
      delegator: isSet(object.delegator) ? String(object.delegator) : "",
      redelegationCount: isSet(object.redelegationCount) ? String(object.redelegationCount) : "",
      redelegationFailCount: isSet(object.redelegationFailCount) ? String(object.redelegationFailCount) : ""
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$delegator3, _object$redelegationC, _object$redelegationF;
    const 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: ""
  };
}
export const AutocompoundStakingRewardsEvent = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseAutocompoundStakingRewardsEvent();
    while (reader.pos < end) {
      const 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(object) {
    return {
      delegator: isSet(object.delegator) ? String(object.delegator) : "",
      totalAmount: isSet(object.totalAmount) ? String(object.totalAmount) : "",
      feeAmount: isSet(object.feeAmount) ? String(object.feeAmount) : "",
      redelegateAmount: isSet(object.redelegateAmount) ? String(object.redelegateAmount) : "",
      weightedRewardsAmount: isSet(object.weightedRewardsAmount) ? String(object.weightedRewardsAmount) : ""
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$delegator4, _object$totalAmount, _object$feeAmount, _object$redelegateAmo, _object$weightedRewar;
    const 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;
  }
};