blockfrost 0.1.0

A Rust SDK for Blockfrost.io API
Documentation
blockfrost-0.1.0 has been yanked.

License

blockfrost-rust

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:

blockfrost = "0.2.0"

Usage

There are multiple other examples in the examples/ folder.

Simple example

use blockfrost::{load, BlockFrostApi};

fn build_api() -> blockfrost::Result<BlockFrostApi> {
    let configurations = load::configurations_from_env()?;
    let project_id = configurations["project_id"].as_str().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(())
}