This commit is contained in:
Josh Harvey 2016-11-28 03:34:18 +02:00
parent ee0eecbd30
commit 48a9f9d204
14 changed files with 186 additions and 130 deletions

View file

@ -7,9 +7,9 @@ const FETCH_INTERVAL = 5000
function fetchWallet (cryptoCode) {
return Promise.resolve()
.then(() => {
const settings = settingsLoader.settings
const settings = settingsLoader.settings()
const plugin = configManager.cryptoScoped(cryptoCode, settings.config).cryptoServices.wallet
const account = settings.accounts.plugin
const account = settings.accounts[plugin]
const wallet = require('lamassu-' + plugin)
return {wallet, account}
@ -38,9 +38,9 @@ function newAddress (cryptoCode, info) {
.then(r => r.wallet.newAddress(r.account, cryptoCode, info))
}
function getStatus (toAdress, cryptoAtoms, cryptoCode) {
function getStatus (toAddress, cryptoAtoms, cryptoCode) {
return fetchWallet(cryptoCode)
.then(r => r.wallet.getStatus(r.account, toAdress, cryptoAtoms, cryptoCode))
.then(r => r.wallet.getStatus(r.account, toAddress, cryptoAtoms, cryptoCode))
}
module.exports = {