From c3ae98f3d159ce1d1a7be0b9e226b8ca0905dd8d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 5 Apr 2021 12:19:18 +0200 Subject: [PATCH] add passport multisig wallet export --- .../sparrow/control/FileWalletExportPane.java | 3 +++ .../sparrow/control/WalletExportDialog.java | 2 +- .../com/sparrowwallet/sparrow/io/PassportMultisig.java | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java b/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java index fd2cdf73..d47c21fe 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/FileWalletExportPane.java @@ -10,6 +10,7 @@ import com.sparrowwallet.sparrow.event.TimedEvent; import com.sparrowwallet.sparrow.event.WalletExportEvent; import com.sparrowwallet.sparrow.glyphfont.FontAwesome5; import com.sparrowwallet.sparrow.io.CoboVaultMultisig; +import com.sparrowwallet.sparrow.io.PassportMultisig; import com.sparrowwallet.sparrow.io.Storage; import com.sparrowwallet.sparrow.io.WalletExport; import javafx.geometry.Pos; @@ -134,6 +135,8 @@ public class FileWalletExportPane extends TitledDescriptionPane { QRDisplayDialog qrDisplayDialog; if(exporter instanceof CoboVaultMultisig) { qrDisplayDialog = new QRDisplayDialog(RegistryType.BYTES.toString(), outputStream.toByteArray(), true); + } else if(exporter instanceof PassportMultisig) { + qrDisplayDialog = new QRDisplayDialog(RegistryType.BYTES.toString(), outputStream.toByteArray(), false); } else { qrDisplayDialog = new QRDisplayDialog(outputStream.toString(StandardCharsets.UTF_8)); } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletExportDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletExportDialog.java index f53f98ef..d9c849fe 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletExportDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WalletExportDialog.java @@ -43,7 +43,7 @@ public class WalletExportDialog extends Dialog { if(wallet.getPolicyType() == PolicyType.SINGLE) { exporters = List.of(new Electrum(), new SpecterDesktop(), new Sparrow()); } else if(wallet.getPolicyType() == PolicyType.MULTI) { - exporters = List.of(new ColdcardMultisig(), new CoboVaultMultisig(), new Electrum(), new SpecterDesktop(), new BlueWalletMultisig(), new Sparrow()); + exporters = List.of(new ColdcardMultisig(), new CoboVaultMultisig(), new Electrum(), new PassportMultisig(), new SpecterDesktop(), new BlueWalletMultisig(), new Sparrow()); } else { throw new UnsupportedOperationException("Cannot export wallet with policy type " + wallet.getPolicyType()); } diff --git a/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java b/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java index 0094be72..a1c8a875 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/PassportMultisig.java @@ -35,4 +35,14 @@ public class PassportMultisig extends ColdcardMultisig { public boolean isKeystoreImportScannable() { return true; } + + @Override + public String getWalletExportDescription() { + return "Export file that can be read by your Passport using the Settings > Multisig Wallets > Import feature."; + } + + @Override + public boolean isWalletExportScannable() { + return true; + } }