Browse Source
Merge pull request #217 from SuperNETorg/electrum
Electrum
pkg_automation_electrum
pbca26
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
24 additions and
5 deletions
-
main.js
-
routes/appConfig.js
-
routes/shepherd/dashboardUpdate.js
-
routes/shepherd/electrum/auth.js
|
|
@ -429,7 +429,7 @@ function createWindow(status) { |
|
|
|
shepherd.log('Closing Main Window...'); |
|
|
|
shepherd.writeLog('exiting app...'); |
|
|
|
|
|
|
|
shepherd.quitKomodod(1000); |
|
|
|
shepherd.quitKomodod(appConfig.cliStopTimeout); |
|
|
|
|
|
|
|
const result = 'Closing daemons: done'; |
|
|
|
|
|
|
@ -480,7 +480,7 @@ function createWindow(status) { |
|
|
|
closeApp(); |
|
|
|
} else { |
|
|
|
createAppCloseWindow(); |
|
|
|
shepherd.quitKomodod(1000); |
|
|
|
shepherd.quitKomodod(appConfig.cliStopTimeout); |
|
|
|
_appClosingInterval = setInterval(function() { |
|
|
|
if (!Object.keys(shepherd.coindInstanceRegistry).length) { |
|
|
|
closeApp(); |
|
|
|
|
|
@ -14,6 +14,7 @@ const appConfig = { |
|
|
|
dex: { |
|
|
|
walletUnlockTimeout: 3600, |
|
|
|
}, |
|
|
|
cliStopTimeout: 1000, |
|
|
|
}, |
|
|
|
schema: { |
|
|
|
host: { |
|
|
@ -91,6 +92,11 @@ const appConfig = { |
|
|
|
type: 'number', |
|
|
|
}, |
|
|
|
}, |
|
|
|
cliStopTimeout: { |
|
|
|
display: true, |
|
|
|
displayName: 'CLI stop timeout', |
|
|
|
type: 'number', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -261,6 +261,7 @@ module.exports = (shepherd) => { |
|
|
|
|
|
|
|
shepherd.Promise.all(_promiseStack.map((_call, index) => { |
|
|
|
let _params; |
|
|
|
|
|
|
|
if (_call === 'listtransactions') { |
|
|
|
_params = [ |
|
|
|
'', |
|
|
|
|
|
@ -2,11 +2,23 @@ module.exports = (shepherd) => { |
|
|
|
shepherd.post('/electrum/login', (req, res, next) => { |
|
|
|
for (let key in shepherd.electrumServers) { |
|
|
|
const _abbr = shepherd.electrumServers[key].abbr; |
|
|
|
const { priv, pub } = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana); |
|
|
|
let keys; |
|
|
|
|
|
|
|
if (req.body.seed.length === 52 && |
|
|
|
req.body.seed[0] === 'U' && |
|
|
|
req.body.seed.match(/^[a-zA-Z0-9]*$/)) { |
|
|
|
let key = shepherd.bitcoinJS.ECPair.fromWIF(req.body.seed, shepherd.electrumJSNetworks.komodo); |
|
|
|
keys = { |
|
|
|
priv: key.toWIF(), |
|
|
|
pub: key.getAddress(), |
|
|
|
}; |
|
|
|
} else { |
|
|
|
keys = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana); |
|
|
|
} |
|
|
|
|
|
|
|
shepherd.electrumKeys[_abbr] = { |
|
|
|
priv, |
|
|
|
pub, |
|
|
|
priv: keys.priv, |
|
|
|
pub: keys.pub, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|