"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.NFT = exports.Class = void 0;
var _any = require("../../../google/protobuf/any");
var _binary = require("../../../binary");
var _helpers = require("../../../helpers");
/** Class defines the class of the nft type. */

/** Class defines the class of the nft type. */

/** Class defines the class of the nft type. */

/** NFT defines the NFT. */

/** NFT defines the NFT. */

/** NFT defines the NFT. */

function createBaseClass() {
  return {
    id: "",
    name: "",
    symbol: "",
    description: "",
    uri: "",
    uriHash: "",
    data: undefined
  };
}
var Class = exports.Class = {
  typeUrl: "/cosmos.nft.v1beta1.Class",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.name !== "") {
      writer.uint32(18).string(message.name);
    }
    if (message.symbol !== "") {
      writer.uint32(26).string(message.symbol);
    }
    if (message.description !== "") {
      writer.uint32(34).string(message.description);
    }
    if (message.uri !== "") {
      writer.uint32(42).string(message.uri);
    }
    if (message.uriHash !== "") {
      writer.uint32(50).string(message.uriHash);
    }
    if (message.data !== undefined) {
      _any.Any.encode(message.data, writer.uint32(58).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      name: (0, _helpers.isSet)(object.name) ? String(object.name) : "",
      symbol: (0, _helpers.isSet)(object.symbol) ? String(object.symbol) : "",
      description: (0, _helpers.isSet)(object.description) ? String(object.description) : "",
      uri: (0, _helpers.isSet)(object.uri) ? String(object.uri) : "",
      uriHash: (0, _helpers.isSet)(object.uriHash) ? String(object.uriHash) : "",
      data: (0, _helpers.isSet)(object.data) ? _any.Any.fromJSON(object.data) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$id, _object$name, _object$symbol, _object$description, _object$uri, _object$uriHash;
    var message = createBaseClass();
    message.id = (_object$id = object.id) !== null && _object$id !== void 0 ? _object$id : "";
    message.name = (_object$name = object.name) !== null && _object$name !== void 0 ? _object$name : "";
    message.symbol = (_object$symbol = object.symbol) !== null && _object$symbol !== void 0 ? _object$symbol : "";
    message.description = (_object$description = object.description) !== null && _object$description !== void 0 ? _object$description : "";
    message.uri = (_object$uri = object.uri) !== null && _object$uri !== void 0 ? _object$uri : "";
    message.uriHash = (_object$uriHash = object.uriHash) !== null && _object$uriHash !== void 0 ? _object$uriHash : "";
    message.data = object.data !== undefined && object.data !== null ? _any.Any.fromPartial(object.data) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseClass();
    if (object.id !== undefined && object.id !== null) {
      message.id = object.id;
    }
    if (object.name !== undefined && object.name !== null) {
      message.name = object.name;
    }
    if (object.symbol !== undefined && object.symbol !== null) {
      message.symbol = object.symbol;
    }
    if (object.description !== undefined && object.description !== null) {
      message.description = object.description;
    }
    if (object.uri !== undefined && object.uri !== null) {
      message.uri = object.uri;
    }
    if (object.uri_hash !== undefined && object.uri_hash !== null) {
      message.uriHash = object.uri_hash;
    }
    if (object.data !== undefined && object.data !== null) {
      message.data = _any.Any.fromAmino(object.data);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.id = message.id === "" ? undefined : message.id;
    obj.name = message.name === "" ? undefined : message.name;
    obj.symbol = message.symbol === "" ? undefined : message.symbol;
    obj.description = message.description === "" ? undefined : message.description;
    obj.uri = message.uri === "" ? undefined : message.uri;
    obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash;
    obj.data = message.data ? _any.Any.toAmino(message.data) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return Class.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/Class",
      value: Class.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return Class.decode(message.value);
  },
  toProto: function toProto(message) {
    return Class.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.nft.v1beta1.Class",
      value: Class.encode(message).finish()
    };
  }
};
function createBaseNFT() {
  return {
    classId: "",
    id: "",
    uri: "",
    uriHash: "",
    data: undefined
  };
}
var NFT = exports.NFT = {
  typeUrl: "/cosmos.nft.v1beta1.NFT",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.classId !== "") {
      writer.uint32(10).string(message.classId);
    }
    if (message.id !== "") {
      writer.uint32(18).string(message.id);
    }
    if (message.uri !== "") {
      writer.uint32(26).string(message.uri);
    }
    if (message.uriHash !== "") {
      writer.uint32(34).string(message.uriHash);
    }
    if (message.data !== undefined) {
      _any.Any.encode(message.data, writer.uint32(82).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      classId: (0, _helpers.isSet)(object.classId) ? String(object.classId) : "",
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      uri: (0, _helpers.isSet)(object.uri) ? String(object.uri) : "",
      uriHash: (0, _helpers.isSet)(object.uriHash) ? String(object.uriHash) : "",
      data: (0, _helpers.isSet)(object.data) ? _any.Any.fromJSON(object.data) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$classId, _object$id2, _object$uri2, _object$uriHash2;
    var message = createBaseNFT();
    message.classId = (_object$classId = object.classId) !== null && _object$classId !== void 0 ? _object$classId : "";
    message.id = (_object$id2 = object.id) !== null && _object$id2 !== void 0 ? _object$id2 : "";
    message.uri = (_object$uri2 = object.uri) !== null && _object$uri2 !== void 0 ? _object$uri2 : "";
    message.uriHash = (_object$uriHash2 = object.uriHash) !== null && _object$uriHash2 !== void 0 ? _object$uriHash2 : "";
    message.data = object.data !== undefined && object.data !== null ? _any.Any.fromPartial(object.data) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseNFT();
    if (object.class_id !== undefined && object.class_id !== null) {
      message.classId = object.class_id;
    }
    if (object.id !== undefined && object.id !== null) {
      message.id = object.id;
    }
    if (object.uri !== undefined && object.uri !== null) {
      message.uri = object.uri;
    }
    if (object.uri_hash !== undefined && object.uri_hash !== null) {
      message.uriHash = object.uri_hash;
    }
    if (object.data !== undefined && object.data !== null) {
      message.data = _any.Any.fromAmino(object.data);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.class_id = message.classId === "" ? undefined : message.classId;
    obj.id = message.id === "" ? undefined : message.id;
    obj.uri = message.uri === "" ? undefined : message.uri;
    obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash;
    obj.data = message.data ? _any.Any.toAmino(message.data) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return NFT.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/NFT",
      value: NFT.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return NFT.decode(message.value);
  },
  toProto: function toProto(message) {
    return NFT.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.nft.v1beta1.NFT",
      value: NFT.encode(message).finish()
    };
  }
};