diff --git a/zingolib/src/lightclient/describe.rs b/zingolib/src/lightclient/describe.rs index 90c01a769..425333ad6 100644 --- a/zingolib/src/lightclient/describe.rs +++ b/zingolib/src/lightclient/describe.rs @@ -583,8 +583,10 @@ impl LightClient { } /// TODO: doc comment - pub async fn value_transfers_json_string(&self) -> String { - json::JsonValue::from(self.sorted_value_transfers(true).await).pretty(2) + pub async fn value_transfers_json_string(&self, recent_vts_to_retrieve: usize) -> String { + let sorted_vts = self.sorted_value_transfers(true).await; + let subset = &sorted_vts.as_slice()[..recent_vts_to_retrieve]; + json::JsonValue::from(subset).pretty(2) } /// Provides a list of transaction summaries related to this wallet in order of blockheight diff --git a/zingolib/src/wallet/data.rs b/zingolib/src/wallet/data.rs index 16045c8d2..724f4bd41 100644 --- a/zingolib/src/wallet/data.rs +++ b/zingolib/src/wallet/data.rs @@ -518,7 +518,7 @@ pub mod summaries { /// A value transfer is a note group abstraction. /// A group of all notes sent to a specific address in a transaction. - #[derive(PartialEq)] + #[derive(Clone, PartialEq)] pub struct ValueTransfer { txid: TxId, datetime: u64,