esplora_btc_api/models/
transaction.rs

1/*
2 * Blockstream Esplora HTTP API
3 *
4 * JSON over RESTful HTTP. Amounts are always represented in satoshis.
5 *
6 * The version of the OpenAPI document: 1.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Transaction {
16    #[serde(rename = "txid")]
17    pub txid: String,
18    #[serde(rename = "version")]
19    pub version: f32,
20    #[serde(rename = "locktime", skip_serializing_if = "Option::is_none")]
21    pub locktime: Option<f32>,
22    #[serde(rename = "vin", skip_serializing_if = "Option::is_none")]
23    pub vin: Option<Vec<crate::models::Vin>>,
24    #[serde(rename = "vout", skip_serializing_if = "Option::is_none")]
25    pub vout: Option<Vec<crate::models::VOut>>,
26    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
27    pub size: Option<f32>,
28    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
29    pub weight: Option<f32>,
30    #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
31    pub fee: Option<f32>,
32    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
33    pub status: Option<Box<crate::models::Status>>,
34}
35
36impl Transaction {
37    pub fn new(txid: String, version: f32) -> Transaction {
38        Transaction {
39            txid,
40            version,
41            locktime: None,
42            vin: None,
43            vout: None,
44            size: None,
45            weight: None,
46            fee: None,
47            status: None,
48        }
49    }
50}
51
52