Rust wrapper for Luno API.
Please visit the Settings page to generate an API key.
Put this in your Cargo.toml
:
toml
[dependencies]
luno-rs = "0.1"
A full working example of this library in action.
```rust use luno_rs::LunoClient; use std::env;
async fn main() { let keyid = env::var("LUNOKEYID").unwrap(); let keysecret = env::var("LUNOKEYSECRET").unwrap();
let client = LunoClient::new(key_id, key_secret).unwrap();
let balances = client.get_balances().await.unwrap();
for balance in balances {
println!("{} -> Balance: {}, Reserved: {}", balance.asset, balance.balance, balance.reserved);
}
} ```
We recommend using environment variables rather than including your credentials in plaintext. Run the following in Bash to export Key ID and Secret:
bash
export LUNO_KEY_ID="<id>"
export LUNO_KEY_SECRET="<secret>"
Remember to substitute <id>
and <secret>
with your own Key Id and Secret.