Migrate plugins to lib directory
This commit is contained in:
parent
09b29bba56
commit
e7ab8223c2
27 changed files with 869 additions and 858 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const mem = require('mem')
|
||||
const configManager = require('./config-manager')
|
||||
const ph = require('./plugin-helper')
|
||||
|
||||
const FETCH_INTERVAL = 10000
|
||||
function getRates (settings, fiatCode, cryptoCode) {
|
||||
|
|
@ -8,10 +9,8 @@ function getRates (settings, fiatCode, cryptoCode) {
|
|||
const config = settings.config
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, config).ticker
|
||||
|
||||
if (!plugin) throw new Error('No ticker plugin defined')
|
||||
|
||||
const account = settings.accounts[plugin]
|
||||
const ticker = require('lamassu-' + plugin)
|
||||
const ticker = ph.load(ph.TICKER, plugin)
|
||||
|
||||
return ticker.ticker(account, fiatCode, cryptoCode)
|
||||
.then(r => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue