Skip to main content

blockfrost_openapi/models/
mempool_tx_content_inputs_inner.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct MempoolTxContentInputsInner {
6    /// Input address
7    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
8    pub address: Option<String>,
9    /// Hash of the UTXO transaction
10    #[serde(rename = "tx_hash")]
11    pub tx_hash: String,
12    /// UTXO index in the transaction
13    #[serde(rename = "output_index")]
14    pub output_index: i32,
15    /// Whether the input is a collateral consumed on script validation failure
16    #[serde(rename = "collateral")]
17    pub collateral: bool,
18    /// Whether the input is a reference transaction input
19    #[serde(rename = "reference", skip_serializing_if = "Option::is_none")]
20    pub reference: Option<bool>,
21}
22
23impl MempoolTxContentInputsInner {
24    pub fn new(tx_hash: String, output_index: i32, collateral: bool) -> MempoolTxContentInputsInner {
25        MempoolTxContentInputsInner {
26            address: None,
27            tx_hash,
28            output_index,
29            collateral,
30            reference: None,
31        }
32    }
33}
34