use of com.toshi.exception.InvalidMasterSeedException in project toshi-android-client by toshiapp.
the class HDWallet method createFromMasterSeed.
public Single<HDWallet> createFromMasterSeed(final String masterSeed) {
return Single.fromCallable(() -> {
try {
final DeterministicSeed seed = getSeed(masterSeed);
seed.check();
final Wallet wallet = constructFromSeed(seed);
deriveKeysFromWallet(wallet);
saveMasterSeedToStorage(masterSeed);
return this;
} catch (final UnreadableWalletException | MnemonicException e) {
LogUtil.exception("Error while creating wallet from master seed", e);
throw new InvalidMasterSeedException(e);
}
});
}
Aggregations