nut08 change amount

This commit is contained in:
thesimplekid
2023-07-03 23:27:25 -04:00
parent e8303fcc8c
commit eb31150031

View File

@@ -40,3 +40,12 @@ pub struct MeltResponse {
pub preimage: Option<String>,
pub change: Option<Vec<BlindedSignature>>,
}
impl MeltResponse {
pub fn change_amount(&self) -> Amount {
match &self.change {
Some(change) => change.iter().map(|c| c.amount).sum(),
None => Amount::ZERO,
}
}
}