[−][src]Struct luno::client::LunoClient
The top level client for interacting with the Luno API.
Implementations
impl LunoClient
[src]
pub fn new(key: String, secret: String) -> LunoClient
[src]
pub fn get_ticker(
&self,
pair: TradingPair
) -> impl Future<Output = Result<Ticker, Error>> + '_
[src]
&self,
pair: TradingPair
) -> impl Future<Output = Result<Ticker, Error>> + '_
Returns the latest ticker indicators.
pub fn list_tickers(
&self
) -> impl Future<Output = Result<TickerList, Error>> + '_
[src]
&self
) -> impl Future<Output = Result<TickerList, Error>> + '_
Returns the latest ticker indicators from all active Luno exchanges.
pub fn get_orderbook_top(
&self,
pair: TradingPair
) -> impl Future<Output = Result<Orderbook, Error>> + '_
[src]
&self,
pair: TradingPair
) -> impl Future<Output = Result<Orderbook, Error>> + '_
Returns a list of the top 100 bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by price descending. Orders of the same price are aggregated.
pub fn get_orderbook(
&self,
pair: TradingPair
) -> impl Future<Output = Result<Orderbook, Error>> + '_
[src]
&self,
pair: TradingPair
) -> impl Future<Output = Result<Orderbook, Error>> + '_
Returns a list of all bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by price descending. Multiple orders at the same price are not aggregated.
Warning: This may return a large amount of data. Generally you should rather use get_orderbook_top
or the Streaming API.
pub fn list_trades(
&self,
pair: TradingPair
) -> impl Future<Output = Result<TradeList, Error>> + '_
[src]
&self,
pair: TradingPair
) -> impl Future<Output = Result<TradeList, Error>> + '_
Returns a list of the most recent trades that happened in the last 24h. At most 100 results are returned per call.
pub async fn create_account<'_, '_>(
&'_ self,
currency: Currency,
name: &'_ str
) -> Result<Account, Error>
[src]
&'_ self,
currency: Currency,
name: &'_ str
) -> Result<Account, Error>
This request creates an account for the specified currency.
Please note that the balances for the Account will be displayed based on the asset
value,
which is the currency the account is based on.
Permissions required: Perm_W_Addresses
.
pub fn update_account_name(
&self,
account_id: &str,
name: &str
) -> impl Future<Output = Result<UpdateAccountNameResponse, Error>> + '_
[src]
&self,
account_id: &str,
name: &str
) -> impl Future<Output = Result<UpdateAccountNameResponse, Error>> + '_
Update the name of an account with a given ID,
Perm_W_Addresses
pub fn list_balances(
&self
) -> impl Future<Output = Result<BalanceList, Error>> + '_
[src]
&self
) -> impl Future<Output = Result<BalanceList, Error>> + '_
The list of all accounts and their respective balances for the requesting user.
Permissions required: Perm_R_Balance
.
pub fn list_transactions(
&self,
account_id: &str,
min_row: i64,
max_row: i64
) -> impl Future<Output = Result<TransactionList, Error>> + '_
[src]
&self,
account_id: &str,
min_row: i64,
max_row: i64
) -> impl Future<Output = Result<TransactionList, Error>> + '_
Return a list of transaction entries from an account.
Transaction entry rows are numbered sequentially starting from 1, where 1 is the oldest entry.
The range of rows to return are specified with the min_row
(inclusive) and max_row
(exclusive) parameters.
At most 1000 rows can be requested per call.
If min_row
or max_row
is non-positive, the range wraps around the most recent row.
For example, to fetch the 100 most recent rows, use min_row=-100
and max_row=0
.
Permissions required: Perm_R_Transactions
.
pub fn list_pending_transactions(
&self,
account_id: &str
) -> impl Future<Output = Result<PendingTransactionList, Error>> + '_
[src]
&self,
account_id: &str
) -> impl Future<Output = Result<PendingTransactionList, Error>> + '_
Return a list of all transactions that have not completed for the account.
Pending transactions are not numbered, and may be reordered, deleted or updated at any time.
Permissions required: Perm_R_Transactions
.
pub fn list_beneficiaries(
&self
) -> impl Future<Output = Result<ListBeneficiariesResponse, Error>> + '_
[src]
&self
) -> impl Future<Output = Result<ListBeneficiariesResponse, Error>> + '_
Returns a list of bank beneficiaries
Permissions required: Perm_R_Beneficiaries
pub fn list_orders(&self) -> ListOrdersBuilder<'_>
[src]
Get a list of the most recently placed orders.
Note that list_orders()
returns a ListOrdersBuilder
that allows you chain pair and state filters onto your
request.
pub fn limit_order(
&self,
pair: TradingPair,
order_type: LimitOrderType,
volume: Decimal,
price: Decimal
) -> PostLimitOrderBuilder<'_>
[src]
&self,
pair: TradingPair,
order_type: LimitOrderType,
volume: Decimal,
price: Decimal
) -> PostLimitOrderBuilder<'_>
Create a new trade order.
Warning! Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting orders.
If no base_account_id
or counter_account_id
are specified, your default base currency or counter currency account will be used.
You can find your account IDs by calling list_balances()
.
pub fn market_order(
&self,
pair: TradingPair,
order_type: MarketOrderType,
volume: Decimal
) -> PostMarketOrderBuilder<'_>
[src]
&self,
pair: TradingPair,
order_type: MarketOrderType,
volume: Decimal
) -> PostMarketOrderBuilder<'_>
Create a new market order.
A market order executes immediately, and either buys as much cryptocurrency that can be bought for a set amount of fiat currency, or sells a set amount of cryptocurrency for as much fiat as possible.
Warning! Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting orders.
If no base_account_id or counter_account_id are specified, your default base currency or counter currency account will be used.
You can find your account IDs by calling the list_balances()
.
pub async fn stop_order<'_, '_>(
&'_ self,
order_id: &'_ str
) -> Result<StopOrderResponse, Error>
[src]
&'_ self,
order_id: &'_ str
) -> Result<StopOrderResponse, Error>
Request to stop an order.
pub fn get_order(
&self,
order_id: &str
) -> impl Future<Output = Result<Order, Error>> + '_
[src]
&self,
order_id: &str
) -> impl Future<Output = Result<Order, Error>> + '_
Get an order by its ID.
pub fn list_own_trades(&self, pair: TradingPair) -> ListTradesBuilder<'_>
[src]
Returns a list of your recent trades for a given pair, sorted by oldest first. If before
is specified, then the trades are returned sorted by most recent first.
type
in the response indicates the type of order that you placed in order to participate in the trade. Possible types: BID
, ASK
.
If is_buy
in the response is true, then the order which completed the trade (market taker) was a bid order.
Results of this query may lag behind the latest data.
pub fn get_fee_info(
&self,
pair: TradingPair
) -> impl Future<Output = Result<FeeInfo, Error>> + '_
[src]
&self,
pair: TradingPair
) -> impl Future<Output = Result<FeeInfo, Error>> + '_
Returns the fees and 30 day trading volume (as of midnight) for a given currency pair. For complete details, please see Fees & Features.
pub fn quote(
&self,
order_type: MarketOrderType,
base_amount: Decimal,
pair: TradingPair
) -> CreateQuoteBuilder<'_>
[src]
&self,
order_type: MarketOrderType,
base_amount: Decimal,
pair: TradingPair
) -> CreateQuoteBuilder<'_>
Creates a new quote to buy or sell a particular amount of a base currency for a counter currency.
Users can specify either the exact amount to pay or the exact amount to receive.
For example, to buy exactly 0.1 Bitcoin using ZAR, you would create a quote to BUY 0.1 XBTZAR. The returned quote includes the appropriate ZAR amount. To buy Bitcoin using exactly ZAR 100, create a quote to SELL 100 ZARXBT. The returned quote specifies the Bitcoin as the counter amount returned.
An error is returned if the Account is not verified for the currency pair, or if the Account would have insufficient balance to ever exercise the quote.
Permissions required: Perm_W_Orders
pub fn get_quote(
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
[src]
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
Get the latest status of a quote by its id.
Permissions required: Perm_R_Orders
pub fn exercise_quote(
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
[src]
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
Exercise a quote to perform the Trade. If there is sufficient balance available in the Account, it will be debited and the counter amount credited.
An error is returned if the quote has expired or if the Account has insufficient available balance.
Permissions required: Perm_W_Orders
pub fn discard_quote(
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
[src]
&self,
id: &str
) -> impl Future<Output = Result<Quote, Error>> + '_
Discard a Quote. Once a Quote has been discarded, it cannot be exercised even if it has not expired.
Permissions required: Perm_W_Orders
Auto Trait Implementations
impl !RefUnwindSafe for LunoClient
impl Send for LunoClient
impl Sync for LunoClient
impl Unpin for LunoClient
impl !UnwindSafe for LunoClient
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,
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, 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.
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>,