Skip to main content

Crate cryptologo

Crate cryptologo 

Source
Expand description

Rust client for crypto-logo.com — the cryptocurrency logo database with 413 coins in SVG, PNG, WebP, JPEG, and ICO formats.

§Quick Start

use cryptologo::{CryptoLogo, LogoFormat};

#[tokio::main]
async fn main() -> Result<(), cryptologo::Error> {
    let client = CryptoLogo::new();

    // List all coins
    let coins = client.list_coins().await?;
    for coin in coins.iter().take(3) {
        println!("{} ({}) — rank #{:?}", coin.name, coin.ticker, coin.market_cap_rank);
    }

    // Download Bitcoin SVG
    let svg = client.get_logo("bitcoin-btc", LogoFormat::Svg, None).await?;
    std::fs::write("bitcoin.svg", &svg)?;

    Ok(())
}

Structs§

Coin
A cryptocurrency coin with logo availability metadata.
CryptoLogo
Client for the crypto-logo.com API.
CryptoLogoBuilder
Builder for configuring a CryptoLogo client.
LogoOptions
Options for logo requests.

Enums§

Error
Errors from the CryptoLogo client.
LogoFormat
Supported image formats for logo serving.

Constants§

ALLOWED_SIZES
Standard pre-generated square sizes in pixels.
ICO_SIZES
Valid ICO format sizes.