8 releases (5 stable)

1.0.5 Nov 20, 2024
1.0.3 Oct 4, 2024
1.0.1 Jan 1, 2024
1.0.0 Dec 18, 2023
0.1.1 Oct 29, 2021

#4 in #cardano

Download history 8/week @ 2024-12-16 3/week @ 2024-12-30 5/week @ 2025-01-06 16/week @ 2025-01-13 47/week @ 2025-01-20 11/week @ 2025-01-27 70/week @ 2025-02-03 14/week @ 2025-02-10 51/week @ 2025-02-17 109/week @ 2025-02-24 84/week @ 2025-03-03 53/week @ 2025-03-10 94/week @ 2025-03-17 37/week @ 2025-03-24 65/week @ 2025-03-31

251 downloads per month

Apache-2.0

120KB
3K 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.5"

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

~10–26MB
~402K SLoC