mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-11-02 18:26:43 +00:00
add satochip wallet model
This commit is contained in:
parent
30aff11908
commit
12db57c8d7
2 changed files with 49 additions and 2 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue