diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java index f7d31e9f..172ae84d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardMultisig.java @@ -48,8 +48,8 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle keystore.setKeyDerivation(new KeyDerivation(cck.xfp, cck.p2sh_deriv)); keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(cck.p2sh)); } else if(scriptType.equals(ScriptType.P2SH_P2WSH)) { - keystore.setKeyDerivation(new KeyDerivation(cck.xfp, cck.p2wsh_p2sh_deriv)); - keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(cck.p2wsh_p2sh)); + keystore.setKeyDerivation(new KeyDerivation(cck.xfp, cck.p2wsh_p2sh_deriv != null ? cck.p2wsh_p2sh_deriv : cck.p2sh_p2wsh_deriv)); + keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(cck.p2wsh_p2sh != null ? cck.p2wsh_p2sh : cck.p2sh_p2wsh)); } else if(scriptType.equals(ScriptType.P2WSH)) { keystore.setKeyDerivation(new KeyDerivation(cck.xfp, cck.p2wsh_deriv)); keystore.setExtendedPublicKey(ExtendedKey.fromDescriptor(cck.p2wsh)); @@ -65,6 +65,8 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle public String p2sh; public String p2wsh_p2sh_deriv; public String p2wsh_p2sh; + public String p2sh_p2wsh_deriv; + public String p2sh_p2wsh; public String p2wsh_deriv; public String p2wsh; public String xpub; diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java index a308e3b2..f7c1a450 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/ColdcardSinglesig.java @@ -66,7 +66,7 @@ public class ColdcardSinglesig implements KeystoreFileImport, WalletImport { ColdcardKeystore ck = gson.fromJson(map.get(key), ColdcardKeystore.class); if(ck.name != null) { - ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").toUpperCase()); + ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").replace("p2sh-p2wpkh", "p2sh_p2wpkh").toUpperCase()); if(ckScriptType.equals(scriptType)) { Keystore keystore = new Keystore(); keystore.setLabel(getName());