Skip to main content

ic_query/sns/report/model/reports/
list.rs

1//! Module: sns::report::model::reports::list
2//!
3//! Responsibility: deployed SNS list and info report DTOs.
4//! Does not own: SNS-W fetching, metadata lookup, sorting, or rendering.
5//! Boundary: preserves raw report fields for text and JSON output writers.
6
7use serde::Serialize;
8
9///
10/// SnsListReport
11///
12/// Serializable report for deployed SNS listings.
13///
14
15#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
16pub struct SnsListReport {
17    pub schema_version: u32,
18    pub network: String,
19    pub sns_wasm_canister_id: String,
20    pub fetched_at: String,
21    pub source_endpoint: String,
22    pub fetched_by: String,
23    pub verbose: bool,
24    pub sort: String,
25    pub sns_count: usize,
26    pub metadata_error_count: usize,
27    pub sns_instances: Vec<SnsListRow>,
28}
29
30///
31/// SnsListRow
32///
33/// Serializable row for one deployed SNS in a list report.
34///
35
36#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
37pub struct SnsListRow {
38    pub id: usize,
39    pub name: String,
40    pub root_canister_id: String,
41    pub governance_canister_id: String,
42    pub ledger_canister_id: String,
43    pub swap_canister_id: String,
44    pub index_canister_id: String,
45    pub metadata_error: Option<String>,
46}
47
48///
49/// SnsInfoReport
50///
51/// Serializable report for one deployed SNS resolved by id or root principal.
52///
53
54#[cfg(feature = "host")]
55#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
56pub struct SnsInfoReport {
57    pub schema_version: u32,
58    pub network: String,
59    pub sns_wasm_canister_id: String,
60    pub fetched_at: String,
61    pub source_endpoint: String,
62    pub fetched_by: String,
63    pub id: usize,
64    pub name: String,
65    pub description: Option<String>,
66    pub url: Option<String>,
67    pub root_canister_id: String,
68    pub governance_canister_id: String,
69    pub ledger_canister_id: String,
70    pub swap_canister_id: String,
71    pub index_canister_id: String,
72    pub metadata_error: Option<String>,
73}