Skip to main content

blockfrost_openapi/models/
signer_with_stake.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4use serde_with::serde_as;
5
6/// SignerWithStake : Signer represents a signing party in the network (including its stakes)
7#[serde_as]
8#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
9pub struct SignerWithStake {
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    /// Stake share as computed in the 'stake distribution' by the Cardano Node, multiplied by a billion (1.0e9)
29    #[serde(rename = "stake")]
30    pub stake: i64,
31}
32
33impl SignerWithStake {
34    /// Signer represents a signing party in the network (including its stakes)
35    pub fn new(party_id: String, verification_key: Vec<u8>, stake: i64) -> SignerWithStake {
36        SignerWithStake {
37            party_id,
38            verification_key,
39            verification_key_signature: None,
40            operational_certificate: None,
41            kes_period: None,
42            stake,
43        }
44    }
45}
46