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

@validators-dao/solana-stream-sdk

v1.2.0

Published

Solana Stream SDK by Validators DAO

Readme

@validators-dao/solana-stream-sdk

Solana Stream SDK by Validators DAO - A TypeScript SDK for streaming Solana blockchain data.

What's New in v1.1.0

  • Refreshed starter layout and docs to highlight trading hooks
  • Yellowstone Geyser gRPC connection upgraded to an NAPI-RS-powered client for better backpressure
  • NAPI-powered Shreds client/decoder so TypeScript can tap near-native throughput
  • Improved backpressure handling and up to 4x streaming efficiency (400% improvement)
  • Faster real-time Geyser streams for TypeScript clients with lower overhead

Production-Ready Geyser Client (TypeScript Best Practices)

  • Ping/Pong handling to keep Yellowstone gRPC streams alive
  • Exponential reconnect backoff plus fromSlot gap recovery
  • Bounded in-memory queue with drop logging for backpressure safety
  • Update subscriptions by writing a new request to the stream (no reconnect)
  • Optional runtime metrics logging (rates, queue size, drops)
  • Default filters drop vote/failed transactions to reduce traffic

Tip: start with slots, then add filters as needed. When resuming from fromSlot, duplicates are expected.

Performance Highlights

  • NAPI-powered Geyser gRPC and Shreds client/decoder for high-throughput streaming
  • TypeScript ergonomics with native performance under the hood

Installation

npm install @validators-dao/solana-stream-sdk

Or with pnpm:

pnpm add @validators-dao/solana-stream-sdk

Usage

Geyser Client (TypeScript)

For a production-ready runner (reconnects, backpressure handling, metrics), see https://github.com/ValidatorsDAO/solana-stream/tree/main/client/geyser-ts.

Minimal SDK usage (filters defined in code):

import {
  CommitmentLevel,
  SubscribeRequestFilterTransactions,
  GeyserClient,
  bs58,
} from '@validators-dao/solana-stream-sdk'
import 'dotenv/config'

const PUMP_FUN_PROGRAM_ID = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'

const pumpfun: SubscribeRequestFilterTransactions = {
  vote: false,
  failed: false,
  accountInclude: [PUMP_FUN_PROGRAM_ID],
  accountExclude: [],
  accountRequired: [],
}

const request = {
  accounts: {},
  slots: {},
  transactions: { pumpfun },
  transactionsStatus: {},
  blocks: {},
  blocksMeta: {},
  entry: {},
  accountsDataSlice: [],
  commitment: CommitmentLevel.PROCESSED,
}

const main = async () => {
  const endpoint = process.env.GEYSER_ENDPOINT || 'http://localhost:10000'
  const token = process.env.X_TOKEN?.trim()
  const client = new GeyserClient(endpoint, token || undefined, undefined)

  await client.connect()
  const stream = await client.subscribe()

  stream.on('data', (data: any) => {
    if (data?.ping != undefined) {
      stream.write({ ping: { id: 1 } }, () => undefined)
      return
    }
    if (data?.pong != undefined) {
      return
    }
    if (data?.transaction != undefined) {
      const signature = data.transaction.transaction.signature
      const txSignature = bs58.encode(new Uint8Array(signature))

      // TODO: Add your trade logic here.
      console.log('tx:', txSignature)
    }
  })

  await new Promise<void>((resolve, reject) => {
    stream.write(request, (err: any) => {
      if (!err) {
        resolve()
      } else {
        console.error('Request error:', err)
        reject(err)
      }
    })
  })
}

void main()

If your endpoint requires authentication, set the X_TOKEN environment variable with your gRPC token. Please note that the endpoint in the example is for demonstration purposes. Replace it with your actual endpoint.

Shreds Client

For a working starter that includes latency checks, see https://github.com/ValidatorsDAO/solana-stream/tree/main/client/shreds-ts.

Here's a minimal example:

import {
  ShredsClient,
  ShredsClientCommitmentLevel,
  // decodeSolanaEntries,
} from '@validators-dao/solana-stream-sdk'
import 'dotenv/config'

const endpoint = process.env.SHREDS_ENDPOINT!

const client = new ShredsClient(endpoint)

// The filter is experimental
const request = {
  accounts: {},
  transactions: {},
  slots: {},
  commitment: ShredsClientCommitmentLevel.Processed,
}

const connect = () => {
  console.log('Connecting to:', endpoint)

  client.subscribeEntries(
    JSON.stringify(request),
    (_error: any, buffer: any) => {
      if (!buffer) {
        return
      }
      const { slot } = JSON.parse(buffer)

      // You can decode entries as needed
      // const decodedEntries = decodeSolanaEntries(new Uint8Array(entries))

      console.log('slot:', slot)
    },
  )
}

connect()

Ensure the environment variable SHREDS_ENDPOINT is set correctly.

Features

  • Geyser Client: Direct access to the Yellowstone gRPC client for real-time Solana data streaming
  • Shredstream Client: Real-time entry streaming and decoding from Solana Shreds
  • TypeScript Types: Comprehensive TypeScript types for all filter and subscription interfaces
  • Utilities: Includes bs58 for Solana address and data encoding/decoding, gRPC utilities, and entry decoding functions
  • Full Type Safety: Complete TypeScript support with detailed type definitions

Exported Types and Utilities

Geyser Client Types

  • GeyserClient: Main client for connecting to Yellowstone gRPC streams.
  • CommitmentLevel: Solana commitment levels (e.g., processed, confirmed, finalized).
  • SubscribeRequestFilterAccounts: Filters for account subscriptions.
  • SubscribeRequestFilterTransactions: Filters for transaction subscriptions.
  • SubscribeRequestFilterBlocks: Filters for block subscriptions.
  • SubscribeRequestFilterBlocksMeta: Filters for block metadata subscriptions.
  • SubscribeRequestFilterSlots: Filters for slot subscriptions.
  • SubscribeRequestFilterEntry: Filters for entry subscriptions.
  • SubscribeRequestAccountsDataSlice: Data slice configuration for account subscriptions.
  • bs58: Base58 encoding/decoding utilities for Solana addresses and data.

Shredstream Client

  • ShredsClient: Client for streaming Solana shreds through shreds endpoints.
  • ShredsClientCommitmentLevel: Solana commitment levels (e.g., processed, confirmed, finalized).

Utility Exports

  • decodeSolanaEntries: Function to decode raw Solana shred entry data into structured, human-readable formats.

Dependencies

  • Yellowstone gRPC client: For gRPC streaming capabilities
  • bs58: For base58 encoding/decoding
  • @validators-dao/solana-entry-decoder: Utility for decoding Solana shred entries.
  • @validators-dao/solana-shreds-client: Solana Shreds Client for Scale. (NAPI-RS)

⚠️ Experimental Filtering Feature Notice

The filtering functionality provided by this SDK is currently experimental. Occasionally, data may not be fully available, and filters may not be applied correctly.

If you encounter such cases, please report them by opening an issue at: https://github.com/ValidatorsDAO/solana-stream/issues

Your feedback greatly assists our debugging efforts and overall improvement of this feature.

Other reports and suggestions are also highly appreciated.

You can also join discussions or share feedback on Validators DAO's Discord community: https://discord.gg/C7ZQSrCkYR

Repository

This package is part of the Solana Stream monorepo.

Support

For issues and support, please visit our Discord.

License

The package is available as open source under the terms of the Apache-2.0 License.

Code of Conduct

Everyone interacting in the Validators DAO project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.