mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
feat: raw xpub qr support for coldcard q
This commit is contained in:
parent
78f5e45d9b
commit
1833c0804a
1 changed files with 8 additions and 2 deletions
|
@ -54,6 +54,8 @@ class WalletRestoreFromQRCode {
|
|||
|
||||
final extracted = sortedKeys.firstWhereOrNull((key) => code.toLowerCase().contains(key));
|
||||
|
||||
if (code.startsWith("xpub")) return WalletType.bitcoin;
|
||||
|
||||
if (extracted == null) {
|
||||
// Special case for view-only monero wallet
|
||||
try {
|
||||
|
@ -117,11 +119,15 @@ class WalletRestoreFromQRCode {
|
|||
|
||||
formattedUri = seedPhrase != null
|
||||
? '$walletType:?seed=$seedPhrase'
|
||||
: code.startsWith('xpub')
|
||||
? '$walletType:?xpub=$code'
|
||||
: throw Exception('Failed to determine valid seed phrase');
|
||||
} else {
|
||||
final index = code.indexOf(':');
|
||||
final query = code.substring(index + 1).replaceAll('?', '&');
|
||||
formattedUri = '$walletType:?$query';
|
||||
formattedUri = code.startsWith('xpub')
|
||||
? '$walletType:?xpub=$code'
|
||||
:'$walletType:?$query';
|
||||
}
|
||||
|
||||
final uri = Uri.parse(formattedUri);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue