|
@ -40,6 +40,7 @@ module.exports = (shepherd) => { |
|
|
const keys = { |
|
|
const keys = { |
|
|
pub: keyPair.getAddress(), |
|
|
pub: keyPair.getAddress(), |
|
|
priv: keyPair.toWIF(), |
|
|
priv: keyPair.toWIF(), |
|
|
|
|
|
pubHex: keyPair.getPublicKeyBuffer().toString('hex'), |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/*shepherd.log(`seed: ${seed}`, true); |
|
|
/*shepherd.log(`seed: ${seed}`, true); |
|
@ -98,28 +99,6 @@ module.exports = (shepherd) => { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
shepherd.post('/electrum/seedtowif', (req, res, next) => { |
|
|
|
|
|
if (shepherd.checkToken(req.body.token)) { |
|
|
|
|
|
let keys = shepherd.seedToWif(req.body.seed, req.body.network.toLowerCase(), req.body.iguana); |
|
|
|
|
|
|
|
|
|
|
|
const successObj = { |
|
|
|
|
|
msg: 'success', |
|
|
|
|
|
result: { |
|
|
|
|
|
keys, |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
res.end(JSON.stringify(successObj)); |
|
|
|
|
|
} else { |
|
|
|
|
|
const errorObj = { |
|
|
|
|
|
msg: 'error', |
|
|
|
|
|
result: 'unauthorized access', |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
res.end(JSON.stringify(errorObj)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
shepherd.getCoinByPub = (address) => { |
|
|
shepherd.getCoinByPub = (address) => { |
|
|
const _skipNetworks = ['btc', 'crw', 'dgb', 'arg', 'zec', 'nmc', 'ltc', 'vtc', 'via', 'fair', 'doge', 'kmd', 'mona']; |
|
|
const _skipNetworks = ['btc', 'crw', 'dgb', 'arg', 'zec', 'nmc', 'ltc', 'vtc', 'via', 'fair', 'doge', 'kmd', 'mona']; |
|
|
|
|
|
|
|
|