diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletImportDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletImportDialog.java index 93a3f9ae..ec43afab 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletImportDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WalletImportDialog.java @@ -61,7 +61,7 @@ public class WalletImportDialog extends Dialog { } List walletImporters = new ArrayList<>(List.of(new Bip129(), new CaravanMultisig(), new ColdcardMultisig(), new CoboVaultMultisig(), new Electrum(), - new KeystoneMultisig(), new Descriptor(), new SpecterDesktop(), new BlueWalletMultisig(), new Sparrow(), new JadeMultisig())); + new KeystoneMultisig(), new Descriptor(), new SpecterDesktop(), new BlueWalletMultisig(), new Sparrow(), new JadeMultisig(), new PassportMultisig())); if(!selectedWalletForms.isEmpty()) { walletImporters.add(new WalletLabels(selectedWalletForms)); } diff --git a/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java b/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java index 9760d6d5..87d99af2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java @@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow.io; import com.sparrowwallet.drongo.protocol.ScriptType; import com.sparrowwallet.drongo.wallet.Keystore; +import com.sparrowwallet.drongo.wallet.Wallet; import com.sparrowwallet.drongo.wallet.WalletModel; import java.io.InputStream; @@ -45,4 +46,25 @@ public class PassportMultisig extends ColdcardMultisig { public boolean isWalletExportScannable() { return true; } + + @Override + public boolean isWalletImportScannable() { + return true; + } + + @Override + public String getWalletImportDescription() { + return "Import file or QR created by using Settings > Bitcoin > Multisig > [Wallet Detail] > Export via QR/microSD on your Passport."; + } + + @Override + public Wallet importWallet(InputStream inputStream, String password) throws ImportException { + Wallet wallet = super.importWallet(inputStream, password); + for(Keystore keystore : wallet.getKeystores()) { + keystore.setLabel(keystore.getLabel().replace("Coldcard", "Passport")); + keystore.setWalletModel(WalletModel.PASSPORT); + } + + return wallet; + } }