Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gliderkite/akkorokamui
Kraken REST APIs HTTP client
https://github.com/gliderkite/akkorokamui
client crypto http http-client kraken kraken-exchange-api rust
Last synced: 3 months ago
JSON representation
Kraken REST APIs HTTP client
- Host: GitHub
- URL: https://github.com/gliderkite/akkorokamui
- Owner: gliderkite
- License: mit
- Created: 2020-10-16T16:04:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-10T10:11:14.000Z (over 3 years ago)
- Last Synced: 2024-08-09T08:55:15.940Z (6 months ago)
- Topics: client, crypto, http, http-client, kraken, kraken-exchange-api, rust
- Language: Rust
- Homepage: https://docs.rs/akkorokamui
- Size: 129 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# :octopus: akkorokamui
[![docs.rs](https://docs.rs/akkorokamui/badge.svg)](https://docs.rs/akkorokamui)
[![crates.io](https://img.shields.io/crates/v/akkorokamui.svg)](https://crates.io/crates/akkorokamui)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)[akkorokamui](https://en.wikipedia.org/wiki/Akkorokamui) is a HTTP client
written in Rust that allows to query the
[Kraken REST APIs](https://docs.kraken.com/rest).The main goal of this project is to provide a flexible interface and a safe
implementation.Check out the [crate documentation](https://docs.rs/akkorokamui) to learn how to
use `akkorokamui`.### Example: account balance (async version)
```rust
use akkorokamui::{api, Asset, Client, Credentials, Response};
use anyhow::{bail, Result};
use std::collections::HashMap;type Amount = String;
type Balance<'a> = HashMap, Amount>;#[tokio::main]
async fn main() -> Result<()> {
let keys_path = "kraken.key";
let credentials = Credentials::read(keys_path)?;let user_agent = "/";
let client = Client::with_credentials(user_agent, credentials)?;let api = api::private::balance();
let resp: Response = client.send(api).await?;
println!("{:?}", resp);if let Some(result) = resp.result {
println!("GBP: {:?}", result.get(&Asset::new("ZGBP")));
} else {
bail!("Cannot get balance: {:?}", resp.error);
}Ok(())
}
```