diff --git a/src/api/common/schemas/transactions-options.json b/src/api/common/schemas/transactions-options.json index 922c718c..715b7448 100644 --- a/src/api/common/schemas/transactions-options.json +++ b/src/api/common/schemas/transactions-options.json @@ -15,6 +15,7 @@ "excludeFailures": {"type": "boolean"}, "outgoing": {"type": "boolean"}, "incoming": {"type": "boolean"}, + "counterparty": {"$ref": "address"}, "types": { "type": "array", "items": { diff --git a/src/api/ledger/transactions.js b/src/api/ledger/transactions.js index 76c0b5e5..59cb477a 100644 --- a/src/api/ledger/transactions.js +++ b/src/api/ledger/transactions.js @@ -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; }