feat: add transactions method on wallet
This commit is contained in:
@@ -109,6 +109,8 @@ interface Wallet {
|
||||
boolean sign(PartiallySignedTransaction psbt);
|
||||
|
||||
SentAndReceivedValues sent_and_received([ByRef] Transaction tx);
|
||||
|
||||
sequence<Transaction> transactions();
|
||||
};
|
||||
|
||||
interface Update {};
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user