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:
ardocrat
2024-04-16 15:24:22 +03:00
parent 02a79188bf
commit b93a2efd5e
32 changed files with 1518 additions and 743 deletions
+18
View File
@@ -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;
}
}
}
}