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

@temporalxyz/nozomi-sdk

v1.0.3

Published

Find the fastest Nozomi endpoints for optimal transaction submission

Readme

Nozomi SDK

Find the fastest Nozomi endpoints for optimal Solana transaction submission.

Installation

npm install @temporalxyz/nozomi-sdk

Usage

Basic Usage

import { findFastestEndpoints } from '@temporalxyz/nozomi-sdk';

// Find the 2 fastest regional endpoints + auto-routed fallback
const endpoints = await findFastestEndpoints();

console.log(endpoints);
// [
//   { url: 'https://pit1.nozomi.temporal.xyz', region: 'pittsburgh', minTime: 12.5, ... },
//   { url: 'https://ewr1.nozomi.temporal.xyz', region: 'newark', minTime: 15.2, ... },
//   { url: 'https://nozomi.temporal.xyz', region: 'auto', minTime: 18.0, ... }
// ]

Find Single Fastest

const [fastest] = await findFastestEndpoints({ topCount: 1 });
console.log(`Fastest: ${fastest.url} (${fastest.minTime.toFixed(2)}ms)`);

With Solana Web3.js

import { Connection, Keypair, Transaction } from '@solana/web3.js';
import { findFastestEndpoints } from '@temporalxyz/nozomi-sdk';

const [fastest] = await findFastestEndpoints({ topCount: 1 });

const API_KEY = process.env.NOZOMI_API_KEY;
const connection = new Connection(`${fastest.url}/?c=${API_KEY}`, 'confirmed');

// Send transaction via Nozomi
const signature = await connection.sendRawTransaction(signedTx, {
  skipPreflight: true,
  maxRetries: 0
});

Configuration Options

const results = await findFastestEndpoints({
  // Number of measurement pings per endpoint (default: 5, max: 20)
  pingCount: 10,

  // Number of warmup pings before measurement (default: 2, max: 5)
  warmupCount: 2,

  // Number of top endpoints to return (default: 2, max: 10)
  topCount: 3,

  // Timeout per ping in ms (default: 5000, min: 1000, max: 30000)
  timeout: 3000,

  // Include auto-routed endpoint in results (default: true)
  includeAutoRouted: true,

  // Custom ping endpoint path (default: '/ping')
  endpoint: '/ping',

  // Custom endpoints URL (default: GitHub raw URL)
  endpointsUrl: 'https://example.com/endpoints.json',

  // Custom endpoint configs (skips remote fetch)
  endpoints: [
    { url: 'https://custom.xyz', region: 'custom', type: 'direct' }
  ],

  // Callback for each endpoint result (useful for progress)
  onResult: (result) => {
    console.log(`${result.url}: ${result.minTime}ms`);
  }
});

Fallback Strategy

const endpoints = await findFastestEndpoints({ topCount: 3 });

for (const endpoint of endpoints) {
  try {
    const connection = new Connection(`${endpoint.url}/?c=${API_KEY}`);
    const sig = await connection.sendRawTransaction(tx);
    console.log(`Success via ${endpoint.url}`);
    break;
  } catch (err) {
    console.warn(`Failed on ${endpoint.url}, trying next...`);
  }
}

API Reference

findFastestEndpoints(options?)

Returns a promise that resolves to an array of EndpointResult objects.

Never throws - always returns at least one endpoint (the auto-routed fallback).

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | pingCount | number | 5 | Number of measurement pings (1-20) | | warmupCount | number | 2 | Number of warmup pings (0-5) | | topCount | number | 2 | Number of top results to return (1-10) | | timeout | number | 5000 | Timeout per ping in ms (1000-30000) | | includeAutoRouted | boolean | true | Include auto-routed endpoint | | endpoint | string | '/ping' | Ping endpoint path | | endpointsUrl | string | GitHub URL | URL to fetch endpoint configs | | endpoints | EndpointConfig[] | - | Custom endpoint configs | | onResult | function | - | Callback for each result |

Result Type

interface EndpointResult {
  url: string;           // Endpoint URL
  region: string;        // Region identifier
  minTime: number;       // Minimum ping time (ms)
  times?: number[];      // All measurement times
  warmupTimes?: number[]; // Warmup times
}

Constants

import {
  NOZOMI_ENDPOINTS,      // Hardcoded fallback endpoints
  NOZOMI_AUTO_ENDPOINT,  // Auto-routed endpoint URL
  NOZOMI_ENDPOINTS_URL   // Default endpoints JSON URL
} from '@temporalxyz/nozomi-sdk';

Features

  • Zero dependencies - works in Node.js and browsers
  • Never throws - always returns valid results with fallbacks
  • Region deduplication - returns only the fastest endpoint per region
  • Warmup pings - accounts for TLS/TCP connection setup
  • Remote config - fetches latest endpoints from GitHub with fallback
  • Fully typed - complete TypeScript definitions

License

MIT