Skip to content

Commit 0df0128

Browse files
committed
feat(api): create MempoolRecentTx struct
1 parent 1cd9946 commit 0df0128

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/api.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,19 @@ pub struct MempoolStats {
246246
pub fee_histogram: Vec<(f64, usize)>,
247247
}
248248

249+
/// A [`Transaction`] that recently entered the mempool.
250+
#[derive(Clone, Debug, PartialEq, Eq, Deserialize)]
251+
pub struct MempoolRecentTx {
252+
/// Transaction ID as a [`Txid`].
253+
pub txid: Txid,
254+
/// [`Amount`] of fees paid by the transaction, in satoshis.
255+
pub fee: u64,
256+
/// The transaction size, in virtual bytes.
257+
pub vsize: usize,
258+
/// Combined [`Amount`] of the transaction, in satoshis.
259+
pub value: u64,
260+
}
261+
249262
impl Tx {
250263
pub fn to_tx(&self) -> Transaction {
251264
Transaction {

0 commit comments

Comments
 (0)