"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TokenBatch = exports.MsgTransferTokenResponse = exports.MsgTransferToken = exports.MsgTransferCreditResponse = exports.MsgTransferCredit = exports.MsgStopTokenResponse = exports.MsgStopToken = exports.MsgRetireTokenResponse = exports.MsgRetireToken = exports.MsgPauseTokenResponse = exports.MsgPauseToken = exports.MsgMintTokenResponse = exports.MsgMintToken = exports.MsgCreateTokenResponse = exports.MsgCreateToken = exports.MsgCancelTokenResponse = exports.MsgCancelToken = exports.MintBatch = void 0;
var _token = require("./token");
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
function createBaseMsgCreateToken() {
  return {
    minter: "",
    "class": "",
    name: "",
    description: "",
    image: "",
    tokenType: "",
    cap: ""
  };
}
var MsgCreateToken = exports.MsgCreateToken = {
  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["class"] !== "") {
      writer.uint32(18).string(message["class"]);
    }
    if (message.name !== "") {
      writer.uint32(26).string(message.name);
    }
    if (message.description !== "") {
      writer.uint32(34).string(message.description);
    }
    if (message.image !== "") {
      writer.uint32(42).string(message.image);
    }
    if (message.tokenType !== "") {
      writer.uint32(50).string(message.tokenType);
    }
    if (message.cap !== "") {
      writer.uint32(58).string(message.cap);
    }
    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 = createBaseMsgCreateToken();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.minter = reader.string();
          break;
        case 2:
          message["class"] = reader.string();
          break;
        case 3:
          message.name = reader.string();
          break;
        case 4:
          message.description = reader.string();
          break;
        case 5:
          message.image = reader.string();
          break;
        case 6:
          message.tokenType = reader.string();
          break;
        case 7:
          message.cap = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      minter: (0, _helpers.isSet)(object.minter) ? String(object.minter) : "",
      "class": (0, _helpers.isSet)(object["class"]) ? String(object["class"]) : "",
      name: (0, _helpers.isSet)(object.name) ? String(object.name) : "",
      description: (0, _helpers.isSet)(object.description) ? String(object.description) : "",
      image: (0, _helpers.isSet)(object.image) ? String(object.image) : "",
      tokenType: (0, _helpers.isSet)(object.tokenType) ? String(object.tokenType) : "",
      cap: (0, _helpers.isSet)(object.cap) ? String(object.cap) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message["class"] !== undefined && (obj["class"] = message["class"]);
    message.name !== undefined && (obj.name = message.name);
    message.description !== undefined && (obj.description = message.description);
    message.image !== undefined && (obj.image = message.image);
    message.tokenType !== undefined && (obj.tokenType = message.tokenType);
    message.cap !== undefined && (obj.cap = message.cap);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$minter, _object$class, _object$name, _object$description, _object$image, _object$tokenType, _object$cap;
    var message = createBaseMsgCreateToken();
    message.minter = (_object$minter = object.minter) !== null && _object$minter !== void 0 ? _object$minter : "";
    message["class"] = (_object$class = object["class"]) !== null && _object$class !== void 0 ? _object$class : "";
    message.name = (_object$name = object.name) !== null && _object$name !== void 0 ? _object$name : "";
    message.description = (_object$description = object.description) !== null && _object$description !== void 0 ? _object$description : "";
    message.image = (_object$image = object.image) !== null && _object$image !== void 0 ? _object$image : "";
    message.tokenType = (_object$tokenType = object.tokenType) !== null && _object$tokenType !== void 0 ? _object$tokenType : "";
    message.cap = (_object$cap = object.cap) !== null && _object$cap !== void 0 ? _object$cap : "";
    return message;
  }
};
function createBaseMsgCreateTokenResponse() {
  return {};
}
var MsgCreateTokenResponse = exports.MsgCreateTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgCreateTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgCreateTokenResponse();
    return message;
  }
};
function createBaseMsgMintToken() {
  return {
    minter: "",
    contractAddress: "",
    owner: "",
    mintBatch: []
  };
}
var MsgMintToken = exports.MsgMintToken = {
  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.owner !== "") {
      writer.uint32(26).string(message.owner);
    }
    var _iterator = _createForOfIteratorHelper(message.mintBatch),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        MintBatch.encode(v, writer.uint32(34).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 = createBaseMsgMintToken();
    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.owner = reader.string();
          break;
        case 4:
          message.mintBatch.push(MintBatch.decode(reader, reader.uint32()));
          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) : "",
      owner: (0, _helpers.isSet)(object.owner) ? String(object.owner) : "",
      mintBatch: Array.isArray(object === null || object === void 0 ? void 0 : object.mintBatch) ? object.mintBatch.map(function (e) {
        return MintBatch.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.mintBatch) {
      obj.mintBatch = message.mintBatch.map(function (e) {
        return e ? MintBatch.toJSON(e) : undefined;
      });
    } else {
      obj.mintBatch = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$minter2, _object$contractAddre, _object$owner, _object$mintBatch;
    var message = createBaseMsgMintToken();
    message.minter = (_object$minter2 = object.minter) !== null && _object$minter2 !== void 0 ? _object$minter2 : "";
    message.contractAddress = (_object$contractAddre = object.contractAddress) !== null && _object$contractAddre !== void 0 ? _object$contractAddre : "";
    message.owner = (_object$owner = object.owner) !== null && _object$owner !== void 0 ? _object$owner : "";
    message.mintBatch = ((_object$mintBatch = object.mintBatch) === null || _object$mintBatch === void 0 ? void 0 : _object$mintBatch.map(function (e) {
      return MintBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMintBatch() {
  return {
    name: "",
    index: "",
    amount: "",
    collection: "",
    tokenData: []
  };
}
var MintBatch = exports.MintBatch = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.name !== "") {
      writer.uint32(10).string(message.name);
    }
    if (message.index !== "") {
      writer.uint32(18).string(message.index);
    }
    if (message.amount !== "") {
      writer.uint32(26).string(message.amount);
    }
    if (message.collection !== "") {
      writer.uint32(34).string(message.collection);
    }
    var _iterator2 = _createForOfIteratorHelper(message.tokenData),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        _token.TokenData.encode(v, writer.uint32(42).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 = createBaseMintBatch();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.name = reader.string();
          break;
        case 2:
          message.index = reader.string();
          break;
        case 3:
          message.amount = reader.string();
          break;
        case 4:
          message.collection = reader.string();
          break;
        case 5:
          message.tokenData.push(_token.TokenData.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      name: (0, _helpers.isSet)(object.name) ? String(object.name) : "",
      index: (0, _helpers.isSet)(object.index) ? String(object.index) : "",
      amount: (0, _helpers.isSet)(object.amount) ? String(object.amount) : "",
      collection: (0, _helpers.isSet)(object.collection) ? String(object.collection) : "",
      tokenData: Array.isArray(object === null || object === void 0 ? void 0 : object.tokenData) ? object.tokenData.map(function (e) {
        return _token.TokenData.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.name !== undefined && (obj.name = message.name);
    message.index !== undefined && (obj.index = message.index);
    message.amount !== undefined && (obj.amount = message.amount);
    message.collection !== undefined && (obj.collection = message.collection);
    if (message.tokenData) {
      obj.tokenData = message.tokenData.map(function (e) {
        return e ? _token.TokenData.toJSON(e) : undefined;
      });
    } else {
      obj.tokenData = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$name2, _object$index, _object$amount, _object$collection, _object$tokenData;
    var message = createBaseMintBatch();
    message.name = (_object$name2 = object.name) !== null && _object$name2 !== void 0 ? _object$name2 : "";
    message.index = (_object$index = object.index) !== null && _object$index !== void 0 ? _object$index : "";
    message.amount = (_object$amount = object.amount) !== null && _object$amount !== void 0 ? _object$amount : "";
    message.collection = (_object$collection = object.collection) !== null && _object$collection !== void 0 ? _object$collection : "";
    message.tokenData = ((_object$tokenData = object.tokenData) === null || _object$tokenData === void 0 ? void 0 : _object$tokenData.map(function (e) {
      return _token.TokenData.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgMintTokenResponse() {
  return {};
}
var MsgMintTokenResponse = exports.MsgMintTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgMintTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgMintTokenResponse();
    return message;
  }
};
function createBaseMsgTransferToken() {
  return {
    owner: "",
    recipient: "",
    tokens: []
  };
}
var MsgTransferToken = exports.MsgTransferToken = {
  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 _iterator3 = _createForOfIteratorHelper(message.tokens),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        TokenBatch.encode(v, writer.uint32(26).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 = createBaseMsgTransferToken();
    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(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 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 ? TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner2, _object$recipient, _object$tokens;
    var message = createBaseMsgTransferToken();
    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 TokenBatch.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgTransferTokenResponse() {
  return {};
}
var MsgTransferTokenResponse = exports.MsgTransferTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgTransferTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgTransferTokenResponse();
    return message;
  }
};
function createBaseTokenBatch() {
  return {
    id: "",
    amount: ""
  };
}
var TokenBatch = exports.TokenBatch = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.amount !== "") {
      writer.uint32(18).string(message.amount);
    }
    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 = createBaseTokenBatch();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.amount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      amount: (0, _helpers.isSet)(object.amount) ? String(object.amount) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.amount !== undefined && (obj.amount = message.amount);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id, _object$amount2;
    var message = createBaseTokenBatch();
    message.id = (_object$id = object.id) !== null && _object$id !== void 0 ? _object$id : "";
    message.amount = (_object$amount2 = object.amount) !== null && _object$amount2 !== void 0 ? _object$amount2 : "";
    return message;
  }
};
function createBaseMsgRetireToken() {
  return {
    owner: "",
    tokens: [],
    jurisdiction: "",
    reason: ""
  };
}
var MsgRetireToken = exports.MsgRetireToken = {
  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;
        TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    if (message.jurisdiction !== "") {
      writer.uint32(26).string(message.jurisdiction);
    }
    if (message.reason !== "") {
      writer.uint32(34).string(message.reason);
    }
    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 = createBaseMsgRetireToken();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(TokenBatch.decode(reader, reader.uint32()));
          break;
        case 3:
          message.jurisdiction = reader.string();
          break;
        case 4:
          message.reason = reader.string();
          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 TokenBatch.fromJSON(e);
      }) : [],
      jurisdiction: (0, _helpers.isSet)(object.jurisdiction) ? String(object.jurisdiction) : "",
      reason: (0, _helpers.isSet)(object.reason) ? String(object.reason) : ""
    };
  },
  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 ? TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    message.jurisdiction !== undefined && (obj.jurisdiction = message.jurisdiction);
    message.reason !== undefined && (obj.reason = message.reason);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner3, _object$tokens2, _object$jurisdiction, _object$reason;
    var message = createBaseMsgRetireToken();
    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 TokenBatch.fromPartial(e);
    })) || [];
    message.jurisdiction = (_object$jurisdiction = object.jurisdiction) !== null && _object$jurisdiction !== void 0 ? _object$jurisdiction : "";
    message.reason = (_object$reason = object.reason) !== null && _object$reason !== void 0 ? _object$reason : "";
    return message;
  }
};
function createBaseMsgRetireTokenResponse() {
  return {};
}
var MsgRetireTokenResponse = exports.MsgRetireTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgRetireTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgRetireTokenResponse();
    return message;
  }
};
function createBaseMsgTransferCredit() {
  return {
    owner: "",
    tokens: [],
    jurisdiction: "",
    reason: "",
    authorizationId: ""
  };
}
var MsgTransferCredit = exports.MsgTransferCredit = {
  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 _iterator5 = _createForOfIteratorHelper(message.tokens),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var v = _step5.value;
        TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    if (message.jurisdiction !== "") {
      writer.uint32(26).string(message.jurisdiction);
    }
    if (message.reason !== "") {
      writer.uint32(34).string(message.reason);
    }
    if (message.authorizationId !== "") {
      writer.uint32(42).string(message.authorizationId);
    }
    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 = createBaseMsgTransferCredit();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(TokenBatch.decode(reader, reader.uint32()));
          break;
        case 3:
          message.jurisdiction = reader.string();
          break;
        case 4:
          message.reason = reader.string();
          break;
        case 5:
          message.authorizationId = reader.string();
          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 TokenBatch.fromJSON(e);
      }) : [],
      jurisdiction: (0, _helpers.isSet)(object.jurisdiction) ? String(object.jurisdiction) : "",
      reason: (0, _helpers.isSet)(object.reason) ? String(object.reason) : "",
      authorizationId: (0, _helpers.isSet)(object.authorizationId) ? String(object.authorizationId) : ""
    };
  },
  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 ? TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    message.jurisdiction !== undefined && (obj.jurisdiction = message.jurisdiction);
    message.reason !== undefined && (obj.reason = message.reason);
    message.authorizationId !== undefined && (obj.authorizationId = message.authorizationId);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner4, _object$tokens3, _object$jurisdiction2, _object$reason2, _object$authorization;
    var message = createBaseMsgTransferCredit();
    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 TokenBatch.fromPartial(e);
    })) || [];
    message.jurisdiction = (_object$jurisdiction2 = object.jurisdiction) !== null && _object$jurisdiction2 !== void 0 ? _object$jurisdiction2 : "";
    message.reason = (_object$reason2 = object.reason) !== null && _object$reason2 !== void 0 ? _object$reason2 : "";
    message.authorizationId = (_object$authorization = object.authorizationId) !== null && _object$authorization !== void 0 ? _object$authorization : "";
    return message;
  }
};
function createBaseMsgTransferCreditResponse() {
  return {};
}
var MsgTransferCreditResponse = exports.MsgTransferCreditResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgTransferCreditResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgTransferCreditResponse();
    return message;
  }
};
function createBaseMsgCancelToken() {
  return {
    owner: "",
    tokens: [],
    reason: ""
  };
}
var MsgCancelToken = exports.MsgCancelToken = {
  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 _iterator6 = _createForOfIteratorHelper(message.tokens),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var v = _step6.value;
        TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    if (message.reason !== "") {
      writer.uint32(26).string(message.reason);
    }
    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 = createBaseMsgCancelToken();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.owner = reader.string();
          break;
        case 2:
          message.tokens.push(TokenBatch.decode(reader, reader.uint32()));
          break;
        case 3:
          message.reason = reader.string();
          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 TokenBatch.fromJSON(e);
      }) : [],
      reason: (0, _helpers.isSet)(object.reason) ? String(object.reason) : ""
    };
  },
  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 ? TokenBatch.toJSON(e) : undefined;
      });
    } else {
      obj.tokens = [];
    }
    message.reason !== undefined && (obj.reason = message.reason);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$owner5, _object$tokens4, _object$reason3;
    var message = createBaseMsgCancelToken();
    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 TokenBatch.fromPartial(e);
    })) || [];
    message.reason = (_object$reason3 = object.reason) !== null && _object$reason3 !== void 0 ? _object$reason3 : "";
    return message;
  }
};
function createBaseMsgCancelTokenResponse() {
  return {};
}
var MsgCancelTokenResponse = exports.MsgCancelTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgCancelTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgCancelTokenResponse();
    return message;
  }
};
function createBaseMsgPauseToken() {
  return {
    minter: "",
    contractAddress: "",
    paused: false
  };
}
var MsgPauseToken = exports.MsgPauseToken = {
  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 = createBaseMsgPauseToken();
    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$minter3, _object$contractAddre2, _object$paused;
    var message = createBaseMsgPauseToken();
    message.minter = (_object$minter3 = object.minter) !== null && _object$minter3 !== void 0 ? _object$minter3 : "";
    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 createBaseMsgPauseTokenResponse() {
  return {};
}
var MsgPauseTokenResponse = exports.MsgPauseTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgPauseTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgPauseTokenResponse();
    return message;
  }
};
function createBaseMsgStopToken() {
  return {
    minter: "",
    contractAddress: ""
  };
}
var MsgStopToken = exports.MsgStopToken = {
  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);
    }
    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 = createBaseMsgStopToken();
    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;
        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) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$minter4, _object$contractAddre3;
    var message = createBaseMsgStopToken();
    message.minter = (_object$minter4 = object.minter) !== null && _object$minter4 !== void 0 ? _object$minter4 : "";
    message.contractAddress = (_object$contractAddre3 = object.contractAddress) !== null && _object$contractAddre3 !== void 0 ? _object$contractAddre3 : "";
    return message;
  }
};
function createBaseMsgStopTokenResponse() {
  return {};
}
var MsgStopTokenResponse = exports.MsgStopTokenResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgStopTokenResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgStopTokenResponse();
    return message;
  }
};