2023-11-17 01:44:17 +00:00
|
|
|
import 'package:stackwallet/models/node_model.dart';
|
2023-09-18 21:28:31 +00:00
|
|
|
import 'package:stackwallet/utilities/constants.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|
|
|
|
|
|
|
enum CryptoCurrencyNetwork {
|
|
|
|
main,
|
|
|
|
test,
|
|
|
|
stage;
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract class CryptoCurrency {
|
|
|
|
@Deprecated("[prio=low] Should eventually move away from Coin enum")
|
|
|
|
late final Coin coin;
|
|
|
|
|
|
|
|
final CryptoCurrencyNetwork network;
|
|
|
|
|
|
|
|
CryptoCurrency(this.network);
|
|
|
|
|
2023-11-03 19:46:55 +00:00
|
|
|
// override in subclass if the currency has tokens on it's network
|
|
|
|
// (used for eth currently)
|
|
|
|
bool get hasTokenSupport => false;
|
|
|
|
|
2023-09-18 21:28:31 +00:00
|
|
|
// 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);
|
|
|
|
|
|
|
|
int get minConfirms;
|
|
|
|
|
2023-10-30 17:41:52 +00:00
|
|
|
// TODO: [prio=low] could be handled differently as (at least) epiccash does not use this
|
|
|
|
String get genesisHash;
|
|
|
|
|
2023-09-18 21:28:31 +00:00
|
|
|
bool validateAddress(String address);
|
2023-11-17 01:44:17 +00:00
|
|
|
|
|
|
|
NodeModel get defaultNode;
|
2023-09-18 21:28:31 +00:00
|
|
|
}
|