10
10
using ReactiveUI ;
11
11
using System ;
12
12
using System . Collections . Generic ;
13
+ using System . ComponentModel ;
13
14
using System . Diagnostics ;
14
15
using System . Linq ;
15
16
16
17
namespace FinderOuter . ViewModels
17
18
{
19
+ public enum PassRecoveryMode
20
+ {
21
+ [ Description ( "A password consisting of random characters" ) ]
22
+ Alphanumeric
23
+ }
24
+
18
25
public class MissingMnemonicPassViewModel : OptionVmBase
19
26
{
20
27
public MissingMnemonicPassViewModel ( )
@@ -24,6 +31,8 @@ public MissingMnemonicPassViewModel()
24
31
InputTypeList = ListHelper . GetEnumDescItems < InputType > ( ) . ToArray ( ) ;
25
32
SelectedInputType = InputTypeList . First ( ) ;
26
33
MnService = new MnemonicExtensionService ( Result ) ;
34
+ PassRecoveryModeList = ListHelper . GetEnumDescItems < PassRecoveryMode > ( ) . ToArray ( ) ;
35
+ SelectedPassRecoveryMode = PassRecoveryModeList . First ( ) ;
27
36
28
37
IObservable < bool > isFindEnabled = this . WhenAnyValue (
29
38
x => x . Mnemonic ,
@@ -51,17 +60,17 @@ public MissingMnemonicPassViewModel()
51
60
52
61
public override string OptionName => "Missing Mnemonic Pass" ;
53
62
public override string Description => "This option can recover missing mnemonic passphrases also known as extra " +
54
- "or extension words. Enter the full mnemonic, a child key for comparisson and the full path of that key. " +
63
+ "or extension words. Enter the mnemonic, a child key or address for comparisson and the full path of that key. " +
55
64
"The path is the full BIP-32 defined path of the child key including the key's index (eg. m/44'/0'/0'/0)." +
56
65
$ "{ Environment . NewLine } " +
57
- $ "the only available case for now is when you don't know any characters of the passphrase. Enter its exact " +
58
- $ "length and select the type of characters that were used in the passphrase. And finally click Find.";
66
+ $ "Choose a recovery mode and enter the required information. Finally click Find button.";
59
67
60
68
61
69
public MnemonicExtensionService MnService { get ; }
62
70
public IEnumerable < BIP0039 . WordLists > WordListsList { get ; }
63
71
public IEnumerable < MnemonicTypes > MnemonicTypesList { get ; }
64
72
public IEnumerable < DescriptiveItem < InputType > > InputTypeList { get ; }
73
+ public IEnumerable < DescriptiveItem < PassRecoveryMode > > PassRecoveryModeList { get ; }
65
74
66
75
private MnemonicTypes _selMnT ;
67
76
public MnemonicTypes SelectedMnemonicType
@@ -84,6 +93,13 @@ public DescriptiveItem<InputType> SelectedInputType
84
93
set => this . RaiseAndSetIfChanged ( ref _inT , value ) ;
85
94
}
86
95
96
+ private DescriptiveItem < PassRecoveryMode > _recMode ;
97
+ public DescriptiveItem < PassRecoveryMode > SelectedPassRecoveryMode
98
+ {
99
+ get => _recMode ;
100
+ set => this . RaiseAndSetIfChanged ( ref _recMode , value ) ;
101
+ }
102
+
87
103
private string _mnemonic ;
88
104
public string Mnemonic
89
105
{
@@ -98,9 +114,7 @@ public int PassLength
98
114
set
99
115
{
100
116
if ( value < 1 )
101
- {
102
117
value = 1 ;
103
- }
104
118
105
119
this . RaiseAndSetIfChanged ( ref _passLen , value ) ;
106
120
}
@@ -148,7 +162,7 @@ public bool IsSymbol
148
162
set => this . RaiseAndSetIfChanged ( ref _isSymbol , value ) ;
149
163
}
150
164
151
- public string AllSymbols => $ "Symbols ({ ConstantsFO . AllSymbols } )";
165
+ public static string AllSymbols => $ "Symbols ({ ConstantsFO . AllSymbols } )";
152
166
153
167
154
168
public PasswordType PassType
0 commit comments