Crate luno_rs

Source
Expand description

This library is a Rust wrapper for Luno API

§Authentication

Please visit the Settings page to generate an API key.

§Usage

Put this in your Cargo.toml:

[dependencies]
luno-rs = "0.1"

§Example usage

Using LunoClient

use luno_rs::LunoClient;
use std::env;

#[async_std::main]
async fn main() {
    let key_id = env::var("LUNO_KEY_ID").unwrap();
    let key_secret = env::var("LUNO_KEY_SECRET").unwrap();

    let client = LunoClient::new(key_id, key_secret);
    let balances = client.list_balances().await.unwrap();
    for balance in balances {
        println!("{} -> Balance: {}, Reserved: {}", balance.asset, balance.balance, balance.reserved);
    }
}

Using LunoClientBuilder

use luno_rs::{LunoClientBuilder, CurrencyPair};
use std::env;

#[async_std::main]
async fn main() {
    let key_id = env::var("LUNO_KEY_ID").unwrap();
    let key_secret = env::var("LUNO_KEY_SECRET").unwrap();

    let client = LunoClientBuilder::new(key_id, key_secret)
        .with_timeout(30000)
        .with_request_logger()
        .build();
    let ticker = client.get_ticker(CurrencyPair::XRPNGN).await.unwrap();
    println!("{:#?}", ticker);
}

Structs§

AccountBalance
LunoClient
LunoClientBuilder
LunoError
Order
OrderBook
Contains a list of all bids and asks for the currency pair specified in the Order Book
OrderBookEntry
OrderBookEntry contains the limit price and available volume.
Ticker
Trade

Enums§

CurrencyPair
Currency pairs available on Luno.
Error
OrderType