1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
//! This library is a Rust wrapper for [Luno API](https://www.luno.com/api) //! //! ## Authentication //! //! Please visit the [Settings](https://www.luno.com/wallet/settings/api_keys) page //! to generate an API key. //! //! ## Usage //! //! Put this in your `Cargo.toml`: //! //! ```toml //! [dependencies] //! luno-rs = "0.1" //! ``` //! //! ### Example usage //! //! __Using LunoClient__ //! //! ```no_run //! 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__ //! //! ```no_run //! 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); //! } //! ``` #![allow(missing_docs)] #[macro_use] extern crate log; mod client; mod credential; mod domain; mod error; mod http; mod middleware; pub use client::{LunoClient, LunoClientBuilder}; pub use domain::{ AccountBalance, CurrencyPair, Order, OrderBook, OrderBookEntry, OrderType, Ticker, Trade, }; pub use error::{Error, LunoError};