function * createWalletSaga (action) {
  const initSeed = typeof action.seed !== 'undefined'
  try {
    let response
    if (initSeed) {
      yield put(actions.initSeedStarted())
      response = yield siadCall({
        url: '/wallet/init/seed',
        method: 'POST',
        timeout: 1.7e8, // two days
        qs: {
          dictionary: 'english',
          encryptionpassword: action.password,
          seed: action.seed
        }
      })
      yield put(actions.initSeedFinished())
    } else {
      response = yield siadCall({
        url: '/wallet/init',
        method: 'POST',
        qs: {
          dictionary: 'english',
          encryptionpassword: action.password
        }
      })
    }

    if (
      (!initSeed && typeof action.password === 'undefined') ||
      action.password === ''
    ) {
      yield put(
        actions.showNewWalletDialog(response.primaryseed, response.primaryseed)
      )
    } else if (!initSeed) {
      yield put(
        actions.showNewWalletDialog(action.password, response.primaryseed)
      )
    }

    yield take(constants.SET_UNLOCKED)
    yield put(actions.dismissNewWalletDialog())
  } catch (e) {
    if (initSeed) {
      yield put(actions.initSeedFinished())
    }
    sendError(e)
  }
}
// Wait for the user to close the dialog, then unlock the wallet using the primary seed.
Wait for the user to close the dialog, then unlock the wallet using the primary seed.
Wait for the user to close the dialog then unlock the wallet using the primary seed .
function * createWalletSaga (action) {
  const initSeed = typeof action.seed !== 'undefined'
  try {
    let response
    if (initSeed) {
      yield put(actions.initSeedStarted())
      response = yield siadCall({
        url: '/wallet/init/seed',
        method: 'POST',
        timeout: 1.7e8, 
        qs: {
          dictionary: 'english',
          encryptionpassword: action.password,
          seed: action.seed
        }
      })
      yield put(actions.initSeedFinished())
    } else {
      response = yield siadCall({
        url: '/wallet/init',
        method: 'POST',
        qs: {
          dictionary: 'english',
          encryptionpassword: action.password
        }
      })
    }
    if (
      (!initSeed && typeof action.password === 'undefined') ||
      action.password === ''
    ) {
      yield put(
        actions.showNewWalletDialog(response.primaryseed, response.primaryseed)
      )
    } else if (!initSeed) {
      yield put(
        actions.showNewWalletDialog(action.password, response.primaryseed)
      )
    }
    yield take(constants.SET_UNLOCKED)
    yield put(actions.dismissNewWalletDialog())
  } catch (e) {
    if (initSeed) {
      yield put(actions.initSeedFinished())
    }
    sendError(e)
  }
}
function * createWalletSaga ( action ) { const initSeed = typeof action . seed !== 'undefined' try { let response if ( initSeed ) { yield put ( actions . initSeedStarted ( ) ) response = yield siadCall ( { url : '/wallet/init/seed' , method : 'POST' , timeout : 1.7e8 , qs : { dictionary : 'english' , encryptionpassword : action . password , seed : action . seed } } ) yield put ( actions . initSeedFinished ( ) ) } else { response = yield siadCall ( { url : '/wallet/init' , method : 'POST' , qs : { dictionary : 'english' , encryptionpassword : action . password } } ) } if ( ( ! initSeed && typeof action . password === 'undefined' ) || action . password === '' ) { yield put ( actions . showNewWalletDialog ( response . primaryseed , response . primaryseed ) ) } else if ( ! initSeed ) { yield put ( actions . showNewWalletDialog ( action . password , response . primaryseed ) ) } yield take ( constants . SET_UNLOCKED ) yield put ( actions . dismissNewWalletDialog ( ) ) } catch ( e ) { if ( initSeed ) { yield put ( actions . initSeedFinished ( ) ) } sendError ( e ) } }
Wait for the user to close the dialog, then unlock the wallet using the primary seed.
Wait for the user to close the dialog then unlock the wallet using the primary seed .
// two days