Skip to main content

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

1//! Module: sns::report::model::reports::token
2//!
3//! Responsibility: SNS token metadata report DTOs.
4//! Does not own: ledger calls, token amount formatting, or rendering.
5//! Boundary: preserves raw token metadata fields for text and JSON output.
6
7use crate::icrc::{IcrcIndexData, IcrcTokenData};
8use serde::Serialize;
9
10///
11/// SnsTokenReport
12///
13/// Serializable report for SNS ledger token metadata.
14///
15
16#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
17pub struct SnsTokenReport {
18    pub schema_version: u32,
19    /// Shared record, flattened in JSON.
20    #[serde(flatten)]
21    pub context: crate::sns::SnsInstanceContext,
22    pub ledger_canister_id: String,
23    pub sns_index_canister_id: String,
24    /// Raw ledger metadata shared with ICRC reports and sources.
25    #[serde(flatten)]
26    pub token: IcrcTokenData,
27    /// Ledger-discovered index principal or its unavailability reason.
28    pub ledger_index: IcrcIndexData,
29}