rosetta_types/
network_identifier.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// NetworkIdentifier : The network_identifier specifies which network a particular object is associated with.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct NetworkIdentifier {
15    #[serde(rename = "blockchain")]
16    pub blockchain: String,
17    /// If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.
18    #[serde(rename = "network")]
19    pub network: String,
20    #[serde(
21        rename = "sub_network_identifier",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub sub_network_identifier: Option<crate::SubNetworkIdentifier>,
25}
26
27impl NetworkIdentifier {
28    /// The network_identifier specifies which network a particular object is associated with.
29    pub fn new(blockchain: String, network: String) -> NetworkIdentifier {
30        NetworkIdentifier {
31            blockchain,
32            network,
33            sub_network_identifier: None,
34        }
35    }
36}