use serde::{Deserialize, Serialize};
-/// Types of script
+/// Types of keychains
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum KeychainKind {
/// External
}
impl KeychainKind {
+ /// Return [`KeychainKind`] as a byte
pub fn as_byte(&self) -> u8 {
match self {
KeychainKind::External => b'e',
/// A wallet unspent output
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct UTXO {
+ /// Reference to a transaction output
pub outpoint: OutPoint,
+ /// Transaction output
pub txout: TxOut,
+ /// Type of keychain
pub keychain: KeychainKind,
}
/// A wallet transaction
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default)]
pub struct TransactionDetails {
+ /// Optional transaction
pub transaction: Option<Transaction>,
+ /// Transaction id
pub txid: Txid,
+ /// Timestamp
pub timestamp: u64,
+ /// Received value (sats)
pub received: u64,
+ /// Sent value (sats)
pub sent: u64,
+ /// Fee value (sats)
pub fees: u64,
+ /// Confirmed in block height, `None` means unconfirmed
pub height: Option<u32>,
}