Adding latest blocks and transactions to dashboard.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { TransactionExtended } from '../interfaces';
|
||||
import { Transaction, TransactionExtended, TransactionStripped } from '../interfaces';
|
||||
|
||||
export class Common {
|
||||
static median(numbers: number[]) {
|
||||
@@ -47,4 +47,13 @@ export class Common {
|
||||
});
|
||||
return matches;
|
||||
}
|
||||
|
||||
static stripTransaction(tx: TransactionExtended): TransactionStripped {
|
||||
return {
|
||||
txid: tx.txid,
|
||||
fee: tx.fee,
|
||||
weight: tx.weight,
|
||||
value: tx.vin.reduce((acc, vin) => acc + (vin.prevout ? vin.prevout.value : 0), 0),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user