improve config loading; remove debug
This commit is contained in:
parent
5f0b70ca42
commit
614c64646a
15 changed files with 198 additions and 193 deletions
|
|
@ -2,13 +2,16 @@ const configManager = require('./config-manager')
|
|||
const ph = require('./plugin-helper')
|
||||
|
||||
function lookupExchange (settings, cryptoCode) {
|
||||
return configManager.cryptoScoped(cryptoCode, settings.config).exchange
|
||||
const exchange = configManager.cryptoScoped(cryptoCode, settings.config).exchange
|
||||
if (exchange === 'no-exchange') return null
|
||||
return exchange
|
||||
}
|
||||
|
||||
function fetchExchange (settings, cryptoCode) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const plugin = lookupExchange(settings, cryptoCode)
|
||||
if (!plugin) throw new Error('No exchange set')
|
||||
const exchange = ph.load(ph.EXCHANGE, plugin)
|
||||
const account = settings.accounts[plugin]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue