chia_node/fullnode/
model.rs

1use chrono::DateTime;
2use chrono::Utc;
3use serde::Deserialize;
4use serde_json::Value;
5
6#[derive(Debug, Deserialize)]
7pub(crate) struct BlockchainStateResponse {
8	pub blockchain_state: BlockchainState,
9	pub success: bool
10}
11
12#[derive(Debug, Deserialize)]
13pub struct BlockchainState {
14	pub difficulty: u16,
15	pub genesis_challenge_initialized: bool,
16	pub mempool_size: u8,
17	pub peak: BlockchainStatePeak,
18	pub space: f64,
19	pub sub_slot_iters: u32,
20	pub sync: BlockchainStateSync
21}
22
23#[derive(Debug, Deserialize)]
24pub struct BlockchainStatePeak {
25	pub challenge_block_info_hash: String,
26	pub challenge_vdf_output: ChallengeVdfOutput,
27	pub deficit: u8,
28	pub farmer_puzzle_hash: String,
29	pub fees: Value,
30	pub finished_challenge_slot_hashes: Value,
31	pub finished_infused_challenge_slot_hashes: Value,
32	pub finished_reward_slot_hashes: Value,
33	pub header_hash: String,
34	pub height: u32,
35	pub infused_challenge_vdf_output: Value,
36	pub overflow: bool,
37	pub pool_puzzle_hash: String,
38	pub prev_hash: String,
39	pub prev_transaction_block_hash: Value,
40	pub prev_transaction_block_height: u32,
41	pub required_iters: u32,
42	pub reward_claims_incorporated: Value,
43	pub reward_infusion_new_challenge: String,
44	pub signage_point_index: u8,
45	pub sub_epoch_summary_included: Value,
46	pub sub_slot_iters: u32,
47	#[serde(deserialize_with = "crate::util::deserialize_optional_timestamp")]
48	pub timestamp: Option<DateTime<Utc>>,
49	pub total_iters: u64,
50	pub weight: u32
51}
52
53#[derive(Debug, Deserialize)]
54pub struct ChallengeVdfOutput {
55	data: String
56}
57
58#[derive(Debug, Deserialize)]
59pub struct BlockchainStateSync {
60	sync_mode: bool,
61	sync_progress_height: u32,
62	sync_tip_height: u32,
63	synced: bool
64}
65