orbis.getMessages()

Returns an array of encrypted messages from a conversation.

How to use?

let { data, error } = await orbis.getMessages(conversation_id);

Parameters

  • conversation_id: ID of the conversation

Returns

[
	{
		stream_id: "k...",
		conversation_id: "k...",
		creator: "did:pkh:...",
		content: {
			conversation_id: "k...",
			encryptedMessage: {
		    encryptedString: "...",
		    encryptedSymmetricKey: "...",
		    accessControlConditions: "[]"
		  }
		},
		creator_details: {
			did: "did:pkh:...",
			profile: {
				username: "Baptiste",
				pfp: "https://..."
			}
		},
	},
	...
]

The messages can then be decrypted using the decryptMessage() function.