b6213bc016
* remove [most of] legacy data from nym-api endpoints
* chore: removed contamination with legacy nodes data
* added /v1/nym-nodes/stake-saturation/{node_id}
* added /v1/legacy/mixnodes and /v1/legacy/gateways
* removed scraping of legacy mixnodes in NS api
* remove export of removed types
* huge warnings on attempting to use removed commands in the wallet
* fixed reference to removed type in tests
47 lines
972 B
Rust
47 lines
972 B
Rust
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use schemars::JsonSchema;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub mod constants;
|
|
pub mod ecash;
|
|
mod helpers;
|
|
pub mod models;
|
|
pub mod nym_nodes;
|
|
pub mod pagination;
|
|
pub mod signable;
|
|
|
|
// The response type we fetch from the network details endpoint.
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
pub struct NymNetworkDetailsResponse {
|
|
pub network: nym_config::defaults::NymNetworkDetails,
|
|
}
|
|
|
|
pub trait Deprecatable {
|
|
fn deprecate(self) -> Deprecated<Self>
|
|
where
|
|
Self: Sized,
|
|
{
|
|
self.into()
|
|
}
|
|
}
|
|
|
|
impl<T> Deprecatable for T {}
|
|
|
|
#[derive(Serialize, Deserialize, JsonSchema)]
|
|
pub struct Deprecated<T> {
|
|
pub deprecated: bool,
|
|
#[serde(flatten)]
|
|
pub response: T,
|
|
}
|
|
|
|
impl<T> From<T> for Deprecated<T> {
|
|
fn from(response: T) -> Self {
|
|
Deprecated {
|
|
deprecated: true,
|
|
response,
|
|
}
|
|
}
|
|
}
|