import * as _m0 from "protobufjs/minimal";
/** PoolType is an enumeration of all supported pool types. */

export let PoolType;
(function (PoolType) {
  PoolType[PoolType["Balancer"] = 0] = "Balancer";
  PoolType[PoolType["Stableswap"] = 1] = "Stableswap";
  PoolType[PoolType["Concentrated"] = 2] = "Concentrated";
  PoolType[PoolType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(PoolType || (PoolType = {}));
export const PoolTypeSDKType = PoolType;
export function poolTypeFromJSON(object) {
  switch (object) {
    case 0:
    case "Balancer":
      return PoolType.Balancer;
    case 1:
    case "Stableswap":
      return PoolType.Stableswap;
    case 2:
    case "Concentrated":
      return PoolType.Concentrated;
    case -1:
    case "UNRECOGNIZED":
    default:
      return PoolType.UNRECOGNIZED;
  }
}
export function poolTypeToJSON(object) {
  switch (object) {
    case PoolType.Balancer:
      return "Balancer";
    case PoolType.Stableswap:
      return "Stableswap";
    case PoolType.Concentrated:
      return "Concentrated";
    case PoolType.UNRECOGNIZED:
    default:
      return "UNRECOGNIZED";
  }
}
/**
 * ModuleRouter defines a route encapsulating pool type.
 * It is used as the value of a mapping from pool id to the pool type,
 * allowing the swap router to know which module to route swaps to given the
 * pool id.
 */

function createBaseModuleRoute() {
  return {
    poolType: 0
  };
}
export const ModuleRoute = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.poolType !== 0) {
      writer.uint32(8).int32(message.poolType);
    }
    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 = createBaseModuleRoute();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.poolType = reader.int32();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial(object) {
    var _object$poolType;
    const message = createBaseModuleRoute();
    message.poolType = (_object$poolType = object.poolType) !== null && _object$poolType !== void 0 ? _object$poolType : 0;
    return message;
  }
};