41fb17a31b
* WIP adding derive(ToSchema) * Derive ToSchema for more types * ContractBuildInformation on /nym_contracts_detailed * rustfmt * Add cfg_attr * A bunch of annotations * Compiles with utoipa 5.2 * WIP * Post rebase fixes * Gitattributes to ignore .sqlx diffs * generate Sqlx schema files * Improvements * Move ecash schema out of ecash crate * Move redocly config to nym-api/ * Move redocly config to nym-api/ * Remove ErrorResponse * Move generated openapi spec to .gitignore * Include BSL licence * Remove utoipa from ecash toml file * Remove placeholder annotations * Chain-watcher rebase changes * Update licence info * Treat Scalar as String in OpenAPI
30 lines
805 B
Rust
30 lines
805 B
Rust
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
use nym_config::defaults::NymNetworkDetails;
|
|
use schemars::JsonSchema;
|
|
use serde::{Deserialize, Serialize};
|
|
use utoipa::ToSchema;
|
|
|
|
#[derive(Clone, Serialize, Deserialize, JsonSchema, ToSchema)]
|
|
pub struct NetworkDetails {
|
|
pub(crate) connected_nyxd: String,
|
|
pub(crate) network: NymNetworkDetails,
|
|
}
|
|
|
|
impl NetworkDetails {
|
|
pub fn new(connected_nyxd: String, network: NymNetworkDetails) -> Self {
|
|
Self {
|
|
connected_nyxd,
|
|
network,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize, JsonSchema, ToSchema)]
|
|
#[serde(rename_all = "snake_case")]
|
|
pub struct ContractInformation<T> {
|
|
pub(crate) address: Option<String>,
|
|
pub(crate) details: Option<T>,
|
|
}
|