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

test-snet-sdk-core

v0.1.19

Published

Test SingularityNET core SDK for JS

Readme

snet-sdk-js

SingularityNET SDK for JavaScript

Getting Started

This repo hosts multiple SDKs for JavaScript. Currently supported platforms

  1. Node.js using grpc-node
  2. Browser (Web) using grpc-web

You can find more details about each sdk within the respective package folders.

  1. Node.js under packages/nodejs directory
  2. Web under packages/web directory

These SDKs are under active development and not ready for production use yet. If you find any bug or something doesn't work as expected, please create an issue.

Usage

All the SDKs assume that there is enough eth balance to cover the gas cost and AGI tokens in the wallet to cover the service execution cost.

The SDKs chose a default PaymentChannelManagementStrategy which is the simplest form of picking an existing Payment Channel if any or creates a new Payment Channel if no channel is found. This can be easily overridden by providing your own strategy to the SDK at the time of construction. Documentation on creating custom strategies will be available soon.

Development

This is a monorepo which is setup a little differently. It does not use any external tools like lerna or any other popular tool.

There are 3 packages out of which only 2 of them are published to npm

  1. core
  2. nodejs (published)
  3. web (published)

The way the core package is shared across nodejs and web is by creating a symlink to core under each package. This setup has been tested on macOS and should work on any standard Linux distribution but it has not been tested on Windows OS.

Build

Navigate to the specific package which needs to be build and then run the following command

npm run build

Publish

Navigate to the specific package which needs to be published and then run the following command

npm run publish

Handling Signature / Binary

The grpc API metadata is a map of key, value pair to store the headers.
The value can be either String or Buffer.

All binary headers should have -bin suffix in their names. Vice versa. A String header's name must not end with this.

NodeSDK and WebSDK use grpc and @improbable-eng/grpc-web respectively to make grpc API calls.

NodeSDK

The grpc package used in node allows to use buffer in the raw binary format without any modification.
So the signature returned by the signData method in the Account class can be directly passed on to the grpc metadata.
e.g.

async getPaymentMetadata() {
   const signature = await this._generateSignature(currentBlockNumber);
   const metadata = [{ 
                     'snet-payment-channel-signature-bin': signature 
                    }];
   return metadata;
 }

WebSDK

Browsers don't have native support for http2.0 which is the base for grpc.
The package @improbable-eng/grpc-web acts as a wrapper around grpc and allows developers to make grpc calls from the browser.

In order to transfer buffer signatures in the headers, the value has to converted first to base64 string.
A buffer can be converted to base64 string using the javascript function Array.prototype.toString("base64").

e.g.

async getPaymentMetadata() {
   const signature = await this._generateSignature(channel.channelId, channel.state.nonce, amount);
   const metadata = [{ 
                     'snet-payment-channel-signature-bin': signature.toString('base64') 
                    }];
   return metadata;
 }