//@ts-nocheck
import { TokenData } from "./token";
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../helpers";
function createBaseMsgCreateToken() {
  return {
    minter: "",
    class: "",
    name: "",
    description: "",
    image: "",
    tokenType: "",
    cap: ""
  };
}
export const MsgCreateToken = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseMsgCreateToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      minter: isSet(object.minter) ? String(object.minter) : "",
      class: isSet(object.class) ? String(object.class) : "",
      name: isSet(object.name) ? String(object.name) : "",
      description: isSet(object.description) ? String(object.description) : "",
      image: isSet(object.image) ? String(object.image) : "",
      tokenType: isSet(object.tokenType) ? String(object.tokenType) : "",
      cap: isSet(object.cap) ? String(object.cap) : ""
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$minter, _object$class, _object$name, _object$description, _object$image, _object$tokenType, _object$cap;
    const 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 {};
}
export const MsgCreateTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgCreateTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgCreateTokenResponse();
    return message;
  }
};
function createBaseMsgMintToken() {
  return {
    minter: "",
    contractAddress: "",
    owner: "",
    mintBatch: []
  };
}
export const MsgMintToken = {
  encode(message, writer = _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);
    }
    for (const v of message.mintBatch) {
      MintBatch.encode(v, writer.uint32(34).fork()).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 = createBaseMsgMintToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      minter: isSet(object.minter) ? String(object.minter) : "",
      contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "",
      owner: isSet(object.owner) ? String(object.owner) : "",
      mintBatch: Array.isArray(object === null || object === void 0 ? void 0 : object.mintBatch) ? object.mintBatch.map(e => MintBatch.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const 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(e => e ? MintBatch.toJSON(e) : undefined);
    } else {
      obj.mintBatch = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$minter2, _object$contractAddre, _object$owner, _object$mintBatch;
    const 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(e => MintBatch.fromPartial(e))) || [];
    return message;
  }
};
function createBaseMintBatch() {
  return {
    name: "",
    index: "",
    amount: "",
    collection: "",
    tokenData: []
  };
}
export const MintBatch = {
  encode(message, writer = _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);
    }
    for (const v of message.tokenData) {
      TokenData.encode(v, writer.uint32(42).fork()).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 = createBaseMintBatch();
    while (reader.pos < end) {
      const 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(TokenData.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      name: isSet(object.name) ? String(object.name) : "",
      index: isSet(object.index) ? String(object.index) : "",
      amount: isSet(object.amount) ? String(object.amount) : "",
      collection: isSet(object.collection) ? String(object.collection) : "",
      tokenData: Array.isArray(object === null || object === void 0 ? void 0 : object.tokenData) ? object.tokenData.map(e => TokenData.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const 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(e => e ? TokenData.toJSON(e) : undefined);
    } else {
      obj.tokenData = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$name2, _object$index, _object$amount, _object$collection, _object$tokenData;
    const 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(e => TokenData.fromPartial(e))) || [];
    return message;
  }
};
function createBaseMsgMintTokenResponse() {
  return {};
}
export const MsgMintTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgMintTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgMintTokenResponse();
    return message;
  }
};
function createBaseMsgTransferToken() {
  return {
    owner: "",
    recipient: "",
    tokens: []
  };
}
export const MsgTransferToken = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    if (message.recipient !== "") {
      writer.uint32(18).string(message.recipient);
    }
    for (const v of message.tokens) {
      TokenBatch.encode(v, writer.uint32(26).fork()).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 = createBaseMsgTransferToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      owner: isSet(object.owner) ? String(object.owner) : "",
      recipient: isSet(object.recipient) ? String(object.recipient) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(e => TokenBatch.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    message.recipient !== undefined && (obj.recipient = message.recipient);
    if (message.tokens) {
      obj.tokens = message.tokens.map(e => e ? TokenBatch.toJSON(e) : undefined);
    } else {
      obj.tokens = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$owner2, _object$recipient, _object$tokens;
    const 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(e => TokenBatch.fromPartial(e))) || [];
    return message;
  }
};
function createBaseMsgTransferTokenResponse() {
  return {};
}
export const MsgTransferTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgTransferTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgTransferTokenResponse();
    return message;
  }
};
function createBaseTokenBatch() {
  return {
    id: "",
    amount: ""
  };
}
export const TokenBatch = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.amount !== "") {
      writer.uint32(18).string(message.amount);
    }
    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 = createBaseTokenBatch();
    while (reader.pos < end) {
      const 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(object) {
    return {
      id: isSet(object.id) ? String(object.id) : "",
      amount: isSet(object.amount) ? String(object.amount) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.amount !== undefined && (obj.amount = message.amount);
    return obj;
  },
  fromPartial(object) {
    var _object$id, _object$amount2;
    const 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: ""
  };
}
export const MsgRetireToken = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    for (const v of message.tokens) {
      TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
    }
    if (message.jurisdiction !== "") {
      writer.uint32(26).string(message.jurisdiction);
    }
    if (message.reason !== "") {
      writer.uint32(34).string(message.reason);
    }
    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 = createBaseMsgRetireToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      owner: isSet(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(e => TokenBatch.fromJSON(e)) : [],
      jurisdiction: isSet(object.jurisdiction) ? String(object.jurisdiction) : "",
      reason: isSet(object.reason) ? String(object.reason) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(e => 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(object) {
    var _object$owner3, _object$tokens2, _object$jurisdiction, _object$reason;
    const 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(e => 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 {};
}
export const MsgRetireTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgRetireTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgRetireTokenResponse();
    return message;
  }
};
function createBaseMsgTransferCredit() {
  return {
    owner: "",
    tokens: [],
    jurisdiction: "",
    reason: "",
    authorizationId: ""
  };
}
export const MsgTransferCredit = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    for (const v of message.tokens) {
      TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
    }
    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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseMsgTransferCredit();
    while (reader.pos < end) {
      const 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(object) {
    return {
      owner: isSet(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(e => TokenBatch.fromJSON(e)) : [],
      jurisdiction: isSet(object.jurisdiction) ? String(object.jurisdiction) : "",
      reason: isSet(object.reason) ? String(object.reason) : "",
      authorizationId: isSet(object.authorizationId) ? String(object.authorizationId) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(e => 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(object) {
    var _object$owner4, _object$tokens3, _object$jurisdiction2, _object$reason2, _object$authorization;
    const 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(e => 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 {};
}
export const MsgTransferCreditResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgTransferCreditResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgTransferCreditResponse();
    return message;
  }
};
function createBaseMsgCancelToken() {
  return {
    owner: "",
    tokens: [],
    reason: ""
  };
}
export const MsgCancelToken = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.owner !== "") {
      writer.uint32(10).string(message.owner);
    }
    for (const v of message.tokens) {
      TokenBatch.encode(v, writer.uint32(18).fork()).ldelim();
    }
    if (message.reason !== "") {
      writer.uint32(26).string(message.reason);
    }
    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 = createBaseMsgCancelToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      owner: isSet(object.owner) ? String(object.owner) : "",
      tokens: Array.isArray(object === null || object === void 0 ? void 0 : object.tokens) ? object.tokens.map(e => TokenBatch.fromJSON(e)) : [],
      reason: isSet(object.reason) ? String(object.reason) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.owner !== undefined && (obj.owner = message.owner);
    if (message.tokens) {
      obj.tokens = message.tokens.map(e => e ? TokenBatch.toJSON(e) : undefined);
    } else {
      obj.tokens = [];
    }
    message.reason !== undefined && (obj.reason = message.reason);
    return obj;
  },
  fromPartial(object) {
    var _object$owner5, _object$tokens4, _object$reason3;
    const 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(e => TokenBatch.fromPartial(e))) || [];
    message.reason = (_object$reason3 = object.reason) !== null && _object$reason3 !== void 0 ? _object$reason3 : "";
    return message;
  }
};
function createBaseMsgCancelTokenResponse() {
  return {};
}
export const MsgCancelTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgCancelTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgCancelTokenResponse();
    return message;
  }
};
function createBaseMsgPauseToken() {
  return {
    minter: "",
    contractAddress: "",
    paused: false
  };
}
export const MsgPauseToken = {
  encode(message, writer = _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(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseMsgPauseToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      minter: isSet(object.minter) ? String(object.minter) : "",
      contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "",
      paused: isSet(object.paused) ? Boolean(object.paused) : false
    };
  },
  toJSON(message) {
    const 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(object) {
    var _object$minter3, _object$contractAddre2, _object$paused;
    const 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 {};
}
export const MsgPauseTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgPauseTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgPauseTokenResponse();
    return message;
  }
};
function createBaseMsgStopToken() {
  return {
    minter: "",
    contractAddress: ""
  };
}
export const MsgStopToken = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.minter !== "") {
      writer.uint32(10).string(message.minter);
    }
    if (message.contractAddress !== "") {
      writer.uint32(18).string(message.contractAddress);
    }
    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 = createBaseMsgStopToken();
    while (reader.pos < end) {
      const 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(object) {
    return {
      minter: isSet(object.minter) ? String(object.minter) : "",
      contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.minter !== undefined && (obj.minter = message.minter);
    message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
    return obj;
  },
  fromPartial(object) {
    var _object$minter4, _object$contractAddre3;
    const 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 {};
}
export const MsgStopTokenResponse = {
  encode(_, writer = _m0.Writer.create()) {
    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 = createBaseMsgStopTokenResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseMsgStopTokenResponse();
    return message;
  }
};