File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ enum Commands {
210
210
/// List last transactions
211
211
#[ command( name = "listtransactions" ) ]
212
212
ListTransactions {
213
- #[ arg( default_value = "1 " ) ]
213
+ #[ arg( default_value = "10 " ) ]
214
214
count : usize ,
215
215
#[ arg( default_value = "0" ) ]
216
216
skip : usize ,
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ pub struct TxResponse {
54
54
pub struct TxInfo {
55
55
pub txid : Txid ,
56
56
pub confirmed : bool ,
57
+ pub sent : Amount ,
58
+ pub received : Amount ,
59
+ pub fee : Option < Amount > ,
57
60
}
58
61
59
62
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -402,10 +405,19 @@ impl RpcWallet {
402
405
. into_iter ( )
403
406
. skip ( skip)
404
407
. take ( count)
405
- . map ( |tx| {
406
- let txid = tx. tx_node . txid . clone ( ) ;
407
- let confirmed = tx. chain_position . is_confirmed ( ) ;
408
- TxInfo { txid, confirmed }
408
+ . map ( |ctx| {
409
+ let tx = ctx. tx_node . tx ;
410
+ let txid = ctx. tx_node . txid . clone ( ) ;
411
+ let confirmed = ctx. chain_position . is_confirmed ( ) ;
412
+ let ( sent, received) = wallet. spaces . sent_and_received ( & tx) ;
413
+ let fee = wallet. spaces . calculate_fee ( & tx) . ok ( ) ;
414
+ TxInfo {
415
+ txid,
416
+ confirmed,
417
+ sent,
418
+ received,
419
+ fee,
420
+ }
409
421
} )
410
422
. collect ( ) ;
411
423
Ok ( transactions)
You can’t perform that action at this time.
0 commit comments