Skip to main content

blockfrost_openapi/models/
pool_calidus_key.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4/// PoolCalidusKey : Last valid Calidus key for the pool
5#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
6pub struct PoolCalidusKey {
7    /// A Bech32-encoded identifier derived from the calidus public key
8    #[serde(rename = "id")]
9    pub id: String,
10    /// The raw hexadecimal-encoded calidus public key used for verification purposes
11    #[serde(rename = "pub_key")]
12    pub pub_key: String,
13    /// A unique number used once to prevent replay attacks and ensure the uniqueness of the key registration
14    #[serde(rename = "nonce")]
15    pub nonce: i32,
16    /// The transaction hash that submitted the Calidus key registration
17    #[serde(rename = "tx_hash")]
18    pub tx_hash: String,
19    /// The block height at which this key registration was recorded
20    #[serde(rename = "block_height")]
21    pub block_height: i32,
22    /// Block time of the key registration
23    #[serde(rename = "block_time")]
24    pub block_time: i32,
25    /// Epoch number of the key registration
26    #[serde(rename = "epoch")]
27    pub epoch: i32,
28}
29
30impl PoolCalidusKey {
31    /// Last valid Calidus key for the pool
32    pub fn new(id: String, pub_key: String, nonce: i32, tx_hash: String, block_height: i32, block_time: i32, epoch: i32) -> PoolCalidusKey {
33        PoolCalidusKey {
34            id,
35            pub_key,
36            nonce,
37            tx_hash,
38            block_height,
39            block_time,
40            epoch,
41        }
42    }
43}
44