Skip to main content

nym_node_requests/api/v2/node/
models.rs

1// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: GPL-3.0-only
3
4use celes::Country;
5use schemars::JsonSchema;
6use serde::{Deserialize, Serialize};
7
8pub use crate::api::v1::node::models::AnnouncePorts;
9
10/// Auxiliary details of the associated Nym Node.
11#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
12#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
13pub struct AuxiliaryDetailsV2 {
14    /// Optional ISO 3166 alpha-2 two-letter country code of the node's **physical** location
15    #[cfg_attr(feature = "openapi", schema(example = "PL", value_type = Option<String>))]
16    #[schemars(with = "Option<String>")]
17    #[schemars(length(equal = 2))]
18    pub location: Option<Country>,
19
20    /// On-chain address of this node
21    pub address: String,
22
23    #[serde(default)]
24    pub announce_ports: AnnouncePorts,
25
26    /// Specifies whether this node operator has agreed to the terms and conditions
27    /// as defined at <https://nymtech.net/terms-and-conditions/operators/v1.0.0>
28    // make sure to include the default deserialisation as this field hasn't existed when the struct was first created
29    #[serde(default)]
30    pub accepted_operator_terms_and_conditions: bool,
31}