- Package:
helius-sdk(npm / pnpm / yarn) - Version: 2.x (uses
@solana/kit, not@solana/web3.js) - Runtime: Any JavaScript runtime — browsers, Deno, Bun, edge runtimes (Cloudflare Workers, Vercel Edge), Node.js 20+
- TypeScript: 5.8+ (full type definitions included)
- License: ISC
Installation
Quick Start
Client Options
Namespaces
All methods are accessed through thehelius client. DAS API methods and standard Solana RPC methods are available directly on helius.*. Other functionality is organized into namespaces:
| Namespace | Access | Purpose |
|---|---|---|
| DAS API | helius.getAsset(), helius.getAssetsByOwner(), etc. | Query NFTs, tokens, compressed assets |
| RPC V2 | helius.getTransactionsForAddress(), helius.getProgramAccountsV2() | Enhanced RPC with pagination and filters |
| Transactions | helius.tx.* | Smart transactions and Helius Sender |
| Enhanced | helius.enhanced.* | Parse transactions into human-readable format |
| Webhooks | helius.webhooks.* | Create and manage webhook subscriptions |
| WebSockets | helius.ws.* | Real-time blockchain data streams |
| Staking | helius.stake.* | Stake SOL to Helius validator |
| ZK Compression | helius.zk.* | Compressed accounts and proofs |
| Wallet API | helius.wallet.* | Balances, history, identity lookups |
| Standard RPC | helius.getBalance(), helius.getSlot(), etc. | All standard Solana RPC methods via proxy |
| Raw RPC | helius.raw | Direct access to the underlying @solana/kit Rpc client |
| Auth | import { makeAuthClient } from "helius-sdk/auth/client" | Agent signup and API key management (standalone import) |
Recommendations for Agents
Use getTransactionsForAddress instead of two-step lookup
getTransactionsForAddress combines signature lookup and transaction fetching into a single call with server-side filtering. It supports time/slot ranges, token account filtering, and pagination.
Use sendSmartTransaction for standard sends
It automatically simulates, estimates compute units, fetches priority fees, and confirms. Do not manually build ComputeBudget instructions — the SDK adds them automatically.
Use Helius Sender for ultra-low latency
For time-sensitive transactions (arbitrage, sniping, liquidations), usesendTransactionWithSender. It routes through Helius’s multi-region infrastructure and Jito.
Use getAssetBatch for multiple assets
When fetching more than one asset, batch them. Do not call getAsset in a loop.
Use webhooks or WebSockets instead of polling
Do not pollgetTransactionsForAddress in a loop. Use webhooks for server-to-server notifications or WebSockets for real-time client-side streaming.
Pagination
The SDK uses different pagination strategies depending on the method.Token/Cursor-Based (RPC V2 Methods)
Page-Based (DAS API)
tokenAccounts Filter
When querying getTransactionsForAddress, the tokenAccounts filter controls whether token account activity is included:
| Value | Behavior | Use When |
|---|---|---|
omitted / "none" | Only transactions directly involving the address | You only care about SOL transfers and program calls |
"balanceChanged" | Also includes token transactions that changed a balance | Recommended for most agents — shows token sends/receives without noise |
"all" | Includes all token account transactions | You need complete token activity (can return many results) |
changedSinceSlot — Incremental Account Fetching
changedSinceSlot returns only accounts modified after a given slot. Useful for syncing or indexing workflows. Supported by getProgramAccountsV2, getTokenAccountsByOwnerV2, getAccountInfo, getMultipleAccounts, getProgramAccounts, and getTokenAccountsByOwner.
Common Mistakes
-
transactionDetails: "full"is not the default — By default,getTransactionsForAddressreturns signatures only. SettransactionDetails: "full"to get full transaction data. -
Do not add ComputeBudget instructions with
sendSmartTransaction— The SDK adds them automatically. Adding your own causes duplicate instructions and transaction failure. -
Priority fees are in microlamports per compute unit — Not lamports. Values from
getPriorityFeeEstimateare already in the correct unit forSetComputeUnitPrice. -
DAS pagination is 1-indexed —
page: 1is the first page, notpage: 0. -
blockTimeis Unix seconds, not milliseconds — UseMath.floor(Date.now() / 1000)when filtering byblockTime. -
getAssethides fungible tokens by default — Passoptions: { showFungible: true }to include them. -
WebSocket streams need cleanup — Always use an AbortController signal and call
helius.ws.close()when done to avoid connection leaks.
Error Handling and Retries
The SDK throws nativeError objects with the HTTP status code embedded in the message string (e.g., "API error (429): ..."). There is no .status property on the error object, so status detection requires message parsing.
| Status | Meaning | Action |
|---|---|---|
| 401 | Invalid or missing API key | Check API key |
| 429 | Rate limited or out of credits | Back off and retry |
| 5xx | Server error | Retry with exponential backoff |
Programmatic Signup (Auth Module)
The auth module is a standalone import — it is not on the mainHeliusClient. Use it for programmatic agent signup flows.
API Quick Reference
Here is a full list of all API methods supported by the Helius TypeScript SDK:DAS API (Digital Asset Standard)
RPC V2 Methods
Transactions
Enhanced Transactions
Webhooks
WebSockets
Staking
Wallet API
ZK Compression
Standard Solana RPC
All standard Solana RPC methods are available directly onhelius.* via a proxy to the underlying @solana/kit Rpc client:
helius.raw property exposes the same Rpc client explicitly, useful when passing to third-party libraries that expect a standard Rpc object.