Skip to content

Commit

Permalink
Add counterparty option to getTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Clark committed Jul 9, 2015
1 parent 1068b68 commit 941aaf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api/common/schemas/transactions-options.json
Expand Up @@ -15,6 +15,7 @@
"excludeFailures": {"type": "boolean"},
"outgoing": {"type": "boolean"},
"incoming": {"type": "boolean"},
"counterparty": {"$ref": "address"},
"types": {
"type": "array",
"items": {
Expand Down
4 changes: 4 additions & 0 deletions src/api/ledger/transactions.js
Expand Up @@ -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;
}

Expand Down

0 comments on commit 941aaf6

Please sign in to comment.