Skip to main content

blockfrost_openapi/models/
mempool_tx_content_outputs_inner.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct MempoolTxContentOutputsInner {
6    /// Output address
7    #[serde(rename = "address")]
8    pub address: String,
9    #[serde(rename = "amount")]
10    pub amount: Vec<models::TxContentOutputAmountInner>,
11    /// UTXO index in the transaction
12    #[serde(rename = "output_index")]
13    pub output_index: i32,
14    /// The hash of the transaction output datum
15    #[serde(rename = "data_hash", deserialize_with = "Option::deserialize")]
16    pub data_hash: Option<String>,
17    /// CBOR encoded inline datum
18    #[serde(rename = "inline_datum", deserialize_with = "Option::deserialize")]
19    pub inline_datum: Option<String>,
20    /// Whether the output is a collateral output
21    #[serde(rename = "collateral")]
22    pub collateral: bool,
23    /// The hash of the reference script of the output
24    #[serde(rename = "reference_script_hash", deserialize_with = "Option::deserialize")]
25    pub reference_script_hash: Option<String>,
26}
27
28impl MempoolTxContentOutputsInner {
29    pub fn new(address: String, amount: Vec<models::TxContentOutputAmountInner>, output_index: i32, data_hash: Option<String>, inline_datum: Option<String>, collateral: bool, reference_script_hash: Option<String>) -> MempoolTxContentOutputsInner {
30        MempoolTxContentOutputsInner {
31            address,
32            amount,
33            output_index,
34            data_hash,
35            inline_datum,
36            collateral,
37            reference_script_hash,
38        }
39    }
40}
41