@hashchat/js-hashchat
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Models

  • ChatMessage is the main model that uses a JWMPayload as the dto
  • HashchatStreamMessage is an internal dto that represents the fully signed and encrypted message stored in Stream
  • SignedChatMessage is the payload of the encrypted message and contains information needed to verify the message
  • JWMPayload is the final payload that contains message data

Services

  • AuthService handles wallet connection, Lit authentication, and DID session management
  • EncrypterService handles encryption and decryption. It is internally access by ChatService
  • SignerService handles signing messages. It is internally access by ChatService
  • 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

Readme

Keywords

none

Package Sidebar

Install

npm i @hashchat/js-hashchat

Weekly Downloads

8

Version

0.1.0

License

none

Unpacked Size

1.14 MB

Total Files

189

Last publish

Collaborators

  • sjdthree