blockchain height endpoint
This commit is contained in:
parent
f7ec6e3a0b
commit
b2731e59f1
|
@ -168,6 +168,20 @@ Insight.prototype.estimateFee = function(nbBlocks, cb) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Insight.prototype.getBlockchainHeight = function(cb) {
|
||||||
|
var path = this.apiPrefix + '/sync';
|
||||||
|
|
||||||
|
var args = {
|
||||||
|
method: 'GET',
|
||||||
|
path: path,
|
||||||
|
json: true,
|
||||||
|
};
|
||||||
|
this._doRequest(args, function(err, res, body) {
|
||||||
|
if (err || res.statusCode !== 200) return cb(_parseErr(err, res));
|
||||||
|
return cb(null, body.blockChainHeight);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Insight.prototype.initSocket = function() {
|
Insight.prototype.initSocket = function() {
|
||||||
|
|
||||||
// sockets always use the first server on the pull
|
// sockets always use the first server on the pull
|
||||||
|
|
Loading…
Reference in New Issue