mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-24 14:15:49 +00:00
Get all results when limit is not specified
This commit is contained in:
@@ -10,7 +10,7 @@ function requestAccountOffers(remote, address, ledgerVersion, options,
|
||||
remote.requestAccountOffers({
|
||||
account: address,
|
||||
marker: marker,
|
||||
limit: limit,
|
||||
limit: utils.clamp(limit, 10, 400),
|
||||
ledger: ledgerVersion
|
||||
},
|
||||
composeAsync((data) => ({
|
||||
@@ -23,13 +23,11 @@ function getAccountOrders(account, options, callback) {
|
||||
validate.address(account);
|
||||
validate.options(options);
|
||||
|
||||
const defaultLimit = 100;
|
||||
const limit = options.limit || defaultLimit;
|
||||
const ledgerVersion = options.ledgerVersion
|
||||
|| this.remote.getLedgerSequence();
|
||||
const getter = _.partial(requestAccountOffers, this.remote, account,
|
||||
ledgerVersion, options);
|
||||
utils.getRecursive(getter, limit,
|
||||
utils.getRecursive(getter, options.limit,
|
||||
composeAsync((orders) => _.sortBy(orders,
|
||||
(order) => order.properties.sequence), callback));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user