Skip to main content

blockfrost_openapi/models/
certificate_metadata.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// CertificateMetadata : CertificateMetadata represents the metadata associated to a Certificate
5#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
6pub struct CertificateMetadata {
7    /// Cardano network
8    #[serde(rename = "network")]
9    pub network: String,
10    /// Version of the protocol
11    #[serde(rename = "version")]
12    pub version: String,
13    #[serde(rename = "parameters")]
14    pub parameters: models::ProtocolParameters,
15    /// Date and time at which the certificate was initialized and ready to accept single signatures from signers
16    #[serde(rename = "initiated_at")]
17    pub initiated_at: String,
18    /// Date and time at which the certificate was sealed (when the quorum of single signatures was reached so that a multi signature could be aggregated from them)
19    #[serde(rename = "sealed_at")]
20    pub sealed_at: String,
21    /// The list of the signers identifiers with their stakes and verification keys
22    #[serde(rename = "signers")]
23    pub signers: Vec<models::StakeDistributionParty>,
24}
25
26impl CertificateMetadata {
27    /// CertificateMetadata represents the metadata associated to a Certificate
28    pub fn new(network: String, version: String, parameters: models::ProtocolParameters, initiated_at: String, sealed_at: String, signers: Vec<models::StakeDistributionParty>) -> CertificateMetadata {
29        CertificateMetadata {
30            network,
31            version,
32            parameters,
33            initiated_at,
34            sealed_at,
35            signers,
36        }
37    }
38}
39