1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct CryptoSymbol {
9 pub symbol: String,
11 pub name: Option<String>,
13 pub currency: Option<String>,
15 pub stock_exchange: Option<String>,
17 pub exchange_short_name: Option<String>,
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
23#[serde(rename_all = "camelCase")]
24pub struct CryptoQuote {
25 pub symbol: String,
27 pub name: Option<String>,
29 pub price: Option<f64>,
31 pub change: Option<f64>,
33 pub changes_percentage: Option<f64>,
35 pub day_low: Option<f64>,
37 pub day_high: Option<f64>,
39 pub year_low: Option<f64>,
41 pub year_high: Option<f64>,
43 pub market_cap: Option<f64>,
45 pub volume: Option<f64>,
47 pub avg_volume: Option<f64>,
49 pub open: Option<f64>,
51 pub previous_close: Option<f64>,
53 pub timestamp: Option<i64>,
55}
56
57#[derive(Debug, Clone, Serialize, Deserialize)]
59#[serde(rename_all = "camelCase")]
60pub struct CryptoHistorical {
61 pub date: String,
63 pub open: f64,
65 pub high: f64,
67 pub low: f64,
69 pub close: f64,
71 pub adj_close: Option<f64>,
73 pub volume: f64,
75}
76
77#[derive(Debug, Clone, Serialize, Deserialize)]
79#[serde(rename_all = "camelCase")]
80pub struct CryptoIntraday {
81 pub date: String,
83 pub open: f64,
85 pub high: f64,
87 pub low: f64,
89 pub close: f64,
91 pub volume: f64,
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(rename_all = "camelCase")]
98pub struct ForexPair {
99 pub symbol: String,
101 pub name: Option<String>,
103 pub currency: Option<String>,
105 pub stock_exchange: Option<String>,
107 pub exchange_short_name: Option<String>,
109}
110
111#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(rename_all = "camelCase")]
114pub struct ForexQuote {
115 pub symbol: String,
117 pub name: Option<String>,
119 pub price: Option<f64>,
121 pub change: Option<f64>,
123 pub changes_percentage: Option<f64>,
125 pub day_low: Option<f64>,
127 pub day_high: Option<f64>,
129 pub year_low: Option<f64>,
131 pub year_high: Option<f64>,
133 pub open: Option<f64>,
135 pub previous_close: Option<f64>,
137 pub timestamp: Option<i64>,
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(rename_all = "camelCase")]
144pub struct ForexHistorical {
145 pub date: String,
147 pub open: f64,
149 pub high: f64,
151 pub low: f64,
153 pub close: f64,
155 pub adj_close: Option<f64>,
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(rename_all = "camelCase")]
162pub struct ForexIntraday {
163 pub date: String,
165 pub open: f64,
167 pub high: f64,
169 pub low: f64,
171 pub close: f64,
173}