Crates.io | coinchecker |
lib.rs | coinchecker |
version | 0.1.2 |
source | src |
created_at | 2021-07-16 14:43:03.15752 |
updated_at | 2021-10-05 14:14:28.018188 |
description | Client library for the Coincheck API |
homepage | |
repository | https://github.com/ugai/coinchecker |
max_upload_size | |
id | 423666 |
size | 49,739 |
An unofficial Rust Library for the Coincheck REST API.
Use at your own risk. (自己責任で使ってください)
Some APIs not implemented
Some APIs not well tested
If you use the private API, set the access key in the environment variable. You can use the .env file.
# .env
COINCHECK_ACCESS_KEY=hogehoge
COINCHECK_SECRET_KEY=fugafuga
Use like this.
use anyhow::Result;
use coinchecker::Coincheck;
use coinchecker::types::CoinPair;
use coinchecker::utils::quick_debug;
#[tokio::main]
async fn main() -> Result<()> {
// Private and Public API
let mut coincheck = Coincheck::new_with_env_keys();
quick_debug(coincheck.public.trades(&CoinPair::BtcJpy)).await;
quick_debug(coincheck.private.account.balance()).await;
// Public API only
let mut coincheck = Coincheck::new_without_keys();
quick_debug(coincheck.public.ticker()).await;
Ok(())
}
MIT License