helius-labs /helius-sdk

★ 299⑂ 95👁 8⑃ 318● 81▤ 18◈ 0
TypeScriptMITCreated 2023-01-24
299
stars
95
forks
8
watchers
318
prs
81
issues
18
releases
0
discussions

README

Helius TypeScript SDK


!Downloads

The Helius TypeScript SDK provides access to Helius APIs and enhanced Solana RPC functionality, making building on Solana as easy as possible.

 Agent Account Sign Up

The SDK ships two signup helpers on helius.auth:

- signup(opts) — authenticates the wallet, detects existing projects, and returns either kind: "already_subscribed", kind: "upgrade_required", or kind: "payment_required" with a hosted-checkout link the user opens in a browser.
- signupAndPay(opts) — same as signup, plus auto-pays USDC + memo from the local keypair and polls activation. On poll timeout returns kind: "pending" with the txSignature so callers can resume later.

ts
import { makeAuthClient } from "helius-sdk/auth/client";

const auth = makeAuthClient();
const { secretKey } = await auth.generateKeypair();

const result = await auth.signup({
  secretKey,
  plan: "agent",
  email: "[email protected]",
  firstName: "Jane",
  lastName: "Doe",
});

if (result.kind === "payment_required") {
  console.log("Pay here:", result.paymentLink.paymentUrl);
}


See examples/auth/signup.ts and examples/auth/signupAndPay.ts for full flows.

 For AI Agents: You can create a Helius account and generate an API key programmatically using the helius-cli. See the agent signup guide or helius-cli agent file for complete details.

 Documentation

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

For detailed SDK API docs (auto-generated from source), see the TypeDoc Reference.

See the CHANGELOG for version history and release notes.

LaserStream gRPC streaming is not part of this SDK. Use the standalone helius-laserstream package instead.

 Contributions

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

 Installation

Using pnpm (recommended):

shell
pnpm add helius-sdk


Using npm:

shell
npm install helius-sdk


Using yarn:

shell
yarn add helius-sdk


 Usage

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

ts
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);
  }
})();


 Custom RPC transport (retries, failover)

createHelius accepts a transport hook that lets you augment or replace the default RPC transport, following @solana/kit's custom-transport pattern. The hook receives the SDK's fully configured transport (Helius URL with your API key, SDK headers, and request-id stamping) and returns the transport the client will use for all JSON-RPC calls — standard Solana RPC and DAS/Helius methods alike.

ts
import { createHelius, type RpcTransport } from "h

Top issues

Latest release

v3.4.0 v3.4.0 2026-10-29
What's New in v3.4.0
This release adds server-side history scans to Parsed Events, exposes the unwrapped @solana/kit RPC, and fixes several methods that failed on every call. There are no breaking API changes, but a few behaviours have changed:
- Helius JSON-RPC methods (DAS, ZK Compression, getTransactionsForAddress, getPriorityFeeEstimate, and others) now resolve to null when the server's result is null, instead of returning the { jsonrpc, id, result: null } envelope. JSON-RPC errors are thrown as the new HeliusRpcError with method, code and data. The message format is unchanged 375
- hel

Snapshot: 2026-11-11T15:31:17Z · Data license Apache-2.0 · JSON