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

notbank

v2.7.0-alpha

Published

The Notbank for Node.js

Readme

Notbank Node SDK

main page

sign up in Notbank.

Installation

To install Notbank use npm

npm install notbank

Documentation

This sdk makes use of the api of Notbank.

Quick start

Rest client

// client
const client = NotbankClient.Factory.createRestClient();

// authentication
await client.authenticateUser({
  ApiPublicKey: "my-public-key",
  ApiSecretKey: "my-secret-key",
  UserId: "xxxx"
});

handling errors

try {
  const response = await accountService.getAccountPositions({
    AccountId: 13,
    IncludePending: true,
  });
} catch (err) {
  const error = err as NotbankError;
  // handle error
}

Put order at the top of book example

const client = NotbankClient.Factory.createRestClient();
await client.authenticateUser({
  ApiPublicKey: "my-public-key",
  ApiSecretKey: "my-secret-key",
  UserId: "xxxx",
});
var accountId = 235;

// get USDT user balance (also known as position)
var positions = await client
  .getAccountService()
  .getAccountPositions({ AccountId: accountId });
var productSymbol = "USDT";
var usdtPosition = positions
  .filter(position => position.ProductSymbol === productSymbol)
  .pop();
if (!usdtPosition) {
  throw new Error("no usdt position");
}

// define quantityToSpend (between all usdt_balance and half usdt_balance)
var myUsdtBalance = usdtPosition.Amount;
var randomFraction = Math.random();
var halfMyBalance = myUsdtBalance / 2;
var atLeastHalfMyBalance = myUsdtBalance - randomFraction * halfMyBalance;
var quantityToSpend = atLeastHalfMyBalance;

var marketPair = "BTCUSDT";

// define orderPrice (around market top)
var btcUsdtOrderbook = await client
  .getTradingService()
  .getOrderBook({ Market_Pair: marketPair, Depth: 5, Level: 2 });
var randomSmallFraction = (Math.random() * 90 + 10) / 1000;
var topBid = btcUsdtOrderbook.bids[0];
var orderPrice = topBid.price + randomSmallFraction;
// TODO: handle tick size
var orderQuantity = quantityToSpend / orderPrice;

// send order
var instruments = await client.getInstrumentService().getInstruments();
var btcUsdtInstrument = instruments.filter(
  pair => pair.Symbol === marketPair
)[0];
var orderResult = await client.getTradingService().sendOrder({
  InstrumentId: btcUsdtInstrument.InstrumentId,
  AccountId: accountId,
  TimeInForce: TimeInForce.GTC,
  Side: OrderSide.Buy,
  OrderType: OrderTypeInt.Limit,
  Quantity: orderQuantity,
  LimitPrice: orderPrice
});

// handle order result
if (orderResult.Status === "Rejected") {
  // order was rejected
  console.log("order rejected");
  console.log(orderResult.Message);
  return;
}
// order was accepted
console.log("orderId,", orderResult.OrderId);

// cancel order
await client.getTradingService().cancelOrder({
  AccountId: accountId,
  OrderId: orderResult.OrderId
});
return orderResult.OrderId;

websocket client

The websocket client can be instanced with auto reconnection active. If done, then the restarting websocket will reconnect forever when the connection goes down unexpectedly, re-authenticating if it was authenticated, and re-subscribing to already stablished subscriptions. While reconnecting, calls to the websocket will throw. For subscriptions, reconnection will call again the snapshot hooks.

client = NotbankClient.Factory.createWebsocketClient({
  withReconnect: true
});
await client.connect();
await client.authenticateUser({
  ApiPublicKey: "my-public-key",
  ApiSecretKey: "my-secret-key",
  UserId: "xxxx"
});
// ...
client.close();

DevOps

How to build

Run the following npm script

npm run build

This command will compile the library's code from Typescript to Javascript including its type declarations to be used in NodeJS and a bundle version for Browser.