2022-08-26 08:11:35 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
2022-10-24 22:30:38 +00:00
|
|
|
import 'package:stackwallet/utilities/util.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
class _LayoutSizing {
|
|
|
|
const _LayoutSizing();
|
|
|
|
|
|
|
|
double get circularBorderRadius => 8.0;
|
|
|
|
double get checkboxBorderRadius => 4.0;
|
|
|
|
|
|
|
|
double get standardPadding => 16.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract class Constants {
|
|
|
|
static const size = _LayoutSizing();
|
|
|
|
|
2022-10-24 22:30:38 +00:00
|
|
|
static void exchangeForExperiencedUsers(int count) {
|
|
|
|
enableExchange =
|
|
|
|
Util.isDesktop || Platform.isAndroid || count > 5 || !Platform.isIOS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool enableExchange = Util.isDesktop || !Platform.isIOS;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
//TODO: correct for monero?
|
|
|
|
static const int satsPerCoinMonero = 1000000000000;
|
2022-09-28 23:15:16 +00:00
|
|
|
static const int satsPerCoinWownero = 100000000000;
|
2022-08-26 08:11:35 +00:00
|
|
|
static const int satsPerCoin = 100000000;
|
|
|
|
static const int decimalPlaces = 8;
|
2022-09-30 21:21:10 +00:00
|
|
|
static const int decimalPlacesWownero = 11;
|
|
|
|
static const int decimalPlacesMonero = 12;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
static const int notificationsMax = 0xFFFFFFFF;
|
|
|
|
static const Duration networkAliveTimerDuration = Duration(seconds: 10);
|
|
|
|
|
|
|
|
static const int pinLength = 4;
|
|
|
|
|
|
|
|
// enable testnet
|
|
|
|
// TODO: currently unused
|
|
|
|
static const bool allowTestnets = true;
|
|
|
|
|
|
|
|
// Enable Logger.print statements
|
|
|
|
static const bool disableLogger = false;
|
|
|
|
|
2022-10-19 22:51:50 +00:00
|
|
|
static const int currentHiveDbVersion = 3;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
static List<int> possibleLengthsForCoin(Coin coin) {
|
|
|
|
final List<int> values = [];
|
|
|
|
switch (coin) {
|
|
|
|
case Coin.bitcoin:
|
2022-09-26 20:32:53 +00:00
|
|
|
case Coin.bitcoincash:
|
|
|
|
case Coin.bitcoincashTestnet:
|
2022-08-26 08:11:35 +00:00
|
|
|
case Coin.dogecoin:
|
|
|
|
case Coin.firo:
|
|
|
|
case Coin.bitcoinTestNet:
|
|
|
|
case Coin.dogecoinTestNet:
|
|
|
|
case Coin.firoTestNet:
|
|
|
|
case Coin.epicCash:
|
2022-09-23 21:02:53 +00:00
|
|
|
case Coin.namecoin:
|
2022-08-26 08:11:35 +00:00
|
|
|
values.addAll([24, 21, 18, 15, 12]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Coin.monero:
|
|
|
|
values.addAll([25]);
|
|
|
|
break;
|
2022-09-27 08:09:31 +00:00
|
|
|
case Coin.wownero:
|
|
|
|
values.addAll([14]);
|
|
|
|
break;
|
2022-08-26 08:11:35 +00:00
|
|
|
}
|
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int targetBlockTimeInSeconds(Coin coin) {
|
|
|
|
// TODO verify values
|
|
|
|
switch (coin) {
|
|
|
|
case Coin.bitcoin:
|
|
|
|
case Coin.bitcoinTestNet:
|
|
|
|
return 600;
|
|
|
|
|
2022-09-26 20:32:53 +00:00
|
|
|
case Coin.bitcoincash:
|
|
|
|
case Coin.bitcoincashTestnet:
|
|
|
|
return 600;
|
2022-09-09 10:59:40 +00:00
|
|
|
|
2022-08-26 08:11:35 +00:00
|
|
|
case Coin.dogecoin:
|
|
|
|
case Coin.dogecoinTestNet:
|
|
|
|
return 60;
|
|
|
|
|
|
|
|
case Coin.firo:
|
|
|
|
case Coin.firoTestNet:
|
|
|
|
return 150;
|
|
|
|
|
|
|
|
case Coin.epicCash:
|
|
|
|
return 60;
|
|
|
|
|
|
|
|
case Coin.monero:
|
|
|
|
return 120;
|
2022-09-27 08:09:31 +00:00
|
|
|
|
|
|
|
case Coin.wownero:
|
|
|
|
return 120;
|
2022-09-27 08:16:20 +00:00
|
|
|
|
2022-09-23 21:02:53 +00:00
|
|
|
case Coin.namecoin:
|
|
|
|
return 600;
|
2022-08-26 08:11:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static const int seedPhraseWordCountBip39 = 24;
|
|
|
|
static const int seedPhraseWordCountMonero = 25;
|
|
|
|
|
|
|
|
static const Map<int, String> monthMapShort = {
|
|
|
|
1: 'Jan',
|
|
|
|
2: 'Feb',
|
|
|
|
3: 'Mar',
|
|
|
|
4: 'Apr',
|
|
|
|
5: 'May',
|
|
|
|
6: 'Jun',
|
|
|
|
7: 'Jul',
|
|
|
|
8: 'Aug',
|
|
|
|
9: 'Sep',
|
|
|
|
10: 'Oct',
|
|
|
|
11: 'Nov',
|
|
|
|
12: 'Dec',
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Map<int, String> monthMap = {
|
|
|
|
1: 'January',
|
|
|
|
2: 'February',
|
|
|
|
3: 'March',
|
|
|
|
4: 'April',
|
|
|
|
5: 'May',
|
|
|
|
6: 'June',
|
|
|
|
7: 'July',
|
|
|
|
8: 'August',
|
|
|
|
9: 'September',
|
|
|
|
10: 'October',
|
|
|
|
11: 'November',
|
|
|
|
12: 'December',
|
|
|
|
};
|
|
|
|
}
|