pub struct BitmexRestClient { /* private fields */ }
Expand description
The REST client for BitMEX.
BitMEX has Swap and Future markets.
- REST API doc: https://www.bitmex.com/api/explorer/
- Trading at: https://www.bitmex.com/app/trade/
- Rate Limits: https://www.bitmex.com/app/restAPI#Limits
- 60 requests per minute on all routes (reduced to 30 when unauthenticated)
- 10 requests per second on certain routes (see below)
Implementations§
Source§impl BitmexRestClient
impl BitmexRestClient
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self
Sourcepub fn fetch_trades(
symbol: &str,
start_time: Option<String>,
) -> Result<String, Error>
pub fn fetch_trades( symbol: &str, start_time: Option<String>, ) -> Result<String, Error>
Get trades from a beginning time.
Equivalent to /trade
with count=1000
For example: https://www.bitmex.com/api/v1/trade?symbol=XBTUSD&count=1000&startTime=2018-09-28T12:34:25.706Z
Sourcepub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
Get a full Level2 snapshot of orderbook.
Equivalent to /orderBook/L2
with depth=0
For example: https://www.bitmex.com/api/v1/orderBook/L2?symbol=XBTUSD&depth=0
Auto Trait Implementations§
impl Freeze for BitmexRestClient
impl RefUnwindSafe for BitmexRestClient
impl Send for BitmexRestClient
impl Sync for BitmexRestClient
impl Unpin for BitmexRestClient
impl UnwindSafe for BitmexRestClient
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