pub struct Account {
pub client: Client,
pub recv_window: u64,
}Fields§
§client: Client§recv_window: u64Implementations§
Source§impl Account
impl Account
pub fn get_account(&self) -> Result<AccountInformation>
pub fn get_balance<S>(&self, asset: S) -> Result<Balance>
pub fn get_open_orders<S>(&self, symbol: S) -> Result<Vec<Order>>
pub fn get_all_open_orders(&self) -> Result<Vec<Order>>
pub fn cancel_all_open_orders<S>(&self, symbol: S) -> Result<Vec<OrderCanceled>>
pub fn order_status<S>(&self, symbol: S, order_id: u64) -> Result<Order>
Sourcepub fn test_order_status<S>(&self, symbol: S, order_id: u64) -> Result<()>
pub fn test_order_status<S>(&self, symbol: S, order_id: u64) -> Result<()>
Place a test status order
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn limit_buy<S, F>( &self, symbol: S, qty: F, price: f64, ) -> Result<Transaction>
Sourcepub fn test_limit_buy<S, F>(&self, symbol: S, qty: F, price: f64) -> Result<()>
pub fn test_limit_buy<S, F>(&self, symbol: S, qty: F, price: f64) -> Result<()>
Place a test limit order - BUY
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn limit_sell<S, F>( &self, symbol: S, qty: F, price: f64, ) -> Result<Transaction>
Sourcepub fn test_limit_sell<S, F>(&self, symbol: S, qty: F, price: f64) -> Result<()>
pub fn test_limit_sell<S, F>(&self, symbol: S, qty: F, price: f64) -> Result<()>
Place a test LIMIT order - SELL
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn market_buy<S, F>(&self, symbol: S, qty: F) -> Result<Transaction>
Sourcepub fn test_market_buy<S, F>(&self, symbol: S, qty: F) -> Result<()>
pub fn test_market_buy<S, F>(&self, symbol: S, qty: F) -> Result<()>
Place a test MARKET order - BUY
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn market_buy_using_quote_quantity<S, F>( &self, symbol: S, quote_order_qty: F, ) -> Result<Transaction>
Sourcepub fn test_market_buy_using_quote_quantity<S, F>(
&self,
symbol: S,
quote_order_qty: F,
) -> Result<()>
pub fn test_market_buy_using_quote_quantity<S, F>( &self, symbol: S, quote_order_qty: F, ) -> Result<()>
Place a test MARKET order with quote quantity - BUY
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn market_sell<S, F>(&self, symbol: S, qty: F) -> Result<Transaction>
Sourcepub fn test_market_sell<S, F>(&self, symbol: S, qty: F) -> Result<()>
pub fn test_market_sell<S, F>(&self, symbol: S, qty: F) -> Result<()>
Place a test MARKET order - SELL
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn market_sell_using_quote_quantity<S, F>( &self, symbol: S, quote_order_qty: F, ) -> Result<Transaction>
Sourcepub fn test_market_sell_using_quote_quantity<S, F>(
&self,
symbol: S,
quote_order_qty: F,
) -> Result<()>
pub fn test_market_sell_using_quote_quantity<S, F>( &self, symbol: S, quote_order_qty: F, ) -> Result<()>
Place a test MARKET order with quote quantity - SELL
This order is sandboxed: it is validated, but not sent to the matching engine.
Sourcepub fn stop_limit_buy_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: f64,
time_in_force: TimeInForce,
) -> Result<Transaction>
pub fn stop_limit_buy_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: f64, time_in_force: TimeInForce, ) -> Result<Transaction>
Create a stop limit buy order for the given symbol, price and stop price.
Returning a Transaction value with the same parameters sent on the order.
use binance::api::Binance;
use binance::account::*;
fn main() {
let api_key = Some("api_key".into());
let secret_key = Some("secret_key".into());
let account: Account = Binance::new(api_key, secret_key);
let result = account.stop_limit_buy_order("LTCBTC", 1, 0.1, 0.09, TimeInForce::GTC);
}Sourcepub fn test_stop_limit_buy_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: f64,
time_in_force: TimeInForce,
) -> Result<()>
pub fn test_stop_limit_buy_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: f64, time_in_force: TimeInForce, ) -> Result<()>
Create a stop limit buy test order for the given symbol, price and stop price.
Returning a Transaction value with the same parameters sent on the order.
This order is sandboxed: it is validated, but not sent to the matching engine.
use binance::api::Binance;
use binance::account::*;
fn main() {
let api_key = Some("api_key".into());
let secret_key = Some("secret_key".into());
let account: Account = Binance::new(api_key, secret_key);
let result = account.test_stop_limit_buy_order("LTCBTC", 1, 0.1, 0.09, TimeInForce::GTC);
}Sourcepub fn stop_limit_sell_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: f64,
time_in_force: TimeInForce,
) -> Result<Transaction>
pub fn stop_limit_sell_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: f64, time_in_force: TimeInForce, ) -> Result<Transaction>
Create a stop limit sell order for the given symbol, price and stop price.
Returning a Transaction value with the same parameters sent on the order.
use binance::api::Binance;
use binance::account::*;
fn main() {
let api_key = Some("api_key".into());
let secret_key = Some("secret_key".into());
let account: Account = Binance::new(api_key, secret_key);
let result = account.stop_limit_sell_order("LTCBTC", 1, 0.1, 0.09, TimeInForce::GTC);
}Sourcepub fn test_stop_limit_sell_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: f64,
time_in_force: TimeInForce,
) -> Result<()>
pub fn test_stop_limit_sell_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: f64, time_in_force: TimeInForce, ) -> Result<()>
Create a stop limit sell order for the given symbol, price and stop price.
Returning a Transaction value with the same parameters sent on the order.
This order is sandboxed: it is validated, but not sent to the matching engine.
use binance::api::Binance;
use binance::account::*;
fn main() {
let api_key = Some("api_key".into());
let secret_key = Some("secret_key".into());
let account: Account = Binance::new(api_key, secret_key);
let result = account.test_stop_limit_sell_order("LTCBTC", 1, 0.1, 0.09, TimeInForce::GTC);
}Sourcepub fn custom_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: Option<f64>,
order_side: OrderSide,
order_type: OrderType,
time_in_force: TimeInForce,
new_client_order_id: Option<String>,
) -> Result<Transaction>
pub fn custom_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: Option<f64>, order_side: OrderSide, order_type: OrderType, time_in_force: TimeInForce, new_client_order_id: Option<String>, ) -> Result<Transaction>
Place a custom order
Sourcepub fn test_custom_order<S, F>(
&self,
symbol: S,
qty: F,
price: f64,
stop_price: Option<f64>,
order_side: OrderSide,
order_type: OrderType,
time_in_force: TimeInForce,
new_client_order_id: Option<String>,
) -> Result<()>
pub fn test_custom_order<S, F>( &self, symbol: S, qty: F, price: f64, stop_price: Option<f64>, order_side: OrderSide, order_type: OrderType, time_in_force: TimeInForce, new_client_order_id: Option<String>, ) -> Result<()>
Place a test custom order
This order is sandboxed: it is validated, but not sent to the matching engine.
pub fn cancel_order<S>(&self, symbol: S, order_id: u64) -> Result<OrderCanceled>
pub fn cancel_order_with_client_id<S>( &self, symbol: S, orig_client_order_id: String, ) -> Result<OrderCanceled>
pub fn cancel_order_with_client_id_rs<S>()
Sourcepub fn test_cancel_order<S>(&self, symbol: S, order_id: u64) -> Result<()>
pub fn test_cancel_order<S>(&self, symbol: S, order_id: u64) -> Result<()>
Place a test cancel order
This order is sandboxed: it is validated, but not sent to the matching engine.