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§
source§impl 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