support for Coin ATM Radar
This commit is contained in:
parent
2cdc8b0d13
commit
6c3099921f
13 changed files with 262 additions and 8 deletions
|
|
@ -6,6 +6,7 @@ const cashOutTx = require('./cash-out/cash-out-tx')
|
|||
const cashInTx = require('./cash-in/cash-in-tx')
|
||||
const sanctionsUpdater = require('./ofac/update')
|
||||
const sanctions = require('./ofac/index')
|
||||
const coinAtmRadar = require('./coinatmradar/coinatmradar')
|
||||
|
||||
const INCOMING_TX_INTERVAL = 30 * T.seconds
|
||||
const LIVE_INCOMING_TX_INTERVAL = 5 * T.seconds
|
||||
|
|
@ -15,6 +16,7 @@ const TRADE_INTERVAL = 60 * T.seconds
|
|||
const PONG_INTERVAL = 10 * T.seconds
|
||||
const PONG_CLEAR_INTERVAL = 1 * T.day
|
||||
const SANCTIONS_UPDATE_INTERVAL = 1 * T.week
|
||||
const RADAR_UPDATE_INTERVAL = 5 * T.minutes
|
||||
|
||||
const CHECK_NOTIFICATION_INTERVAL = 20 * T.seconds
|
||||
|
||||
|
|
@ -38,6 +40,17 @@ function updateAndLoadSanctions () {
|
|||
.then(() => logger.info('Sanctions database updated.'))
|
||||
}
|
||||
|
||||
const pp = require('./pp')
|
||||
function updateCoinAtmRadar () {
|
||||
const config = settings().config
|
||||
|
||||
return pi().getRates()
|
||||
.then(rates => {
|
||||
pp('DEBUG200')(rates)
|
||||
return coinAtmRadar.update({rates, config})
|
||||
})
|
||||
}
|
||||
|
||||
function start (__settings) {
|
||||
reload(__settings)
|
||||
|
||||
|
|
@ -49,6 +62,7 @@ function start (__settings) {
|
|||
cashOutTx.monitorUnnotified(settings())
|
||||
pi().sweepHd()
|
||||
notifier.checkNotification(pi())
|
||||
updateCoinAtmRadar()
|
||||
|
||||
setInterval(() => pi().executeTrades(), TRADE_INTERVAL)
|
||||
setInterval(() => cashOutTx.monitorLiveIncoming(settings()), LIVE_INCOMING_TX_INTERVAL)
|
||||
|
|
@ -60,6 +74,7 @@ function start (__settings) {
|
|||
setInterval(() => pi().pongClear(), PONG_CLEAR_INTERVAL)
|
||||
setInterval(() => notifier.checkNotification(pi()), CHECK_NOTIFICATION_INTERVAL)
|
||||
setInterval(updateAndLoadSanctions, SANCTIONS_UPDATE_INTERVAL)
|
||||
setInterval(updateCoinAtmRadar, RADAR_UPDATE_INTERVAL)
|
||||
}
|
||||
|
||||
module.exports = {start, reload}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue