WIPP
This commit is contained in:
parent
4184e99273
commit
493e669e6d
5 changed files with 198 additions and 196 deletions
|
|
@ -1,20 +1,20 @@
|
|||
const mem = require('mem')
|
||||
const settingsLoader = require('./settings-loader')
|
||||
const configManager = require('./config-manager')
|
||||
|
||||
const FETCH_INTERVAL = 10000
|
||||
function getRates (fiatCode, cryptoCode) {
|
||||
function getRates (settings, fiatCode, cryptoCode) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
return settingsLoader.settings()
|
||||
.then(settings => {
|
||||
const config = settings.config
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, config).cryptoServices.ticker
|
||||
const account = settings.accounts.plugin
|
||||
const ticker = require('lamassu-' + plugin)
|
||||
const config = settings.config
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, config).cryptoServices.ticker
|
||||
const account = settings.accounts.plugin
|
||||
const ticker = require('lamassu-' + plugin)
|
||||
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
})
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
.then(r => ({
|
||||
rates: r.rates,
|
||||
timestamp: Date.now()
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue