feat: xpub restore from bitcoin URI QR

This commit is contained in:
Czarek Nakamoto 2025-06-03 12:13:47 +02:00 committed by cyan
parent cde1274def
commit a4a40356a3
2 changed files with 7 additions and 2 deletions

View file

@ -44,6 +44,7 @@ class RestoredWallet {
} catch (e) {
// fine, we don't care, it is only for monero anyway
}
json['view_key'] ??= json['xpub'];
final height = json['height'] as String?;
return RestoredWallet(
restoreMode: json['mode'] as WalletRestoreMode,

View file

@ -158,6 +158,10 @@ class WalletRestoreFromQRCode {
throw Exception('Unexpected restore mode: tx_payment_id is invalid');
}
if (credentials.containsKey("xpub")) {
return WalletRestoreMode.keys;
}
if (credentials['seed'] != null) {
final seedValue = credentials['seed'] as String;
final words = SeedValidator.getWordList(type: type, language: 'english');