add tor support bool to CryptoCurrency and override in coin impls

This commit is contained in:
sneurlax 2024-04-16 17:42:51 -05:00
parent 70a0232de9
commit 3218216caa
10 changed files with 30 additions and 0 deletions

View file

@ -25,6 +25,9 @@ class Bitcoin extends Bip39HDCurrency with PaynymCurrencyInterface {
// change this to change the number of confirms a tx needs in order to show as confirmed
int get minConfirms => 1;
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.bip44,

View file

@ -23,6 +23,9 @@ class BitcoinFrost extends FrostCurrency {
@override
int get minConfirms => 1;
@override
bool get torSupport => true;
@override
NodeModel get defaultNode {
switch (network) {

View file

@ -34,6 +34,9 @@ class Bitcoincash extends Bip39HDCurrency {
// change this to change the number of confirms a tx needs in order to show as confirmed
int get minConfirms => 0; // bch zeroconf
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.bip44,

View file

@ -20,6 +20,9 @@ class Dogecoin extends Bip39HDCurrency {
}
}
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.bip44,

View file

@ -32,6 +32,9 @@ class Ecash extends Bip39HDCurrency {
// change this to change the number of confirms a tx needs in order to show as confirmed
int get minConfirms => 0; // bch zeroconf
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.eCash44,

View file

@ -24,6 +24,9 @@ class Firo extends Bip39HDCurrency {
@override
int get minConfirms => 1;
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.bip44,

View file

@ -24,6 +24,9 @@ class Litecoin extends Bip39HDCurrency {
// change this to change the number of confirms a tx needs in order to show as confirmed
int get minConfirms => 1;
@override
bool get torSupport => true;
@override
List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.bip44,

View file

@ -22,6 +22,9 @@ class Namecoin extends Bip39HDCurrency {
// See https://github.com/cypherstack/stack_wallet/blob/621aff47969761014e0a6c4e699cb637d5687ab3/lib/services/coins/namecoin/namecoin_wallet.dart#L58
int get minConfirms => 2;
@override
bool get torSupport => true;
@override
// See https://github.com/cypherstack/stack_wallet/blob/621aff47969761014e0a6c4e699cb637d5687ab3/lib/services/coins/namecoin/namecoin_wallet.dart#L80
String constructDerivePath({

View file

@ -22,6 +22,9 @@ class Particl extends Bip39HDCurrency {
// See https://github.com/cypherstack/stack_wallet/blob/d08b5c9b22b58db800ad07b2ceeb44c6d05f9cf3/lib/services/coins/particl/particl_wallet.dart#L57
int get minConfirms => 1;
@override
bool get torSupport => true;
@override
// See https://github.com/cypherstack/stack_wallet/blob/d08b5c9b22b58db800ad07b2ceeb44c6d05f9cf3/lib/services/coins/particl/particl_wallet.dart#L68
String constructDerivePath(

View file

@ -20,6 +20,9 @@ abstract class CryptoCurrency {
// (used for eth currently)
bool get hasTokenSupport => false;
// Override in subclass if the currency has Tor support:
bool get torSupport => false;
// TODO: [prio=low] require these be overridden in concrete implementations to remove reliance on [coin]
int get fractionDigits => coin.decimals;
BigInt get satsPerCoin => Constants.satsPerCoin(coin);