pub struct LunoClient { /* private fields */ }
Implementations§
Source§impl LunoClient
impl LunoClient
Sourcepub async fn list_balances(&self) -> Result<Vec<AccountBalance>, Error>
pub async fn list_balances(&self) -> Result<Vec<AccountBalance>, Error>
List the balances on all assets linked to Luno profile
Sourcepub async fn get_ticker(
&self,
currency_pair: CurrencyPair,
) -> Result<Ticker, Error>
pub async fn get_ticker( &self, currency_pair: CurrencyPair, ) -> Result<Ticker, Error>
Get ticker for currency pair
Sourcepub async fn list_tickers(&self) -> Result<Vec<Ticker>, Error>
pub async fn list_tickers(&self) -> Result<Vec<Ticker>, Error>
List tickers for all currency pairs
Sourcepub async fn list_tickers_for_currency_pairs(
&self,
currency_pairs: Vec<CurrencyPair>,
) -> Result<Vec<Ticker>, Error>
pub async fn list_tickers_for_currency_pairs( &self, currency_pairs: Vec<CurrencyPair>, ) -> Result<Vec<Ticker>, Error>
List tickers for specific currency pairs
Sourcepub async fn get_order_book(
&self,
currency_pair: CurrencyPair,
) -> Result<OrderBook, Error>
pub async fn get_order_book( &self, currency_pair: CurrencyPair, ) -> Result<OrderBook, Error>
Get order book
Sourcepub async fn get_order_book_top_100(
&self,
currency_pair: CurrencyPair,
) -> Result<OrderBook, Error>
pub async fn get_order_book_top_100( &self, currency_pair: CurrencyPair, ) -> Result<OrderBook, Error>
Get top 100 bids and asks in order book
Sourcepub async fn list_trades(
&self,
currency_pair: CurrencyPair,
) -> Result<Vec<Trade>, Error>
pub async fn list_trades( &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
);
}
Sourcepub async fn list_trades_since(
&self,
currency_pair: CurrencyPair,
duration: Duration,
) -> Result<Vec<Trade>, Error>
pub async fn list_trades_since( &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 Freeze for LunoClient
impl !RefUnwindSafe for LunoClient
impl Send for LunoClient
impl Sync for LunoClient
impl Unpin for LunoClient
impl !UnwindSafe for LunoClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more