using paginated version of insight-api addrs/txs

This commit is contained in:
Ivan Socolsky 2014-11-17 18:28:01 -03:00
commit 18deef115a
5 changed files with 60 additions and 34 deletions

View file

@ -269,11 +269,14 @@ Insight.prototype.getTransaction = function(txid, cb) {
});
};
Insight.prototype.getTransactions = function (addresses, cb) {
Insight.prototype.getTransactions = function (addresses, from, to, cb) {
preconditions.shouldBeArray(addresses);
preconditions.shouldBeFunction(cb);
this.requestPost('/api/addrs/txs', {
var qs = '?from=' + (from || 0);
if (to) qs += '&to=' + to;
this.requestPost('/api/addrs/txs' + qs, {
addrs: addresses.join(',')
}, function (err, res, txs) {
if (err || res.statusCode != 200) return cb(err || res);