Skip to main content

blockfrost_openapi/models/
register_signer_message.rs

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