Skip to main content

blockfrost_openapi/models/
tx_content_pool_certs_inner.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct TxContentPoolCertsInner {
6    /// Index of the certificate within the transaction
7    #[serde(rename = "cert_index")]
8    pub cert_index: i32,
9    /// Bech32 encoded pool ID
10    #[serde(rename = "pool_id")]
11    pub pool_id: String,
12    /// VRF key hash
13    #[serde(rename = "vrf_key")]
14    pub vrf_key: String,
15    /// Stake pool certificate pledge in Lovelaces
16    #[serde(rename = "pledge")]
17    pub pledge: String,
18    /// Margin tax cost of the stake pool
19    #[serde(rename = "margin_cost")]
20    pub margin_cost: f64,
21    /// Fixed tax cost of the stake pool in Lovelaces
22    #[serde(rename = "fixed_cost")]
23    pub fixed_cost: String,
24    /// Bech32 reward account of the stake pool
25    #[serde(rename = "reward_account")]
26    pub reward_account: String,
27    #[serde(rename = "owners")]
28    pub owners: Vec<String>,
29    #[serde(rename = "metadata", deserialize_with = "Option::deserialize")]
30    pub metadata: Option<Box<models::TxContentPoolCertsInnerMetadata>>,
31    #[serde(rename = "relays")]
32    pub relays: Vec<models::TxContentPoolCertsInnerRelaysInner>,
33    /// Epoch in which the update becomes active
34    #[serde(rename = "active_epoch")]
35    pub active_epoch: i32,
36}
37
38impl TxContentPoolCertsInner {
39    pub fn new(cert_index: i32, pool_id: String, vrf_key: String, pledge: String, margin_cost: f64, fixed_cost: String, reward_account: String, owners: Vec<String>, metadata: Option<models::TxContentPoolCertsInnerMetadata>, relays: Vec<models::TxContentPoolCertsInnerRelaysInner>, active_epoch: i32) -> TxContentPoolCertsInner {
40        TxContentPoolCertsInner {
41            cert_index,
42            pool_id,
43            vrf_key,
44            pledge,
45            margin_cost,
46            fixed_cost,
47            reward_account,
48            owners,
49            metadata: if let Some(x) = metadata {Some(Box::new(x))} else {None},
50            relays,
51            active_epoch,
52        }
53    }
54}
55