cat_gateway/service/common/objects/cardano/
network.rs

1//! Defines API schemas of Cardano network types.
2use poem_openapi::Enum;
3
4/// Cardano network type.
5#[derive(Clone, Enum, Debug)]
6pub(crate) enum Network {
7    /// Cardano mainnet.
8    #[oai(rename = "mainnet")]
9    Mainnet,
10    /// Cardano preprod.
11    #[oai(rename = "preprod")]
12    Preprod,
13    /// Cardano preview.
14    #[oai(rename = "preview")]
15    Preview,
16}
17
18impl From<Network> for cardano_blockchain_types::Network {
19    fn from(value: Network) -> Self {
20        match value {
21            Network::Mainnet => Self::Mainnet,
22            Network::Preprod => Self::Preprod,
23            Network::Preview => Self::Preview,
24        }
25    }
26}