helius-labs /helius-sdk

★ 299⑂ 96👁 7⑃ 325● 82▤ 20
TypeScriptMITCreated 2023-01-24
下载:v3.5.0v3.5.0 ↓3.5.02026-11-13
+0
日增长
299
stars
96
forks
7
watchers
325
prs
82
issues
20
releases

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.5.0 v3.5.0 2026-11-13
What's New in v3.5.0

This release adds historical account state, request cancellation and timeouts for Parsed Events, and a disconnect callback for Parsed Streams. Everything is additive: there are no breaking changes, and existing calls behave as before

 Historical account state (beta)

Read any account as it was at a past slot, or right after a specific transaction within that slot. Mainnet only, Business plans and above, from slot 444959999 onward.

ts
// An account right after the transaction at index 10 in slot 445000000
const { value } = await helius.getHistoricalAccountInfo(

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON