add Infura wallet support

This commit is contained in:
Josh Harvey 2018-07-08 21:31:26 +03:00
parent 05e7889dc0
commit ac89f0e5e9
9 changed files with 472 additions and 513 deletions

View file

@ -34,9 +34,11 @@ function fetchWallet (settings, cryptoCode) {
const masterSeed = Buffer.from(hex.trim(), 'hex')
const plugin = configManager.cryptoScoped(cryptoCode, settings.config).wallet
const wallet = ph.load(ph.WALLET, plugin)
const account = settings.accounts[plugin]
const rawAccount = settings.accounts[plugin]
const account = _.set('seed', computeSeed(masterSeed), rawAccount)
if (_.isFunction(wallet.run)) wallet.run(account)
return {wallet, account: _.set('seed', computeSeed(masterSeed), account)}
return {wallet, account}
})
}