src/controllers/erc20.js
/**
   * function responsible for the generation of wallet.json where the seed is received from '/seed/:point'
   */
function responsible for the generation of wallet.json where the seed is received from '/seed/:point'
function responsible for the generation of wallet . json where the seed is received from ' / seed / : point '
create(req, res) {
    if (isNullOrUndefined.isNullOrUndefined(req.body.seed)) {
      let error = {
        isError: true,
        msg: "Error read parameter <seed>"
      };
      res.status(400).json(error);
    }
    if (isNullOrUndefined.isNullOrUndefined(req.body.password)) {
      let error = {
        isError: true,
        msg: "Error read parameter <password>"
      };
      res.status(400).json(error);
    }
    let paramPassword = req.body.password.toString();
    let paramSeed = req.body.seed.toString();
    let numAddr = 1;
    Lightwallet.keystore.createVault(
      {
        password: paramPassword,
        seedPhrase: paramSeed,
        hdPathString: "m/44'/60'/0'/0"
      },
      function(err, ks) {
        ks.keyFromPassword(paramPassword, function(err, pwDerivedKey) {
          if (ks.isDerivedKeyCorrect(pwDerivedKey)) {
            ks.generateNewAddress(pwDerivedKey, numAddr);
            let data = {
              wallet: ks
            };
            res.status(200).json(data);
          } else {
            let error = {
              isError: true,
              msg: "Password incorret"
            };
            res.status(400).json(error);
          }
        });
      }
    );
  }
create ( req , res ) { if ( isNullOrUndefined . isNullOrUndefined ( req . body . seed ) ) { let error = { isError : true , msg : "Error read parameter <seed>" } ; res . status ( 400 ) . json ( error ) ; } if ( isNullOrUndefined . isNullOrUndefined ( req . body . password ) ) { let error = { isError : true , msg : "Error read parameter <password>" } ; res . status ( 400 ) . json ( error ) ; } let paramPassword = req . body . password . toString ( ) ; let paramSeed = req . body . seed . toString ( ) ; let numAddr = 1 ; Lightwallet . keystore . createVault ( { password : paramPassword , seedPhrase : paramSeed , hdPathString : "m/44'/60'/0'/0" } , function ( err , ks ) { ks . keyFromPassword ( paramPassword , function ( err , pwDerivedKey ) { if ( ks . isDerivedKeyCorrect ( pwDerivedKey ) ) { ks . generateNewAddress ( pwDerivedKey , numAddr ) ; let data = { wallet : ks } ; res . status ( 200 ) . json ( data ) ; } else { let error = { isError : true , msg : "Password incorret" } ; res . status ( 400 ) . json ( error ) ; } } ) ; } ) ; }
function responsible for the generation of wallet.json where the seed is received from '/seed/:point'
function responsible for the generation of wallet . json where the seed is received from ' / seed / : point '
//random salt