Struct crypto_rest_client::KrakenSpotRestClient
source · [−]pub struct KrakenSpotRestClient { /* private fields */ }
Expand description
The WebSocket client for Kraken.
Kraken has only Spot market.
- REST API doc: https://docs.kraken.com/rest/
- Trading at: https://trade.kraken.com/
- Rate Limits: https://docs.kraken.com/rest/#section/Rate-Limits/REST-API-Rate-Limits
- 15 requests per 45 seconds
Implementations
sourceimpl KrakenSpotRestClient
impl KrakenSpotRestClient
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self
sourcepub fn fetch_trades(symbol: &str, since: Option<String>) -> Result<String, Error>
pub fn fetch_trades(symbol: &str, since: Option<String>) -> Result<String, Error>
Get most recent trades.
If since
is provided, return trade data since given id (exclusive).
For example: https://api.kraken.com/0/public/Trades?pair=XXBTZUSD&since=1609893937598797338
sourcepub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
Get a Level2 snapshot of orderbook.
Top 500 bids and asks are returned.
For example: https://api.kraken.com/0/public/Depth?pair=XXBTZUSD&count=500
Auto Trait Implementations
impl RefUnwindSafe for KrakenSpotRestClient
impl Send for KrakenSpotRestClient
impl Sync for KrakenSpotRestClient
impl Unpin for KrakenSpotRestClient
impl UnwindSafe for KrakenSpotRestClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more