solana_kit_helius 0.5.0
solana_kit_helius: ^0.5.0 copied to clipboard
Helius client package for Solana Kit Dart.
solana_kit_helius #
Helius client package for Solana Kit Dart. A Dart port of the Helius TypeScript SDK, providing DAS API, enhanced transactions, webhooks, smart transactions, ZK compression, staking, wallet API, WebSocket subscriptions, and auth.
Features #
- DAS API - Digital Asset Standard methods for querying assets, proofs, and metadata
- Enhanced Transactions - Parsed transaction history with human-readable types
- Webhooks - Create, manage, and delete webhook subscriptions
- Smart Transactions - Optimized transaction building with compute unit estimation and priority fees
- ZK Compression - Compressed account and token operations via Light Protocol
- Staking - Create stake, unstake, and withdraw transactions via Helius validators
- Wallet API - Identity resolution, balances, history, and transfers
- WebSockets - Real-time subscription support
- Auth - Project and API key management
- Priority Fees - Estimate priority fees for transactions
- RPC V2 - Enhanced RPC methods with pagination
Upstream compatibility #
This package was audited against helius-labs/helius-sdk v3.0.0 at commit 4c0c55b86eab0e3abde7896c0aa23c4b6515e9b0 (chore(release): Update CHANGELOG (#330), 2026-05-30). Helius has not published a Git tag for that release, so this commit is the comparison baseline.
The package covers the broad v3 surface: DAS, priority fees, RPC v2 including getTransfersByAddress, enhanced transactions, webhook CRUD/toggle, ZK compression, staking, wallet operations, Sender, the v3 JWT-based signup/checkout/payment flow, Admin project usage, and WebSocket subscriptions. The mainnet REST default follows v3's https://api-mainnet.helius-rpc.com/v0 host, while devnet enhanced REST continues to use https://api-devnet.helius.xyz/v0.
The legacy smart-transaction façade does not yet implement the v3 transaction-building contract: createSmartTransaction only fetches a blockhash and sendSmartTransaction does not compile or sign instructions. Do not use those two helpers to authorize value transfers. Prefer Solana Kit's transaction-message, signer, and Sender APIs until that surface is replaced. Remaining v3 gaps also include smart-transaction tip helpers and enhanced WebSocket account/transaction subscriptions.
Installation #
Install the package directly:
dependencies:
"solana_kit_helius": ^0.5.0
If your app uses several Solana Kit packages together, you can also depend on the umbrella package instead:
dart pub add solana_kit
Inside this monorepo, Dart workspace resolution uses the local package automatically.
Documentation #
- Package page: https://pub.dev/packages/solana_kit_helius
- API reference: https://pub.dev/documentation/solana_kit_helius/latest/
- Workspace docs: https://openbudgetfun.github.io/solana_kit/
- Package catalog entry: https://openbudgetfun.github.io/solana_kit/reference/package-catalog#solana_kit_helius
- Source code: https://github.com/openbudgetfun/solana_kit/tree/main/packages/solana_kit_helius
For architecture notes, getting-started guides, and cross-package examples, start with the workspace docs site and then drill down into the package README and API reference.
Usage #
import 'package:solana_kit_helius/solana_kit_helius.dart';
final helius = createHelius(
HeliusConfig(apiKey: 'your-api-key'),
);
// DAS API
final asset = await helius.das.getAsset(
GetAssetRequest(id: 'asset-id'),
);
// Priority fees
final fees = await helius.priorityFee.getPriorityFeeEstimate(
GetPriorityFeeEstimateRequest(
accountKeys: ['account-key'],
),
);
// Enhanced transactions
final txns = await helius.enhanced.getTransactions(
GetTransactionsRequest(transactions: ['tx-sig']),
);
Authenticated signup #
signup uses the developer API's wallet-signup response as a bearer JWT, then uses that JWT for project and checkout calls. Project API keys are only returned after subscription provisioning and are never reused as bearer tokens.
final result = await helius.auth.signup(
SignupRequest.secretKey(
secretKey: base64EncodedSolanaCliKeypair,
plan: 'developer',
email: 'ada@example.com',
firstName: 'Ada',
lastName: 'Lovelace',
),
);
Only pay PaymentLink values received from a trusted Helius developer API. The payment helper rejects non-positive amounts, mismatched memo/intent IDs, and non-payment link kinds before constructing a transfer.
Configuration #
// Mainnet (default)
final helius = createHelius(
HeliusConfig(apiKey: 'your-api-key'),
);
// Devnet
final helius = createHelius(
HeliusConfig(
apiKey: 'your-api-key',
cluster: HeliusCluster.devnet,
),
);
// Custom HTTP client (useful for testing)
import 'package:http/http.dart' as http;
final helius = createHelius(
HeliusConfig(apiKey: 'your-api-key'),
client: http.Client(),
);
WebSocket security defaults #
HeliusWebSocket enforces wss:// URLs and rejects localhost plus non-public IP literals by default. Use allowInsecureWs: true and allowPrivateHosts: true only for local development and controlled tests. The private-host check does not resolve DNS names, so do not accept arbitrary WebSocket URLs from untrusted input.
Testing strategy #
The Helius package keeps DTO smoke coverage, but long-term confidence should come from higher-level contracts:
- shared REST and JSON-RPC client contract tests cover request shaping, headers, query merging, and error mapping
- endpoint tests focus on user-facing request/response behavior
- websocket session tests cover subscribe, notification routing, unsubscribe, and close boundaries across concurrent subscriptions
When adding a new Helius surface, prefer extending one of these boundaries before adding large amounts of DTO-only roundtrip coverage.
Example #
Use example/main.dart as a runnable starting point for solana_kit_helius.
- Import path:
package:solana_kit_helius/solana_kit_helius.dart - This section is centrally maintained with
mdtto keep package guidance aligned. - After updating shared docs templates, run
docs:updatefrom the repo root.
Maintenance #
- Validate docs in CI and locally with
docs:check. - Keep examples focused on one workflow and reference package README sections for deeper API details.