whisky_provider/blockfrost/models/
block.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
4pub struct BlockContent {
5    /// Block creation time in UNIX time
6    #[serde(rename = "time")]
7    pub time: i32,
8    /// Block number
9    #[serde(rename = "height", deserialize_with = "Option::deserialize")]
10    pub height: Option<i32>,
11    /// Hash of the block
12    #[serde(rename = "hash")]
13    pub hash: String,
14    /// Slot number
15    #[serde(rename = "slot", deserialize_with = "Option::deserialize")]
16    pub slot: Option<i32>,
17    /// Epoch number
18    #[serde(rename = "epoch", deserialize_with = "Option::deserialize")]
19    pub epoch: Option<i32>,
20    /// Slot within the epoch
21    #[serde(rename = "epoch_slot", deserialize_with = "Option::deserialize")]
22    pub epoch_slot: Option<i32>,
23    /// Bech32 ID of the slot leader or specific block description in case there is no slot leader
24    #[serde(rename = "slot_leader")]
25    pub slot_leader: String,
26    /// Block size in Bytes
27    #[serde(rename = "size")]
28    pub size: i32,
29    /// Number of transactions in the block
30    #[serde(rename = "tx_count")]
31    pub tx_count: i32,
32    /// Total output within the block in Lovelaces
33    #[serde(rename = "output", deserialize_with = "Option::deserialize")]
34    pub output: Option<String>,
35    /// Total fees within the block in Lovelaces
36    #[serde(rename = "fees", deserialize_with = "Option::deserialize")]
37    pub fees: Option<String>,
38    /// VRF key of the block
39    #[serde(rename = "block_vrf", deserialize_with = "Option::deserialize")]
40    pub block_vrf: Option<String>,
41    /// The hash of the operational certificate of the block producer
42    #[serde(rename = "op_cert", deserialize_with = "Option::deserialize")]
43    pub op_cert: Option<String>,
44    /// The value of the counter used to produce the operational certificate
45    #[serde(rename = "op_cert_counter", deserialize_with = "Option::deserialize")]
46    pub op_cert_counter: Option<String>,
47    /// Hash of the previous block
48    #[serde(rename = "previous_block", deserialize_with = "Option::deserialize")]
49    pub previous_block: Option<String>,
50    /// Hash of the next block
51    #[serde(rename = "next_block", deserialize_with = "Option::deserialize")]
52    pub next_block: Option<String>,
53    /// Number of block confirmations
54    #[serde(rename = "confirmations")]
55    pub confirmations: i32,
56}