feat: add transactions method on wallet

This commit is contained in:
Matthew
2023-12-07 13:24:39 -06:00
parent bbc6e1a43c
commit a1a45996fc
6 changed files with 46 additions and 1 deletions

View File

@@ -109,6 +109,8 @@ interface Wallet {
boolean sign(PartiallySignedTransaction psbt);
SentAndReceivedValues sent_and_received([ByRef] Transaction tx);
sequence<Transaction> transactions();
};
interface Update {};

View File

@@ -99,6 +99,13 @@ impl Wallet {
let (sent, received): (u64, u64) = self.get_wallet().sent_and_received(&tx.clone().into());
SentAndReceivedValues { sent, received }
}
pub fn transactions(&self) -> Vec<Arc<Transaction>> {
self.get_wallet()
.transactions()
.map(|tx| Arc::new(tx.tx_node.tx.clone().into()))
.collect()
}
}
pub struct SentAndReceivedValues {