flosight-api/app/models/Utils.js
2015-07-15 16:20:27 -03:00

23 lines
490 B
JavaScript

'use strict';
//var imports = require('soop').imports();
var bitcore = require('bitcore');
var RpcClient = bitcore.RpcClient;
var config = require('../../config/config');
var rpc = new RpcClient(config.bitcoind);
function Utils() {}
Utils.prototype.estimateFee = function(n, next) {
var that = this;
rpc.estimateFee(n, function(err, info) {
if (err) return next(err);
that.feePerKB = info.result;
return next();
});
};
module.exports = require('soop')(Utils);