WIPP
This commit is contained in:
parent
7e5515a873
commit
b16d11045c
10 changed files with 368 additions and 550 deletions
|
|
@ -0,0 +1,23 @@
|
|||
const mem = require('mem')
|
||||
const settingsLoader = require('./settings-loader')
|
||||
const configManager = require('./config-manager')
|
||||
|
||||
const FETCH_INTERVAL = 10000
|
||||
function getRates (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)
|
||||
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getRates: mem(getRates, {maxAge: FETCH_INTERVAL})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue