0.1.0 • Published 2 years ago
@hashchat/js-hashchat v0.1.0
Models
ChatMessage
is the main model that uses aJWMPayload
as the dtoHashchatStreamMessage
is an internal dto that represents the fully signed and encrypted message stored in StreamSignedChatMessage
is the payload of the encrypted message and contains information needed to verify the messageJWMPayload
is the final payload that contains message data
Services
AuthService
handles wallet connection, Lit authentication, and DID session managementEncrypterService
handles encryption and decryption. It is internally access byChatService
SignerService
handles signing messages. It is internally access byChatService
ChatService
handles 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 build
And in the example app directory:
yarn
npm link js-hashchat
yarn start
0.1.0
2 years ago