/* eslint-disable */ import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.nft.v1beta1"; /** 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; } /** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponse { } function createBaseMsgSend(): MsgSend { return { classId: "", id: "", sender: "", receiver: "" }; } export const MsgSend = { encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 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; }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.classId = reader.string(); break; case 2: message.id = reader.string(); break; case 3: message.sender = reader.string(); break; case 4: message.receiver = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, 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) : "", }; }, toJSON(message: MsgSend): unknown { const obj: any = {}; message.classId !== undefined && (obj.classId = message.classId); message.id !== undefined && (obj.id = message.id); message.sender !== undefined && (obj.sender = message.sender); message.receiver !== undefined && (obj.receiver = message.receiver); return obj; }, fromPartial, I>>(object: I): MsgSend { const message = createBaseMsgSend(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; message.sender = object.sender ?? ""; message.receiver = object.receiver ?? ""; return message; }, }; function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(_: any): MsgSendResponse { return {}; }, toJSON(_: MsgSendResponse): unknown { const obj: any = {}; return obj; }, fromPartial, I>>(_: I): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, }; /** Msg defines the nft Msg service. */ export interface Msg { /** Send defines a method to send a nft from one account to another account. */ Send(request: MsgSend): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.Send = this.Send.bind(this); } Send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Msg", "Send", data); return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); } } interface Rpc { request(service: string, method: string, data: Uint8Array): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function isSet(value: any): boolean { return value !== null && value !== undefined; }