Introduces the Chat class to enable the DMs feature:
getConversations(paginationOpts): returns the list of active conversations
getConversationMessages(conversationId, paginationOpts?: PaginationOpts): returns the list of messages of the given conversation ( in date-descending order )
sendMessage(msg, conversationId): send a direct message to the given conversation ( for a one-to-one conversation the conversationId is identical to the (hex) public key of the contact, for group chats the conversationId is equal to the vault id)
deleteMessage(messageId, conversationId): deletes the given direct message from the connected relays ( if the relays support NIP-09 )
getConversationMembers(conversationId) - returns the list of hex public keys of the members of the group chat, for one-to-one chats it returns the public key of the contact.
setActiveConversation(conversationId): sets the active conversation ( active conversation is used to deduce the Conversations that have unread messages )
Introduces the Chat class to enable the DMs feature: