mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
correct mnemonic length displayed on new ba/nano wallet creation
This commit is contained in:
parent
0517422e71
commit
81970af4a4
2 changed files with 44 additions and 12 deletions
|
@ -73,12 +73,6 @@ class _NewWalletRecoveryPhraseWarningViewState
|
|||
Widget build(BuildContext context) {
|
||||
debugPrint("BUILD: $runtimeType");
|
||||
|
||||
final _numberOfPhraseWords = coin == Coin.monero
|
||||
? Constants.seedPhraseWordCountMonero
|
||||
: coin == Coin.wownero
|
||||
? 14
|
||||
: Constants.seedPhraseWordCountBip39;
|
||||
|
||||
return MasterScaffold(
|
||||
isDesktop: isDesktop,
|
||||
appBar: isDesktop
|
||||
|
@ -177,7 +171,15 @@ class _NewWalletRecoveryPhraseWarningViewState
|
|||
width: isDesktop ? 480 : null,
|
||||
child: isDesktop
|
||||
? Text(
|
||||
"On the next screen you will see $_numberOfPhraseWords words that make up your recovery phrase.\n\nPlease write it down. Keep it safe and never share it with anyone. Your recovery phrase is the only way you can access your funds if you forget your PIN, lose your phone, etc.\n\nStack Wallet does not keep nor is able to restore your recover phrase. Only you have access to your wallet.",
|
||||
"On the next screen you will see "
|
||||
"${Constants.defaultSeedPhraseLengthFor(coin: coin)} "
|
||||
"words that make up your recovery phrase.\n\nPlease "
|
||||
"write it down. Keep it safe and never share it with "
|
||||
"anyone. Your recovery phrase is the only way you can"
|
||||
" access your funds if you forget your PIN, lose your"
|
||||
" phone, etc.\n\nStack Wallet does not keep nor is "
|
||||
"able to restore your recover phrase. Only you have "
|
||||
"access to your wallet.",
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextMediumRegular(context)
|
||||
: STextStyles.subtitle(context).copyWith(
|
||||
|
@ -214,7 +216,9 @@ class _NewWalletRecoveryPhraseWarningViewState
|
|||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: "$_numberOfPhraseWords words",
|
||||
text:
|
||||
"${Constants.defaultSeedPhraseLengthFor(coin: coin)}"
|
||||
" words",
|
||||
style: STextStyles.desktopH3(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
|
|
|
@ -40,9 +40,9 @@ abstract class Constants {
|
|||
static final BigInt _satsPerCoinMonero = BigInt.from(1000000000000);
|
||||
static final BigInt _satsPerCoinWownero = BigInt.from(100000000000);
|
||||
static final BigInt _satsPerCoinNano =
|
||||
BigInt.parse("1000000000000000000000000000000");// 1*10^30
|
||||
BigInt.parse("1000000000000000000000000000000"); // 1*10^30
|
||||
static final BigInt _satsPerCoinBanano =
|
||||
BigInt.parse("100000000000000000000000000000");// 1*10^29
|
||||
BigInt.parse("100000000000000000000000000000"); // 1*10^29
|
||||
static final BigInt _satsPerCoin = BigInt.from(100000000);
|
||||
static const int _decimalPlaces = 8;
|
||||
static const int _decimalPlacesNano = 30;
|
||||
|
@ -217,8 +217,36 @@ abstract class Constants {
|
|||
}
|
||||
}
|
||||
|
||||
static const int seedPhraseWordCountBip39 = 12;
|
||||
static const int seedPhraseWordCountMonero = 25;
|
||||
static int defaultSeedPhraseLengthFor({required Coin coin}) {
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoinTestNet:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.bitcoincashTestnet:
|
||||
case Coin.eCash:
|
||||
case Coin.dogecoin:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.litecoin:
|
||||
case Coin.litecoinTestNet:
|
||||
case Coin.firo:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.epicCash:
|
||||
case Coin.namecoin:
|
||||
case Coin.particl:
|
||||
case Coin.ethereum:
|
||||
return 12;
|
||||
|
||||
case Coin.wownero:
|
||||
return 14;
|
||||
|
||||
case Coin.nano:
|
||||
case Coin.banano:
|
||||
return 24;
|
||||
|
||||
case Coin.monero:
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
|
||||
static const Map<int, String> monthMapShort = {
|
||||
1: 'Jan',
|
||||
|
|
Loading…
Reference in a new issue