deribit_http/model/
withdrawal.rs

1/******************************************************************************
2   Author: Joaquín Béjar García
3   Email: jb@taunais.com
4   Date: 15/9/25
5******************************************************************************/
6use pretty_simple_display::{DebugPretty, DisplaySimple};
7use serde::{Deserialize, Serialize};
8
9/// Withdrawal priority information
10#[derive(DebugPretty, DisplaySimple, Clone, PartialEq, Serialize, Deserialize)]
11pub struct WithdrawalPriority {
12    /// Priority name (e.g., "very_low", "low", "medium", "high", "very_high")
13    pub name: String,
14    /// Priority value (fee multiplier)
15    pub value: f64,
16}
17
18impl WithdrawalPriority {
19    /// Create a new withdrawal priority
20    pub fn new(name: String, value: f64) -> Self {
21        Self { name, value }
22    }
23
24    /// Create a very low priority
25    pub fn very_low() -> Self {
26        Self::new("very_low".to_string(), 0.15)
27    }
28
29    /// Create a low priority
30    pub fn low() -> Self {
31        Self::new("low".to_string(), 0.5)
32    }
33
34    /// Create a medium priority
35    pub fn medium() -> Self {
36        Self::new("medium".to_string(), 1.0)
37    }
38
39    /// Create a high priority
40    pub fn high() -> Self {
41        Self::new("high".to_string(), 1.2)
42    }
43
44    /// Create a very high priority
45    pub fn very_high() -> Self {
46        Self::new("very_high".to_string(), 1.5)
47    }
48}