feat: add local backup restore during seed setup

This commit is contained in:
thePR0M3TH3AN committed 2025-08-22 09:39:38 -04:00
1 parent 2b68df9428
commit ee3d9d8e9d
3 files changed
+88 -1

No files matched your search

+11 -1
View File
@@ -988,7 +988,8 @@ class PasswordManager:
"2. Enter an existing seed one word at a time\n"
"3. Generate a new seed\n"
"4. Restore from Nostr\n"
"Enter choice (1/2/3/4): "
"5. Restore from local backup\n"
"Enter choice (1/2/3/4/5): "
).strip()
if choice == "1":
@@ -1001,6 +1002,15 @@ class PasswordManager:
seed_phrase = masked_input("Enter your 12-word BIP-85 seed: ").strip()
self.restore_from_nostr_with_guidance(seed_phrase)
return
elif choice == "5":
backup_path = input("Enter backup file path: ").strip()
if not getattr(self, "fingerprint_manager", None):
self.initialize_fingerprint_manager()
seed_phrase = masked_input("Enter your 12-word BIP-85 seed: ").strip()
fp = self._finalize_existing_seed(seed_phrase)
if fp:
self.backup_manager.restore_from_backup(backup_path)
return
else:
print(colored("Invalid choice. Exiting.", "red"))
sys.exit(1)