Skip to main content

blockfrost_openapi/models/
signer.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4use serde_with::serde_as;
5
6/// Signer : Signer represents a signing participant in the network
7#[serde_as]
8#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
9pub struct Signer {
10    /// The unique identifier of the signer
11    #[serde(rename = "party_id")]
12    pub party_id: String,
13    /// The public key used to authenticate signer signature
14    #[serde_as(as = "serde_with::base64::Base64")]
15    #[serde(rename = "verification_key")]
16    pub verification_key: Vec<u8>,
17    /// The signature of the verification_key (signed by the Cardano node KES secret key)
18    #[serde_as(as = "Option<serde_with::base64::Base64>")]
19    #[serde(rename = "verification_key_signature", skip_serializing_if = "Option::is_none")]
20    pub verification_key_signature: Option<Vec<u8>>,
21    /// The operational certificate of the stake pool operator attached to the signer node
22    #[serde_as(as = "Option<serde_with::base64::Base64>")]
23    #[serde(rename = "operational_certificate", skip_serializing_if = "Option::is_none")]
24    pub operational_certificate: Option<Vec<u8>>,
25    /// The number of updates of the KES secret key that signed the verification key
26    #[serde(rename = "kes_period", skip_serializing_if = "Option::is_none")]
27    pub kes_period: Option<i64>,
28}
29
30impl Signer {
31    /// Signer represents a signing participant in the network
32    pub fn new(party_id: String, verification_key: Vec<u8>) -> Signer {
33        Signer {
34            party_id,
35            verification_key,
36            verification_key_signature: None,
37            operational_certificate: None,
38            kes_period: None,
39        }
40    }
41}
42