Merge pull request #543 from cypherstack/add-ecash

Add ecash and themes upgrade
This commit is contained in:
Diego Salazar 2023-05-20 08:51:17 -06:00 committed by GitHub
commit 818cb56d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 9012 additions and 1350 deletions

Binary file not shown.

Binary file not shown.

83
assets/svg/anonymize.svg Normal file
View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
version="1.1"
id="svg18"
sodipodi:docname="tx-icon-anonymize.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<metadata
id="metadata22">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2262"
inkscape:window-height="1263"
id="namedview20"
showgrid="false"
inkscape:zoom="9.8333333"
inkscape:cx="-15.813559"
inkscape:cy="12"
inkscape:window-x="1019"
inkscape:window-y="569"
inkscape:window-maximized="0"
inkscape:current-layer="g8" />
<g
clip-path="url(#clip0_5035_57299)"
id="g8">
<g
clip-path="url(#clip1_5035_57299)"
id="g6"
transform="matrix(1.6610229,0,0,1.7055051,-7.9831634,-8.2054918)">
<path
d="m 9.92728,11.6469 c 0.13122,0.5688 -0.49218,1.0145 -0.9871,0.7028 L 8.27572,11.934 6.88393,14.1606 c -0.3645,0.583 0.05479,1.3393 0.74238,1.3393 h 0.87554 c 0.48235,0 0.87446,0.3916 0.87446,0.8739 0,0.4824 -0.39211,0.8764 -0.87446,0.8764 H 7.62904 c -2.06062,0 -3.31679,-2.2651 -2.22769,-4.0141 L 6.79123,11.0098 6.12514,10.5915 C 5.62994,10.2797 5.75627,9.52505 6.32557,9.3938 L 8.8256,8.81548 C 9.06049,8.7649 9.29838,8.90709 9.35307,9.14498 Z M 12.741,7.15873 13.8689,8.96724 13.2058,9.37959 c -0.4966,0.30925 -0.3711,1.06481 0.199,1.19681 l 2.4992,0.5783 c 0.2358,0.0546 0.4712,-0.0926 0.5253,-0.3284 L 17.0046,8.32631 C 17.1356,7.75728 16.5138,7.31322 16.0183,7.62193 L 15.3522,8.03755 14.2257,6.23396 C 13.1981,4.58951 10.8023,4.58841 9.77416,6.23227 L 9.57182,6.55552 C 9.31752,6.96158 9.4433,7.50381 9.84799,7.75865 10.256,8.01456 10.7987,7.89225 11.0541,7.48412 L 11.2576,7.159 c 0.3486,-0.55754 1.1498,-0.53703 1.4834,-2.7e-4 z m 5.857,6.07957 -0.4646,-0.7454 c -0.2553,-0.4096 -0.7946,-0.5348 -1.2042,-0.2791 -0.4085,0.2548 -0.5338,0.797 -0.2784,1.2053 l 0.4646,0.7424 c 0.365,0.5829 -0.0542,1.3398 -0.7421,1.3398 h -2.6247 l 6e-4,-0.7859 c 0,-0.5846 -0.7068,-0.8774 -1.1203,-0.464 l -1.8159,1.8165 c -0.1701,0.1701 -0.1701,0.4487 2e-4,0.6188 l 1.8161,1.8139 c 0.4135,0.4129 1.1198,0.12 1.1198,-0.4643 l -7e-4,-0.7842 h 2.6212 c 2.0616,3e-4 3.3194,-2.2665 2.2284,-4.0138 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#494949" />
</g>
</g>
<defs
id="defs16">
<clipPath
id="clip0_5035_57299">
<rect
width="24"
height="24"
fill="white"
id="rect10" />
</clipPath>
<clipPath
id="clip1_5035_57299">
<rect
width="14"
height="14"
fill="white"
transform="translate(5 5)"
id="rect13" />
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -188,33 +188,8 @@ void main() async {
await MainDB.instance.initMainDB();
ThemeService.instance.init(MainDB.instance);
// install default themes
if (!(await ThemeService.instance.verifyInstalled(themeId: "light"))) {
Logging.instance.log(
"Installing default light theme...",
level: LogLevel.Info,
);
final lightZip = await rootBundle.load("assets/default_themes/light.zip");
await ThemeService.instance
.install(themeArchiveData: lightZip.buffer.asUint8List());
Logging.instance.log(
"Installing default light theme... finished",
level: LogLevel.Info,
);
}
if (!(await ThemeService.instance.verifyInstalled(themeId: "dark"))) {
Logging.instance.log(
"Installing default dark theme... ",
level: LogLevel.Info,
);
final darkZip = await rootBundle.load("assets/default_themes/dark.zip");
await ThemeService.instance
.install(themeArchiveData: darkZip.buffer.asUint8List());
Logging.instance.log(
"Installing default dark theme... finished",
level: LogLevel.Info,
);
}
// check and update or install default themes
await ThemeService.instance.checkDefaultThemesOnStartup();
runApp(const ProviderScope(child: MyApp()));
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ class NotificationCard extends ConsumerWidget {
static const double mobileIconSize = 24;
static const double desktopIconSize = 30;
String coinIconPath(ThemeAssets assets, WidgetRef ref) {
String coinIconPath(IThemeAssets assets, WidgetRef ref) {
try {
final coin = coinFromPrettyName(notification.coinName);
return ref.read(coinIconProvider(coin));
@ -61,7 +61,7 @@ class NotificationCard extends ConsumerWidget {
File(
coinIconPath(
ref.watch(
themeProvider.select((value) => value.assets),
themeAssetsProvider,
),
ref),
),
@ -79,7 +79,7 @@ class NotificationCard extends ConsumerWidget {
File(
coinIconPath(
ref.watch(
themeProvider.select((value) => value.assets),
themeAssetsProvider,
),
ref),
),

View file

@ -113,7 +113,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
super.initState();
}
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
ChangeNowTransactionStatus? status;
try {
if (statusString.toLowerCase().startsWith("waiting")) {
@ -322,11 +322,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
File(
_fetchIconAssetForStatus(
trade.status,
ref.watch(
themeProvider.select(
(value) => value.assets,
),
),
ref.watch(themeAssetsProvider),
),
),
width: 32,
@ -393,11 +389,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
File(
_fetchIconAssetForStatus(
trade.status,
ref.watch(
themeProvider.select(
(value) => value.assets,
),
),
ref.watch(themeAssetsProvider),
),
),
width: 32,
@ -1232,7 +1224,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
if (trade.exchangeName
.startsWith(TrocadorExchange.exchangeName)) {
url =
"https://trocador.app/en/checkout${trade.tradeId}";
"https://trocador.app/en/checkout/${trade.tradeId}";
}
}
return ConditionalParent(

View file

@ -138,10 +138,8 @@ class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
const Spacer(
flex: 1,
),
Image(
image: AssetImage(
Assets.svg.unclaimedPaynym,
),
SvgPicture.asset(
Assets.svg.unclaimedPaynym,
width: MediaQuery.of(context).size.width / 2,
),
const SizedBox(

View file

@ -225,14 +225,14 @@ class _IncognitoInstalledThemesState
extends ConsumerState<IncognitoInstalledThemes> {
late final StreamSubscription<void> _subscription;
List<Tuple2<String, String>> installedThemeIdNames = [];
List<Tuple3<String, String, int?>> installedThemeIdNames = [];
void _updateInstalledList() {
installedThemeIdNames = ref
.read(pThemeService)
.installedThemes
.where((e) => e.themeId != "light" && e.themeId != "dark")
.map((e) => Tuple2(e.themeId, e.name))
.map((e) => Tuple3(e.themeId, e.name, e.version))
.toList();
}
@ -274,6 +274,7 @@ class _IncognitoInstalledThemesState
data: StackThemeMetaData(
name: e.item2,
id: e.item1,
version: e.item3 ?? 1,
sha256: "",
size: "",
previewImageUrl: "",

View file

@ -717,6 +717,7 @@ class _NodeFormState extends ConsumerState<NodeForm> {
case Coin.firoTestNet:
case Coin.dogecoinTestNet:
case Coin.epicCash:
case Coin.eCash:
return false;
case Coin.ethereum:

View file

@ -24,7 +24,7 @@ class TxIcon extends ConsumerWidget {
static const Size size = Size(32, 32);
String _getAssetName(
bool isCancelled, bool isReceived, bool isPending, ThemeAssets assets) {
bool isCancelled, bool isReceived, bool isPending, IThemeAssets assets) {
if (!isReceived && transaction.subType == TransactionSubType.mint) {
if (isCancelled) {
return Assets.svg.anonymizeFailed;
@ -65,7 +65,7 @@ class TxIcon extends ConsumerWidget {
currentHeight,
coin.requiredConfirmations,
),
ref.watch(themeProvider).assets,
ref.watch(themeAssetsProvider),
);
return SizedBox(

View file

@ -1,11 +1,13 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/receive_view/addresses/address_details_view.dart';
import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/edit_note_view.dart';
@ -605,17 +607,45 @@ class _TransactionDetailsViewState
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
_transaction.type ==
TransactionType.outgoing
? "Sent to"
: "Receiving address",
style: isDesktop
? STextStyles
.desktopTextExtraExtraSmall(
context)
: STextStyles.itemSubtitle(
context),
ConditionalParent(
condition: kDebugMode,
builder: (child) {
return Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
child,
CustomTextButton(
text: "Info",
onTap: () {
Navigator.of(context)
.pushNamed(
AddressDetailsView
.routeName,
arguments: Tuple2(
_transaction.address
.value!.id,
widget.walletId,
),
);
},
)
],
);
},
child: Text(
_transaction.type ==
TransactionType.outgoing
? "Sent to"
: "Receiving address",
style: isDesktop
? STextStyles
.desktopTextExtraExtraSmall(
context)
: STextStyles.itemSubtitle(
context),
),
),
const SizedBox(
height: 8,

View file

@ -288,7 +288,7 @@ class DesktopTradeRowCard extends ConsumerStatefulWidget {
class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
late final String tradeId;
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
ChangeNowTransactionStatus? status;
try {
if (statusString.toLowerCase().startsWith("waiting")) {
@ -528,7 +528,7 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
_fetchIconAssetForStatus(
trade.status,
ref.watch(
themeProvider.select((value) => value.assets),
themeAssetsProvider,
),
),
),

View file

@ -63,8 +63,8 @@ class DesktopBuyIcon extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return SvgPicture.asset(
ref.watch(themeProvider.select((value) => value.assets.buy)),
return SvgPicture.file(
File(ref.watch(themeAssetsProvider).buy),
width: 20,
height: 20,
color: DesktopMenuItemId.buy ==

View file

@ -69,7 +69,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
_MoreFeaturesItem(
label: "Anonymize funds",
detail: "Anonymize funds",
iconAsset: Assets.svg.anonymize,
iconAsset: Assets.svg.recycle,
onPressed: () => widget.onAnonymizeAllPressed?.call(),
),
if (manager.hasWhirlpoolSupport)

View file

@ -118,44 +118,6 @@ class _AppearanceOptionSettings
],
),
),
// const Padding(
// padding: EdgeInsets.all(10.0),
// child: Divider(
// thickness: 0.5,
// ),
// ),
// Padding(
// padding: const EdgeInsets.all(10.0),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// "System brightness",
// style: STextStyles.desktopTextExtraSmall(context)
// .copyWith(
// color: Theme.of(context)
// .extension<StackColors>()!
// .textDark),
// textAlign: TextAlign.left,
// ),
// SizedBox(
// height: 20,
// width: 40,
// child: DraggableSwitchButton(
// isOn: ref.watch(
// prefsChangeNotifierProvider.select(
// (value) => value.enableSystemBrightness),
// ),
// onValueChanged: (newValue) {
// ref
// .read(prefsChangeNotifierProvider)
// .enableSystemBrightness = newValue;
// },
// ),
// )
// ],
// ),
// ),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(

View file

@ -1468,7 +1468,7 @@ class BitcoinWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
// Generate and add addresses to relevant arrays

View file

@ -1371,7 +1371,7 @@ class BitcoinCashWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
// Generate and add addresses to relevant arrays

View file

@ -7,6 +7,7 @@ import 'package:stackwallet/models/paymint/fee_object_model.dart';
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart';
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
@ -233,6 +234,17 @@ abstract class CoinServiceAPI {
cachedClient: cachedClient,
tracker: tracker,
);
case Coin.eCash:
return ECashWallet(
walletId: walletId,
walletName: walletName,
coin: coin,
secureStore: secureStorageInterface,
client: client,
cachedClient: cachedClient,
tracker: tracker,
);
}
}

View file

@ -1318,7 +1318,7 @@ class DogecoinWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: "",

File diff suppressed because it is too large Load diff

View file

@ -350,7 +350,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
"Attempted to overwrite mnemonic on generate new wallet!");
}
final String mnemonic = bip39.generateMnemonic(strength: 256);
final String mnemonic = bip39.generateMnemonic(strength: 128);
await _secureStore.write(key: '${_walletId}_mnemonic', value: mnemonic);
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',

View file

@ -2163,7 +2163,7 @@ class FiroWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: "",

View file

@ -1498,7 +1498,7 @@ class LitecoinWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: "",

View file

@ -1479,7 +1479,7 @@ class NamecoinWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: "",

View file

@ -1394,7 +1394,7 @@ class ParticlWallet extends CoinServiceAPI
}
await _secureStore.write(
key: '${_walletId}_mnemonic',
value: bip39.generateMnemonic(strength: 256));
value: bip39.generateMnemonic(strength: 128));
await _secureStore.write(
key: '${_walletId}_mnemonicPassphrase',
value: "",

View file

@ -89,7 +89,7 @@ class PriceAPI {
final uri =
Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency"
"=${baseCurrency.toLowerCase()}"
"&ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false");

View file

@ -1,36 +1,44 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/models/isar/stack_theme.dart';
import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
final assets = ref.watch(themeProvider).assets;
switch (coin) {
case Coin.bitcoin:
case Coin.bitcoinTestNet:
return assets.bitcoin;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoin;
case Coin.bitcoincash:
case Coin.bitcoincashTestnet:
return assets.bitcoincash;
case Coin.dogecoin:
case Coin.dogecoinTestNet:
return assets.dogecoin;
case Coin.epicCash:
return assets.epicCash;
case Coin.firo:
case Coin.firoTestNet:
return assets.firo;
case Coin.monero:
return assets.monero;
case Coin.wownero:
return assets.wownero;
case Coin.namecoin:
return assets.namecoin;
case Coin.particl:
return assets.particl;
case Coin.ethereum:
return assets.ethereum;
final assets = ref.watch(themeAssetsProvider);
if (assets is ThemeAssets) {
switch (coin) {
case Coin.bitcoin:
case Coin.bitcoinTestNet:
return assets.bitcoin;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoin;
case Coin.bitcoincash:
case Coin.bitcoincashTestnet:
return assets.bitcoincash;
case Coin.dogecoin:
case Coin.dogecoinTestNet:
return assets.dogecoin;
case Coin.eCash:
return assets.bitcoin;
case Coin.epicCash:
return assets.epicCash;
case Coin.firo:
case Coin.firoTestNet:
return assets.firo;
case Coin.monero:
return assets.monero;
case Coin.wownero:
return assets.wownero;
case Coin.namecoin:
return assets.namecoin;
case Coin.particl:
return assets.particl;
case Coin.ethereum:
return assets.ethereum;
}
} else {
return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!;
}
});

View file

@ -1,77 +1,92 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/models/isar/stack_theme.dart';
import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
final assets = ref.watch(themeProvider).assets;
switch (coin) {
case Coin.bitcoin:
return assets.bitcoinImage;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoinImage;
case Coin.bitcoincash:
return assets.bitcoincashImage;
case Coin.dogecoin:
return assets.dogecoinImage;
case Coin.epicCash:
return assets.epicCashImage;
case Coin.firo:
return assets.firoImage;
case Coin.monero:
return assets.moneroImage;
case Coin.wownero:
return assets.wowneroImage;
case Coin.namecoin:
return assets.namecoinImage;
case Coin.particl:
return assets.particlImage;
case Coin.bitcoinTestNet:
return assets.bitcoinImage;
case Coin.bitcoincashTestnet:
return assets.bitcoincashImage;
case Coin.firoTestNet:
return assets.firoImage;
case Coin.dogecoinTestNet:
return assets.dogecoinImage;
case Coin.ethereum:
return assets.ethereumImage;
final assets = ref.watch(themeAssetsProvider);
if (assets is ThemeAssets) {
switch (coin) {
case Coin.bitcoin:
return assets.bitcoinImage;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoinImage;
case Coin.bitcoincash:
return assets.bitcoincashImage;
case Coin.dogecoin:
return assets.dogecoinImage;
case Coin.eCash:
return assets.bitcoinImage;
case Coin.epicCash:
return assets.epicCashImage;
case Coin.firo:
return assets.firoImage;
case Coin.monero:
return assets.moneroImage;
case Coin.wownero:
return assets.wowneroImage;
case Coin.namecoin:
return assets.namecoinImage;
case Coin.particl:
return assets.particlImage;
case Coin.bitcoinTestNet:
return assets.bitcoinImage;
case Coin.bitcoincashTestnet:
return assets.bitcoincashImage;
case Coin.firoTestNet:
return assets.firoImage;
case Coin.dogecoinTestNet:
return assets.dogecoinImage;
case Coin.ethereum:
return assets.ethereumImage;
}
} else {
return (assets as ThemeAssetsV2).coinImages[coin.mainNetVersion]!;
}
});
final coinImageSecondaryProvider = Provider.family<String, Coin>((ref, coin) {
final assets = ref.watch(themeProvider).assets;
switch (coin) {
case Coin.bitcoin:
return assets.bitcoinImageSecondary;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoinImageSecondary;
case Coin.bitcoincash:
return assets.bitcoincashImageSecondary;
case Coin.dogecoin:
return assets.dogecoinImageSecondary;
case Coin.epicCash:
return assets.epicCashImageSecondary;
case Coin.firo:
return assets.firoImageSecondary;
case Coin.monero:
return assets.moneroImageSecondary;
case Coin.wownero:
return assets.wowneroImageSecondary;
case Coin.namecoin:
return assets.namecoinImageSecondary;
case Coin.particl:
return assets.particlImageSecondary;
case Coin.bitcoinTestNet:
return assets.bitcoinImageSecondary;
case Coin.bitcoincashTestnet:
return assets.bitcoincashImageSecondary;
case Coin.firoTestNet:
return assets.firoImageSecondary;
case Coin.dogecoinTestNet:
return assets.dogecoinImageSecondary;
case Coin.ethereum:
return assets.ethereumImageSecondary;
final assets = ref.watch(themeAssetsProvider);
if (assets is ThemeAssets) {
switch (coin) {
case Coin.bitcoin:
return assets.bitcoinImageSecondary;
case Coin.litecoin:
case Coin.litecoinTestNet:
return assets.litecoinImageSecondary;
case Coin.bitcoincash:
return assets.bitcoincashImageSecondary;
case Coin.dogecoin:
return assets.dogecoinImageSecondary;
case Coin.eCash:
return assets.bitcoinImageSecondary;
case Coin.epicCash:
return assets.epicCashImageSecondary;
case Coin.firo:
return assets.firoImageSecondary;
case Coin.monero:
return assets.moneroImageSecondary;
case Coin.wownero:
return assets.wowneroImageSecondary;
case Coin.namecoin:
return assets.namecoinImageSecondary;
case Coin.particl:
return assets.particlImageSecondary;
case Coin.bitcoinTestNet:
return assets.bitcoinImageSecondary;
case Coin.bitcoincashTestnet:
return assets.bitcoincashImageSecondary;
case Coin.firoTestNet:
return assets.firoImageSecondary;
case Coin.dogecoinTestNet:
return assets.dogecoinImageSecondary;
case Coin.ethereum:
return assets.ethereumImageSecondary;
}
} else {
return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!;
}
});

View file

@ -12,6 +12,7 @@ class CoinThemeColorDefault {
Color get firo => const Color(0xFFFF897A);
Color get dogecoin => const Color(0xFFFFE079);
Color get epicCash => const Color(0xFFC5C7CB);
Color get eCash => const Color(0xFFC5C7CB);
Color get ethereum => const Color(0xFFA7ADE9);
Color get monero => const Color(0xFFFF9E6B);
Color get namecoin => const Color(0xFF91B1E1);
@ -32,6 +33,8 @@ class CoinThemeColorDefault {
case Coin.dogecoin:
case Coin.dogecoinTestNet:
return dogecoin;
case Coin.eCash:
return eCash;
case Coin.epicCash:
return epicCash;
case Coin.ethereum:

View file

@ -1682,6 +1682,8 @@ class StackColors extends ThemeExtension<StackColors> {
return _coin.dogecoin;
case Coin.epicCash:
return _coin.epicCash;
case Coin.eCash:
return _coin.eCash;
case Coin.ethereum:
return _coin.ethereum;
case Coin.firo:

View file

@ -20,3 +20,11 @@ final themeProvider = StateProvider<StackTheme>(
),
),
);
final themeAssetsProvider = StateProvider<IThemeAssets>(
(ref) => ref.watch(
themeProvider.select(
(value) => value.assets,
),
),
);

View file

@ -1,9 +1,9 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:archive/archive_io.dart';
import 'package:crypto/crypto.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart';
import 'package:isar/isar.dart';
@ -17,6 +17,7 @@ final pThemeService = Provider<ThemeService>((ref) {
});
class ThemeService {
static const _currentDefaultThemeVersion = 2;
ThemeService._();
static ThemeService? _instance;
static ThemeService get instance => _instance ??= ThemeService._();
@ -92,6 +93,70 @@ class ThemeService {
}
}
Future<void> checkDefaultThemesOnStartup() async {
// install default themes
if (!(await ThemeService.instance.verifyInstalled(themeId: "light"))) {
Logging.instance.log(
"Installing default light theme...",
level: LogLevel.Info,
);
final lightZip = await rootBundle.load("assets/default_themes/light.zip");
await ThemeService.instance
.install(themeArchiveData: lightZip.buffer.asUint8List());
Logging.instance.log(
"Installing default light theme... finished",
level: LogLevel.Info,
);
} else {
// check installed version
final theme = ThemeService.instance.getTheme(themeId: "light");
if ((theme?.version ?? 1) < _currentDefaultThemeVersion) {
Logging.instance.log(
"Updating default light theme...",
level: LogLevel.Info,
);
final lightZip =
await rootBundle.load("assets/default_themes/light.zip");
await ThemeService.instance
.install(themeArchiveData: lightZip.buffer.asUint8List());
Logging.instance.log(
"Updating default light theme... finished",
level: LogLevel.Info,
);
}
}
if (!(await ThemeService.instance.verifyInstalled(themeId: "dark"))) {
Logging.instance.log(
"Installing default dark theme... ",
level: LogLevel.Info,
);
final darkZip = await rootBundle.load("assets/default_themes/dark.zip");
await ThemeService.instance
.install(themeArchiveData: darkZip.buffer.asUint8List());
Logging.instance.log(
"Installing default dark theme... finished",
level: LogLevel.Info,
);
} else {
// check installed version
final theme = ThemeService.instance.getTheme(themeId: "dark");
if ((theme?.version ?? 1) < _currentDefaultThemeVersion) {
Logging.instance.log(
"Updating default dark theme...",
level: LogLevel.Info,
);
final darkZip = await rootBundle.load("assets/default_themes/dark.zip");
await ThemeService.instance
.install(themeArchiveData: darkZip.buffer.asUint8List());
Logging.instance.log(
"Updating default dark theme... finished",
level: LogLevel.Info,
);
}
}
}
// TODO more thorough check/verification of theme
Future<bool> verifyInstalled({required String themeId}) async {
final dbHasTheme =
@ -175,6 +240,7 @@ class ThemeService {
class StackThemeMetaData {
final String name;
final String id;
final int version;
final String sha256;
final String size;
final String previewImageUrl;
@ -182,6 +248,7 @@ class StackThemeMetaData {
StackThemeMetaData({
required this.name,
required this.id,
required this.version,
required this.sha256,
required this.size,
required this.previewImageUrl,
@ -192,6 +259,7 @@ class StackThemeMetaData {
return StackThemeMetaData(
name: map["name"] as String,
id: map["id"] as String,
version: map["version"] as int? ?? 1,
sha256: map["sha256"] as String,
size: map["size"] as String,
previewImageUrl: map["previewImageUrl"] as String,
@ -210,6 +278,7 @@ class StackThemeMetaData {
return "$runtimeType("
"name: $name, "
"id: $id, "
"version: $version, "
"sha256: $sha256, "
"size: $size, "
"previewImageUrl: $previewImageUrl"

View file

@ -5,6 +5,7 @@ import 'package:crypto/crypto.dart';
import 'package:flutter_libepiccash/epic_cash.dart';
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart';
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart';
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
@ -61,6 +62,8 @@ class AddressUtils {
return true; //TODO - validate ETH address
case Coin.firo:
return Address.validateAddress(address, firoNetwork);
case Coin.eCash:
return Address.validateAddress(address, eCashNetwork);
case Coin.monero:
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);

View file

@ -165,6 +165,7 @@ class _SVG {
String get questionMessage => "assets/svg/message-question.svg";
String get envelope => "assets/svg/envelope.svg";
String get share => "assets/svg/share-2.svg";
String get recycle => "assets/svg/anonymize.svg";
String get anonymize => "assets/svg/tx-icon-anonymize.svg";
String get anonymizePending => "assets/svg/tx-icon-anonymize-pending.svg";
String get anonymizeFailed => "assets/svg/tx-icon-anonymize-failed.svg";
@ -193,7 +194,7 @@ class _SVG {
String get exchange3 => "assets/svg/exchange-3.svg";
String get messageQuestion => "assets/svg/message-question-1.svg";
String get list => "assets/svg/list-ul.svg";
String get unclaimedPaynym => "assets/svg/unclaimed.png";
String get unclaimedPaynym => "assets/svg/unclaimed.svg";
String get trocadorRatingA => "assets/svg/trocador_rating_a.svg";
String get trocadorRatingB => "assets/svg/trocador_rating_b.svg";

View file

@ -17,6 +17,8 @@ Uri getDefaultBlockExplorerUrlFor({
return Uri.parse("https://mempool.space/testnet/tx/$txid");
case Coin.dogecoin:
return Uri.parse("https://chain.so/tx/DOGE/$txid");
case Coin.eCash:
return Uri.parse("https://explorer.bitcoinabc.org/tx/$txid");
case Coin.dogecoinTestNet:
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
case Coin.epicCash:

View file

@ -26,6 +26,7 @@ abstract class Constants {
// // true; // true for development,
static const int _satsPerCoinEthereum = 1000000000000000000;
static const int _satsPerCoinECash = 100;
static const int _satsPerCoinMonero = 1000000000000;
static const int _satsPerCoinWownero = 100000000000;
static const int _satsPerCoin = 100000000;
@ -33,6 +34,7 @@ abstract class Constants {
static const int _decimalPlacesWownero = 11;
static const int _decimalPlacesMonero = 12;
static const int _decimalPlacesEthereum = 18;
static const int _decimalPlacesECash = 2;
static const int notificationsMax = 0xFFFFFFFF;
static const Duration networkAliveTimerDuration = Duration(seconds: 10);
@ -71,6 +73,9 @@ abstract class Constants {
case Coin.ethereum:
return _satsPerCoinEthereum;
case Coin.eCash:
return _satsPerCoinECash;
}
}
@ -99,6 +104,9 @@ abstract class Constants {
case Coin.ethereum:
return _decimalPlacesEthereum;
case Coin.eCash:
return _decimalPlacesECash;
}
}
@ -115,6 +123,7 @@ abstract class Constants {
case Coin.bitcoinTestNet:
case Coin.dogecoinTestNet:
case Coin.firoTestNet:
case Coin.eCash:
case Coin.epicCash:
case Coin.ethereum:
case Coin.namecoin:
@ -137,10 +146,9 @@ abstract class Constants {
switch (coin) {
case Coin.bitcoin:
case Coin.bitcoinTestNet:
return 600;
case Coin.bitcoincash:
case Coin.bitcoincashTestnet:
case Coin.eCash:
return 600;
case Coin.dogecoin:
@ -175,7 +183,7 @@ abstract class Constants {
}
}
static const int seedPhraseWordCountBip39 = 24;
static const int seedPhraseWordCountBip39 = 12;
static const int seedPhraseWordCountMonero = 25;
static const Map<int, String> monthMapShort = {

View file

@ -1,6 +1,5 @@
import 'package:stackwallet/models/node_model.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
// import 'package:web3dart/browser.dart';
abstract class DefaultNodes {
static const String defaultNodeIdPrefix = "default_";
@ -13,6 +12,7 @@ abstract class DefaultNodes {
dogecoin,
firo,
monero,
eCash,
epicCash,
ethereum,
bitcoincash,
@ -219,6 +219,18 @@ abstract class DefaultNodes {
isDown: false,
);
static NodeModel get eCash => NodeModel(
host: "electrum.bitcoinabc.org",
port: 50002,
name: defaultName,
id: _nodeId(Coin.eCash),
useSSL: true,
enabled: true,
coinName: Coin.eCash.name,
isFailover: true,
isDown: false,
);
static NodeModel getNodeFor(Coin coin) {
switch (coin) {
case Coin.bitcoin:
@ -233,6 +245,9 @@ abstract class DefaultNodes {
case Coin.dogecoin:
return dogecoin;
case Coin.eCash:
return eCash;
case Coin.epicCash:
return epicCash;

View file

@ -3,6 +3,7 @@ import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'
as bch;
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
as doge;
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart' as ecash;
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
as epic;
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
@ -22,6 +23,7 @@ enum Coin {
bitcoin,
bitcoincash,
dogecoin,
eCash,
epicCash,
ethereum,
firo,
@ -59,6 +61,8 @@ extension CoinExt on Coin {
return "Dogecoin";
case Coin.epicCash:
return "Epic Cash";
case Coin.eCash:
return "E-Cash";
case Coin.ethereum:
return "Ethereum";
case Coin.firo:
@ -98,6 +102,8 @@ extension CoinExt on Coin {
return "EPIC";
case Coin.ethereum:
return "ETH";
case Coin.eCash:
return "XEC";
case Coin.firo:
return "FIRO";
case Coin.monero:
@ -136,6 +142,8 @@ extension CoinExt on Coin {
return "epic";
case Coin.ethereum:
return "ethereum";
case Coin.eCash:
return "ecash";
case Coin.firo:
return "firo";
case Coin.monero:
@ -173,6 +181,7 @@ extension CoinExt on Coin {
case Coin.bitcoincashTestnet:
case Coin.firoTestNet:
case Coin.dogecoinTestNet:
case Coin.eCash:
return true;
case Coin.epicCash:
@ -195,6 +204,7 @@ extension CoinExt on Coin {
case Coin.firo:
case Coin.namecoin:
case Coin.particl:
case Coin.eCash:
case Coin.epicCash:
case Coin.monero:
case Coin.wownero:
@ -220,6 +230,7 @@ extension CoinExt on Coin {
case Coin.ethereum:
case Coin.monero:
case Coin.wownero:
case Coin.eCash:
return false;
case Coin.dogecoinTestNet:
@ -244,6 +255,7 @@ extension CoinExt on Coin {
case Coin.ethereum:
case Coin.monero:
case Coin.wownero:
case Coin.eCash:
return this;
case Coin.dogecoinTestNet:
@ -288,6 +300,9 @@ extension CoinExt on Coin {
case Coin.epicCash:
return epic.MINIMUM_CONFIRMATIONS;
case Coin.eCash:
return ecash.MINIMUM_CONFIRMATIONS;
case Coin.ethereum:
return eth.MINIMUM_CONFIRMATIONS;
@ -339,6 +354,11 @@ Coin coinFromPrettyName(String name) {
case "firo":
return Coin.firo;
case "E-Cash":
case "ecash":
case "eCash":
return Coin.eCash;
case "Monero":
case "monero":
return Coin.monero;
@ -404,6 +424,8 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
return Coin.dogecoin;
case "epic":
return Coin.epicCash;
case "xec":
return Coin.eCash;
case "eth":
return Coin.ethereum;
case "firo":

View file

@ -6,6 +6,7 @@ enum DerivePathType {
bip49,
bip84,
eth,
eCash44,
}
extension DerivePathTypeExt on DerivePathType {
@ -27,6 +28,9 @@ extension DerivePathTypeExt on DerivePathType {
case Coin.particl:
return DerivePathType.bip84;
case Coin.eCash:
return DerivePathType.eCash44;
case Coin.ethereum: // TODO: do we need something here?
return DerivePathType.eth;

View file

@ -24,7 +24,7 @@ class TradeCard extends ConsumerWidget {
final Trade trade;
final VoidCallback onTap;
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
ChangeNowTransactionStatus? status;
try {
if (statusString.toLowerCase().startsWith("waiting")) {
@ -89,11 +89,7 @@ class TradeCard extends ConsumerWidget {
File(
_fetchIconAssetForStatus(
trade.status,
ref.watch(
themeProvider.select(
(value) => value.assets,
),
),
ref.watch(themeAssetsProvider),
),
),
width: 32,

View file

@ -120,9 +120,9 @@ packages:
dependency: "direct main"
description:
path: "."
ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
resolved-ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
url: "https://github.com/Quppy/bitbox-flutter.git"
ref: "50bf29957514a5712466ba37590a851212a244bf"
resolved-ref: "50bf29957514a5712466ba37590a851212a244bf"
url: "https://github.com/PiRK/bitbox-flutter.git"
source: git
version: "1.0.1"
bitcoindart:

View file

@ -85,8 +85,8 @@ dependencies:
ref: 3bef5acc21340f3cc78df0ad1dce5868a3ed68a5
bitbox:
git:
url: https://github.com/Quppy/bitbox-flutter.git
ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
url: https://github.com/PiRK/bitbox-flutter.git
ref: 50bf29957514a5712466ba37590a851212a244bf
bip32: ^2.0.0
bech32:
git:
@ -288,6 +288,7 @@ flutter:
- assets/svg/message-question.svg
- assets/svg/envelope.svg
- assets/svg/share-2.svg
- assets/svg/anonymize.svg
- assets/svg/tx-icon-anonymize.svg
- assets/svg/tx-icon-anonymize-pending.svg
- assets/svg/tx-icon-anonymize-failed.svg

View file

@ -27,13 +27,69 @@ void main() {
when(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,bitcoin-cash"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash"
",namecoin,wownero,ethereum,particl&order=market_cap_desc&per_page=50"
"&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
})).thenAnswer((_) async => Response(
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_change_percentage_24h":-2.64879,"circulating_supply":132670764299.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https://assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033729","current_price":0.00717236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"circulating_supply":18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo","image":"https://assets.coingecko.com/coins/images/479/large/firocoingecko.png?1636537544","current_price":0.0001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_change_percentage_24h":-0.79578,"circulating_supply":11411043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://asse'
'ts.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","curr'
'ent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_dil'
'uted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low'
'_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,'
'"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.0'
'0497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max'
'_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896'
',"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_'
'percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":nul'
'l,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symb'
'ol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/'
'coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e'
'-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuati'
'on":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-0'
'6,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h'
'":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_c'
'hange_percentage_24h":-2.64879,"circulating_supply":132670764299.89'
'4,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change'
'_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":'
'1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-'
'17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.11'
'3Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https:/'
'/assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033'
'729","current_price":0.00717236,"market_cap":130002,"market_cap_ran'
'k":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":'
'0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467'
'e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h"'
':-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"c'
'irculating_supply":18147820.3764146,"total_supply":null,"max_supply'
'":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date'
'":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentag'
'e":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"las'
't_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo'
'","name":"Firo","image":"https://assets.coingecko.com/coins/images/'
'479/large/firocoingecko.png?1636537544","current_price":0.0001096,"'
'market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":234'
'9,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,'
'"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h'
'":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_'
'change_percentage_24h":-0.79578,"circulating_supply":11411043.83546'
'97,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.016162'
'72,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.'
'408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"'
'2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16'
':38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
'"image":"https://assets.coingecko.com/coins/images/9520/large/Epic_C'
'oin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"marke'
't_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null'
',"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05'
',"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"'
'market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":'
'7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"'
'max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864'
',"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_chang'
'e_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi'
'":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
200));
final priceAPI = PriceAPI(client);
@ -45,7 +101,7 @@ void main() {
price.toString(),
'{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0], '
'Coin.dogecoin: [0.00000315, -2.68533], '
'Coin.epicCash: [0.00002803, 7.27524], '
'Coin.eCash: [0, 0.0], Coin.epicCash: [0.00002803, 7.27524], '
'Coin.ethereum: [0, 0.0], '
'Coin.firo: [0.0001096, -0.89304], Coin.litecoin: [0, 0.0], '
'Coin.monero: [0.00717236, -0.77656], Coin.namecoin: [0, 0.0], '
@ -57,7 +113,7 @@ void main() {
verify(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false",
),
@ -72,13 +128,69 @@ void main() {
when(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&"
"ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,"
"ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
})).thenAnswer((_) async => Response(
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_change_percentage_24h":-2.64879,"circulating_supply":132670764299.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https://assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033729","current_price":0.00717236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"circulating_supply":18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo","image":"https://assets.coingecko.com/coins/images/479/large/firocoingecko.png?1636537544","current_price":0.0001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_change_percentage_24h":-0.79578,"circulating_supply":11411043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://a'
'ssets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","c'
'urrent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_'
'diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"'
'low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0'
'.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h"'
':0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"'
'max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32'
'896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_cha'
'nge_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi"'
':null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","'
'symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.'
'com/coins/images/5/large/dogecoin.png?1547792256","current_price":3'
'.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_val'
'uation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.1'
'3e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage'
'_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_'
'cap_change_percentage_24h":-2.64879,"circulating_supply":1326707642'
'99.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_c'
'hange_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","'
'atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"202'
'0-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:'
'15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"ht'
'tps://assets.coingecko.com/coins/images/69/large/monero_logo.png?15'
'47033729","current_price":0.00717236,"market_cap":130002,"market_cap'
'_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high'
'_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.613354'
'3212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_chan'
'ge_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.7'
'6929,"circulating_supply":18147820.3764146,"total_supply":null,"ma'
'x_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"'
'ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_'
'percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":n'
'ull,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbo'
'l":"firo","name":"Firo","image":"https://assets.coingecko.com/coins'
'/images/479/large/firocoingecko.png?1636537544","current_price":0.0'
'001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valu'
'ation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0'
'.00010834,"price_change_24h":-9.87561775002e-07,"price_change_perce'
'ntage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"ma'
'rket_cap_change_percentage_24h":-0.79578,"circulating_supply":11411'
'043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath"'
':0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04'
'T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,'
'"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2'
'022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"'
'Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/'
'large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.80'
'3e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_val'
'uation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h'
'":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24'
'h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_perc'
'entage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":'
'21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentag'
'e":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-0'
'7,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01'
'.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
200));
final priceAPI = PriceAPI(client);
@ -94,7 +206,7 @@ void main() {
expect(
cachedPrice.toString(),
'{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0],'
' Coin.dogecoin: [0.00000315, -2.68533], Coin.epicCash: [0.00002803, 7.27524],'
' Coin.dogecoin: [0.00000315, -2.68533], Coin.eCash: [0, 0.0], Coin.epicCash: [0.00002803, 7.27524],'
' Coin.ethereum: [0, 0.0], Coin.firo: [0.0001096, -0.89304], '
'Coin.litecoin: [0, 0.0], Coin.monero: [0.00717236, -0.77656], '
'Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0], '
@ -105,7 +217,10 @@ void main() {
// verify only called once during filling of cache
verify(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,bitcoin-cash,namecoin,wownero,ethereum,particl&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {'Content-Type': 'application/json'})).called(1);
verifyNoMoreInteractions(client);
@ -117,13 +232,70 @@ void main() {
when(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
'Content-Type': 'application/json'
})).thenAnswer((_) async => Response(
'[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_change_percentage_24h":-2.64879,"circulating_supply":132670764299.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https://assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033729","current_price":0.00717236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"circulating_supply":18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo","image":"https://assets.coingecko.com/coins/images/479/large/firocoingecko.png?1636537544","current_price":0.0001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_change_percentage_24h":-0.79578,"circulating_supply":11411043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
'[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/'
'bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800'
',"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volum'
'e":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"pri'
'ce_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_'
'cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"t'
'otal_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath'
'_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z",'
'"atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":'
'"2019-10-21T00:00:00.000Z","roi":null,'
'"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin"'
',"symbol":"doge","name":"Dogecoin","image":'
'"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256",'
'"current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10'
',"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3'
'.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"'
'price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11'
'370.894861206936,"market_cap_change_percentage_24h":-2.64879,"cir'
'culating_supply":132670764299.894,"total_supply":null,"max_supply'
'":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date'
'":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percen'
'tage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,'
'"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol"'
':"xmr","name":"Monero","image":"https://assets.coingecko.com/coins'
'/images/69/large/monero_logo.png?1547033729","current_price":0.007'
'17236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valu'
'ation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.'
'00707511,"price_change_24h":-5.6133543212467e-05,"price_change_per'
'centage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197'
',"market_cap_change_percentage_24h":-0.76929,"circulating_supply":'
'18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.034'
'75393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:'
'00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"at'
'l_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022'
'-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo"'
',"image":"https://assets.coingecko.com/coins/images/479/large/firo'
'coingecko.png?1636537544","current_price":0.0001096,"market_cap":1'
'252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_vo'
'lume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_chang'
'e_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,'
'"market_cap_change_24h":-10.046635178462793,"market_cap_change_per'
'centage_24h":-0.79578,"circulating_supply":11411043.8354697,"tota'
'l_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath'
'_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z"'
',"atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"202'
'2-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:3'
'8:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
'"image":"https://assets.coingecko.com/coins/images/9520/large/'
'Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-0'
'5,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuat'
'ion":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":'
'2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h"'
':7.27524,"market_cap_change_24h":28.26753,"market_cap_change_per'
'centage_24h":7.30726,"circulating_supply":14808052.0,"total_suppl'
'y":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_perce'
'ntage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74'
'028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T'
'16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
200));
final priceAPI = PriceAPI(client);
@ -131,8 +303,15 @@ void main() {
final price = await priceAPI.getPricesAnd24hChange(baseCurrency: "btc");
expect(price.toString(),
'{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], Coin.dogecoin: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0], Coin.firo: [0, 0.0], Coin.litecoin: [0, 0.0], Coin.monero: [0, 0.0], Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0], Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0], Coin.firoTestNet: [0, 0.0]}');
expect(
price.toString(),
'{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], Coin.dogecoin: '
'[0, 0.0], Coin.eCash: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0],'
' Coin.firo: [0, 0.0], Coin.litecoin: [0, 0.0], Coin.monero: [0, 0.0],'
' Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0],'
' Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], '
'Coin.bitcoincashTestnet: [0, 0.0], Coin.dogecoinTestNet: [0, 0.0],'
' Coin.firoTestNet: [0, 0.0]}');
});
test("no internet available", () async {
@ -141,7 +320,7 @@ void main() {
when(client.get(
Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,epic-cash,zcoin,dogecoin,"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {
@ -157,7 +336,7 @@ void main() {
expect(
price.toString(),
'{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], '
'Coin.dogecoin: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0],'
'Coin.dogecoin: [0, 0.0], Coin.eCash: [0, 0.0], Coin.epicCash: [0, 0.0], Coin.ethereum: [0, 0.0],'
' Coin.firo: [0, 0.0], Coin.litecoin: [0, 0.0], Coin.monero: [0, 0.0],'
' Coin.namecoin: [0, 0.0], Coin.particl: [0, 0.0], Coin.wownero: [0, 0.0],'
' Coin.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], '

View file

@ -0,0 +1,252 @@
const Map<String, dynamic> lightThemeJsonMap = {
"name": "Light",
"version": 2,
"id": "light",
"brightness": "light",
"colors": {
// keys for coin colors must match the Coin enum name value exactly
"coin": {
"bitcoin": "0xFFFCC17B",
"litecoin": "0xFF7FA6E1",
"bitcoincash": "0xFF7BCFB8",
"firo": "0xFFFF897A",
"dogecoin": "0xFFFFE079",
"eCash": "0xFFC5C7CB",
"epicCash": "0xFFC5C7CB",
"ethereum": "0xFFA7ADE9",
"monero": "0xFFFF9E6B",
"namecoin": "0xFF91B1E1",
"wownero": "0xFFED80C1",
"particl": "0xFF8175BD"
},
"background": "0xFFF7F7F7",
"background_app_bar": "0xFFF7F7F7",
"overlay": "0xFF111215",
"accent_color_blue": "0xFF0052DF",
"accent_color_green": "0xFF4CC0A0",
"accent_color_yellow": "0xFFF7D65D",
"accent_color_red": "0xFFD34E50",
"accent_color_orange": "0xFFFEA68D",
"accent_color_dark": "0xFF232323",
"shadow": "0x0F2D3132",
"text_dark_one": "0xFF232323",
"text_dark_two": "0xFF414141",
"text_dark_three": "0xFF747778",
"text_white": "0xFFFFFFFF",
"text_favorite": "0xFF232323",
"text_error": "0xFF930006",
"text_restore": "0xFF111215",
"text_subtitle_one": "0xFF8E9192",
"text_subtitle_two": "0xFFA9ACAC",
"text_subtitle_three": "0xFFC4C7C7",
"text_subtitle_four": "0xFFE0E3E3",
"text_subtitle_five": "0xFFEEEFF1",
"text_subtitle_six": "0xFFF5F5F5",
"button_back_primary": "0xFF232323",
"button_back_secondary": "0xFFE0E3E3",
"button_back_primary_disabled": "0xFFD7D7D7",
"button_back_secondary_disabled": "0xFFF0F1F1",
"button_back_border": "0xFF232323",
"button_back_border_disabled": "0xFFB6B6B6",
"button_back_border_secondary": "0xFFE0E3E3",
"button_back_border_secondary_disabled": "0xFFF0F1F1",
"number_back_default": "0xFFFFFFFF",
"numpad_back_default": "0xFF232323",
"bottom_nav_back": "0xFFFFFFFF",
"button_text_primary": "0xFFFFFFFF",
"button_text_secondary": "0xFF232323",
"button_text_primary_disabled": "0xFFF8F8F8",
"button_text_secondary_disabled": "0xFFB7B7B7",
"button_text_border": "0xFF232323",
"button_text_disabled": "0xFFB6B6B6",
"button_text_borderless": "0xFF0052DF",
"button_text_borderless_disabled": "0xFFB6B6B6",
"number_text_default": "0xFF232323",
"numpad_text_default": "0xFFFFFFFF",
"bottom_nav_text": "0xFF232323",
"custom_text_button_enabled_text": "0xFF0052DF",
"custom_text_button_disabled_text": "0xFF8E9192",
"switch_bg_on": "0xFF0052DF",
"switch_bg_off": "0xFFD8E4FB",
"switch_bg_disabled": "0xFFC5C6C9",
"switch_circle_on": "0xFFDAE2FF",
"switch_circle_off": "0xFFFBFCFF",
"switch_circle_disabled": "0xFFFBFCFF",
"step_indicator_bg_check": "0xFFD9E2FF",
"step_indicator_bg_number": "0xFFD9E2FF",
"step_indicator_bg_inactive": "0xFFCDCDCD",
"step_indicator_bg_lines": "0xFF0056D2",
"step_indicator_bg_lines_inactive": "0xFFCDCDCD",
"step_indicator_icon_text": "0xFF0056D2",
"step_indicator_icon_number": "0xFF0056D2",
"step_indicator_icon_inactive": "0xFFF7F7F7",
"checkbox_bg_checked": "0xFF0056D2",
"checkbox_border_empty": "0xFF8E9192",
"checkbox_bg_disabled": "0xFFADC7EC",
"checkbox_icon_checked": "0xFFFFFFFF",
"checkbox_icon_disabled": "0xFFFFFFFF",
"checkbox_text_label": "0xFF232323",
"snack_bar_back_success": "0xFFB9E9D4",
"snack_bar_back_error": "0xFFFFDAD4",
"snack_bar_back_info": "0xFFDAE2FF",
"snack_bar_text_success": "0xFF006C4D",
"snack_bar_text_error": "0xFF930006",
"snack_bar_text_info": "0xFF002A78",
"bottom_nav_icon_back": "0xFFA2A2A2",
"bottom_nav_icon_icon": "0xFF232323",
"bottom_nav_icon_icon_highlighted": "0xFF232323",
"top_nav_icon_primary": "0xFF232323",
"top_nav_icon_green": "0xFF00A578",
"top_nav_icon_yellow": "0xFFF4C517",
"top_nav_icon_red": "0xFFC00205",
"settings_icon_back": "0xFFE0E3E3",
"settings_icon_icon": "0xFF232323",
"settings_icon_back_two": "0xFF94D6C4",
"settings_icon_element": "0xFF00A578",
"text_field_active_bg": "0xFFEEEFF1",
"text_field_default_bg": "0xFFEEEFF1",
"text_field_error_bg": "0xFFFFDAD4",
"text_field_success_bg": "0xFFB9E9D4",
"text_field_error_border": "0xFFFFDAD4",
"text_field_success_border": "0xFFB9E9D4",
"text_field_active_search_icon_left": "0xFFA9ACAC",
"text_field_default_search_icon_left": "0xFFA9ACAC",
"text_field_error_search_icon_left": "0xFF930006",
"text_field_success_search_icon_left": "0xFF006C4D",
"text_field_active_text": "0xFF232323",
"text_field_default_text": "0xFFA9ACAC",
"text_field_error_text": "0xFF000000",
"text_field_success_text": "0xFF000000",
"text_field_active_label": "0xFFA9ACAC",
"text_field_error_label": "0xFF930006",
"text_field_success_label": "0xFF006C4D",
"text_field_active_search_icon_right": "0xFF747778",
"text_field_default_search_icon_right": "0xFF747778",
"text_field_error_search_icon_right": "0xFF930006",
"text_field_success_search_icon_right": "0xFF006C4D",
"settings_item_level_two_active_bg": "0xFFFFFFFF",
"settings_item_level_two_active_text": "0xFF232323",
"settings_item_level_two_active_sub": "0xFF8E9192",
"radio_button_icon_border": "0xFF0056D2",
"radio_button_icon_border_disabled": "0xFF8F909A",
"radio_button_border_enabled": "0xFF0056D2",
"radio_button_border_disabled": "0xFF8F909A",
"radio_button_icon_circle": "0xFF0056D2",
"radio_button_icon_enabled": "0xFF0056D2",
"radio_button_text_enabled": "0xFF44464E",
"radio_button_text_disabled": "0xFF44464E",
"radio_button_label_enabled": "0xFF8E9192",
"radio_button_label_disabled": "0xFF8E9192",
"info_item_bg": "0xFFFFFFFF",
"info_item_label": "0xFF8E9192",
"info_item_text": "0xFF232323",
"info_item_icons": "0xFF0056D2",
"popup_bg": "0xFFFFFFFF",
"currency_list_item_bg": "0xFFF9F9FC",
"sw_bg": "0xFFFFFFFF",
"sw_mid": "0xFFFFFFFF",
"sw_bottom": "0xFF232323",
"bottom_nav_shadow": "0xFF282E33",
"favorite_star_active": "0xFF0056D2",
"favorite_star_inactive": "0xFFC4C7C7",
"splash": "0x358E9192",
"highlight": "0x44A9ACAC",
"warning_foreground": "0xFF232323",
"warning_background": "0xFFFFDAD3",
"loading_overlay_text_color": "0xFFF7F7F7",
"my_stack_contact_icon_bg": "0xFFEEEFF1",
"text_confirm_total_amount": "0xFF232323",
"text_selected_word_table_iterm": "0xFF232323",
"rate_type_toggle_color_on": "0xFFEEEFF1",
"rate_type_toggle_color_off": "0xFFFFFFFF",
"rate_type_toggle_desktop_color_on": "0xFFEEEFF1",
"rate_type_toggle_desktop_color_off": "0xFFE0E3E3",
"eth_tag_text": "0xFFFFFFFF",
"eth_tag_bg": "0xFF4D5798",
"eth_wallet_tag_text": "0xFF4D5798",
"eth_wallet_tag_bg": "0xFFF0F3FD",
"token_summary_text_primary": "0xFF232323",
"token_summary_text_secondary": "0xFF8488AB",
"token_summary_bg": "0xFFE9EAFF",
"token_summary_button_bg": "0xFFFFFFFF",
"token_summary_icon": "0xFF424A97",
"box_shadows": {
"standard": {
"color": "0x0F2D3132",
"spread_radius": 3.0,
"blur_radius": 4.0
},
"home_view_button_bar": {
"color": "0x0F2D3132",
"spread_radius": 3.0,
"blur_radius": 4.0
}
}
},
"assets": {
"coin_placeholder": "dummy.svg",
// keys for coin assets must match the Coin enum name value exactly
"coins": {
"icons": {
"bitcoin": "dummy.svg",
"litecoin": "dummy.svg",
"bitcoincash": "dummy.svg",
"dogecoin": "dummy.svg",
"eCash": "dummy.svg",
"epicCash": "dummy.svg",
"ethereum": "dummy.svg",
"firo": "dummy.svg",
"monero": "dummy.svg",
"wownero": "dummy.svg",
"namecoin": "dummy.svg",
"particl": "dummy.svg"
},
"images": {
"bitcoin": "dummy.svg",
"litecoin": "dummy.svg",
"bitcoincash": "dummy.svg",
"dogecoin": "dummy.svg",
"eCash": "dummy.svg",
"epicCash": "dummy.svg",
"ethereum": "dummy.svg",
"firo": "dummy.svg",
"monero": "dummy.svg",
"wownero": "dummy.svg",
"namecoin": "dummy.svg",
"particl": "dummy.svg"
},
"secondaries": {
"bitcoin": "dummy.svg",
"litecoin": "dummy.svg",
"bitcoincash": "dummy.svg",
"dogecoin": "dummy.svg",
"eCash": "dummy.svg",
"epicCash": "dummy.svg",
"ethereum": "dummy.svg",
"firo": "dummy.svg",
"monero": "dummy.svg",
"wownero": "dummy.svg",
"namecoin": "dummy.svg",
"particl": "dummy.svg"
}
},
"bell_new": "dummy.svg",
"persona_incognito": "dummy.svg.svg",
"persona_easy": "dummy.svg",
"stack": "dummy.svg",
"stack_icon": "dummy.svg",
"receive": "dummy.svg",
"receive_pending": "dummy.svg",
"receive_cancelled": "dummy.svg",
"send": "dummy.svg",
"tx_exchange": "dummy.svg",
"tx_exchange_pending": "dummy.svg",
"tx_exchange_failed": "dummy.svg",
"buy": "dummy.svg",
"exchange": "dummy.svg",
"send_pending": "dummy.svg",
"send_cancelled": "dummy.svg",
"theme_selector": "dummy.svg",
"theme_preview": "dummy.png"
}
};