License

blockfrost-rust


A Rust SDK for Blockfrost.io API.

Getting startedInstallationUsage


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.2.0"


Usage

There are multiple other examples in the examples/ folder.

Simple example

```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(())

} ```