mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-18 11:43:54 +01:00
build + android + wallet + ui: new lib to get IPs, egui, android and grin deps, add input from soft keyboard to text edit, receive txs, filter txs by account, finalize input (in rework), wallet creation copy/paste buttons
This commit is contained in:
@@ -103,4 +103,22 @@ impl Mnemonic {
|
||||
}
|
||||
words
|
||||
}
|
||||
|
||||
/// Set words from provided text if possible.
|
||||
pub fn import_text(&mut self, text: String) {
|
||||
if self.mode != PhraseMode::Import {
|
||||
return;
|
||||
}
|
||||
let words_split = text.trim().split(" ");
|
||||
let count = words_split.clone().count();
|
||||
if PhraseSize::is_correct_count(count) {
|
||||
if self.size == PhraseSize::type_for_value(count).unwrap() {
|
||||
let mut words = vec![];
|
||||
words_split.enumerate().for_each(|(i, word)| {
|
||||
words.insert(i, word.to_string())
|
||||
});
|
||||
self.words = words;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user