Added Latest Blocks and improved network ifs
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct NodeInfo {
|
||||
pub struct NodeInfoOuter {
|
||||
pub id: String,
|
||||
pub jsonrpc: String,
|
||||
pub result: NodeInfoInner
|
||||
pub result: NodeInfo,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct NodeInfoInner {
|
||||
pub struct NodeInfo {
|
||||
pub adjusted_time: u64,
|
||||
alt_blocks_count: u64,
|
||||
block_size_limit: u64,
|
||||
@@ -25,7 +25,7 @@ pub struct NodeInfoInner {
|
||||
difficulty_top64: u64,
|
||||
pub free_space: u64,
|
||||
grey_peerlist_size: u64,
|
||||
height: u64,
|
||||
pub height: u64,
|
||||
height_without_bootstrap: u64,
|
||||
incoming_connections_count: u64,
|
||||
mainnet: bool,
|
||||
@@ -60,6 +60,51 @@ pub struct NodeInfoInner {
|
||||
pub db_size_pretty: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct BlockHeaderInfosOuter {
|
||||
pub id: String,
|
||||
pub jsonrpc: String,
|
||||
pub result: BlockHeaderInfos,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct BlockHeaderInfos {
|
||||
credits: u64,
|
||||
pub headers: Vec<BlockHeaderInfo>,
|
||||
status: String,
|
||||
top_hash: String,
|
||||
untrusted: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct BlockHeaderInfo {
|
||||
block_size: u64,
|
||||
block_weight: u64,
|
||||
cumulative_difficulty: u64,
|
||||
cumulative_difficulty_top64: u64,
|
||||
depth: u64,
|
||||
difficulty: u64,
|
||||
difficulty_top64: u64,
|
||||
hash: String,
|
||||
height: u64,
|
||||
long_term_weight: u64,
|
||||
major_version: u64,
|
||||
miner_tx_hash: String,
|
||||
minor_version: u64,
|
||||
nonce: u64,
|
||||
num_txes: u64,
|
||||
orphan_status: bool,
|
||||
pow_hash: String,
|
||||
prev_hash: String,
|
||||
reward: u64,
|
||||
pub timestamp: u64,
|
||||
wide_cumulative_difficulty: String,
|
||||
wide_difficulty: String,
|
||||
#[serde(skip_deserializing, default = "none")]
|
||||
pub timestamp_pretty: String
|
||||
}
|
||||
|
||||
|
||||
fn none() -> String {
|
||||
"".to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user