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