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

helius-sdk

v2.1.0

Published

A Helius Node.js SDK for building the future of Solana

Readme

Helius Node.js SDK

Version Downloads

The Helius Node.js SDK provides access to Helius-related methods and APIs using TypeScript, making building on Solana as easy as possible.

Documentation

API reference documentation is available at helius.dev/docs.

Contributions

Interested in contributing? Read the following contributions guide before opening a PR.

Installation

Using pnpm (recommended):

pnpm add helius-sdk

Using npm:

npm install helius-sdk

Using yarn:

yarn add helius-sdk

Usage

The package needs to be configured with your account's API key, which is available in the Helius Dashboard.

import { createHelius } from "helius-sdk";

(async () => {
  const apiKey = ""; // From Helius dashboard
  const helius = createHelius({ apiKey });

  try {
    const assets = await helius.getAssetsByOwner({
      ownerAddress: "owner_address_goes_here",
      page: 1,
      limit: 50,
      sortBy: { sortBy: "created", sortDirection: "asc" },
    });

    console.log("Fetched assets:", assets);
  } catch (error) {
    console.error("Error:", error);
  }
})();

Migrating to helius-sdk 2.0.0

The Helius Node.js SDK has been rewritten from the ground up in version 2.0.0 to use @solana/kit (i.e., Kit) under the hood, replacing the dependency on @solana/web3.js versions higher than 1.73.2.

We've gone to great lengths to ensure that the developer experience remains largely the same, with minimal impact on existing code. The API methods and namespaces are designed to be intuitive and an improvement on previous versions, so migrating to the latest version is relatively straightforward. There are a plethora of examples found in the examples directory, organized by namespace, to aid in this migration.

For more detailed migration help, refer to the following migration guide

For general help with Kit, please refer to Kit's new documentation site

Handling errors

When the API returns a non-success status code (4xx or 5xx response), an error message will be thrown:

try {
  const assets = await helius.getAssetsByOwner({
    ownerAddress: "owner_address_goes_here",
    page: 1,
    limit: 50,
    sortBy: { sortBy: "created", sortDirection: "asc" },
  });

  console.log("Fetched assets:", assets);
} catch (error) {
  console.error("Error:", error);
}

Common Error Codes

When working with the Helius SDK, you may encounter several error codes. Below is a table detailing some of the common error codes along with additional information to help you troubleshoot:

| Error Code | Error Message | More Information | | ---------- | --------------------- | ------------------------------------------------------------------------------------------------------ | | 401 | Unauthorized | This occurs when an invalid API key is provided or access is restricted due to RPC rules. | | 429 | Too Many Requests | This indicates that the user has exceeded the request limit in a given timeframe or is out of credits. | | 5XX | Internal Server Error | This is a generic error message for server-side issues. Please contact Helius support for assistance. |

If you encounter any of these errors, refer to the Helius documentation for further guidance, or reach out to the Helius support team for more detailed assistance.

Using the Helius SDK

Our SDK is designed to give you a seamless experience when building on Solana. We've separated the core functionality into various segments. Examples for individual methods can be found in the examples directory, with examples organized by namespace.

DAS API

Comprehensive and performant API for tokens, NFTs, and compressed NFTs on Solana. Available on the helius namespace.

  • getAsset(): Get an asset by its ID.
  • getAssetBatch(): Get multiple assets by their IDs (up to 1k).
  • getAssetProof(): Get a Merkle proof for a compressed asset by its ID.
  • getAssetProofBatch(): Get Merkle proofs for a set of compressed assets by their IDs.
  • getAssetsByAuthority(): Get a list of assets with a specific authority.
  • getAssetsByCreator(): Get a list of assets created by an address.
  • getAssetsByGroup(): Get a list of assets by a group key and value. This endpoint is very useful for getting the mint list for NFT Collections.
  • getAssetsByOwner(): Get a list of assets owned by an address. This is the fastest way to get all the NFTs and fungible tokens that are owned by a wallet on Solana.
  • getNftEditions(): Get information about all the edition NFTs for a specific master NFT.
  • getTokenAccounts(): Get information about all token accounts for a specific mint or a specific owner.
  • searchAssets(): Search for assets by a variety of parameters. This is very useful for token-gating.

RPC V2 Methods

Enhanced RPC methods, available only with Helius.

  • getProgramAccountsV2(): Enhanced version of getProgramAccounts with cursor-based pagination and changedSinceSlot support for efficiently querying large sets of accounts owned by specific Solana programs with incremental updates.
  • getAllProgramAccounts(): Auto-paginates through all program accounts. Use with caution on larger programs.
  • getTokenAccountsByOwnerV2(): An enhanced version of getTokenAccountsByOwner with cursor-based pagination and changedSinceSlot support to incrementally retrieve SPL token accounts owned by a given mint.
  • getAllTokenAccountsByOwner(): Auto-paginates all token accounts for a given owner.
  • getTransactionsForAddress(): Get transaction history for an address with advanced filtering by slot, time, and bidirectional sorting options. Supports both signature-only and full transaction details. Optionally include transactions from associated token accounts.

Staking

The easiest way to stake with Helius programmatically. Available on the helius.staking namespace.

  • createStakeTransaction(): Generate a transaction to create + delegate a new stake account to the Helius validator.
  • createUnstakeTransaction(): Generate a transaction to deactivate a stake account.
  • createWithdrawTransaction(): Generate a transaction to withdraw lamports from a stake account (after cooldown).
  • getStakeInstructions(): Return only the instructions for creating and delegating a stake account.
  • getUnstakeInstruction(): Return the instruction to deactivate a stake account.
  • getWithdrawInstruction(): Return the instruction to withdraw lamports from a stake account.
  • getWithdrawableAmount(): Determine how many lamports are withdrawable (with optional rent-exempt inclusion).
  • getHeliusStakeAccounts(): Return all stake accounts delegated to the Helius validator for a given wallet.

Transactions

Simply create, send, and land transactions as fast as possible. Available on the helius.tx namespace.

  • getComputeUnits(): Fetches the total compute units the transaction provided is expected to consume
  • broadcastTransaction(): Broadcasts a fully signed transaction (object or serialized) and polls for its confirmation.
  • pollTransactionConfirmation(): Polls a transaction to check whether it has been confirmed
  • createSmartTransaction(): Creates a smart transaction with the provided configuration
  • sendSmartTransaction(): Builds and sends an optimized transaction
  • sendTransaction(): Wrapper for sendTransaction RPC call that includes support for a validatorAcls parameter (i.e., JSON-based allow and deny lists).
  • sendTransactionWithSender(): Ultra-low latency Solana transaction submission with dual routing to validators and Jito infra via Helius Sender.

Priority Fee API

Estimate optimal priority fees for Solana transactions. Available on the helius namespace.

Enhanced Transactions API

Transform complex Solana transactions into human-readable data. Available on the helius.enhanced namespace.

  • getTransactions(): Converts raw Solana transactions into enhanced, human-readable formats with decoded instruction data and contextual information.
  • getTransactionsByAddress(): Retrieves a comprehensive transaction history for a given address with human-readable decoded data.

Webhooks

Provides methods for setting up, editing, and managing webhooks, crucial for listening to on-chain Solana events (e.g., sales, listings, swaps) and triggering actions when these events happen. Available on the helius.webhooks namespace.

WebSockets

Stream real-time data with WebSockets using Kit's subscription methods. Available on the helius.ws namespace.

  • logsNotifications(): Streams transaction logs for all transactions, all transactions including votes, or transactions that mention a specific set of addresses.
  • slotNotifications(): Streams notifications any time a slot is processed by a validator.
  • signatureNotifications(): Streams notifications when a transaction with the provided signature reaches the specified commitment level.
  • programNotifications(): Streams notifications when the lamports or data for an account owned by the specified program changes.
  • accountNotifications(): Streams notifications when the lamports or data for the specified account changes.
  • close(): Closes an open WebSocket connection via Kit's dispose method, falling back to .close().

ZK Compression

Estimate optimal priority fees for Solana transactions. Available on the helius.zk namespace.