import * as _m0 from "protobufjs/minimal";
import { Long } from "../../../helpers";
/** IDSet represents a set of IDs */

function createBaseIDSet() {
  return {
    ids: []
  };
}
export const IDSet = {
  encode(message, writer = _m0.Writer.create()) {
    writer.uint32(10).fork();
    for (const v of message.ids) {
      writer.uint64(v);
    }
    writer.ldelim();
    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 = createBaseIDSet();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          if ((tag & 7) === 2) {
            const end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) {
              message.ids.push(reader.uint64());
            }
          } else {
            message.ids.push(reader.uint64());
          }
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial(object) {
    var _object$ids;
    const message = createBaseIDSet();
    message.ids = ((_object$ids = object.ids) === null || _object$ids === void 0 ? void 0 : _object$ids.map(e => Long.fromValue(e))) || [];
    return message;
  }
};
function createBaseBatchFees() {
  return {
    token: "",
    totalFees: ""
  };
}
export const BatchFees = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.token !== "") {
      writer.uint32(10).string(message.token);
    }
    if (message.totalFees !== "") {
      writer.uint32(18).string(message.totalFees);
    }
    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 = createBaseBatchFees();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.token = reader.string();
          break;
        case 2:
          message.totalFees = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial(object) {
    var _object$token, _object$totalFees;
    const message = createBaseBatchFees();
    message.token = (_object$token = object.token) !== null && _object$token !== void 0 ? _object$token : "";
    message.totalFees = (_object$totalFees = object.totalFees) !== null && _object$totalFees !== void 0 ? _object$totalFees : "";
    return message;
  }
};