Crate selene_helius_sdk
source ·Expand description
§Overview
selene_helius_sdk
is an async library for the Helius SDK
use color_eyre::Result;
use selene_helius_sdk::api::das::GetAssetsByOwnerParams;
use selene_helius_sdk::HeliusBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let api_key = std::env::var("HELIUS_API_KEY").expect("env HELIUS_API_KEY is not defined!");
let helius = HeliusBuilder::new(&api_key).build()?;
let result = helius
.get_assets_by_owner(&GetAssetsByOwnerParams {
owner_address: "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY".to_string(),
..Default::default()
})
.await?;
println!("total: {}", result.total);
for asset in result.items {
println!("{}", asset.id);
}
Ok(())
}
Note the package needs to be configured with your account’s API key, which is available in the Helius Dashboard.
See HeliusBuilder
for other option such as timeouts and providing your own http client
Re-exports§
pub use api::Helius;
pub use api::HeliusBuilder;