Node.js SDK
Official Helius Node.js SDK for Solana development
Rust SDK
Official Helius Rust SDK for Solana development
Node.js SDK
Note the Node.js SDK has been rewritten as of version 2.0.0. This was done to use@solana/kit
and remove the dependency on @solana/web3.js
versions higher than 1.73.2. For those migrating to the latest version, please refer to our migration guide.
Installation
The Helius Node.js SDK can be installed with any of the following package managers:Quick Start
Below is a straightforward example of how to use the Node.js SDK to fetch a list of assets owned by a given address:Documentation
The examples directory is filled with in-depth code examples covering each method and basic usage, organized by namespace. For API reference documentation, refer to our documentation and the official Solana documentation for general Solana JSON RPC API help. For general help with Kit, please refer to Kit’s documentation.Rust SDK
Installation
1
Add dependency to Cargo.toml
To start using the Helius Rust SDK in your project, add it as a dependency via where
cargo
. Open your project’s Cargo.toml
and add the following line under [dependencies]
:x.y.z
is your desired version.2
Alternative: Use cargo add command
Alternatively, use
cargo add helius
to add the dependency directly via the command line. This will automatically find the latest version compatible with your project and add it to your Cargo.toml
.3
Keep your SDK updated
Remember to run
cargo update
regularly to fetch the latest version of the SDK.Quick Start
Below is a straightforward example of using the Enhanced Transactions API to parse a given transaction:Documentation
Rust Docs
Latest documentation on docs.rs
API Reference
Helius API documentation
Examples
Code examples in the GitHub repo
Error Handling
An error message will be thrown when the API returns a non-success (i.e., 4xx or 5xx status code).
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:400: Bad Request
400: Bad Request
This occurs when a request has invalid parameters.
401: Unauthorized
401: Unauthorized
429: Too Many Requests
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
5XX: Internal Server Error
This is a generic error message for server-side issues. Please contact Helius support for assistance.
1
Check error documentation
Refer to
errors.rs
for a list of all possible errors returned by the Helius
client, if using the Rust SDK. For the Node.js SDK, refer to Kit’s errors2
Review the documentation
Refer to the Helius documentation for further guidance
3
Contact support
Reach out to the Helius support team for more detailed assistance
Contribution to Our SDKs
We welcome all contributions to our SDKs! If you’re interested, here are our GitHub Repositories:Interested in contributing to the Helius Rust SDK specifically? Read the following contributions guide before opening up a pull request!
Unofficial Community SDKs
Our amazing community members have also created their own SDKs to interact with our REST APIs. Please note our team does not officially maintain these.