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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@validators-dao/solana-entry-decoder

v2.3.0

Published

Decoding Solana Shreds Entry Data

Downloads

1,005

Readme

@validators-dao/solana-entry-decoder

A TypeScript utility provided by Validators DAO for decoding Solana shred entry data.

This package is designed to decode Solana entries from shreds, making it easier to work with real-time data streams from the Solana blockchain.

Why Rust?

TypeScript alone cannot decode Solana shreds effectively. Therefore, Rust is utilized for efficient decoding, converting the data into JSON format suitable for handling in TypeScript environments.

Leveraging NAPI instead of WASM

This utility leverages NAPI (Node-API) instead of WebAssembly (WASM) to decode Solana shred entry data, providing significant practical advantages.

Node-API - Node.js: https://nodejs.org/api/n-api.html#node-api

Benefits of Using NAPI:

  • Performance: NAPI delivers near-native performance by directly interfacing with Rust code through bindings, minimizing overhead compared to WebAssembly.

  • Seamless Integration: NAPI simplifies the interoperation between Node.js and Rust, enabling straightforward calls and efficient memory management without extensive tooling or additional complexity.

  • Memory Efficiency: Efficient memory handling with NAPI significantly reduces risks associated with memory leaks or unnecessary garbage collection, common pitfalls when using WASM.

  • Enhanced Debugging and Maintainability: Debugging native modules built with NAPI offers clearer stack traces and robust debugging capabilities, overcoming the opaque debugging difficulties often encountered with WASM.

  • Wide Compatibility: Modules built with NAPI are natively compatible across various Node.js versions without requiring extra compilation steps or environment-specific adjustments.

Installation

npm install @validators-dao/solana-entry-decoder

Or using pnpm:

pnpm add @validators-dao/solana-entry-decoder

Usage

Direct Usage (Node.js ES Modules)

To directly import this package, you'll need to use the Node.js require function:

import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const { decodeSolanaEntries } = require('@validators-dao/solana-entry-decoder')

Recommended Usage

For TypeScript projects, it's recommended to import directly from Solana Stream SDK, which exports the decoder in a more convenient way:

pnpm add @validators-dao/solana-stream-sdk
import { decodeSolanaEntries } from '@validators-dao/solana-stream-sdk'

You can find comprehensive usage examples here.

Multi-Platform Build

To build binaries for multiple platforms (cross-compilation), you must first install Rust targets for each desired OS and architecture. Execute the following commands once on your machine to enable cross-platform builds:

rustup target add x86_64-unknown-linux-gnu      # Linux x64
rustup target add aarch64-unknown-linux-gnu     # Linux ARM64
rustup target add aarch64-apple-darwin          # macOS ARM64 (Apple Silicon)
rustup target add x86_64-apple-darwin           # macOS x64 (Intel)

Here's a concise README section in English that clearly states this is for macOS specifically:

Cross-compilation for Linux (macOS)

On macOS, to cross-compile for Linux targets (x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu), you must install the following toolchains:

brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu zig

For Windows Users

For now please use WSL2 and follow the Linux instructions.

Build packages

pnpm i
pnpm build

// or from the root of the monorepo
pnpm -F @validators-dao/solana-entry-decoder build

Repository

This utility is part of the Solana Stream Monorepo.

Support

For support and further questions, please join our Discord server.

License

Apache-2.0 License. Refer to the license document.

Code of Conduct

All contributors must adhere to our Contributor Covenant.