Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bosonprotocol/chat-sdk

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bosonprotocol/chat-sdk

Extension of @xmtp/xmtp-js with support for chat threads and further message types.

  • 1.3.1-alpha.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
329
increased by80.77%
Maintainers
4
Weekly downloads
 
Created
Source

banner

Chat SDK for Boson Protocol v2

🛠️ Tools for building on top of the Boson Protocol.

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

FAQs

Package last updated on 13 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc