Skip to main content

ark_rest/models/
tx_notification.rs

1/*
2 * Ark API
3 *
4 * Combined Ark Service, Indexer, Admin, Signer Manager, and Wallet API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::Deserialize;
13use serde::Serialize;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TxNotification {
17    /// This field is set only in case of offchain tx.  key: outpoint, value: checkpoint txid
18    #[serde(rename = "checkpointTxs", skip_serializing_if = "Option::is_none")]
19    pub checkpoint_txs: Option<std::collections::HashMap<String, models::TxData>>,
20    #[serde(rename = "spendableVtxos", skip_serializing_if = "Option::is_none")]
21    pub spendable_vtxos: Option<Vec<models::Vtxo>>,
22    #[serde(rename = "spentVtxos", skip_serializing_if = "Option::is_none")]
23    pub spent_vtxos: Option<Vec<models::Vtxo>>,
24    #[serde(rename = "sweptVtxos", skip_serializing_if = "Option::is_none")]
25    pub swept_vtxos: Option<Vec<models::Outpoint>>,
26    #[serde(rename = "tx", skip_serializing_if = "Option::is_none")]
27    pub tx: Option<String>,
28    #[serde(rename = "txid", skip_serializing_if = "Option::is_none")]
29    pub txid: Option<String>,
30}
31
32impl TxNotification {
33    pub fn new() -> TxNotification {
34        TxNotification {
35            checkpoint_txs: None,
36            spendable_vtxos: None,
37            spent_vtxos: None,
38            swept_vtxos: None,
39            tx: None,
40            txid: None,
41        }
42    }
43}