1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! Kraken Futures WebSocket API client.
//!
//! This module provides a WebSocket client for the Kraken Futures API,
//! supporting both public market data feeds and authenticated private feeds.
//!
//! ## Features
//!
//! - Real-time market data (ticker, order book, trades)
//! - Private feeds (orders, fills, positions, balances)
//! - Automatic reconnection with exponential backoff
//! - Subscription restoration after reconnect
//! - Challenge-based authentication
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use kraken_api_client::futures::ws::{FuturesWsClient, feeds};
//! use futures_util::StreamExt;
//!
//! // Connect to public feeds
//! let client = FuturesWsClient::new();
//! let mut stream = client.connect_public().await?;
//!
//! // Subscribe to ticker for BTC perpetual
//! stream.subscribe_public(feeds::TICKER, vec!["PI_XBTUSD"]).await?;
//!
//! while let Some(msg) = stream.next().await {
//! println!("Message: {:?}", msg);
//! }
//! ```
//!
//! ## Authentication
//!
//! The Futures WebSocket API uses challenge-based authentication:
//!
//! 1. Request a challenge with your API key
//! 2. Sign the challenge using HMAC-SHA512(SHA256(challenge), secret)
//! 3. Include both original and signed challenge in private subscriptions
//!
//! ```rust,ignore
//! use kraken_api_client::futures::ws::FuturesWsClient;
//! use kraken_api_client::auth::StaticCredentials;
//! use std::sync::Arc;
//!
//! let credentials = Arc::new(StaticCredentials::new("api_key", "api_secret"));
//! let client = FuturesWsClient::new();
//!
//! // Connect and authenticate
//! let mut stream = client.connect_private(credentials).await?;
//!
//! // Subscribe to private feeds
//! stream.subscribe_private(feeds::OPEN_ORDERS).await?;
//! stream.subscribe_private(feeds::FILLS).await?;
//! ```
pub use ;
pub use *;
pub use ;
/// WebSocket endpoint URLs.
/// Available feed names.