nym_api_requests/models/
performance.rs1use crate::pagination::PaginatedResponse;
5use nym_contracts_common::Percent;
6use nym_performance_contract_common::{EpochId, KindMedians, LatestPerformance, NodeId};
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9use tendermint::block::Height;
10use time::OffsetDateTime;
11use utoipa::ToSchema;
12
13#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
14pub struct PerformanceEntriesRecordsResponse {
15 #[schema(value_type = String)]
18 pub height: Height,
19
20 pub entries: PaginatedResponse<LatestPerformance>,
21}
22
23#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, ToSchema)]
24pub struct NodePerformanceResponseV3 {
25 pub node_id: NodeId,
26
27 pub performance: Option<DetailedNodePerformanceV3>,
29}
30
31#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, ToSchema)]
33pub struct DetailedNodePerformanceV3 {
34 #[schema(value_type = Option<String>)]
36 pub performance_score: Option<Percent>,
37
38 pub source_epoch: EpochId,
40
41 #[serde(with = "time::serde::rfc3339")]
43 #[schemars(with = "String")]
44 #[schema(value_type = String)]
45 pub computed_at: OffsetDateTime,
46
47 pub medians: Option<KindMedians>,
49}