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

@nadohq/otc-client

v0.54.0

Published

HTTP client for the Nado OTC service - execute a signed fill-or-kill order, read its status, and build RFQ quote subscriptions

Readme

@nadohq/otc-client

HTTP client for the Nado OTC service. Submits an already-signed fill-or-kill taker order, reads that execution back, and builds quote subscriptions. No bearer token and no wallet client.

The caller opens the quote WebSocket. A quote can prefill a form; execute does not require one.

Full SDK Documentation

Usage

import { OtcClient, OTC_CLIENT_ENDPOINTS } from '@nadohq/otc-client';

const otc = new OtcClient({ url: OTC_CLIENT_ENDPOINTS.inkMainnet });

const result = await otc.execute({
  dealId: crypto.randomUUID(),
  taker,
});

if (result.deal_id && result.taker_digest) {
  const status = await otc.getExecutionStatus({
    dealId: result.deal_id,
    takerDigest: result.taker_digest,
  });
}

A failure from admission has no digest, so there is nothing to poll. Poll an in-progress failure once it includes taker_digest.

It is also available on a NadoClient context.

const result = await nadoClient.context.otcClient.execute({ dealId, taker });

Quotes

subscribe and unsubscribe are the only RFQ methods. Pass streams, 1–100 entries applied atomically; the service rejects a singular stream. unsubscribe repeats the same stream fields. wallet is a 20-byte address. Socket messages use the server types directly.

import {
  buildOtcRfqSubscriptionMessage,
  OTC_RFQ_WS_CLIENT_ENDPOINTS,
  OtcServerRfqMessage,
} from '@nadohq/otc-client';

const ws = new WebSocket(OTC_RFQ_WS_CLIENT_ENDPOINTS.inkMainnet);

ws.onopen = () => {
  ws.send(
    JSON.stringify(
      buildOtcRfqSubscriptionMessage('subscribe', {
        id: 1,
        streams: [
          {
            type: 'quote',
            productId: 2,
            wallet,
            size: '-1000000000000000000',
            sizeUnit: 'base',
          },
        ],
      }),
    ),
  );
};

ws.onmessage = (event) => {
  const message = JSON.parse(String(event.data)) as OtcServerRfqMessage;
  if ('type' in message && message.type === 'quote_batch') {
    for (const quote of message.quotes) {
      if (quote.status === 'available' && quote.price_x18) {
        // quote.price_x18, quote.valid_until_ms, quote.base_size
      }
    }
  }
};

An ack has result: null and sets error when the server rejected that request. A quote_batch follows a successful subscribe. status: 'available' carries price_x18, valid_until_ms, and base_size. status: 'unavailable' does not.

execute and getExecutionStatus return the JSON body for success, failure, and pending_resolution, including non-200 admission responses. Branch on status and recovery_action, not the HTTP code. getReady reports whether a route's quote and deal coverage overlap.