Skip to main content

blockfrost_openapi/models/
script_utxos_inner.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5pub struct ScriptUtxosInner {
6    /// Bech32 encoded address of the UTXO holding the reference script
7    #[serde(rename = "address")]
8    pub address: String,
9    /// Transaction hash of the UTXO
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    #[serde(rename = "amount")]
16    pub amount: Vec<models::TxContentOutputAmountInner>,
17    /// Block hash of the UTXO
18    #[serde(rename = "block")]
19    pub block: String,
20    /// The hash of the transaction output datum
21    #[serde(rename = "data_hash", deserialize_with = "Option::deserialize")]
22    pub data_hash: Option<String>,
23    /// CBOR encoded inline datum
24    #[serde(rename = "inline_datum", deserialize_with = "Option::deserialize")]
25    pub inline_datum: Option<String>,
26    /// The hash of the reference script of the output. Equals the queried script hash.
27    #[serde(rename = "reference_script_hash")]
28    pub reference_script_hash: String,
29}
30
31impl ScriptUtxosInner {
32    pub fn new(address: String, tx_hash: String, output_index: i32, amount: Vec<models::TxContentOutputAmountInner>, block: String, data_hash: Option<String>, inline_datum: Option<String>, reference_script_hash: String) -> ScriptUtxosInner {
33        ScriptUtxosInner {
34            address,
35            tx_hash,
36            output_index,
37            amount,
38            block,
39            data_hash,
40            inline_datum,
41            reference_script_hash,
42        }
43    }
44}
45