use serde::Serialize;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcIcrcAnalyticsRequest {
pub source_endpoint: String,
pub now_unix_secs: u64,
pub ledger_canister_id: String,
}
impl IcIcrcAnalyticsRequest {
#[must_use]
pub fn new(
source_endpoint: impl Into<String>,
now_unix_secs: u64,
ledger_canister_id: impl Into<String>,
) -> Self {
Self {
source_endpoint: source_endpoint.into(),
now_unix_secs,
ledger_canister_id: ledger_canister_id.into(),
}
}
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct IcIcrcTotalSupplyQuery {
pub start_unix_secs: u64,
pub end_unix_secs: u64,
pub step_secs: u32,
}
impl IcIcrcTotalSupplyQuery {
#[must_use]
pub const fn new(start_unix_secs: u64, end_unix_secs: u64, step_secs: u32) -> Self {
Self {
start_unix_secs,
end_unix_secs,
step_secs,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcIcrcTotalSupplyRequest {
pub analytics: IcIcrcAnalyticsRequest,
pub query: IcIcrcTotalSupplyQuery,
}
impl IcIcrcTotalSupplyRequest {
#[must_use]
pub fn new(
source_endpoint: impl Into<String>,
now_unix_secs: u64,
ledger_canister_id: impl Into<String>,
query: IcIcrcTotalSupplyQuery,
) -> Self {
Self {
analytics: IcIcrcAnalyticsRequest::new(
source_endpoint,
now_unix_secs,
ledger_canister_id,
),
query,
}
}
}