style(jshint): jshint compatibility ensured
This commit is contained in:
parent
291bf21bc3
commit
1a32b5913e
2 changed files with 30 additions and 26 deletions
|
|
@ -37,7 +37,7 @@ exports.init = function init(databaseHandle) {
|
|||
}
|
||||
|
||||
db = databaseHandle;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function loadPlugin(name, config) {
|
||||
|
|
@ -91,7 +91,7 @@ function loadPlugin(name, config) {
|
|||
|
||||
|
||||
return plugin;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
exports.configure = function configure(config) {
|
||||
|
|
@ -100,7 +100,7 @@ exports.configure = function configure(config) {
|
|||
}
|
||||
|
||||
deviceCurrency = config.exchanges.settings.currency;
|
||||
var plugins = config.exchanges.plugins
|
||||
var plugins = config.exchanges.plugins;
|
||||
|
||||
// [required] configure (or load) ticker
|
||||
var tickerName = plugins.current.ticker;
|
||||
|
|
@ -272,7 +272,7 @@ function stopPolling() {
|
|||
clearInterval(balanceInterval);
|
||||
clearInterval(rateInterval);
|
||||
// clearInterval(tradeInterval); // TODO: should this get cleared too?
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function pollBalance(callback) {
|
||||
|
|
@ -300,7 +300,7 @@ function pollBalance(callback) {
|
|||
|
||||
return callback && callback(null, lastBalances);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function pollRate(callback) {
|
||||
logger.debug('polling for rates');
|
||||
|
|
@ -317,7 +317,7 @@ function pollRate(callback) {
|
|||
|
||||
return callback && callback(null, lastRates);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -330,7 +330,7 @@ function getLastRate(currency) {
|
|||
if (!lastRates[tmpCurrency]) return null;
|
||||
|
||||
return lastRates[tmpCurrency];
|
||||
};
|
||||
}
|
||||
exports.getDeviceRate = function getDeviceRate() {
|
||||
return getLastRate(deviceCurrency);
|
||||
};
|
||||
|
|
@ -347,19 +347,19 @@ function clearSession(deviceFingerprint) {
|
|||
clearTimeout(session.reaper);
|
||||
delete sessions[deviceFingerprint];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Trader functions
|
||||
*/
|
||||
function purchase(trade, callback) {
|
||||
traderPlugin.purchase(trade.satoshis, null, function(err, _) {
|
||||
traderPlugin.purchase(trade.satoshis, null, function(err) {
|
||||
if (err) return callback(err);
|
||||
pollBalance();
|
||||
callback && callback();
|
||||
if (typeof callback === 'function') callback();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function consolidateTrades() {
|
||||
// NOTE: value in satoshis stays the same no matter the currency
|
||||
|
|
@ -374,7 +374,7 @@ function consolidateTrades() {
|
|||
|
||||
logger.debug('consolidated: ', JSON.stringify(consolidatedTrade));
|
||||
return consolidatedTrade;
|
||||
};
|
||||
}
|
||||
|
||||
function executeTrades() {
|
||||
if (!traderPlugin) return;
|
||||
|
|
@ -395,7 +395,7 @@ function executeTrades() {
|
|||
logger.error(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* ID Verifier functions
|
||||
|
|
@ -405,5 +405,5 @@ exports.verifyUser = function verifyUser(data, callback) {
|
|||
};
|
||||
|
||||
exports.verifyTransaction = function verifyTransaction(data, callback) {
|
||||
idVerifier.verifyTransaction(data, callback);
|
||||
idVerifierPlugin.verifyTransaction(data, callback);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue