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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use crate::client::client_types::{terra_datetime_format, terra_f64_format, terra_u64_format};
use chrono::{DateTime, Utc};
use serde::Deserialize;
#[derive(Deserialize, Clone, Debug)]
pub struct ValidatorDescription {
pub moniker: String,
pub identity: String,
pub website: String,
pub security_contact: String,
pub details: String,
}
#[derive(Deserialize, Clone, Debug)]
pub struct ValidatorCommissionRates {
#[serde(with = "terra_f64_format")]
pub rate: f64,
#[serde(with = "terra_f64_format")]
pub max_rate: f64,
#[serde(with = "terra_f64_format")]
pub max_change_rate: f64,
}
#[allow(missing_docs)]
#[derive(Deserialize, Clone, Debug)]
pub struct ValidatorCommission {
pub commission_rates: ValidatorCommissionRates,
#[serde(with = "terra_datetime_format")]
pub update_time: DateTime<Utc>,
}
#[derive(Deserialize, Clone, Debug)]
pub struct Validator {
pub operator_address: String,
pub consensus_pubkey: String,
pub jailed: bool,
pub status: u16,
#[serde(with = "terra_u64_format")]
pub tokens: u64,
#[serde(with = "terra_f64_format")]
pub delegator_shares: f64,
pub description: ValidatorDescription,
#[serde(with = "terra_u64_format")]
pub unbonding_height: u64,
#[serde(with = "terra_datetime_format")]
pub unbonding_time: DateTime<Utc>,
pub commission: ValidatorCommission,
#[serde(with = "terra_u64_format")]
pub min_self_delegation: u64,
}
#[allow(missing_docs)]
#[derive(Deserialize, Debug)]
pub struct ValidatorResult {
#[serde(with = "terra_u64_format")]
pub height: u64,
pub result: Validator,
}
#[allow(missing_docs)]
#[derive(Deserialize, Debug)]
pub struct ValidatorListResult {
#[serde(with = "terra_u64_format")]
pub height: u64,
pub result: Vec<Validator>,
}