13 changed files with 104 additions and 21 deletions
@ -1 +1 @@ |
|||
Subproject commit 3642ddc9581c4485b13d4d0fffee6290703a5768 |
|||
Subproject commit 290fbabb54f0a334db15b66c968c9311122817e7 |
@ -0,0 +1,55 @@ |
|||
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; |
|||
|
|||
public class CoboVaultMultisig extends ColdcardMultisig { |
|||
@Override |
|||
public String getName() { |
|||
return "Cobo Vault Multisig"; |
|||
} |
|||
|
|||
@Override |
|||
public WalletModel getWalletModel() { |
|||
return WalletModel.COBO_VAULT; |
|||
} |
|||
|
|||
@Override |
|||
public Keystore getKeystore(ScriptType scriptType, InputStream inputStream, String password) throws ImportException { |
|||
Keystore keystore = super.getKeystore(scriptType, inputStream, password); |
|||
keystore.setLabel("Cobo Vault"); |
|||
keystore.setWalletModel(getWalletModel()); |
|||
|
|||
return keystore; |
|||
} |
|||
|
|||
@Override |
|||
public String getKeystoreImportDescription() { |
|||
return "Import file created by using the Multisig Wallet > Show/Export XPUB > Export All > Export feature on your Cobo Vault."; |
|||
} |
|||
|
|||
@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", "Cobo Vault")); |
|||
keystore.setWalletModel(WalletModel.COBO_VAULT); |
|||
} |
|||
|
|||
return wallet; |
|||
} |
|||
|
|||
@Override |
|||
public String getWalletImportDescription() { |
|||
return "Import file created by using the Multisig Wallet > Create Multisig Wallet feature on your Cobo Vault."; |
|||
} |
|||
|
|||
@Override |
|||
public String getWalletExportDescription() { |
|||
return "Export file that can be read by your Cobo Vault using the Multisig Wallet > Import Multisig Wallet feature."; |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.sparrowwallet.sparrow.io; |
|||
|
|||
import com.sparrowwallet.drongo.protocol.ScriptType; |
|||
import com.sparrowwallet.drongo.wallet.Keystore; |
|||
import com.sparrowwallet.drongo.wallet.WalletModel; |
|||
|
|||
import java.io.InputStream; |
|||
|
|||
public class CoboVaultSinglesig extends ColdcardSinglesig { |
|||
@Override |
|||
public String getName() { |
|||
return "Cobo Vault"; |
|||
} |
|||
|
|||
@Override |
|||
public String getKeystoreImportDescription() { |
|||
return "Import file created by using the Watch-Only Wallet > Generic Wallet > Export Wallet feature on your Cobo Vault."; |
|||
} |
|||
|
|||
@Override |
|||
public WalletModel getWalletModel() { |
|||
return WalletModel.COBO_VAULT; |
|||
} |
|||
|
|||
@Override |
|||
public Keystore getKeystore(ScriptType scriptType, InputStream inputStream, String password) throws ImportException { |
|||
Keystore keystore = super.getKeystore(scriptType, inputStream, password); |
|||
keystore.setLabel("Cobo Vault"); |
|||
keystore.setWalletModel(getWalletModel()); |
|||
|
|||
return keystore; |
|||
} |
|||
} |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 5.2 KiB |
Loading…
Reference in new issue