Skip to main content
The Helius Rust SDK (helius) makes developing on Solana easier from Rust. This page covers installing and using the SDK, handling common errors, and where to find the latest documentation.

GitHub Repository

Official Helius Rust SDK for Solana development

Installation

1

Add dependency to Cargo.toml

To start using the Helius Rust SDK in your project, add it as a dependency via cargo. Open your project’s Cargo.toml and add the following line under [dependencies]:
where 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 docs 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). For example, below is a 401 thrown for an incorrect getAsset call:

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:
This occurs when a request has invalid parameters.
This occurs when an invalid API key is provided or access is restricted due to RPC rules.
This indicates that the user has exceeded the request limit in a given timeframe or is out of credits.
This is a generic error message for server-side issues. Please contact Helius support for assistance.
If you encounter any of these errors:
1

Check error documentation

Refer to errors.rs for a list of all possible errors returned by the Helius client
2

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

Contributing

We welcome all contributions to our SDKs! Read the contributions guide before opening up a pull request.