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
use chrono::DateTime;
use chrono::Utc;
use serde::Deserialize;
use serde_json::Value;

#[derive(Debug, Deserialize)]
pub(crate) struct BlockchainStateResponse {
	pub blockchain_state: BlockchainState,
	pub success: bool
}

#[derive(Debug, Deserialize)]
pub struct BlockchainState {
	pub difficulty: u16,
	pub genesis_challenge_initialized: bool,
	pub mempool_size: u8,
	pub peak: BlockchainStatePeak,
	pub space: f64,
	pub sub_slot_iters: u32,
	pub sync: BlockchainStateSync
}

#[derive(Debug, Deserialize)]
pub struct BlockchainStatePeak {
	pub challenge_block_info_hash: String,
	pub challenge_vdf_output: ChallengeVdfOutput,
	pub deficit: u8,
	pub farmer_puzzle_hash: String,
	pub fees: Value,
	pub finished_challenge_slot_hashes: Value,
	pub finished_infused_challenge_slot_hashes: Value,
	pub finished_reward_slot_hashes: Value,
	pub header_hash: String,
	pub height: u32,
	pub infused_challenge_vdf_output: Value,
	pub overflow: bool,
	pub pool_puzzle_hash: String,
	pub prev_hash: String,
	pub prev_transaction_block_hash: Value,
	pub prev_transaction_block_height: u32,
	pub required_iters: u32,
	pub reward_claims_incorporated: Value,
	pub reward_infusion_new_challenge: String,
	pub signage_point_index: u8,
	pub sub_epoch_summary_included: Value,
	pub sub_slot_iters: u32,
	#[serde(deserialize_with = "crate::util::deserialize_optional_timestamp")]
	pub timestamp: Option<DateTime<Utc>>,
	pub total_iters: u64,
	pub weight: u32
}

#[derive(Debug, Deserialize)]
pub struct ChallengeVdfOutput {
	data: String
}

#[derive(Debug, Deserialize)]
pub struct BlockchainStateSync {
	sync_mode: bool,
	sync_progress_height: u32,
	sync_tip_height: u32,
	synced: bool
}