5 releases (2 stable)

1.0.1 Jan 1, 2024
1.0.0 Dec 18, 2023
0.2.1 May 2, 2023
0.2.0 Nov 17, 2021
0.1.1 Oct 29, 2021

#645 in Magic Beans

Download history 1/week @ 2024-01-26 1/week @ 2024-02-02 13/week @ 2024-02-16 27/week @ 2024-02-23 38/week @ 2024-03-01 47/week @ 2024-03-08 24/week @ 2024-03-15 3/week @ 2024-03-22 23/week @ 2024-03-29 16/week @ 2024-04-05 5/week @ 2024-04-12 18/week @ 2024-04-19 82/week @ 2024-04-26 17/week @ 2024-05-03

122 downloads per month

Apache-2.0

115KB
2.5K SLoC

Crates.io link Docs.rs link License

blockfrost-rust


A Rust SDK for Blockfrost.io API.

Getting startedInstallationExamplesEndpoints

Getting started

To use this SDK you need to login at blockfrost.io and create a new project to receive an API key.

Installation

Add to your project's Cargo.toml:

blockfrost = "1.0.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:

use blockfrost::{BlockfrostAPI, BlockfrostResult};

fn build_api() -> BlockfrostResult<BlockfrostAPI> {
    let api = BlockfrostAPI::new("mainnetxvMK4xOpp5mHJgihi055KDLU64JJv2be", Default::default());
    Ok(api)
}

#[tokio::main]
async fn main() -> blockfrost::BlockfrostResult<()> {
    let api = build_api()?;
    let genesis = api.genesis().await?;

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

Dependencies

~6–21MB
~281K SLoC