use serde::Serialize;
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct IcNodeProviderRewardListQuery {
pub limit: u16,
pub offset: u64,
pub max_reward_index: Option<u64>,
}
impl IcNodeProviderRewardListQuery {
#[must_use]
pub const fn new(limit: u16, offset: u64, max_reward_index: Option<u64>) -> Self {
Self {
limit,
offset,
max_reward_index,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcNodeProviderRewardListRequest {
pub source_endpoint: String,
pub now_unix_secs: u64,
pub query: IcNodeProviderRewardListQuery,
}
impl IcNodeProviderRewardListRequest {
#[must_use]
pub fn new(
source_endpoint: impl Into<String>,
now_unix_secs: u64,
query: IcNodeProviderRewardListQuery,
) -> Self {
Self {
source_endpoint: source_endpoint.into(),
now_unix_secs,
query,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct IcNodeProviderRewardInfoRequest {
pub source_endpoint: String,
pub now_unix_secs: u64,
pub reward_id: u64,
}
impl IcNodeProviderRewardInfoRequest {
#[must_use]
pub fn new(source_endpoint: impl Into<String>, now_unix_secs: u64, reward_id: u64) -> Self {
Self {
source_endpoint: source_endpoint.into(),
now_unix_secs,
reward_id,
}
}
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct IcNodeProviderRewardHistoryQuery {
pub start_unix_secs: u64,
pub end_unix_secs: u64,
pub step_secs: u32,
}
impl IcNodeProviderRewardHistoryQuery {
#[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 IcNodeProviderRewardHistoryRequest {
pub source_endpoint: String,
pub now_unix_secs: u64,
pub query: IcNodeProviderRewardHistoryQuery,
}
impl IcNodeProviderRewardHistoryRequest {
#[must_use]
pub fn new(
source_endpoint: impl Into<String>,
now_unix_secs: u64,
query: IcNodeProviderRewardHistoryQuery,
) -> Self {
Self {
source_endpoint: source_endpoint.into(),
now_unix_secs,
query,
}
}
}