"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TokenUpdatedEvent = exports.TokenTransferredEvent = exports.TokenStoppedEvent = exports.TokenRetiredEvent = exports.TokenPausedEvent = exports.TokenMintedEvent = exports.TokenCreatedEvent = exports.TokenCancelledEvent = exports.CreditsTransferredEvent = void 0;
var _token = require("./token");
var _tx = require("./tx");
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
/** TokenCreatedEvent is an event triggered on a Token creation */

/** TokenCreatedEvent is an event triggered on a Token creation */

/** TokenUpdatedEvent is an event triggered on a Token update */

/** TokenUpdatedEvent is an event triggered on a Token update */

/** TokenMintedEvent is an event triggered on a Token mint execution */

/** TokenMintedEvent is an event triggered on a Token mint execution */

/** TokenTransferedEvent is an event triggered on a Token transfer execution */

/** TokenTransferedEvent is an event triggered on a Token transfer execution */

/** TokenCancelledEvent is an event triggered on a Token cancel execution */

/** TokenCancelledEvent is an event triggered on a Token cancel execution */

/** TokenRetiredEvent is an event triggered on a Token retire execution */

/** TokenRetiredEvent is an event triggered on a Token retire execution */

/**
 * CreditsTransferredEvent is an event triggered on a Credit transfer
 * execution
 */

/**
 * CreditsTransferredEvent is an event triggered on a Credit transfer
 * execution
 */

/** TokenPausedEvent is an event triggered on a Token pause/unpause execution */

/** TokenPausedEvent is an event triggered on a Token pause/unpause execution */

/** TokenStoppedEvent is an event triggered on a Token stopped execution */

/** TokenStoppedEvent is an event triggered on a Token stopped execution */

function createBaseTokenCreatedEvent() {
  return {
    token: undefined
  };
}
var TokenCreatedEvent = exports.TokenCreatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.token !== undefined) {
      _token.Token.encode(message.token, writer.uint32(10).fork()).ldelim();
    }
    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 = createBaseTokenCreatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.token = _token.Token.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      token: (0, _helpers.isSet)(object.token) ? _token.Token.fromJSON(object.token) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.token !== undefined && (obj.token = message.token ? _token.Token.toJSON(message.token) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseTokenCreatedEvent();
    message.token = object.token !== undefined && object.token !== null ? _token.Token.fromPartial(object.token) : undefined;
    return message;
  }
};
function createBaseTokenUpdatedEvent() {
  return {
    token: undefined
  };
}
var TokenUpdatedEvent = exports.TokenUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.token !== undefined) {
      _token.Token.encode(message.token, writer.uint32(10).fork()).ldelim();
    }
    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 = createBaseTokenUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.token = _token.Token.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      token: (0, _helpers.isSet)(object.token) ? _token.Token.fromJSON(object.token) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.token !== undefined && (obj.token = message.token ? _token.Token.toJSON(message.token) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseTokenUpdatedEvent();
    message.token = object.token !== undefined && object.token !== null ? _token.Token.fromPartial(object.token) : undefined;
    return message;
  }
};
function createBaseTokenMintedEvent() {
  return {
    contractAddress: "",
    minter: "",
    owner: "",
    amount: "",
    tokenProperties: undefined
  };
}
var TokenMintedEvent = exports.TokenMintedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.contractAddress !== "") {
      writer.uint32(10).string(message.contractAddress);
    }
    if (message.minter !== "") {
      writer.uint32(18).string(message.minter);
    }
    if (message.owner !== "") {
      writer.uint32(26).string(message.owner);
    }
    if (message.amount !== "") {
      writer.uint32(34).string(message.amount);
    }
    if (message.tokenProperties !== undefined) {
      _token.TokenProperties.encode(message.tokenProperties, writer.uint32(42).fork()).ldelim();
    }
    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 = createBaseTokenMintedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.contractAddress = reader.string();
          break;
        case 2:
          message.minter = reader.string();
          break;
        case 3:
          message.owner = reader.string();
          break;
        case 4:
          message.amount = reader.string();
          break;
        case 5:
          message.tokenProperties = _token.TokenProperties.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      contractAddress: (0, _helpers.isSet)(object.contractAddress) ? String(object.contractAddress) : "",
      minter: (0, _helpers.isSet)(object.minter) ? String(object.minter) : "",
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      amount: (0, _helpers.isSet)(object.amount) ? String(object.amount) : "",
      tokenProperties: (0, _helpers.isSet)(object.tokenProperties) ? _token.TokenProperties.fromJSON(object.tokenProperties) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    message.minter !== undefined && (obj.minter = message.minter);
    message.owner !== undefined && (obj.owner = message.owner);
    message.amount !== undefined && (obj.amount = message.amount);
    message.tokenProperties !== undefined && (obj.tokenProperties = message.tokenProperties ? _token.TokenProperties.toJSON(message.tokenProperties) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$contractAddre, _object$minter, _object$owner, _object$amount;
    var message = createBaseTokenMintedEvent();
    message.contractAddress = (_object$contractAddre = object.contractAddress) !== null && _object$contractAddre !== void 0 ? _object$contractAddre : "";
    message.minter = (_object$minter = object.minter) !== null && _object$minter !== void 0 ? _object$minter : "";
    message.owner = (_object$owner = object.owner) !== null && _object$owner !== void 0 ? _object$owner : "";
    message.amount = (_object$amount = object.amount) !== null && _object$amount !== void 0 ? _object$amount : "";
    message.tokenProperties = object.tokenProperties !== undefined && object.tokenProperties !== null ? _token.TokenProperties.fromPartial(object.tokenProperties) : undefined;
    return message;
  }
};
function createBaseTokenTransferredEvent() {
  return {
    owner: "",
    recipient: "",
    tokens: []
  };
}
var TokenTransferredEvent = exports.TokenTransferredEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    if (message.recipient !== "") {
      writer.uint32(18).string(message.recipient);
    }
    var _iterator = _createForOfIteratorHelper(message.tokens),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _tx.TokenBatch.encode(v, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.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 = createBaseTokenTransferredEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.recipient = reader.string();
          break;
        case 3:
          message.tokens.push(_tx.TokenBatch.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      recipient: (0, _helpers.isSet)(object.recipient) ? String(object.recipient) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(function (e) {
        return _tx.TokenBatch.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    message.recipient !== undefined && (obj.recipient = message.recipient);
    if (message.tokens) {
      obj.tokens = message.tokens.map(function (e) {
        return e ? _tx.TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner2, _object$recipient, _object$tokens;
    var message = createBaseTokenTransferredEvent();
    message.owner = (_object$owner2 = object.owner) !== null && _object$owner2 !== void 0 ? _object$owner2 : "";
    message.recipient = (_object$recipient = object.recipient) !== null && _object$recipient !== void 0 ? _object$recipient : "";
    message.tokens = ((_object$tokens = object.tokens) === null || _object$tokens === void 0 ? void 0 : _object$tokens.map(function (e) {
      return _tx.TokenBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseTokenCancelledEvent() {
  return {
    owner: "",
    tokens: []
  };
}
var TokenCancelledEvent = exports.TokenCancelledEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    var _iterator2 = _createForOfIteratorHelper(message.tokens),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        _tx.TokenBatch.encode(v, writer.uint32(18).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 = createBaseTokenCancelledEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(_tx.TokenBatch.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(function (e) {
        return _tx.TokenBatch.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(function (e) {
        return e ? _tx.TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner3, _object$tokens2;
    var message = createBaseTokenCancelledEvent();
    message.owner = (_object$owner3 = object.owner) !== null && _object$owner3 !== void 0 ? _object$owner3 : "";
    message.tokens = ((_object$tokens2 = object.tokens) === null || _object$tokens2 === void 0 ? void 0 : _object$tokens2.map(function (e) {
      return _tx.TokenBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseTokenRetiredEvent() {
  return {
    owner: "",
    tokens: []
  };
}
var TokenRetiredEvent = exports.TokenRetiredEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    var _iterator3 = _createForOfIteratorHelper(message.tokens),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        _tx.TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.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 = createBaseTokenRetiredEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(_tx.TokenBatch.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(function (e) {
        return _tx.TokenBatch.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(function (e) {
        return e ? _tx.TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner4, _object$tokens3;
    var message = createBaseTokenRetiredEvent();
    message.owner = (_object$owner4 = object.owner) !== null && _object$owner4 !== void 0 ? _object$owner4 : "";
    message.tokens = ((_object$tokens3 = object.tokens) === null || _object$tokens3 === void 0 ? void 0 : _object$tokens3.map(function (e) {
      return _tx.TokenBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseCreditsTransferredEvent() {
  return {
    owner: "",
    tokens: []
  };
}
var CreditsTransferredEvent = exports.CreditsTransferredEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    var _iterator4 = _createForOfIteratorHelper(message.tokens),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var v = _step4.value;
        _tx.TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.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 = createBaseCreditsTransferredEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(_tx.TokenBatch.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(function (e) {
        return _tx.TokenBatch.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(function (e) {
        return e ? _tx.TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner5, _object$tokens4;
    var message = createBaseCreditsTransferredEvent();
    message.owner = (_object$owner5 = object.owner) !== null && _object$owner5 !== void 0 ? _object$owner5 : "";
    message.tokens = ((_object$tokens4 = object.tokens) === null || _object$tokens4 === void 0 ? void 0 : _object$tokens4.map(function (e) {
      return _tx.TokenBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseTokenPausedEvent() {
  return {
    minter: "",
    contractAddress: "",
    paused: false
  };
}
var TokenPausedEvent = exports.TokenPausedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.minter !== "") {
      writer.uint32(10).string(message.minter);
    }
    if (message.contractAddress !== "") {
      writer.uint32(18).string(message.contractAddress);
    }
    if (message.paused === true) {
      writer.uint32(24).bool(message.paused);
    }
    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 = createBaseTokenPausedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.minter = reader.string();
          break;
        case 2:
          message.contractAddress = reader.string();
          break;
        case 3:
          message.paused = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      minter: (0, _helpers.isSet)(object.minter) ? String(object.minter) : "",
      contractAddress: (0, _helpers.isSet)(object.contractAddress) ? String(object.contractAddress) : "",
      paused: (0, _helpers.isSet)(object.paused) ? Boolean(object.paused) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    message.paused !== undefined && (obj.paused = message.paused);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$minter2, _object$contractAddre2, _object$paused;
    var message = createBaseTokenPausedEvent();
    message.minter = (_object$minter2 = object.minter) !== null && _object$minter2 !== void 0 ? _object$minter2 : "";
    message.contractAddress = (_object$contractAddre2 = object.contractAddress) !== null && _object$contractAddre2 !== void 0 ? _object$contractAddre2 : "";
    message.paused = (_object$paused = object.paused) !== null && _object$paused !== void 0 ? _object$paused : false;
    return message;
  }
};
function createBaseTokenStoppedEvent() {
  return {
    minter: "",
    contractAddress: "",
    stopped: false
  };
}
var TokenStoppedEvent = exports.TokenStoppedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.minter !== "") {
      writer.uint32(10).string(message.minter);
    }
    if (message.contractAddress !== "") {
      writer.uint32(18).string(message.contractAddress);
    }
    if (message.stopped === true) {
      writer.uint32(24).bool(message.stopped);
    }
    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 = createBaseTokenStoppedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.minter = reader.string();
          break;
        case 2:
          message.contractAddress = reader.string();
          break;
        case 3:
          message.stopped = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      minter: (0, _helpers.isSet)(object.minter) ? String(object.minter) : "",
      contractAddress: (0, _helpers.isSet)(object.contractAddress) ? String(object.contractAddress) : "",
      stopped: (0, _helpers.isSet)(object.stopped) ? Boolean(object.stopped) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    message.stopped !== undefined && (obj.stopped = message.stopped);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$minter3, _object$contractAddre3, _object$stopped;
    var message = createBaseTokenStoppedEvent();
    message.minter = (_object$minter3 = object.minter) !== null && _object$minter3 !== void 0 ? _object$minter3 : "";
    message.contractAddress = (_object$contractAddre3 = object.contractAddress) !== null && _object$contractAddre3 !== void 0 ? _object$contractAddre3 : "";
    message.stopped = (_object$stopped = object.stopped) !== null && _object$stopped !== void 0 ? _object$stopped : false;
    return message;
  }
};