import { BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSend { /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ classId: string; /** id defines the unique identification of nft */ id: string; /** sender is the address of the owner of nft */ sender: string; /** receiver is the receiver address of nft */ receiver: string; } export interface MsgSendProtoMsg { typeUrl: "/cosmos.nft.v1beta1.MsgSend"; value: Uint8Array; } /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSendAmino { /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ class_id?: string; /** id defines the unique identification of nft */ id?: string; /** sender is the address of the owner of nft */ sender?: string; /** receiver is the receiver address of nft */ receiver?: string; } export interface MsgSendAminoMsg { type: "cosmos-sdk/MsgNFTSend"; value: MsgSendAmino; } /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSendSDKType { class_id: string; id: string; sender: string; receiver: string; } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse {} export interface MsgSendResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse"; value: Uint8Array; } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponseAmino {} export interface MsgSendResponseAminoMsg { type: "cosmos-sdk/MsgSendResponse"; value: MsgSendResponseAmino; } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponseSDKType {} function createBaseMsgSend(): MsgSend { return { classId: "", id: "", sender: "", receiver: "" }; } export const MsgSend = { typeUrl: "/cosmos.nft.v1beta1.MsgSend", encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { 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(object: any): MsgSend { return { classId: isSet(object.classId) ? String(object.classId) : "", id: isSet(object.id) ? String(object.id) : "", sender: isSet(object.sender) ? String(object.sender) : "", receiver: isSet(object.receiver) ? String(object.receiver) : "" }; }, fromPartial(object: Partial): MsgSend { const message = createBaseMsgSend(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; message.sender = object.sender ?? ""; message.receiver = object.receiver ?? ""; return message; }, fromAmino(object: MsgSendAmino): MsgSend { const 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(message: MsgSend): MsgSendAmino { const obj: any = {}; 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(object: MsgSendAminoMsg): MsgSend { return MsgSend.fromAmino(object.value); }, toAminoMsg(message: MsgSend): MsgSendAminoMsg { return { type: "cosmos-sdk/MsgNFTSend", value: MsgSend.toAmino(message) }; }, fromProtoMsg(message: MsgSendProtoMsg): MsgSend { return MsgSend.decode(message.value); }, toProto(message: MsgSend): Uint8Array { return MsgSend.encode(message).finish(); }, toProtoMsg(message: MsgSend): MsgSendProtoMsg { return { typeUrl: "/cosmos.nft.v1beta1.MsgSend", value: MsgSend.encode(message).finish() }; } }; function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse", encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, fromJSON(_: any): MsgSendResponse { return {}; }, fromPartial(_: Partial): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { return MsgSendResponse.fromAmino(object.value); }, toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { return { type: "cosmos-sdk/MsgSendResponse", value: MsgSendResponse.toAmino(message) }; }, fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { return MsgSendResponse.decode(message.value); }, toProto(message: MsgSendResponse): Uint8Array { return MsgSendResponse.encode(message).finish(); }, toProtoMsg(message: MsgSendResponse): MsgSendResponseProtoMsg { return { typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse", value: MsgSendResponse.encode(message).finish() }; } };