diff --git a/cw_bitcoin/lib/bitcoin_derivations.dart b/cw_bitcoin/lib/bitcoin_derivations.dart index 4353429a1..cb94382f3 100644 --- a/cw_bitcoin/lib/bitcoin_derivations.dart +++ b/cw_bitcoin/lib/bitcoin_derivations.dart @@ -64,7 +64,7 @@ Map> bitcoin_derivations = { description: "Samourai Deposit", scriptType: "p2wpkh", ), - DerivationInfo( + DerivationInfo( derivationType: DerivationType.bip39, derivationPath: "m/84'/0'/0'", description: "Samourai Deposit", @@ -106,5 +106,11 @@ Map> bitcoin_derivations = { description: "Samourai Ricochet native segwit", scriptType: "p2wpkh", ), + DerivationInfo( + derivationType: DerivationType.bip39, + derivationPath: "m/84'/2'/0'", + description: "Default Litecoin", + scriptType: "p2wpkh", + ), ], }; diff --git a/lib/nano/cw_nano.dart b/lib/nano/cw_nano.dart index 088b858b1..552f397fc 100644 --- a/lib/nano/cw_nano.dart +++ b/lib/nano/cw_nano.dart @@ -106,8 +106,9 @@ class CWNano extends Nano { required String mnemonic, required DerivationType derivationType, }) { - if (mnemonic.split(" ").length == 12) { - derivationType = DerivationType.bip39; + + if (mnemonic.split(" ").length == 12 && derivationType != DerivationType.bip39) { + throw Exception("Invalid mnemonic for derivation type!"); } return NanoRestoreWalletFromSeedCredentials( @@ -125,8 +126,9 @@ class CWNano extends Nano { required String seedKey, required DerivationType derivationType, }) { - if (seedKey.length == 128) { - derivationType = DerivationType.bip39; + + if (seedKey.length == 128 && derivationType != DerivationType.bip39) { + throw Exception("Invalid seed key length for derivation type!"); } return NanoRestoreWalletFromKeysCredentials( diff --git a/lib/src/screens/restore/wallet_restore_page.dart b/lib/src/screens/restore/wallet_restore_page.dart index f44da653f..7eb2978cf 100644 --- a/lib/src/screens/restore/wallet_restore_page.dart +++ b/lib/src/screens/restore/wallet_restore_page.dart @@ -387,7 +387,7 @@ class WalletRestorePage extends BasePage { } else { // if we have multiple possible derivations, and none have histories // we just default to the most common one: - dInfo = walletRestoreViewModel.getMostCommonDerivation(); + dInfo = walletRestoreViewModel.getCommonRestoreDerivation(); } }