mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
feat: zano hf + bip39 (#3359)
* feat: bip39 zano hf * fix: correct monero_c hash * lockfile [skip ci] * fix: zano: proper bip32 fix: zano respect 24 word setting fix: rename / delete * fix: nonBip39WalletTypes * fix: zano wallet rename * fix: passphrase store zano --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -59,6 +59,7 @@ abstract class AdvancedPrivacySettingsViewModelBase with Store {
|
||||
case WalletType.solana:
|
||||
case WalletType.tron:
|
||||
case WalletType.zcash:
|
||||
case WalletType.zano:
|
||||
case WalletType.decred:
|
||||
return true;
|
||||
|
||||
@@ -74,7 +75,6 @@ abstract class AdvancedPrivacySettingsViewModelBase with Store {
|
||||
case WalletType.wownero:
|
||||
case WalletType.none:
|
||||
case WalletType.haven:
|
||||
case WalletType.zano:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,8 +128,9 @@ abstract class WalletGroupsDisplayViewModelBase with Store {
|
||||
|
||||
bool isNonSeedWallet = wallet.isNonSeedWallet;
|
||||
|
||||
bool isNotMoneroBip39Wallet =
|
||||
wallet.type == WalletType.monero && di.derivationType != DerivationType.bip39;
|
||||
bool isNotBip39CoinWallet =
|
||||
(wallet.type == WalletType.monero || wallet.type == WalletType.zano) &&
|
||||
di.derivationType != DerivationType.bip39;
|
||||
|
||||
bool isNotDecredBip39Wallet = wallet.type == WalletType.decred &&
|
||||
di.derivationType != DerivationType.bip39 &&
|
||||
@@ -142,7 +143,7 @@ abstract class WalletGroupsDisplayViewModelBase with Store {
|
||||
isElectrumDerivationType ||
|
||||
isSameTypeAsSelectedWallet ||
|
||||
isNonSeedWallet ||
|
||||
isNotMoneroBip39Wallet ||
|
||||
isNotBip39CoinWallet ||
|
||||
isNotDecredBip39Wallet;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ abstract class WalletNewVMBase extends WalletCreationVM with Store {
|
||||
name: name,
|
||||
password: walletPassword,
|
||||
passphrase: passphrase,
|
||||
mnemonic: newWalletArguments!.mnemonic,
|
||||
);
|
||||
case WalletType.zcash:
|
||||
return zcash!.createZcashNewWalletCredentials(
|
||||
|
||||
@@ -83,8 +83,13 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
|
||||
late final bool hasSeedLanguageSelector =
|
||||
[WalletType.monero, WalletType.haven, WalletType.wownero].contains(type);
|
||||
|
||||
late final bool hasBlockchainHeightSelector =
|
||||
[WalletType.monero, WalletType.haven, WalletType.wownero, WalletType.zcash].contains(type);
|
||||
late final bool hasBlockchainHeightSelector = [
|
||||
WalletType.monero,
|
||||
WalletType.haven,
|
||||
WalletType.wownero,
|
||||
WalletType.zcash,
|
||||
WalletType.zano,
|
||||
].contains(type);
|
||||
|
||||
late final bool hasRestoreFromPrivateKey = [
|
||||
WalletType.ethereum,
|
||||
@@ -204,13 +209,15 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
|
||||
height: height,
|
||||
);
|
||||
case WalletType.zano:
|
||||
return zano!.createZanoRestoreWalletFromSeedCredentials(
|
||||
final credentials = zano!.createZanoRestoreWalletFromSeedCredentials(
|
||||
name: name,
|
||||
password: password,
|
||||
height: height,
|
||||
passphrase: passphrase ?? '',
|
||||
mnemonic: seed,
|
||||
);
|
||||
credentials.derivationInfo = derivationInfo;
|
||||
return credentials;
|
||||
case WalletType.decred:
|
||||
return decred!.createDecredRestoreWalletFromSeedCredentials(
|
||||
name: name,
|
||||
@@ -363,6 +370,17 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
|
||||
seedKey: seedKey,
|
||||
node: node,
|
||||
);
|
||||
case WalletType.zano:
|
||||
final mnemonic = (credentials['seed'] as String?)?.trim() ?? '';
|
||||
if (mnemonic.isEmpty) break;
|
||||
if (zano!.isBip39Seed(mnemonic)) {
|
||||
return [
|
||||
DerivationInfo(derivationType: DerivationType.bip39),
|
||||
];
|
||||
}
|
||||
return [
|
||||
DerivationInfo(derivationType: DerivationType.unknown),
|
||||
];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user