0.1.0 • Published 3 years ago
@hashchat/js-hashchat v0.1.0
Models
ChatMessageis the main model that uses aJWMPayloadas the dtoHashchatStreamMessageis an internal dto that represents the fully signed and encrypted message stored in StreamSignedChatMessageis the payload of the encrypted message and contains information needed to verify the messageJWMPayloadis the final payload that contains message data
Services
AuthServicehandles wallet connection, Lit authentication, and DID session managementEncrypterServicehandles encryption and decryption. It is internally access byChatServiceSignerServicehandles signing messages. It is internally access byChatServiceChatServicehandles sending and receiving messages from Stream
Example App
The example app under examples/ uses the AuthService and ChatService to authenticate, send a single message to a hardcoded channel, and receive a message from a hardcoded channel. Messages are signed and encrypted before sending, and they are decrypted and validated when receiving.
To test locally, in the root directory:
yarn
npm link
yarn buildAnd in the example app directory:
yarn
npm link js-hashchat
yarn start0.1.0
3 years ago