"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MsgSendResponse = exports.MsgSend = void 0;
var _binary = require("../../../binary");
var _helpers = require("../../../helpers");
/** MsgSend represents a message to send a nft from one account to another account. */

/** MsgSend represents a message to send a nft from one account to another account. */

/** MsgSend represents a message to send a nft from one account to another account. */

/** MsgSendResponse defines the Msg/Send response type. */

/** MsgSendResponse defines the Msg/Send response type. */

/** MsgSendResponse defines the Msg/Send response type. */

function createBaseMsgSend() {
  return {
    classId: "",
    id: "",
    sender: "",
    receiver: ""
  };
}
var MsgSend = exports.MsgSend = {
  typeUrl: "/cosmos.nft.v1beta1.MsgSend",
  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.sender !== "") {
      writer.uint32(26).string(message.sender);
    }
    if (message.receiver !== "") {
      writer.uint32(34).string(message.receiver);
    }
    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) : "",
      sender: (0, _helpers.isSet)(object.sender) ? String(object.sender) : "",
      receiver: (0, _helpers.isSet)(object.receiver) ? String(object.receiver) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$classId, _object$id, _object$sender, _object$receiver;
    var message = createBaseMsgSend();
    message.classId = (_object$classId = object.classId) !== null && _object$classId !== void 0 ? _object$classId : "";
    message.id = (_object$id = object.id) !== null && _object$id !== void 0 ? _object$id : "";
    message.sender = (_object$sender = object.sender) !== null && _object$sender !== void 0 ? _object$sender : "";
    message.receiver = (_object$receiver = object.receiver) !== null && _object$receiver !== void 0 ? _object$receiver : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseMsgSend();
    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.sender !== undefined && object.sender !== null) {
      message.sender = object.sender;
    }
    if (object.receiver !== undefined && object.receiver !== null) {
      message.receiver = object.receiver;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.class_id = message.classId === "" ? undefined : message.classId;
    obj.id = message.id === "" ? undefined : message.id;
    obj.sender = message.sender === "" ? undefined : message.sender;
    obj.receiver = message.receiver === "" ? undefined : message.receiver;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return MsgSend.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/MsgNFTSend",
      value: MsgSend.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return MsgSend.decode(message.value);
  },
  toProto: function toProto(message) {
    return MsgSend.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.nft.v1beta1.MsgSend",
      value: MsgSend.encode(message).finish()
    };
  }
};
function createBaseMsgSendResponse() {
  return {};
}
var MsgSendResponse = exports.MsgSendResponse = {
  typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse",
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    return writer;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgSendResponse();
    return message;
  },
  fromAmino: function fromAmino(_) {
    var message = createBaseMsgSendResponse();
    return message;
  },
  toAmino: function toAmino(_) {
    var obj = {};
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return MsgSendResponse.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/MsgSendResponse",
      value: MsgSendResponse.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return MsgSendResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return MsgSendResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse",
      value: MsgSendResponse.encode(message).finish()
    };
  }
};