crypto-prices-lib

Crates.iocrypto-prices-lib
lib.rscrypto-prices-lib
version0.5.0
sourcesrc
created_at2022-06-25 05:20:49.942035
updated_at2024-04-30 16:54:08.515411
descriptionA SDK for getting prices of cryptocurrencies against another.
homepage
repositoryhttps://github.com/zackbalbin/crypto-prices-lib
max_upload_size
id612822
size40,579
Zack Balbin (zackbalbin)

documentation

https://docs.rs/crypto-prices-lib

README

Crypto Prices Lib

Docs

Crate pubshlied here Docs are available here

Example

A example for getting the price of Ergo against Bitcoin

use anyhow::Result;
use crypto_prices_lib::{get_marketcap, get_price};

#[tokio::main]
async fn main() -> Result<()> {
    let price = get_price("ergo", "usd").await.unwrap();
    println!("{:?}", price);

    let marketcap = get_marketcap("ergo", "usd").await.unwrap();
    println!("{:?}", marketcap);

    Ok(())
}

The result

1.29
96616969.50238612
Commit count: 11

cargo fmt