braiinspool

Crates.iobraiinspool
lib.rsbraiinspool
version0.1.1
sourcesrc
created_at2022-11-15 08:49:48.513121
updated_at2022-11-15 10:02:54.936135
descriptionBraiins Pool API SDK
homepagehttps://github.com/yukibtc/braiinspool-rs-sdk
repositoryhttps://github.com/yukibtc/braiinspool-rs-sdk.git
max_upload_size
id715542
size43,350
Yuki Kishimoto (yukibtc)

documentation

README

Braiins Pool API SDK

Description

Braiins client library to check miners status from Rust.

Example

braiinspool = "0.1"
tokio = { version = "1", features = ["full"] }
use braiinspool::model::{DailyRewards, PoolStats, UserProfile, Workers};
use braiinspool::{Client, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    // Init client
    let client = Client::new("apikey", Some("socks5h://127.0.0.1:9050"))?;

    // Check tor connection
    println!("{}", client.check_tor_connection().await?);

    // Get pool stats
    let pool_stats: PoolStats = client.pool_stats().await?;
    println!("{:#?}", pool_stats);

    // Get user profile
    let user_profile: UserProfile = client.user_profile().await?;
    println!("{:#?}", user_profile);

    // Get daily rewards
    let daily_rewards: DailyRewards = client.daily_rewards().await?;
    println!("{:#?}", daily_rewards);

    // Get workers
    let workers: Workers = client.workers().await?;
    println!("{:#?}", workers);

    Ok(())
}

License

This project is distributed under the MIT software license - see the LICENSE file for details

Commit count: 11

cargo fmt