format for latest standard
This commit is contained in:
parent
4108efd9c7
commit
c2af183911
77 changed files with 1697 additions and 1693 deletions
|
|
@ -9,29 +9,29 @@ const FETCH_INTERVAL = 10000
|
|||
|
||||
function _getRates (settings, fiatCode, cryptoCode) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const config = settings.config
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, config).ticker
|
||||
.then(() => {
|
||||
const config = settings.config
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, config).ticker
|
||||
|
||||
const account = settings.accounts[plugin]
|
||||
const ticker = ph.load(ph.TICKER, plugin)
|
||||
const account = settings.accounts[plugin]
|
||||
const ticker = ph.load(ph.TICKER, plugin)
|
||||
|
||||
const market = [cryptoCode, fiatCode].join('-')
|
||||
const market = [cryptoCode, fiatCode].join('-')
|
||||
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
.then(r => ({
|
||||
rates: r.rates,
|
||||
timestamp: Date.now()
|
||||
}))
|
||||
.then(r => {
|
||||
lastRate[market] = r
|
||||
return r
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
.then(r => ({
|
||||
rates: r.rates,
|
||||
timestamp: Date.now()
|
||||
}))
|
||||
.then(r => {
|
||||
lastRate[market] = r
|
||||
return r
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
return lastRate[market]
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
return lastRate[market]
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getRates = mem(_getRates, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue