Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Shared types, enums, and error handling
kraken-types
[dependencies] kraken-types = { git = "https://github.com/hitakshiA/Havklo_sdk" }
use kraken_types::Level; use rust_decimal_macros::dec; let level = Level { price: dec!(67432.50), qty: dec!(1.5), };
use kraken_types::Symbol; let symbol = Symbol::new("BTC/USD")?; assert_eq!(symbol.base(), "BTC"); assert_eq!(symbol.quote(), "USD");
pub enum Channel { Book, // L2 orderbook Ticker, // Price ticker Trade, // Trade executions Ohlc, // Candlesticks Instrument, // Instrument info Level3, // L3 orderbook Executions, // Private: order fills Balances, // Private: balance updates }
pub enum Depth { D10 = 10, D25 = 25, D100 = 100, D500 = 500, D1000 = 1000, }
pub enum Side { Buy, Sell, }
pub enum OrderType { Market, Limit, StopLoss, TakeProfit, StopLossLimit, TakeProfitLimit, }
pub enum KrakenError { ConnectionFailed { url: String, reason: String }, WebSocket(String), InvalidJson { message: String, raw: String }, ChecksumMismatch { symbol: String, expected: u32, computed: u32 }, SubscriptionRejected { channel: String, reason: String }, RateLimited { retry_after: Duration }, ApiError { code: i32, message: String, raw: String, recovery: RecoveryHint }, AuthenticationFailed { reason: String }, TokenExpired, InvalidSymbol(String), OrderRejected { reason: String }, InsufficientFunds, Timeout, }
impl KrakenError { pub fn is_retryable(&self) -> bool; pub fn retry_after(&self) -> Option<Duration>; }