Bisq: Feature to filter transaction types.

This commit is contained in:
softsimon
2020-07-24 18:41:15 +07:00
parent 24182a6fb3
commit 7f71781916
8 changed files with 166 additions and 46 deletions

View File

@@ -39,8 +39,12 @@ class Bisq {
return this.transactionIndex[txId];
}
getTransactions(start: number, length: number): [BisqTransaction[], number] {
return [this.transactions.slice(start, length + start), this.transactions.length];
getTransactions(start: number, length: number, types: string[]): [BisqTransaction[], number] {
let transactions = this.transactions;
if (types.length) {
transactions = transactions.filter((tx) => types.indexOf(tx.txType) > -1);
}
return [transactions.slice(start, length + start), transactions.length];
}
getBlock(hash: string): BisqBlock | undefined {