whisky_provider/blockfrost/models/
utxo.rs1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Deserialize, Debug, PartialEq, Clone, Serialize)]
6pub struct Asset {
7 pub unit: String,
8 pub quantity: String,
9}
10#[derive(Deserialize, Debug, Clone)]
11pub struct BlockfrostUtxo {
12 #[serde(rename = "address")]
14 pub address: String,
15 #[serde(rename = "tx_hash")]
17 pub tx_hash: String,
18 #[serde(rename = "tx_index")]
20 pub tx_index: i32,
21 #[serde(rename = "output_index")]
23 pub output_index: i32,
24 #[serde(rename = "amount")]
25 pub amount: Vec<Asset>,
26 #[serde(rename = "block")]
28 pub block: String,
29 #[serde(rename = "data_hash", deserialize_with = "Option::deserialize")]
31 pub data_hash: Option<String>,
32 #[serde(rename = "inline_datum", deserialize_with = "Option::deserialize")]
34 pub inline_datum: Option<String>,
35 #[serde(
37 rename = "reference_script_hash",
38 deserialize_with = "Option::deserialize"
39 )]
40 pub reference_script_hash: Option<String>,
41}
42
43#[derive(Deserialize, Debug, Clone)]
44pub struct ReferenceScript {
45 pub bytes: String,
46 pub hash: String,
47 pub json: Option<HashMap<String, serde_json::Value>>,
48 pub r#type: String,
49}