mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-26 07:05:49 +00:00
Add counterparty option to getTransactions
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"excludeFailures": {"type": "boolean"},
|
||||
"outgoing": {"type": "boolean"},
|
||||
"incoming": {"type": "boolean"},
|
||||
"counterparty": {"$ref": "address"},
|
||||
"types": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
@@ -27,6 +27,10 @@ function transactionFilter(address, filters, tx) {
|
||||
if (filters.incoming && tx.address === address) {
|
||||
return false;
|
||||
}
|
||||
if (filters.counterparty && tx.address !== filters.counterparty
|
||||
&& tx.Destination !== filters.counterparty) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user