diff --git a/lib/wallets/crypto_currency/coins/bitcoin.dart b/lib/wallets/crypto_currency/coins/bitcoin.dart index ed44f818c..c1117d36a 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin.dart @@ -18,6 +18,18 @@ class Bitcoin extends Bip39HDCurrency { } } + @override + String get genesisHash { + switch (network) { + case CryptoCurrencyNetwork.main: + return "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"; + case CryptoCurrencyNetwork.test: + return "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"; + default: + throw Exception("Unsupported network: $network"); + } + } + @override Amount get dustLimit => Amount( rawValue: BigInt.from(294), diff --git a/lib/wallets/crypto_currency/coins/epiccash.dart b/lib/wallets/crypto_currency/coins/epiccash.dart index 796b37b29..68e8d4dfa 100644 --- a/lib/wallets/crypto_currency/coins/epiccash.dart +++ b/lib/wallets/crypto_currency/coins/epiccash.dart @@ -13,6 +13,11 @@ class Epiccash extends Bip39Currency { } } + @override + String get genesisHash { + return "not used in epiccash"; + } + @override // change this to change the number of confirms a tx needs in order to show as confirmed int get minConfirms => 3; diff --git a/lib/wallets/crypto_currency/crypto_currency.dart b/lib/wallets/crypto_currency/crypto_currency.dart index 500a18111..a651a8910 100644 --- a/lib/wallets/crypto_currency/crypto_currency.dart +++ b/lib/wallets/crypto_currency/crypto_currency.dart @@ -21,5 +21,8 @@ abstract class CryptoCurrency { int get minConfirms; + // TODO: [prio=low] could be handled differently as (at least) epiccash does not use this + String get genesisHash; + bool validateAddress(String address); }