Crates.io link Docs.rs link License

blockfrost-rust


A Rust SDK for Blockfrost.io API.

Getting startedInstallationExamples

Getting started

To use this SDK, you first need login into to blockfrost.io create your project to retrieve your API key.

Installation

Add to your project's Cargo.toml:

toml blockfrost = "0.1.1"

Examples

All the examples are located at the examples/ folder.

You might want to check [all_requests.rs] and [ipfs.rs].

Here is [simple_request.rs] with the basic setup necessary and no settings customization:

```rust use blockfrost::{load, BlockFrostApi};

fn buildapi() -> blockfrost::Result { let configurations = load::configurationsfromenv()?; let projectid = configurations["projectid"].asstr().unwrap(); let api = BlockFrostApi::new(project_id, Default::default()); Ok(api) }

[tokio::main]

async fn main() -> blockfrost::Result<()> { let api = build_api()?; let genesis = api.genesis().await?;

println!("{:#?}", genesis);
Ok(())

} ```