Crates.io | luno-client |
lib.rs | luno-client |
version | 0.1.0 |
source | src |
created_at | 2022-08-14 20:45:09.187332 |
updated_at | 2022-08-14 20:45:09.187332 |
description | Luno Api client(wrapper) written in rust |
homepage | |
repository | https://github.com/borngraced/Luno-API-Client-Rust |
max_upload_size | |
id | 645572 |
size | 18,922 |
https://www.luno.com/en/developers/api
Some API calls require your application to authenticate itself. This is done using an API key associated with your account. You can create an API key by visiting the API Keys section on the settings page.
An API key consists of a key id and a key secret. For example, cnz2yjswbv3jd (key id) and 0hydMZDb9HRR3Qq-iqALwZtXLkbLR4fWxtDZvkB9h4I (key secret).
API requests are authenticated using HTTP basic authentication with the key id as the username and the key secret as the password. A missing, incorrect or revoked key causes error 401 to be returned.
Each API key is granted a set of permissions when it is created. The key can only be used to call the permitted API functions.
use luno_rust_api::Luno;
#[tokio::test] // any other async runtime can be used, not limited to tokio
async fn test_luno_async() {
dotenv::dotenv().ok();
let key = env::var("API_KEY").expect("Api Key doesn't exist yet, please add");
let secret = env::var("API_SECRET").expect("Api Key Secret doesn't exist yet, please add");
let luno = Luno::init(key, secret).await;
let tickers = luno.get_all_balance().await;
println!("{:#?}", json!(tickers.as_ref().unwrap())); // data can be serialized to json)
assert_eq!(true, tickers.is_ok());
}
"XBTNGN"
)"XBTNGN"
)"XBTNGN"
)make us better :)