murray_rs/blockchain/types/
mining.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Deserialize, Serialize, Debug)]
4#[serde(rename_all = "camelCase")]
5pub struct DifficultyEntry {
6  pub time: u64,
7  pub height: u64,
8  pub difficulty: f64,
9  pub adjustment: f64,
10}
11
12#[derive(Deserialize, Serialize, Debug)]
13#[serde(rename_all = "camelCase")]
14pub struct HashratesEntry {
15  pub timestamp: u64,
16  pub avg_hashrate: f64,
17}
18
19#[derive(Deserialize, Serialize, Debug)]
20#[serde(rename_all = "camelCase")]
21pub struct HashrateData {
22  pub progress_percent: f64,
23  pub difficulty_change: f64,
24  pub estimated_retarget_date: u64,
25  pub remaining_blocks: u64,
26  pub remaining_time: u64,
27  pub previous_retarget: f64,
28  pub previous_time: u64,
29  pub next_retarget_height: u64,
30  pub time_avg: f64,
31  pub adjusted_time_avg: f64,
32  pub time_offset: f64,
33  pub expected_blocks: f64,
34  pub hashrates: Vec<HashratesEntry>,
35  pub difficulty: Vec<DifficultyEntry>,
36  pub current_hashrate: f64,
37  pub current_difficulty: f64,
38}