https://github.com/bosonprotocol/chat-sdk
Implementation of XMTP Protocol to facilitate Buyer to Seller Communications in the Boson Protocol dApp https://bosonapp.io/
https://github.com/bosonprotocol/chat-sdk
bosonprotocol dcommerce
Last synced: about 1 year ago
JSON representation
Implementation of XMTP Protocol to facilitate Buyer to Seller Communications in the Boson Protocol dApp https://bosonapp.io/
- Host: GitHub
- URL: https://github.com/bosonprotocol/chat-sdk
- Owner: bosonprotocol
- License: other
- Created: 2022-08-01T11:08:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-15T15:39:18.000Z (about 1 year ago)
- Last Synced: 2025-04-15T16:48:59.390Z (about 1 year ago)
- Topics: bosonprotocol, dcommerce
- Language: TypeScript
- Homepage:
- Size: 1.75 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://bosonprotocol.io)
Chat SDK for Boson Protocol v2



🛠️ **Tools for building on top of the [Boson Protocol](https://bosonprotocol.io).**
JS lib which extends @xmtp/xmtp-js, adding support for chat threads and further message types.
Install
npm i @bosonprotocol/chat-sdk
Usage
- Initialise SDK
-
import { BosonXmtpClient } from "@bosonprotocol/chat-sdk";
const client = await BosonXmtpClient.initialise(signer, "test");
- Get Chat Threads
-
const counterparties = ["0xabc123", "0xdef456", ...];
const threads = await client.getThreads(counterparties);
- Send Message
-
const messageObj = {
threadId: {
exchangeId: "1",
buyerId: "2",
sellerId: "3"
},
contentType: MessageType.String,
version: "0.0.1",
content: {
value: "Example message"
}
};
const recipient = "0xabc123...";
await client.encodeAndSendMessage(messageObj, recipient);
- Monitor Chat Thread (i.e. for incoming messages)
-
for await (const message of await client.monitorThread(threadId, counterparty)) {
console.log(message);
}
Local Development
- Build
-
npm run build
- Test
-
npm run test:all
npm run test:unit
npm run test:integration
- Lint
-
npm run lint
npm run lint:fix
- Format
-
npm run prettier