[−][src]Struct luno_rs::LunoClient
Implementations
impl LunoClient
[src]
pub fn new<T: AsRef<str>>(key_id: T, key_secret: T) -> Self
[src]
Create a new LunoClient
pub async fn list_balances(&self) -> Result<Vec<AccountBalance>, Error>
[src]
List the balances on all assets linked to Luno profile
pub async fn list_orders(&self) -> Result<Vec<Order>, Error>
[src]
List all orders on Luno profile
pub async fn get_ticker(
&self,
currency_pair: CurrencyPair
) -> Result<Ticker, Error>
[src]
&self,
currency_pair: CurrencyPair
) -> Result<Ticker, Error>
Get ticker for currency pair
pub async fn list_tickers(&self) -> Result<Vec<Ticker>, Error>
[src]
List tickers for all currency pairs
pub async fn list_tickers_for_currency_pairs(
&self,
currency_pairs: Vec<CurrencyPair>
) -> Result<Vec<Ticker>, Error>
[src]
&self,
currency_pairs: Vec<CurrencyPair>
) -> Result<Vec<Ticker>, Error>
List tickers for specific currency pairs
pub async fn get_order_book(
&self,
currency_pair: CurrencyPair
) -> Result<OrderBook, Error>
[src]
&self,
currency_pair: CurrencyPair
) -> Result<OrderBook, Error>
Get order book
pub async fn get_order_book_top_100(
&self,
currency_pair: CurrencyPair
) -> Result<OrderBook, Error>
[src]
&self,
currency_pair: CurrencyPair
) -> Result<OrderBook, Error>
Get top 100 bids and asks in order book
pub async fn list_trades(
&self,
currency_pair: CurrencyPair
) -> Result<Vec<Trade>, Error>
[src]
&self,
currency_pair: CurrencyPair
) -> Result<Vec<Trade>, Error>
List the most recent Trades for the specified currency pair in the last 24 hours. At most 100 results are returned per call.
Example
use luno_rs::{LunoClient, CurrencyPair}; use std::env; let client = LunoClient::new(key_id, key_secret); let trades = client .list_trades(CurrencyPair::XBTNGN) .await .unwrap(); for (i, trade) in trades.iter().enumerate() { println!( "{} :: {} -> Type: {}, Price: {} Volume: {}", i, trade.timestamp, trade.order_type, trade.price, trade.volume ); }
pub async fn list_trades_since(
&self,
currency_pair: CurrencyPair,
duration: Duration
) -> Result<Vec<Trade>, Error>
[src]
&self,
currency_pair: CurrencyPair,
duration: Duration
) -> Result<Vec<Trade>, Error>
List trades since duration ago
Example
use luno_rs::{LunoClient, CurrencyPair}; use std::{env, time::Duration}; let client = LunoClient::new(key_id, key_secret); let trades = client .list_trades_since(CurrencyPair::XBTNGN, Duration::from_secs(20)) .await .unwrap(); for (i, trade) in trades.iter().enumerate() { println!( "{} :: {} -> Type: {}, Price: {} Volume: {}", i, trade.timestamp, trade.order_type, trade.price, trade.volume ); }
Auto Trait Implementations
impl !RefUnwindSafe for LunoClient
[src]
impl Send for LunoClient
[src]
impl Sync for LunoClient
[src]
impl Unpin for LunoClient
[src]
impl !UnwindSafe for LunoClient
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,