mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
Merge remote-tracking branch 'origin_SW/staging' into firo_cleanup
This commit is contained in:
commit
ee830a4788
46 changed files with 9013 additions and 1351 deletions
Binary file not shown.
Binary file not shown.
83
assets/svg/anonymize.svg
Normal file
83
assets/svg/anonymize.svg
Normal 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 |
|
@ -188,33 +188,8 @@ void main() async {
|
||||||
await MainDB.instance.initMainDB();
|
await MainDB.instance.initMainDB();
|
||||||
ThemeService.instance.init(MainDB.instance);
|
ThemeService.instance.init(MainDB.instance);
|
||||||
|
|
||||||
// install default themes
|
// check and update or install default themes
|
||||||
if (!(await ThemeService.instance.verifyInstalled(themeId: "light"))) {
|
await ThemeService.instance.checkDefaultThemesOnStartup();
|
||||||
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,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
runApp(const ProviderScope(child: MyApp()));
|
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
|
@ -32,7 +32,7 @@ class NotificationCard extends ConsumerWidget {
|
||||||
static const double mobileIconSize = 24;
|
static const double mobileIconSize = 24;
|
||||||
static const double desktopIconSize = 30;
|
static const double desktopIconSize = 30;
|
||||||
|
|
||||||
String coinIconPath(ThemeAssets assets, WidgetRef ref) {
|
String coinIconPath(IThemeAssets assets, WidgetRef ref) {
|
||||||
try {
|
try {
|
||||||
final coin = coinFromPrettyName(notification.coinName);
|
final coin = coinFromPrettyName(notification.coinName);
|
||||||
return ref.read(coinIconProvider(coin));
|
return ref.read(coinIconProvider(coin));
|
||||||
|
@ -61,7 +61,7 @@ class NotificationCard extends ConsumerWidget {
|
||||||
File(
|
File(
|
||||||
coinIconPath(
|
coinIconPath(
|
||||||
ref.watch(
|
ref.watch(
|
||||||
themeProvider.select((value) => value.assets),
|
themeAssetsProvider,
|
||||||
),
|
),
|
||||||
ref),
|
ref),
|
||||||
),
|
),
|
||||||
|
@ -79,7 +79,7 @@ class NotificationCard extends ConsumerWidget {
|
||||||
File(
|
File(
|
||||||
coinIconPath(
|
coinIconPath(
|
||||||
ref.watch(
|
ref.watch(
|
||||||
themeProvider.select((value) => value.assets),
|
themeAssetsProvider,
|
||||||
),
|
),
|
||||||
ref),
|
ref),
|
||||||
),
|
),
|
||||||
|
|
|
@ -113,7 +113,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
|
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
|
||||||
ChangeNowTransactionStatus? status;
|
ChangeNowTransactionStatus? status;
|
||||||
try {
|
try {
|
||||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||||
|
@ -322,11 +322,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
File(
|
File(
|
||||||
_fetchIconAssetForStatus(
|
_fetchIconAssetForStatus(
|
||||||
trade.status,
|
trade.status,
|
||||||
ref.watch(
|
ref.watch(themeAssetsProvider),
|
||||||
themeProvider.select(
|
|
||||||
(value) => value.assets,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
width: 32,
|
width: 32,
|
||||||
|
@ -393,11 +389,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
File(
|
File(
|
||||||
_fetchIconAssetForStatus(
|
_fetchIconAssetForStatus(
|
||||||
trade.status,
|
trade.status,
|
||||||
ref.watch(
|
ref.watch(themeAssetsProvider),
|
||||||
themeProvider.select(
|
|
||||||
(value) => value.assets,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
width: 32,
|
width: 32,
|
||||||
|
@ -1232,7 +1224,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
||||||
if (trade.exchangeName
|
if (trade.exchangeName
|
||||||
.startsWith(TrocadorExchange.exchangeName)) {
|
.startsWith(TrocadorExchange.exchangeName)) {
|
||||||
url =
|
url =
|
||||||
"https://trocador.app/en/checkout${trade.tradeId}";
|
"https://trocador.app/en/checkout/${trade.tradeId}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ConditionalParent(
|
return ConditionalParent(
|
||||||
|
|
|
@ -138,10 +138,8 @@ class _PaynymClaimViewState extends ConsumerState<PaynymClaimView> {
|
||||||
const Spacer(
|
const Spacer(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
),
|
),
|
||||||
Image(
|
SvgPicture.asset(
|
||||||
image: AssetImage(
|
Assets.svg.unclaimedPaynym,
|
||||||
Assets.svg.unclaimedPaynym,
|
|
||||||
),
|
|
||||||
width: MediaQuery.of(context).size.width / 2,
|
width: MediaQuery.of(context).size.width / 2,
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|
|
@ -225,14 +225,14 @@ class _IncognitoInstalledThemesState
|
||||||
extends ConsumerState<IncognitoInstalledThemes> {
|
extends ConsumerState<IncognitoInstalledThemes> {
|
||||||
late final StreamSubscription<void> _subscription;
|
late final StreamSubscription<void> _subscription;
|
||||||
|
|
||||||
List<Tuple2<String, String>> installedThemeIdNames = [];
|
List<Tuple3<String, String, int?>> installedThemeIdNames = [];
|
||||||
|
|
||||||
void _updateInstalledList() {
|
void _updateInstalledList() {
|
||||||
installedThemeIdNames = ref
|
installedThemeIdNames = ref
|
||||||
.read(pThemeService)
|
.read(pThemeService)
|
||||||
.installedThemes
|
.installedThemes
|
||||||
.where((e) => e.themeId != "light" && e.themeId != "dark")
|
.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();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +274,7 @@ class _IncognitoInstalledThemesState
|
||||||
data: StackThemeMetaData(
|
data: StackThemeMetaData(
|
||||||
name: e.item2,
|
name: e.item2,
|
||||||
id: e.item1,
|
id: e.item1,
|
||||||
|
version: e.item3 ?? 1,
|
||||||
sha256: "",
|
sha256: "",
|
||||||
size: "",
|
size: "",
|
||||||
previewImageUrl: "",
|
previewImageUrl: "",
|
||||||
|
|
|
@ -717,6 +717,7 @@ class _NodeFormState extends ConsumerState<NodeForm> {
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
case Coin.eCash:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TxIcon extends ConsumerWidget {
|
||||||
static const Size size = Size(32, 32);
|
static const Size size = Size(32, 32);
|
||||||
|
|
||||||
String _getAssetName(
|
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 (!isReceived && transaction.subType == TransactionSubType.mint) {
|
||||||
if (isCancelled) {
|
if (isCancelled) {
|
||||||
return Assets.svg.anonymizeFailed;
|
return Assets.svg.anonymizeFailed;
|
||||||
|
@ -65,7 +65,7 @@ class TxIcon extends ConsumerWidget {
|
||||||
currentHeight,
|
currentHeight,
|
||||||
coin.requiredConfirmations,
|
coin.requiredConfirmations,
|
||||||
),
|
),
|
||||||
ref.watch(themeProvider).assets,
|
ref.watch(themeAssetsProvider),
|
||||||
);
|
);
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
|
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
|
||||||
import 'package:stackwallet/notifications/show_flush_bar.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/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/dialogs/cancelling_transaction_progress_dialog.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/transaction_views/edit_note_view.dart';
|
import 'package:stackwallet/pages/wallet_view/transaction_views/edit_note_view.dart';
|
||||||
|
@ -605,17 +607,45 @@ class _TransactionDetailsViewState
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
ConditionalParent(
|
||||||
_transaction.type ==
|
condition: kDebugMode,
|
||||||
TransactionType.outgoing
|
builder: (child) {
|
||||||
? "Sent to"
|
return Row(
|
||||||
: "Receiving address",
|
mainAxisAlignment:
|
||||||
style: isDesktop
|
MainAxisAlignment
|
||||||
? STextStyles
|
.spaceBetween,
|
||||||
.desktopTextExtraExtraSmall(
|
children: [
|
||||||
context)
|
child,
|
||||||
: STextStyles.itemSubtitle(
|
CustomTextButton(
|
||||||
context),
|
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(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
|
|
|
@ -288,7 +288,7 @@ class DesktopTradeRowCard extends ConsumerStatefulWidget {
|
||||||
class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
||||||
late final String tradeId;
|
late final String tradeId;
|
||||||
|
|
||||||
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
|
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
|
||||||
ChangeNowTransactionStatus? status;
|
ChangeNowTransactionStatus? status;
|
||||||
try {
|
try {
|
||||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||||
|
@ -528,7 +528,7 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
||||||
_fetchIconAssetForStatus(
|
_fetchIconAssetForStatus(
|
||||||
trade.status,
|
trade.status,
|
||||||
ref.watch(
|
ref.watch(
|
||||||
themeProvider.select((value) => value.assets),
|
themeAssetsProvider,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -63,8 +63,8 @@ class DesktopBuyIcon extends ConsumerWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return SvgPicture.asset(
|
return SvgPicture.file(
|
||||||
ref.watch(themeProvider.select((value) => value.assets.buy)),
|
File(ref.watch(themeAssetsProvider).buy),
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
color: DesktopMenuItemId.buy ==
|
color: DesktopMenuItemId.buy ==
|
||||||
|
|
|
@ -69,7 +69,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
|
||||||
_MoreFeaturesItem(
|
_MoreFeaturesItem(
|
||||||
label: "Anonymize funds",
|
label: "Anonymize funds",
|
||||||
detail: "Anonymize funds",
|
detail: "Anonymize funds",
|
||||||
iconAsset: Assets.svg.anonymize,
|
iconAsset: Assets.svg.recycle,
|
||||||
onPressed: () => widget.onAnonymizeAllPressed?.call(),
|
onPressed: () => widget.onAnonymizeAllPressed?.call(),
|
||||||
),
|
),
|
||||||
if (manager.hasWhirlpoolSupport)
|
if (manager.hasWhirlpoolSupport)
|
||||||
|
|
|
@ -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(
|
const Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
|
|
|
@ -1468,7 +1468,7 @@ class BitcoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
|
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
|
||||||
|
|
||||||
// Generate and add addresses to relevant arrays
|
// Generate and add addresses to relevant arrays
|
||||||
|
|
|
@ -1371,7 +1371,7 @@ class BitcoinCashWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
|
await _secureStore.write(key: '${_walletId}_mnemonicPassphrase', value: "");
|
||||||
|
|
||||||
// Generate and add addresses to relevant arrays
|
// Generate and add addresses to relevant arrays
|
||||||
|
|
|
@ -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/bitcoin/bitcoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_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/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/epiccash/epiccash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
|
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||||
|
@ -233,6 +234,17 @@ abstract class CoinServiceAPI {
|
||||||
cachedClient: cachedClient,
|
cachedClient: cachedClient,
|
||||||
tracker: tracker,
|
tracker: tracker,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return ECashWallet(
|
||||||
|
walletId: walletId,
|
||||||
|
walletName: walletName,
|
||||||
|
coin: coin,
|
||||||
|
secureStore: secureStorageInterface,
|
||||||
|
client: client,
|
||||||
|
cachedClient: cachedClient,
|
||||||
|
tracker: tracker,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1318,7 +1318,7 @@ class DogecoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
value: "",
|
value: "",
|
||||||
|
|
3139
lib/services/coins/ecash/ecash_wallet.dart
Normal file
3139
lib/services/coins/ecash/ecash_wallet.dart
Normal file
File diff suppressed because it is too large
Load diff
|
@ -350,7 +350,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
"Attempted to overwrite mnemonic on generate new wallet!");
|
"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}_mnemonic', value: mnemonic);
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
|
|
|
@ -2112,7 +2112,7 @@ class FiroWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
value: "",
|
value: "",
|
||||||
|
|
|
@ -1498,7 +1498,7 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
value: "",
|
value: "",
|
||||||
|
|
|
@ -1479,7 +1479,7 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
value: "",
|
value: "",
|
||||||
|
|
|
@ -1394,7 +1394,7 @@ class ParticlWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonic',
|
key: '${_walletId}_mnemonic',
|
||||||
value: bip39.generateMnemonic(strength: 256));
|
value: bip39.generateMnemonic(strength: 128));
|
||||||
await _secureStore.write(
|
await _secureStore.write(
|
||||||
key: '${_walletId}_mnemonicPassphrase',
|
key: '${_walletId}_mnemonicPassphrase',
|
||||||
value: "",
|
value: "",
|
||||||
|
|
|
@ -89,7 +89,7 @@ class PriceAPI {
|
||||||
final uri =
|
final uri =
|
||||||
Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency"
|
Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency"
|
||||||
"=${baseCurrency.toLowerCase()}"
|
"=${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"
|
"bitcoin-cash,namecoin,wownero,ethereum,particl"
|
||||||
"&order=market_cap_desc&per_page=50&page=1&sparkline=false");
|
"&order=market_cap_desc&per_page=50&page=1&sparkline=false");
|
||||||
|
|
||||||
|
|
|
@ -1,36 +1,44 @@
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
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/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
|
|
||||||
final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
|
final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
final assets = ref.watch(themeProvider).assets;
|
final assets = ref.watch(themeAssetsProvider);
|
||||||
switch (coin) {
|
|
||||||
case Coin.bitcoin:
|
if (assets is ThemeAssets) {
|
||||||
case Coin.bitcoinTestNet:
|
switch (coin) {
|
||||||
return assets.bitcoin;
|
case Coin.bitcoin:
|
||||||
case Coin.litecoin:
|
case Coin.bitcoinTestNet:
|
||||||
case Coin.litecoinTestNet:
|
return assets.bitcoin;
|
||||||
return assets.litecoin;
|
case Coin.litecoin:
|
||||||
case Coin.bitcoincash:
|
case Coin.litecoinTestNet:
|
||||||
case Coin.bitcoincashTestnet:
|
return assets.litecoin;
|
||||||
return assets.bitcoincash;
|
case Coin.bitcoincash:
|
||||||
case Coin.dogecoin:
|
case Coin.bitcoincashTestnet:
|
||||||
case Coin.dogecoinTestNet:
|
return assets.bitcoincash;
|
||||||
return assets.dogecoin;
|
case Coin.dogecoin:
|
||||||
case Coin.epicCash:
|
case Coin.dogecoinTestNet:
|
||||||
return assets.epicCash;
|
return assets.dogecoin;
|
||||||
case Coin.firo:
|
case Coin.eCash:
|
||||||
case Coin.firoTestNet:
|
return assets.bitcoin;
|
||||||
return assets.firo;
|
case Coin.epicCash:
|
||||||
case Coin.monero:
|
return assets.epicCash;
|
||||||
return assets.monero;
|
case Coin.firo:
|
||||||
case Coin.wownero:
|
case Coin.firoTestNet:
|
||||||
return assets.wownero;
|
return assets.firo;
|
||||||
case Coin.namecoin:
|
case Coin.monero:
|
||||||
return assets.namecoin;
|
return assets.monero;
|
||||||
case Coin.particl:
|
case Coin.wownero:
|
||||||
return assets.particl;
|
return assets.wownero;
|
||||||
case Coin.ethereum:
|
case Coin.namecoin:
|
||||||
return assets.ethereum;
|
return assets.namecoin;
|
||||||
|
case Coin.particl:
|
||||||
|
return assets.particl;
|
||||||
|
case Coin.ethereum:
|
||||||
|
return assets.ethereum;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,77 +1,92 @@
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
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/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
|
|
||||||
final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
|
final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
final assets = ref.watch(themeProvider).assets;
|
final assets = ref.watch(themeAssetsProvider);
|
||||||
switch (coin) {
|
|
||||||
case Coin.bitcoin:
|
if (assets is ThemeAssets) {
|
||||||
return assets.bitcoinImage;
|
switch (coin) {
|
||||||
case Coin.litecoin:
|
case Coin.bitcoin:
|
||||||
case Coin.litecoinTestNet:
|
return assets.bitcoinImage;
|
||||||
return assets.litecoinImage;
|
case Coin.litecoin:
|
||||||
case Coin.bitcoincash:
|
case Coin.litecoinTestNet:
|
||||||
return assets.bitcoincashImage;
|
return assets.litecoinImage;
|
||||||
case Coin.dogecoin:
|
case Coin.bitcoincash:
|
||||||
return assets.dogecoinImage;
|
return assets.bitcoincashImage;
|
||||||
case Coin.epicCash:
|
case Coin.dogecoin:
|
||||||
return assets.epicCashImage;
|
return assets.dogecoinImage;
|
||||||
case Coin.firo:
|
case Coin.eCash:
|
||||||
return assets.firoImage;
|
return assets.bitcoinImage;
|
||||||
case Coin.monero:
|
case Coin.epicCash:
|
||||||
return assets.moneroImage;
|
return assets.epicCashImage;
|
||||||
case Coin.wownero:
|
case Coin.firo:
|
||||||
return assets.wowneroImage;
|
return assets.firoImage;
|
||||||
case Coin.namecoin:
|
case Coin.monero:
|
||||||
return assets.namecoinImage;
|
return assets.moneroImage;
|
||||||
case Coin.particl:
|
case Coin.wownero:
|
||||||
return assets.particlImage;
|
return assets.wowneroImage;
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.namecoin:
|
||||||
return assets.bitcoinImage;
|
return assets.namecoinImage;
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.particl:
|
||||||
return assets.bitcoincashImage;
|
return assets.particlImage;
|
||||||
case Coin.firoTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
return assets.firoImage;
|
return assets.bitcoinImage;
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.bitcoincashTestnet:
|
||||||
return assets.dogecoinImage;
|
return assets.bitcoincashImage;
|
||||||
case Coin.ethereum:
|
case Coin.firoTestNet:
|
||||||
return assets.ethereumImage;
|
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 coinImageSecondaryProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
final assets = ref.watch(themeProvider).assets;
|
final assets = ref.watch(themeAssetsProvider);
|
||||||
switch (coin) {
|
|
||||||
case Coin.bitcoin:
|
if (assets is ThemeAssets) {
|
||||||
return assets.bitcoinImageSecondary;
|
switch (coin) {
|
||||||
case Coin.litecoin:
|
case Coin.bitcoin:
|
||||||
case Coin.litecoinTestNet:
|
return assets.bitcoinImageSecondary;
|
||||||
return assets.litecoinImageSecondary;
|
case Coin.litecoin:
|
||||||
case Coin.bitcoincash:
|
case Coin.litecoinTestNet:
|
||||||
return assets.bitcoincashImageSecondary;
|
return assets.litecoinImageSecondary;
|
||||||
case Coin.dogecoin:
|
case Coin.bitcoincash:
|
||||||
return assets.dogecoinImageSecondary;
|
return assets.bitcoincashImageSecondary;
|
||||||
case Coin.epicCash:
|
case Coin.dogecoin:
|
||||||
return assets.epicCashImageSecondary;
|
return assets.dogecoinImageSecondary;
|
||||||
case Coin.firo:
|
case Coin.eCash:
|
||||||
return assets.firoImageSecondary;
|
return assets.bitcoinImageSecondary;
|
||||||
case Coin.monero:
|
case Coin.epicCash:
|
||||||
return assets.moneroImageSecondary;
|
return assets.epicCashImageSecondary;
|
||||||
case Coin.wownero:
|
case Coin.firo:
|
||||||
return assets.wowneroImageSecondary;
|
return assets.firoImageSecondary;
|
||||||
case Coin.namecoin:
|
case Coin.monero:
|
||||||
return assets.namecoinImageSecondary;
|
return assets.moneroImageSecondary;
|
||||||
case Coin.particl:
|
case Coin.wownero:
|
||||||
return assets.particlImageSecondary;
|
return assets.wowneroImageSecondary;
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.namecoin:
|
||||||
return assets.bitcoinImageSecondary;
|
return assets.namecoinImageSecondary;
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.particl:
|
||||||
return assets.bitcoincashImageSecondary;
|
return assets.particlImageSecondary;
|
||||||
case Coin.firoTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
return assets.firoImageSecondary;
|
return assets.bitcoinImageSecondary;
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.bitcoincashTestnet:
|
||||||
return assets.dogecoinImageSecondary;
|
return assets.bitcoincashImageSecondary;
|
||||||
case Coin.ethereum:
|
case Coin.firoTestNet:
|
||||||
return assets.ethereumImageSecondary;
|
return assets.firoImageSecondary;
|
||||||
|
case Coin.dogecoinTestNet:
|
||||||
|
return assets.dogecoinImageSecondary;
|
||||||
|
case Coin.ethereum:
|
||||||
|
return assets.ethereumImageSecondary;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,6 +12,7 @@ class CoinThemeColorDefault {
|
||||||
Color get firo => const Color(0xFFFF897A);
|
Color get firo => const Color(0xFFFF897A);
|
||||||
Color get dogecoin => const Color(0xFFFFE079);
|
Color get dogecoin => const Color(0xFFFFE079);
|
||||||
Color get epicCash => const Color(0xFFC5C7CB);
|
Color get epicCash => const Color(0xFFC5C7CB);
|
||||||
|
Color get eCash => const Color(0xFFC5C7CB);
|
||||||
Color get ethereum => const Color(0xFFA7ADE9);
|
Color get ethereum => const Color(0xFFA7ADE9);
|
||||||
Color get monero => const Color(0xFFFF9E6B);
|
Color get monero => const Color(0xFFFF9E6B);
|
||||||
Color get namecoin => const Color(0xFF91B1E1);
|
Color get namecoin => const Color(0xFF91B1E1);
|
||||||
|
@ -32,6 +33,8 @@ class CoinThemeColorDefault {
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
return dogecoin;
|
return dogecoin;
|
||||||
|
case Coin.eCash:
|
||||||
|
return eCash;
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCash;
|
return epicCash;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
|
|
|
@ -1682,6 +1682,8 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
return _coin.dogecoin;
|
return _coin.dogecoin;
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return _coin.epicCash;
|
return _coin.epicCash;
|
||||||
|
case Coin.eCash:
|
||||||
|
return _coin.eCash;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return _coin.ethereum;
|
return _coin.ethereum;
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
|
|
@ -20,3 +20,11 @@ final themeProvider = StateProvider<StackTheme>(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final themeAssetsProvider = StateProvider<IThemeAssets>(
|
||||||
|
(ref) => ref.watch(
|
||||||
|
themeProvider.select(
|
||||||
|
(value) => value.assets,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:archive/archive_io.dart';
|
import 'package:archive/archive_io.dart';
|
||||||
import 'package:crypto/crypto.dart';
|
import 'package:crypto/crypto.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
@ -17,6 +17,7 @@ final pThemeService = Provider<ThemeService>((ref) {
|
||||||
});
|
});
|
||||||
|
|
||||||
class ThemeService {
|
class ThemeService {
|
||||||
|
static const _currentDefaultThemeVersion = 2;
|
||||||
ThemeService._();
|
ThemeService._();
|
||||||
static ThemeService? _instance;
|
static ThemeService? _instance;
|
||||||
static ThemeService get instance => _instance ??= ThemeService._();
|
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
|
// TODO more thorough check/verification of theme
|
||||||
Future<bool> verifyInstalled({required String themeId}) async {
|
Future<bool> verifyInstalled({required String themeId}) async {
|
||||||
final dbHasTheme =
|
final dbHasTheme =
|
||||||
|
@ -175,6 +240,7 @@ class ThemeService {
|
||||||
class StackThemeMetaData {
|
class StackThemeMetaData {
|
||||||
final String name;
|
final String name;
|
||||||
final String id;
|
final String id;
|
||||||
|
final int version;
|
||||||
final String sha256;
|
final String sha256;
|
||||||
final String size;
|
final String size;
|
||||||
final String previewImageUrl;
|
final String previewImageUrl;
|
||||||
|
@ -182,6 +248,7 @@ class StackThemeMetaData {
|
||||||
StackThemeMetaData({
|
StackThemeMetaData({
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.id,
|
required this.id,
|
||||||
|
required this.version,
|
||||||
required this.sha256,
|
required this.sha256,
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.previewImageUrl,
|
required this.previewImageUrl,
|
||||||
|
@ -192,6 +259,7 @@ class StackThemeMetaData {
|
||||||
return StackThemeMetaData(
|
return StackThemeMetaData(
|
||||||
name: map["name"] as String,
|
name: map["name"] as String,
|
||||||
id: map["id"] as String,
|
id: map["id"] as String,
|
||||||
|
version: map["version"] as int? ?? 1,
|
||||||
sha256: map["sha256"] as String,
|
sha256: map["sha256"] as String,
|
||||||
size: map["size"] as String,
|
size: map["size"] as String,
|
||||||
previewImageUrl: map["previewImageUrl"] as String,
|
previewImageUrl: map["previewImageUrl"] as String,
|
||||||
|
@ -210,6 +278,7 @@ class StackThemeMetaData {
|
||||||
return "$runtimeType("
|
return "$runtimeType("
|
||||||
"name: $name, "
|
"name: $name, "
|
||||||
"id: $id, "
|
"id: $id, "
|
||||||
|
"version: $version, "
|
||||||
"sha256: $sha256, "
|
"sha256: $sha256, "
|
||||||
"size: $size, "
|
"size: $size, "
|
||||||
"previewImageUrl: $previewImageUrl"
|
"previewImageUrl: $previewImageUrl"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:crypto/crypto.dart';
|
||||||
import 'package:flutter_libepiccash/epic_cash.dart';
|
import 'package:flutter_libepiccash/epic_cash.dart';
|
||||||
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_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/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/firo/firo_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
||||||
|
@ -61,6 +62,8 @@ class AddressUtils {
|
||||||
return true; //TODO - validate ETH address
|
return true; //TODO - validate ETH address
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return Address.validateAddress(address, firoNetwork);
|
return Address.validateAddress(address, firoNetwork);
|
||||||
|
case Coin.eCash:
|
||||||
|
return Address.validateAddress(address, eCashNetwork);
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
||||||
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
||||||
|
|
|
@ -165,6 +165,7 @@ class _SVG {
|
||||||
String get questionMessage => "assets/svg/message-question.svg";
|
String get questionMessage => "assets/svg/message-question.svg";
|
||||||
String get envelope => "assets/svg/envelope.svg";
|
String get envelope => "assets/svg/envelope.svg";
|
||||||
String get share => "assets/svg/share-2.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 anonymize => "assets/svg/tx-icon-anonymize.svg";
|
||||||
String get anonymizePending => "assets/svg/tx-icon-anonymize-pending.svg";
|
String get anonymizePending => "assets/svg/tx-icon-anonymize-pending.svg";
|
||||||
String get anonymizeFailed => "assets/svg/tx-icon-anonymize-failed.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 exchange3 => "assets/svg/exchange-3.svg";
|
||||||
String get messageQuestion => "assets/svg/message-question-1.svg";
|
String get messageQuestion => "assets/svg/message-question-1.svg";
|
||||||
String get list => "assets/svg/list-ul.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 trocadorRatingA => "assets/svg/trocador_rating_a.svg";
|
||||||
String get trocadorRatingB => "assets/svg/trocador_rating_b.svg";
|
String get trocadorRatingB => "assets/svg/trocador_rating_b.svg";
|
||||||
|
|
|
@ -17,6 +17,8 @@ Uri getDefaultBlockExplorerUrlFor({
|
||||||
return Uri.parse("https://mempool.space/testnet/tx/$txid");
|
return Uri.parse("https://mempool.space/testnet/tx/$txid");
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return Uri.parse("https://chain.so/tx/DOGE/$txid");
|
return Uri.parse("https://chain.so/tx/DOGE/$txid");
|
||||||
|
case Coin.eCash:
|
||||||
|
return Uri.parse("https://explorer.bitcoinabc.org/tx/$txid");
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
|
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
|
|
@ -26,6 +26,7 @@ abstract class Constants {
|
||||||
// // true; // true for development,
|
// // true; // true for development,
|
||||||
|
|
||||||
static const int _satsPerCoinEthereum = 1000000000000000000;
|
static const int _satsPerCoinEthereum = 1000000000000000000;
|
||||||
|
static const int _satsPerCoinECash = 100;
|
||||||
static const int _satsPerCoinMonero = 1000000000000;
|
static const int _satsPerCoinMonero = 1000000000000;
|
||||||
static const int _satsPerCoinWownero = 100000000000;
|
static const int _satsPerCoinWownero = 100000000000;
|
||||||
static const int _satsPerCoin = 100000000;
|
static const int _satsPerCoin = 100000000;
|
||||||
|
@ -33,6 +34,7 @@ abstract class Constants {
|
||||||
static const int _decimalPlacesWownero = 11;
|
static const int _decimalPlacesWownero = 11;
|
||||||
static const int _decimalPlacesMonero = 12;
|
static const int _decimalPlacesMonero = 12;
|
||||||
static const int _decimalPlacesEthereum = 18;
|
static const int _decimalPlacesEthereum = 18;
|
||||||
|
static const int _decimalPlacesECash = 2;
|
||||||
|
|
||||||
static const int notificationsMax = 0xFFFFFFFF;
|
static const int notificationsMax = 0xFFFFFFFF;
|
||||||
static const Duration networkAliveTimerDuration = Duration(seconds: 10);
|
static const Duration networkAliveTimerDuration = Duration(seconds: 10);
|
||||||
|
@ -71,6 +73,9 @@ abstract class Constants {
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return _satsPerCoinEthereum;
|
return _satsPerCoinEthereum;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return _satsPerCoinECash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +104,9 @@ abstract class Constants {
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return _decimalPlacesEthereum;
|
return _decimalPlacesEthereum;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return _decimalPlacesECash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,6 +123,7 @@ abstract class Constants {
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
|
@ -137,10 +146,9 @@ abstract class Constants {
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
case Coin.bitcoin:
|
case Coin.bitcoin:
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
return 600;
|
|
||||||
|
|
||||||
case Coin.bitcoincash:
|
case Coin.bitcoincash:
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.bitcoincashTestnet:
|
||||||
|
case Coin.eCash:
|
||||||
return 600;
|
return 600;
|
||||||
|
|
||||||
case Coin.dogecoin:
|
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 int seedPhraseWordCountMonero = 25;
|
||||||
|
|
||||||
static const Map<int, String> monthMapShort = {
|
static const Map<int, String> monthMapShort = {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:stackwallet/models/node_model.dart';
|
import 'package:stackwallet/models/node_model.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
// import 'package:web3dart/browser.dart';
|
|
||||||
|
|
||||||
abstract class DefaultNodes {
|
abstract class DefaultNodes {
|
||||||
static const String defaultNodeIdPrefix = "default_";
|
static const String defaultNodeIdPrefix = "default_";
|
||||||
|
@ -13,6 +12,7 @@ abstract class DefaultNodes {
|
||||||
dogecoin,
|
dogecoin,
|
||||||
firo,
|
firo,
|
||||||
monero,
|
monero,
|
||||||
|
eCash,
|
||||||
epicCash,
|
epicCash,
|
||||||
ethereum,
|
ethereum,
|
||||||
bitcoincash,
|
bitcoincash,
|
||||||
|
@ -219,6 +219,18 @@ abstract class DefaultNodes {
|
||||||
isDown: false,
|
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) {
|
static NodeModel getNodeFor(Coin coin) {
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
case Coin.bitcoin:
|
case Coin.bitcoin:
|
||||||
|
@ -233,6 +245,9 @@ abstract class DefaultNodes {
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return dogecoin;
|
return dogecoin;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return eCash;
|
||||||
|
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCash;
|
return epicCash;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'
|
||||||
as bch;
|
as bch;
|
||||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
|
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
|
||||||
as doge;
|
as doge;
|
||||||
|
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart' as ecash;
|
||||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
|
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
|
||||||
as epic;
|
as epic;
|
||||||
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
|
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
|
||||||
|
@ -22,6 +23,7 @@ enum Coin {
|
||||||
bitcoin,
|
bitcoin,
|
||||||
bitcoincash,
|
bitcoincash,
|
||||||
dogecoin,
|
dogecoin,
|
||||||
|
eCash,
|
||||||
epicCash,
|
epicCash,
|
||||||
ethereum,
|
ethereum,
|
||||||
firo,
|
firo,
|
||||||
|
@ -59,6 +61,8 @@ extension CoinExt on Coin {
|
||||||
return "Dogecoin";
|
return "Dogecoin";
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return "Epic Cash";
|
return "Epic Cash";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "E-Cash";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "Ethereum";
|
return "Ethereum";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
@ -98,6 +102,8 @@ extension CoinExt on Coin {
|
||||||
return "EPIC";
|
return "EPIC";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "ETH";
|
return "ETH";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "XEC";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return "FIRO";
|
return "FIRO";
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
|
@ -136,6 +142,8 @@ extension CoinExt on Coin {
|
||||||
return "epic";
|
return "epic";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "ethereum";
|
return "ethereum";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "ecash";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return "firo";
|
return "firo";
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
|
@ -173,6 +181,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.bitcoincashTestnet:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
@ -195,6 +204,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
case Coin.particl:
|
case Coin.particl:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
@ -220,6 +230,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
case Coin.eCash:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
@ -244,6 +255,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
case Coin.eCash:
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
@ -288,6 +300,9 @@ extension CoinExt on Coin {
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epic.MINIMUM_CONFIRMATIONS;
|
return epic.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return ecash.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return eth.MINIMUM_CONFIRMATIONS;
|
return eth.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
|
@ -339,6 +354,11 @@ Coin coinFromPrettyName(String name) {
|
||||||
case "firo":
|
case "firo":
|
||||||
return Coin.firo;
|
return Coin.firo;
|
||||||
|
|
||||||
|
case "E-Cash":
|
||||||
|
case "ecash":
|
||||||
|
case "eCash":
|
||||||
|
return Coin.eCash;
|
||||||
|
|
||||||
case "Monero":
|
case "Monero":
|
||||||
case "monero":
|
case "monero":
|
||||||
return Coin.monero;
|
return Coin.monero;
|
||||||
|
@ -404,6 +424,8 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
|
||||||
return Coin.dogecoin;
|
return Coin.dogecoin;
|
||||||
case "epic":
|
case "epic":
|
||||||
return Coin.epicCash;
|
return Coin.epicCash;
|
||||||
|
case "xec":
|
||||||
|
return Coin.eCash;
|
||||||
case "eth":
|
case "eth":
|
||||||
return Coin.ethereum;
|
return Coin.ethereum;
|
||||||
case "firo":
|
case "firo":
|
||||||
|
|
|
@ -6,6 +6,7 @@ enum DerivePathType {
|
||||||
bip49,
|
bip49,
|
||||||
bip84,
|
bip84,
|
||||||
eth,
|
eth,
|
||||||
|
eCash44,
|
||||||
}
|
}
|
||||||
|
|
||||||
extension DerivePathTypeExt on DerivePathType {
|
extension DerivePathTypeExt on DerivePathType {
|
||||||
|
@ -27,6 +28,9 @@ extension DerivePathTypeExt on DerivePathType {
|
||||||
case Coin.particl:
|
case Coin.particl:
|
||||||
return DerivePathType.bip84;
|
return DerivePathType.bip84;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return DerivePathType.eCash44;
|
||||||
|
|
||||||
case Coin.ethereum: // TODO: do we need something here?
|
case Coin.ethereum: // TODO: do we need something here?
|
||||||
return DerivePathType.eth;
|
return DerivePathType.eth;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TradeCard extends ConsumerWidget {
|
||||||
final Trade trade;
|
final Trade trade;
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
|
|
||||||
String _fetchIconAssetForStatus(String statusString, ThemeAssets assets) {
|
String _fetchIconAssetForStatus(String statusString, IThemeAssets assets) {
|
||||||
ChangeNowTransactionStatus? status;
|
ChangeNowTransactionStatus? status;
|
||||||
try {
|
try {
|
||||||
if (statusString.toLowerCase().startsWith("waiting")) {
|
if (statusString.toLowerCase().startsWith("waiting")) {
|
||||||
|
@ -89,11 +89,7 @@ class TradeCard extends ConsumerWidget {
|
||||||
File(
|
File(
|
||||||
_fetchIconAssetForStatus(
|
_fetchIconAssetForStatus(
|
||||||
trade.status,
|
trade.status,
|
||||||
ref.watch(
|
ref.watch(themeAssetsProvider),
|
||||||
themeProvider.select(
|
|
||||||
(value) => value.assets,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
width: 32,
|
width: 32,
|
||||||
|
|
|
@ -120,9 +120,9 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
|
ref: "50bf29957514a5712466ba37590a851212a244bf"
|
||||||
resolved-ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
|
resolved-ref: "50bf29957514a5712466ba37590a851212a244bf"
|
||||||
url: "https://github.com/Quppy/bitbox-flutter.git"
|
url: "https://github.com/PiRK/bitbox-flutter.git"
|
||||||
source: git
|
source: git
|
||||||
version: "1.0.1"
|
version: "1.0.1"
|
||||||
bitcoindart:
|
bitcoindart:
|
||||||
|
|
|
@ -11,7 +11,7 @@ description: Stack Wallet
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.7.8+172
|
version: 1.7.9+173
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
|
@ -85,8 +85,8 @@ dependencies:
|
||||||
ref: 3bef5acc21340f3cc78df0ad1dce5868a3ed68a5
|
ref: 3bef5acc21340f3cc78df0ad1dce5868a3ed68a5
|
||||||
bitbox:
|
bitbox:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/Quppy/bitbox-flutter.git
|
url: https://github.com/PiRK/bitbox-flutter.git
|
||||||
ref: ea65073efbaf395a5557e8cd7bd72f195cd7eb11
|
ref: 50bf29957514a5712466ba37590a851212a244bf
|
||||||
bip32: ^2.0.0
|
bip32: ^2.0.0
|
||||||
bech32:
|
bech32:
|
||||||
git:
|
git:
|
||||||
|
@ -288,6 +288,7 @@ flutter:
|
||||||
- assets/svg/message-question.svg
|
- assets/svg/message-question.svg
|
||||||
- assets/svg/envelope.svg
|
- assets/svg/envelope.svg
|
||||||
- assets/svg/share-2.svg
|
- assets/svg/share-2.svg
|
||||||
|
- assets/svg/anonymize.svg
|
||||||
- assets/svg/tx-icon-anonymize.svg
|
- assets/svg/tx-icon-anonymize.svg
|
||||||
- assets/svg/tx-icon-anonymize-pending.svg
|
- assets/svg/tx-icon-anonymize-pending.svg
|
||||||
- assets/svg/tx-icon-anonymize-failed.svg
|
- assets/svg/tx-icon-anonymize-failed.svg
|
||||||
|
|
|
@ -27,13 +27,69 @@ void main() {
|
||||||
when(client.get(
|
when(client.get(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
|
"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"
|
",namecoin,wownero,ethereum,particl&order=market_cap_desc&per_page=50"
|
||||||
"&page=1&sparkline=false"),
|
"&page=1&sparkline=false"),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
})).thenAnswer((_) async => Response(
|
})).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));
|
200));
|
||||||
|
|
||||||
final priceAPI = PriceAPI(client);
|
final priceAPI = PriceAPI(client);
|
||||||
|
@ -45,7 +101,7 @@ void main() {
|
||||||
price.toString(),
|
price.toString(),
|
||||||
'{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0], '
|
'{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0], '
|
||||||
'Coin.dogecoin: [0.00000315, -2.68533], '
|
'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.ethereum: [0, 0.0], '
|
||||||
'Coin.firo: [0.0001096, -0.89304], Coin.litecoin: [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.monero: [0.00717236, -0.77656], Coin.namecoin: [0, 0.0], '
|
||||||
|
@ -57,7 +113,7 @@ void main() {
|
||||||
verify(client.get(
|
verify(client.get(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
"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"
|
"bitcoin-cash,namecoin,wownero,ethereum,particl"
|
||||||
"&order=market_cap_desc&per_page=50&page=1&sparkline=false",
|
"&order=market_cap_desc&per_page=50&page=1&sparkline=false",
|
||||||
),
|
),
|
||||||
|
@ -72,13 +128,69 @@ void main() {
|
||||||
when(client.get(
|
when(client.get(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&"
|
"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"
|
"bitcoin-cash,namecoin,wownero,ethereum,particl"
|
||||||
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
})).thenAnswer((_) async => Response(
|
})).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));
|
200));
|
||||||
|
|
||||||
final priceAPI = PriceAPI(client);
|
final priceAPI = PriceAPI(client);
|
||||||
|
@ -94,7 +206,7 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
cachedPrice.toString(),
|
cachedPrice.toString(),
|
||||||
'{Coin.bitcoin: [1, 0.0], Coin.bitcoincash: [0, 0.0],'
|
'{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.ethereum: [0, 0.0], Coin.firo: [0.0001096, -0.89304], '
|
||||||
'Coin.litecoin: [0, 0.0], Coin.monero: [0.00717236, -0.77656], '
|
'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], '
|
'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 only called once during filling of cache
|
||||||
verify(client.get(
|
verify(client.get(
|
||||||
Uri.parse(
|
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);
|
headers: {'Content-Type': 'application/json'})).called(1);
|
||||||
|
|
||||||
verifyNoMoreInteractions(client);
|
verifyNoMoreInteractions(client);
|
||||||
|
@ -117,13 +232,70 @@ void main() {
|
||||||
when(client.get(
|
when(client.get(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
"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"
|
"bitcoin-cash,namecoin,wownero,ethereum,particl"
|
||||||
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
})).thenAnswer((_) async => Response(
|
})).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));
|
200));
|
||||||
|
|
||||||
final priceAPI = PriceAPI(client);
|
final priceAPI = PriceAPI(client);
|
||||||
|
@ -131,8 +303,15 @@ void main() {
|
||||||
|
|
||||||
final price = await priceAPI.getPricesAnd24hChange(baseCurrency: "btc");
|
final price = await priceAPI.getPricesAnd24hChange(baseCurrency: "btc");
|
||||||
|
|
||||||
expect(price.toString(),
|
expect(
|
||||||
'{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]}');
|
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 {
|
test("no internet available", () async {
|
||||||
|
@ -141,7 +320,7 @@ void main() {
|
||||||
when(client.get(
|
when(client.get(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
"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"
|
"bitcoin-cash,namecoin,wownero,ethereum,particl"
|
||||||
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -157,7 +336,7 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
price.toString(),
|
price.toString(),
|
||||||
'{Coin.bitcoin: [0, 0.0], Coin.bitcoincash: [0, 0.0], '
|
'{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.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.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.bitcoinTestNet: [0, 0.0], Coin.litecoinTestNet: [0, 0.0], '
|
||||||
|
|
252
test/sample_data/theme_json_v2.dart
Normal file
252
test/sample_data/theme_json_v2.dart
Normal 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"
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue