chore: integrate new admin with l-s
This commit is contained in:
parent
6b3db134e7
commit
bf8f1d991c
72 changed files with 1493 additions and 1611 deletions
|
|
@ -2,7 +2,7 @@ const _ = require('lodash/fp')
|
|||
const mem = require('mem')
|
||||
const hkdf = require('futoin-hkdf')
|
||||
|
||||
const configManager = require('./config-manager')
|
||||
const configManager = require('./new-config-manager')
|
||||
const pify = require('pify')
|
||||
const fs = pify(require('fs'))
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ function fetchWallet (settings, cryptoCode) {
|
|||
return fs.readFile(options.mnemonicPath, 'utf8')
|
||||
.then(mnemonic => {
|
||||
const masterSeed = mnemonicHelpers.toEntropyBuffer(mnemonic)
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, settings.config).wallet
|
||||
const plugin = configManager.getWalletSettings(cryptoCode, settings.config).wallet
|
||||
const wallet = ph.load(ph.WALLET, plugin)
|
||||
const rawAccount = settings.accounts[plugin]
|
||||
const account = _.set('seed', computeSeed(masterSeed), rawAccount)
|
||||
|
|
@ -135,10 +135,9 @@ function getWalletStatus (settings, tx) {
|
|||
}
|
||||
|
||||
function authorizeZeroConf (settings, tx, machineId) {
|
||||
const cryptoConfig = configManager.cryptoScoped(tx.cryptoCode, settings.config)
|
||||
const machineConfig = configManager.machineScoped(machineId, settings.config)
|
||||
const plugin = cryptoConfig.zeroConf
|
||||
const zeroConfLimit = machineConfig.zeroConfLimit
|
||||
const plugin = configManager.getWalletSettings(tx.cryptoCode, settings.config).zeroConf
|
||||
const cashOutConfig = configManager.cashOutConfig(machineId, settings.config)
|
||||
const zeroConfLimit = cashOutConfig.zeroConfLimit
|
||||
|
||||
if (!_.isObject(tx.fiat)) {
|
||||
return Promise.reject(new Error('tx.fiat is undefined!'))
|
||||
|
|
@ -189,7 +188,7 @@ function isHd (settings, cryptoCode) {
|
|||
}
|
||||
|
||||
function cryptoNetwork (settings, cryptoCode) {
|
||||
const plugin = configManager.cryptoScoped(cryptoCode, settings.config).wallet
|
||||
const plugin = configManager.getWalletSettings(cryptoCode, settings.config).wallet
|
||||
const wallet = ph.load(ph.WALLET, plugin)
|
||||
const account = settings.accounts[plugin]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue