@ -4,7 +4,7 @@ const path = require('path');
let childProcess = require ( 'child_process' ) ;
let textEncoding = require ( 'text-encoding' ) ;
let TextDecoder = textEncoding . TextDecoder ;
import { cliPath } from './binaries' ;
import { platform, cliPath } from './binaries' ;
export class WowRpc {
// ps -ef | grep defunct | grep -v grep | cut -b8-20 | xargs kill -9
@ -129,6 +129,8 @@ export class WowRpc {
}
_parse _stdout ( data ) {
if ( platform === 'win' ) { data = data . replace ( /\r/g , "" ) ; }
// detect incoming transaction
let re _incoming _tx = /Height \d+, txid \<([a-zA-Z0-9]+)\>, ([0-9]+.[0-9]+), idx/g ;
if ( data . match ( re _incoming _tx ) ) {
@ -258,6 +260,7 @@ export class WowRpc {
}
_parse _stdout _create _wallet ( data ) {
if ( platform === 'win' ) { data = data . replace ( /\r/g , "" ) ; } // lol windows
this . _buffer += data ;
if ( data === ` Logging to ${ this . _cli _log _path } \n ` ) {
@ -286,10 +289,10 @@ export class WowRpc {
this . _create _wallet [ 'view_key' ] = re _view _key _match [ 1 ] ;
}
let re _seed = / NOTE: the following 25 words can be used to recover access to your wallet. Write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control.\n\n(.*)\n(.*)\n(.*)\n\*\*\*\*/;
let re _seed = / \*\*\*\*\*\*SEED\n(.*)\n\*\*/
let re _seed _match = this . _buffer . match ( re _seed ) ;
if ( re _seed _match ) {
let seed = ` ${ re _seed _match [ 1 ] } ${ re _seed _match [ 2 ] } ${ re _seed _match [ 3 ] } ` ;
let seed = re _seed _match [ 1 ] . trim ( ) ;
if ( seed . split ( ' ' ) . length !== 25 ) {
this . onCreateWalletFinished ( "could not get seed; invalid num words" ) ;
}