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
#[macro_use]
extern crate serde_derive;
extern crate serde;
mod points;
mod reverse;
pub use self::points::*;
pub use self::reverse::*;
#[derive(Default, Serialize, Deserialize, Clone, Debug)]
pub struct Balance {
pub total: u64,
pub in_use: u64,
pub unused: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_btc: Option<f64>,
}
impl Balance {
#[inline]
pub fn is_zero(&self) -> bool {
self.total == 0
}
#[inline]
pub fn quote(&self) -> f64 {
price(self.total)
}
}