pub struct BinanceRestClient { /* private fields */ }Implementations§
Source§impl BinanceRestClient
impl BinanceRestClient
pub fn new( base_url: &str, futures_base_url: &str, api_key: &str, secret_key: &str, futures_api_key: &str, futures_secret_key: &str, recv_window: u64, ) -> Self
pub async fn ping(&self) -> Result<()>
pub async fn server_time(&self) -> Result<u64>
pub async fn get_account(&self) -> Result<AccountInfo>
pub async fn get_futures_account(&self) -> Result<BinanceFuturesAccountInfo>
pub async fn place_market_order( &self, symbol: &str, side: OrderSide, quantity: f64, client_order_id: &str, ) -> Result<BinanceOrderResponse>
pub async fn place_futures_market_order( &self, symbol: &str, side: OrderSide, quantity: f64, client_order_id: &str, ) -> Result<BinanceOrderResponse>
pub async fn get_spot_symbol_order_rules( &self, symbol: &str, ) -> Result<SymbolOrderRules>
pub async fn get_futures_symbol_order_rules( &self, symbol: &str, ) -> Result<SymbolOrderRules>
Sourcepub async fn get_klines(
&self,
symbol: &str,
interval: &str,
limit: usize,
) -> Result<Vec<Candle>>
pub async fn get_klines( &self, symbol: &str, interval: &str, limit: usize, ) -> Result<Vec<Candle>>
Fetch historical kline (candlestick) OHLC data.
Returns Vec<Candle> oldest first.
pub async fn get_klines_for_market( &self, symbol: &str, interval: &str, limit: usize, is_futures: bool, ) -> Result<Vec<Candle>>
pub async fn cancel_order( &self, symbol: &str, client_order_id: &str, ) -> Result<BinanceOrderResponse>
Sourcepub async fn get_all_orders(
&self,
symbol: &str,
limit: usize,
) -> Result<Vec<BinanceAllOrder>>
pub async fn get_all_orders( &self, symbol: &str, limit: usize, ) -> Result<Vec<BinanceAllOrder>>
Fetch recent orders for a symbol from /api/v3/allOrders.
limit controls max rows returned (1..=1000).
pub async fn get_futures_all_orders( &self, symbol: &str, limit: usize, ) -> Result<Vec<BinanceAllOrder>>
Sourcepub async fn get_my_trades(
&self,
symbol: &str,
limit: usize,
) -> Result<Vec<BinanceMyTrade>>
pub async fn get_my_trades( &self, symbol: &str, limit: usize, ) -> Result<Vec<BinanceMyTrade>>
Fetch recent personal trades for a symbol.
Sourcepub async fn get_my_trades_history(
&self,
symbol: &str,
max_total: usize,
) -> Result<Vec<BinanceMyTrade>>
pub async fn get_my_trades_history( &self, symbol: &str, max_total: usize, ) -> Result<Vec<BinanceMyTrade>>
Fetch all personal trades from the oldest side (fromId=0), up to max_total.
Sourcepub async fn get_my_trades_since(
&self,
symbol: &str,
from_id: u64,
max_pages: usize,
) -> Result<Vec<BinanceMyTrade>>
pub async fn get_my_trades_since( &self, symbol: &str, from_id: u64, max_pages: usize, ) -> Result<Vec<BinanceMyTrade>>
Fetch new personal trades since from_id (inclusive), paging forward.
pub async fn get_futures_my_trades_history( &self, symbol: &str, max_total: usize, ) -> Result<Vec<BinanceMyTrade>>
Auto Trait Implementations§
impl !Freeze for BinanceRestClient
impl !RefUnwindSafe for BinanceRestClient
impl Send for BinanceRestClient
impl Sync for BinanceRestClient
impl Unpin for BinanceRestClient
impl UnsafeUnpin for BinanceRestClient
impl !UnwindSafe for BinanceRestClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more