mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-24 22:25:48 +00:00
Rename "incoming"/"outgoing" to "initiated"
This commit is contained in:
@@ -13,8 +13,7 @@
|
|||||||
"maxLedgerVersion": {"$ref": "ledgerVersion"},
|
"maxLedgerVersion": {"$ref": "ledgerVersion"},
|
||||||
"earliestFirst": {"type": "boolean"},
|
"earliestFirst": {"type": "boolean"},
|
||||||
"excludeFailures": {"type": "boolean"},
|
"excludeFailures": {"type": "boolean"},
|
||||||
"outgoing": {"type": "boolean"},
|
"initiated": {"type": "boolean"},
|
||||||
"incoming": {"type": "boolean"},
|
|
||||||
"counterparty": {"$ref": "address"},
|
"counterparty": {"$ref": "address"},
|
||||||
"types": {
|
"types": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ function transactionFilter(address, filters, tx) {
|
|||||||
if (filters.types && !_.includes(filters.types, tx.type)) {
|
if (filters.types && !_.includes(filters.types, tx.type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (filters.outgoing && tx.address !== address) {
|
if (filters.initiated === true && tx.address !== address) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (filters.incoming && tx.address === address) {
|
if (filters.initiated === false && tx.address === address) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (filters.counterparty && tx.address !== filters.counterparty
|
if (filters.counterparty && tx.address !== filters.counterparty
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ describe('RippleAPI', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('getTransactions', function(done) {
|
it('getTransactions', function(done) {
|
||||||
const options = {types: ['payment', 'order'], outgoing: true, limit: 2};
|
const options = {types: ['payment', 'order'], initiated: true, limit: 2};
|
||||||
this.api.getTransactions(address, options,
|
this.api.getTransactions(address, options,
|
||||||
_.partial(checkResult, responses.getTransactions, done));
|
_.partial(checkResult, responses.getTransactions, done));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user