fixed cashOut rates bug
This commit is contained in:
parent
93983c9645
commit
87fdb355b2
6 changed files with 733 additions and 5090 deletions
|
|
@ -10,7 +10,7 @@ const machineLoader = require('../machine-loader')
|
||||||
const CONSIDERED_UP_SECS = 30
|
const CONSIDERED_UP_SECS = 30
|
||||||
|
|
||||||
function checkWasConfigured () {
|
function checkWasConfigured () {
|
||||||
settingsLoader.loadLatest()
|
return settingsLoader.loadLatest()
|
||||||
.then(() => true)
|
.then(() => true)
|
||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,8 @@ function sendNoAlerts (plugins) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkNotification (plugins) {
|
function checkNotification (plugins) {
|
||||||
|
if (!plugins.notificationsEnabled()) return Promise.resolve()
|
||||||
|
|
||||||
return checkStatus(plugins)
|
return checkStatus(plugins)
|
||||||
.then(alertRec => {
|
.then(alertRec => {
|
||||||
const currentAlertFingerprint = buildAlertFingerprint(alertRec)
|
const currentAlertFingerprint = buildAlertFingerprint(alertRec)
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function plugins (settings, deviceId) {
|
||||||
const cashInCommission = BN(1).add(BN(cryptoConfig.cashInCommission).div(100))
|
const cashInCommission = BN(1).add(BN(cryptoConfig.cashInCommission).div(100))
|
||||||
|
|
||||||
const cashOutCommission = _.isNil(cryptoConfig.cashOutCommission)
|
const cashOutCommission = _.isNil(cryptoConfig.cashOutCommission)
|
||||||
? null
|
? undefined
|
||||||
: BN(1).add(BN(cryptoConfig.cashOutCommission).div(100))
|
: BN(1).add(BN(cryptoConfig.cashOutCommission).div(100))
|
||||||
|
|
||||||
if (Date.now() - rateRec.timestamp > STALE_TICKER) return logger.warn('Stale rate for ' + cryptoCode)
|
if (Date.now() - rateRec.timestamp > STALE_TICKER) return logger.warn('Stale rate for ' + cryptoCode)
|
||||||
|
|
@ -56,9 +56,16 @@ function plugins (settings, deviceId) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log('DEBUG100: %j', rates)
|
||||||
|
|
||||||
return rates
|
return rates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function notificationsEnabled () {
|
||||||
|
const config = configManager.unscoped(settings.config)
|
||||||
|
return config.notificationsEnabled
|
||||||
|
}
|
||||||
|
|
||||||
function buildBalances (balanceRecs) {
|
function buildBalances (balanceRecs) {
|
||||||
const config = configManager.machineScoped(deviceId, settings.config)
|
const config = configManager.machineScoped(deviceId, settings.config)
|
||||||
const cryptoCodes = config.cryptoCurrencies
|
const cryptoCodes = config.cryptoCurrencies
|
||||||
|
|
@ -606,7 +613,8 @@ function plugins (settings, deviceId) {
|
||||||
getMachineNames,
|
getMachineNames,
|
||||||
buildAvailableCassettes,
|
buildAvailableCassettes,
|
||||||
buy,
|
buy,
|
||||||
sell
|
sell,
|
||||||
|
notificationsEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4618
package-lock.json
generated
4618
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -430,6 +430,10 @@ p {
|
||||||
border-color: #eb6b6e;
|
border-color: #eb6b6e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lamassuAdminConfigTable .lamassuAdminInvalidComponent > .lamassuAdminSelectizeContainer {
|
||||||
|
border-color: #eb6b6e;
|
||||||
|
}
|
||||||
|
|
||||||
.lamassuAdminConfigTable tbody td {
|
.lamassuAdminConfigTable tbody td {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue