npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@novasamatech/host-chat

v0.8.5

Published

Host statement store chat integration

Readme

@novasamatech/host-chat

Account lookup and chat-message codecs for host applications integrating with the Polkadot People chain.

Overview

@novasamatech/host-chat exposes the read side of the chat domain: discovering Polkadot accounts by username and resolving their on-chain identity from Resources.Consumers. It also publishes the SCALE codecs used by the chat wire protocol (messages, attachments, local-message envelopes) so host applications can decode statements they receive over the statement store.

The package is UI-framework agnostic. The main entry point returns plain async functions backed by neverthrow ResultAsync, and the codec exports are pure SCALE codecs with no runtime side effects.

Installation

npm install @novasamatech/host-chat --save -E

Getting started

import { createAccountService } from '@novasamatech/host-chat';
import { createLazyClient } from '@novasamatech/statement-store';

const lazyClient = createLazyClient(/* chain provider */);
const accounts = createAccountService('paseo-next-v2', lazyClient);

// Search the off-chain username index for accounts whose username starts with `alice`.
const search = await accounts.search('alice', 'ASSIGNED');
if (search.isOk()) {
  for (const hit of search.value) {
    console.log(hit.candidateAccountId, hit.username);
  }
}

// Resolve a specific account's on-chain identity.
const identity = await accounts.getConsumerInfo('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
if (identity.isOk() && identity.value) {
  console.log(identity.value.fullUsername, identity.value.credibility);
}

Networks

createAccountService accepts one of:

| Network | People chain endpoint | | ---------------- | -------------------------------------- | | stable | Polkadot People | | preview | Westend People | | paseo-next | Paseo People (V1) | | paseo-next-v2 | Paseo People (V2 multi-device) |

Each network entry pins both the People chain WebSocket URL (used via lazyClient) and the off-chain identity-backend REST endpoint that search queries.

API

createAccountService(network, lazyClient)

Returns an object with two methods:

  • search(query, status) — query the off-chain username index. status is 'ASSIGNED' | 'PENDING'. Resolves to a list of { candidateAccountId, username, status, onchainData, createdAt, updatedAt } rows.
  • getConsumerInfo(address) — resolve a single SS58 address to an Identity ({ accountId, fullUsername, liteUsername, credibility }) by reading Resources.Consumers from the People chain. Returns null if the account has no consumer entry. Tolerates both snake_case (V1) and camelCase (V2) runtime field names.

Both methods return ResultAsync<…, Error>; call .isOk() / .isErr() to discriminate.

Codec subpath exports

The chat wire codecs are exposed under explicit subpaths so they can be tree-shaken independently of the main entry point:

import {
  ChatMessage,
  TextContent,
  RichTextContent,
  ChatAcceptedContent,
  DeviceAddedContent,
  DeviceRemovedContent,
} from '@novasamatech/host-chat/codec/message';

import {
  FileMeta,
  FileVariant,
  P2PMixnetFile,
} from '@novasamatech/host-chat/codec/attachment';

import type { ChatSession } from '@novasamatech/host-chat/session';

These are byte-compatible with the Android / iOS Polkadot Mobile clients — modify with care, the indices are pinned by the protocol.