Skip to main content

blockfrost_openapi/models/
proposal_parameters_parameters.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct ProposalParametersParameters {
6    /// Epoch number
7    #[serde(rename = "epoch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
8    pub epoch: Option<Option<i32>>,
9    /// The linear factor for the minimum fee calculation for given epoch
10    #[serde(rename = "min_fee_a", deserialize_with = "Option::deserialize")]
11    pub min_fee_a: Option<i32>,
12    /// The constant factor for the minimum fee calculation
13    #[serde(rename = "min_fee_b", deserialize_with = "Option::deserialize")]
14    pub min_fee_b: Option<i32>,
15    /// Maximum block body size in Bytes
16    #[serde(rename = "max_block_size", deserialize_with = "Option::deserialize")]
17    pub max_block_size: Option<i32>,
18    /// Maximum transaction size
19    #[serde(rename = "max_tx_size", deserialize_with = "Option::deserialize")]
20    pub max_tx_size: Option<i32>,
21    /// Maximum block header size
22    #[serde(rename = "max_block_header_size", deserialize_with = "Option::deserialize")]
23    pub max_block_header_size: Option<i32>,
24    /// The amount of a key registration deposit in Lovelaces
25    #[serde(rename = "key_deposit", deserialize_with = "Option::deserialize")]
26    pub key_deposit: Option<String>,
27    /// The amount of a pool registration deposit in Lovelaces
28    #[serde(rename = "pool_deposit", deserialize_with = "Option::deserialize")]
29    pub pool_deposit: Option<String>,
30    /// Epoch bound on pool retirement
31    #[serde(rename = "e_max", deserialize_with = "Option::deserialize")]
32    pub e_max: Option<i32>,
33    /// Desired number of pools
34    #[serde(rename = "n_opt", deserialize_with = "Option::deserialize")]
35    pub n_opt: Option<i32>,
36    /// Pool pledge influence
37    #[serde(rename = "a0", deserialize_with = "Option::deserialize")]
38    pub a0: Option<f64>,
39    /// Monetary expansion
40    #[serde(rename = "rho", deserialize_with = "Option::deserialize")]
41    pub rho: Option<f64>,
42    /// Treasury expansion
43    #[serde(rename = "tau", deserialize_with = "Option::deserialize")]
44    pub tau: Option<f64>,
45    /// Percentage of blocks produced by federated nodes
46    #[serde(rename = "decentralisation_param", deserialize_with = "Option::deserialize")]
47    pub decentralisation_param: Option<f64>,
48    /// Seed for extra entropy
49    #[serde(rename = "extra_entropy", deserialize_with = "Option::deserialize")]
50    pub extra_entropy: Option<String>,
51    /// Accepted protocol major version
52    #[serde(rename = "protocol_major_ver", deserialize_with = "Option::deserialize")]
53    pub protocol_major_ver: Option<i32>,
54    /// Accepted protocol minor version
55    #[serde(rename = "protocol_minor_ver", deserialize_with = "Option::deserialize")]
56    pub protocol_minor_ver: Option<i32>,
57    /// Minimum UTXO value
58    #[serde(rename = "min_utxo", deserialize_with = "Option::deserialize")]
59    pub min_utxo: Option<String>,
60    /// Minimum stake cost forced on the pool
61    #[serde(rename = "min_pool_cost", deserialize_with = "Option::deserialize")]
62    pub min_pool_cost: Option<String>,
63    /// Cost models parameters for Plutus Core scripts in raw list form
64    #[serde(rename = "cost_models", deserialize_with = "Option::deserialize")]
65    pub cost_models: Option<std::collections::HashMap<String, serde_json::Value>>,
66    /// The per word cost of script memory usage
67    #[serde(rename = "price_mem", deserialize_with = "Option::deserialize")]
68    pub price_mem: Option<f64>,
69    /// The cost of script execution step usage
70    #[serde(rename = "price_step", deserialize_with = "Option::deserialize")]
71    pub price_step: Option<f64>,
72    /// The maximum number of execution memory allowed to be used in a single transaction
73    #[serde(rename = "max_tx_ex_mem", deserialize_with = "Option::deserialize")]
74    pub max_tx_ex_mem: Option<String>,
75    /// The maximum number of execution steps allowed to be used in a single transaction
76    #[serde(rename = "max_tx_ex_steps", deserialize_with = "Option::deserialize")]
77    pub max_tx_ex_steps: Option<String>,
78    /// The maximum number of execution memory allowed to be used in a single block
79    #[serde(rename = "max_block_ex_mem", deserialize_with = "Option::deserialize")]
80    pub max_block_ex_mem: Option<String>,
81    /// The maximum number of execution steps allowed to be used in a single block
82    #[serde(rename = "max_block_ex_steps", deserialize_with = "Option::deserialize")]
83    pub max_block_ex_steps: Option<String>,
84    /// The maximum Val size
85    #[serde(rename = "max_val_size", deserialize_with = "Option::deserialize")]
86    pub max_val_size: Option<String>,
87    /// The percentage of the transactions fee which must be provided as collateral when including non-native scripts
88    #[serde(rename = "collateral_percent", deserialize_with = "Option::deserialize")]
89    pub collateral_percent: Option<i32>,
90    /// The maximum number of collateral inputs allowed in a transaction
91    #[serde(rename = "max_collateral_inputs", deserialize_with = "Option::deserialize")]
92    pub max_collateral_inputs: Option<i32>,
93    /// Cost per UTxO word for Alonzo. Cost per UTxO byte for Babbage and later.
94    #[serde(rename = "coins_per_utxo_size", deserialize_with = "Option::deserialize")]
95    pub coins_per_utxo_size: Option<String>,
96    /// Cost per UTxO word for Alonzo. Cost per UTxO byte for Babbage and later.
97    #[serde(rename = "coins_per_utxo_word", deserialize_with = "Option::deserialize")]
98    pub coins_per_utxo_word: Option<String>,
99    /// Pool Voting threshold for motion of no-confidence. New in 13.2-Conway.
100    #[serde(rename = "pvt_motion_no_confidence", deserialize_with = "Option::deserialize")]
101    pub pvt_motion_no_confidence: Option<f64>,
102    /// Pool Voting threshold for new committee/threshold (normal state). New in 13.2-Conway.
103    #[serde(rename = "pvt_committee_normal", deserialize_with = "Option::deserialize")]
104    pub pvt_committee_normal: Option<f64>,
105    /// Pool Voting threshold for new committee/threshold (state of no-confidence). New in 13.2-Conway.
106    #[serde(rename = "pvt_committee_no_confidence", deserialize_with = "Option::deserialize")]
107    pub pvt_committee_no_confidence: Option<f64>,
108    /// Pool Voting threshold for hard-fork initiation. New in 13.2-Conway.
109    #[serde(rename = "pvt_hard_fork_initiation", deserialize_with = "Option::deserialize")]
110    pub pvt_hard_fork_initiation: Option<f64>,
111    /// DRep Vote threshold for motion of no-confidence. New in 13.2-Conway.
112    #[serde(rename = "dvt_motion_no_confidence", deserialize_with = "Option::deserialize")]
113    pub dvt_motion_no_confidence: Option<f64>,
114    /// DRep Vote threshold for new committee/threshold (normal state). New in 13.2-Conway.
115    #[serde(rename = "dvt_committee_normal", deserialize_with = "Option::deserialize")]
116    pub dvt_committee_normal: Option<f64>,
117    /// DRep Vote threshold for new committee/threshold (state of no-confidence). New in 13.2-Conway.
118    #[serde(rename = "dvt_committee_no_confidence", deserialize_with = "Option::deserialize")]
119    pub dvt_committee_no_confidence: Option<f64>,
120    /// DRep Vote threshold for update to the Constitution. New in 13.2-Conway.
121    #[serde(rename = "dvt_update_to_constitution", deserialize_with = "Option::deserialize")]
122    pub dvt_update_to_constitution: Option<f64>,
123    /// DRep Vote threshold for hard-fork initiation. New in 13.2-Conway.
124    #[serde(rename = "dvt_hard_fork_initiation", deserialize_with = "Option::deserialize")]
125    pub dvt_hard_fork_initiation: Option<f64>,
126    /// DRep Vote threshold for protocol parameter changes, network group. New in 13.2-Conway.
127    #[serde(rename = "dvt_p_p_network_group", deserialize_with = "Option::deserialize")]
128    pub dvt_p_p_network_group: Option<f64>,
129    /// DRep Vote threshold for protocol parameter changes, economic group. New in 13.2-Conway.
130    #[serde(rename = "dvt_p_p_economic_group", deserialize_with = "Option::deserialize")]
131    pub dvt_p_p_economic_group: Option<f64>,
132    /// DRep Vote threshold for protocol parameter changes, technical group. New in 13.2-Conway.
133    #[serde(rename = "dvt_p_p_technical_group", deserialize_with = "Option::deserialize")]
134    pub dvt_p_p_technical_group: Option<f64>,
135    /// DRep Vote threshold for protocol parameter changes, governance group. New in 13.2-Conway.
136    #[serde(rename = "dvt_p_p_gov_group", deserialize_with = "Option::deserialize")]
137    pub dvt_p_p_gov_group: Option<f64>,
138    /// DRep Vote threshold for treasury withdrawal. New in 13.2-Conway.
139    #[serde(rename = "dvt_treasury_withdrawal", deserialize_with = "Option::deserialize")]
140    pub dvt_treasury_withdrawal: Option<f64>,
141    /// Minimal constitutional committee size. New in 13.2-Conway.
142    #[serde(rename = "committee_min_size", deserialize_with = "Option::deserialize")]
143    pub committee_min_size: Option<String>,
144    /// Constitutional committee term limits. New in 13.2-Conway.
145    #[serde(rename = "committee_max_term_length", deserialize_with = "Option::deserialize")]
146    pub committee_max_term_length: Option<String>,
147    /// Governance action expiration. New in 13.2-Conway.
148    #[serde(rename = "gov_action_lifetime", deserialize_with = "Option::deserialize")]
149    pub gov_action_lifetime: Option<String>,
150    /// Governance action deposit. New in 13.2-Conway.
151    #[serde(rename = "gov_action_deposit", deserialize_with = "Option::deserialize")]
152    pub gov_action_deposit: Option<String>,
153    /// DRep deposit amount. New in 13.2-Conway.
154    #[serde(rename = "drep_deposit", deserialize_with = "Option::deserialize")]
155    pub drep_deposit: Option<String>,
156    /// DRep activity period. New in 13.2-Conway.
157    #[serde(rename = "drep_activity", deserialize_with = "Option::deserialize")]
158    pub drep_activity: Option<String>,
159    /// Pool Voting threshold for security-relevant protocol parameters changes. Renamed to pvt_p_p_security_group.
160    #[serde(rename = "pvtpp_security_group", deserialize_with = "Option::deserialize")]
161    pub pvtpp_security_group: Option<f64>,
162    /// Pool Voting threshold for security-relevant protocol parameters changes.
163    #[serde(rename = "pvt_p_p_security_group", deserialize_with = "Option::deserialize")]
164    pub pvt_p_p_security_group: Option<f64>,
165    #[serde(rename = "min_fee_ref_script_cost_per_byte", deserialize_with = "Option::deserialize")]
166    pub min_fee_ref_script_cost_per_byte: Option<f64>,
167}
168
169impl ProposalParametersParameters {
170    pub fn new(min_fee_a: Option<i32>, min_fee_b: Option<i32>, max_block_size: Option<i32>, max_tx_size: Option<i32>, max_block_header_size: Option<i32>, key_deposit: Option<String>, pool_deposit: Option<String>, e_max: Option<i32>, n_opt: Option<i32>, a0: Option<f64>, rho: Option<f64>, tau: Option<f64>, decentralisation_param: Option<f64>, extra_entropy: Option<String>, protocol_major_ver: Option<i32>, protocol_minor_ver: Option<i32>, min_utxo: Option<String>, min_pool_cost: Option<String>, cost_models: Option<std::collections::HashMap<String, serde_json::Value>>, price_mem: Option<f64>, price_step: Option<f64>, max_tx_ex_mem: Option<String>, max_tx_ex_steps: Option<String>, max_block_ex_mem: Option<String>, max_block_ex_steps: Option<String>, max_val_size: Option<String>, collateral_percent: Option<i32>, max_collateral_inputs: Option<i32>, coins_per_utxo_size: Option<String>, coins_per_utxo_word: Option<String>, pvt_motion_no_confidence: Option<f64>, pvt_committee_normal: Option<f64>, pvt_committee_no_confidence: Option<f64>, pvt_hard_fork_initiation: Option<f64>, dvt_motion_no_confidence: Option<f64>, dvt_committee_normal: Option<f64>, dvt_committee_no_confidence: Option<f64>, dvt_update_to_constitution: Option<f64>, dvt_hard_fork_initiation: Option<f64>, dvt_p_p_network_group: Option<f64>, dvt_p_p_economic_group: Option<f64>, dvt_p_p_technical_group: Option<f64>, dvt_p_p_gov_group: Option<f64>, dvt_treasury_withdrawal: Option<f64>, committee_min_size: Option<String>, committee_max_term_length: Option<String>, gov_action_lifetime: Option<String>, gov_action_deposit: Option<String>, drep_deposit: Option<String>, drep_activity: Option<String>, pvtpp_security_group: Option<f64>, pvt_p_p_security_group: Option<f64>, min_fee_ref_script_cost_per_byte: Option<f64>) -> ProposalParametersParameters {
171        ProposalParametersParameters {
172            epoch: None,
173            min_fee_a,
174            min_fee_b,
175            max_block_size,
176            max_tx_size,
177            max_block_header_size,
178            key_deposit,
179            pool_deposit,
180            e_max,
181            n_opt,
182            a0,
183            rho,
184            tau,
185            decentralisation_param,
186            extra_entropy,
187            protocol_major_ver,
188            protocol_minor_ver,
189            min_utxo,
190            min_pool_cost,
191            cost_models,
192            price_mem,
193            price_step,
194            max_tx_ex_mem,
195            max_tx_ex_steps,
196            max_block_ex_mem,
197            max_block_ex_steps,
198            max_val_size,
199            collateral_percent,
200            max_collateral_inputs,
201            coins_per_utxo_size,
202            coins_per_utxo_word,
203            pvt_motion_no_confidence,
204            pvt_committee_normal,
205            pvt_committee_no_confidence,
206            pvt_hard_fork_initiation,
207            dvt_motion_no_confidence,
208            dvt_committee_normal,
209            dvt_committee_no_confidence,
210            dvt_update_to_constitution,
211            dvt_hard_fork_initiation,
212            dvt_p_p_network_group,
213            dvt_p_p_economic_group,
214            dvt_p_p_technical_group,
215            dvt_p_p_gov_group,
216            dvt_treasury_withdrawal,
217            committee_min_size,
218            committee_max_term_length,
219            gov_action_lifetime,
220            gov_action_deposit,
221            drep_deposit,
222            drep_activity,
223            pvtpp_security_group,
224            pvt_p_p_security_group,
225            min_fee_ref_script_cost_per_byte,
226        }
227    }
228}
229