add satochip wallet model

This commit is contained in:
Craig Raw 2023-10-31 09:53:34 +01:00
parent 30aff11908
commit 12db57c8d7
2 changed files with 49 additions and 2 deletions

View file

@ -307,6 +307,13 @@ public class ECKey {
return pub.getEncoded();
}
/**
* Gets the raw public key value in compressed or uncompressed form.
*/
public byte[] getPubKey(boolean compressed) {
return pub.getEncoded(compressed);
}
/**
* Gets the x coordinate of the raw public key value. This appears in transaction scriptPubKeys for Taproot outputs.
*/

View file

@ -4,7 +4,7 @@ import java.util.Locale;
public enum WalletModel {
SEED, SPARROW, BITCOIN_CORE, ELECTRUM, TREZOR_1, TREZOR_T, COLDCARD, LEDGER_NANO_S, LEDGER_NANO_X, DIGITALBITBOX_01, KEEPKEY, SPECTER_DESKTOP, COBO_VAULT,
BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS, BSMS, KRUX;
BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS, BSMS, KRUX, SATOCHIP;
public static WalletModel getModel(String model) {
return valueOf(model.toUpperCase(Locale.ROOT));
@ -67,7 +67,47 @@ public enum WalletModel {
}
public boolean isCard() {
return (this == TAPSIGNER || this == SATSCARD);
return (this == TAPSIGNER || this == SATSCARD || this == SATOCHIP);
}
public int getMinPinLength() {
if(this == SATOCHIP) {
return 4;
} else {
return 6;
}
}
public int getMaxPinLength() {
if(this == SATOCHIP) {
return 16;
} else {
return 32;
}
}
public boolean hasDefaultPin() {
if(this == SATOCHIP) {
return false;
} else {
return true;
}
}
public boolean requiresSeedInitialization() {
if(this == SATOCHIP) {
return true;
} else {
return false;
}
}
public boolean supportsBackup() {
if(this == SATOCHIP) {
return false;
} else {
return true;
}
}
public static WalletModel fromType(String type) {