diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index e677ab5c0..7528dacc8 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -85,7 +85,7 @@ class _SendFromViewState extends ConsumerState { height: 8, ), Text( - "You need to send ${amount.toStringAsFixed(coin == Coin.monero ? 12 : 8)} ${coin.ticker}", + "You need to send ${amount.toStringAsFixed(coin == Coin.monero || coin == Coin.wownero ? 12 : 8)} ${coin.ticker}", style: STextStyles.itemSubtitle(context), ), const SizedBox( @@ -307,7 +307,10 @@ class _SendFromCardState extends ConsumerState { "${Format.localizedStringAsFixed( value: snapshot.data!, locale: locale, - decimalPlaces: coin == Coin.monero ? 12 : 8, + decimalPlaces: + coin == Coin.monero || coin == Coin.wownero + ? 12 + : 8, )} ${coin.ticker}", style: STextStyles.itemSubtitle(context), ); diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index e71e3520d..143b1e84d 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -90,6 +90,7 @@ class _AddEditNodeViewState extends ConsumerState { break; case Coin.monero: + case Coin.wownero: try { final uri = Uri.parse(formData.host!); if (uri.scheme.startsWith("http")) { @@ -384,6 +385,7 @@ class _AddEditNodeViewState extends ConsumerState { // strip unused path String address = formData.host!; if (coin == Coin.monero || + coin == Coin.wownero || coin == Coin.epicCash) { if (address.startsWith("http")) { final uri = Uri.parse(address); @@ -700,7 +702,9 @@ class _NodeFormState extends ConsumerState { focusNode: _hostFocusNode, style: STextStyles.field(context), decoration: standardInputDecoration( - (widget.coin != Coin.monero && widget.coin != Coin.epicCash) + (widget.coin != Coin.monero && + widget.coin != Coin.wownero && + widget.coin != Coin.epicCash) ? "IP address" : "Url", _hostFocusNode, @@ -881,7 +885,9 @@ class _NodeFormState extends ConsumerState { const SizedBox( height: 8, ), - if (widget.coin != Coin.monero && widget.coin != Coin.epicCash) + if (widget.coin != Coin.monero && + widget.coin != Coin.wownero && + widget.coin != Coin.epicCash) Row( children: [ GestureDetector( @@ -932,11 +938,15 @@ class _NodeFormState extends ConsumerState { ), ], ), - if (widget.coin != Coin.monero && widget.coin != Coin.epicCash) + if (widget.coin != Coin.monero && + widget.coin != Coin.wownero && + widget.coin != Coin.epicCash) const SizedBox( height: 8, ), - if (widget.coin != Coin.monero && widget.coin != Coin.epicCash) + if (widget.coin != Coin.monero && + widget.coin != Coin.wownero && + widget.coin != Coin.epicCash) Row( children: [ GestureDetector( diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart index 340bd859b..8baddb700 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart @@ -81,6 +81,7 @@ class _NodeDetailsViewState extends ConsumerState { break; case Coin.monero: + case Coin.wownero: try { final uri = Uri.parse(node!.host); if (uri.scheme.startsWith("http")) { diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index 892cd13d8..c4045dc9b 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -12,6 +12,7 @@ import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_net import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; import 'package:stackwallet/services/coins/monero/monero_wallet.dart'; +import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart'; import 'package:stackwallet/services/event_bus/events/global/blocks_remaining_event.dart'; import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/events/global/refresh_percent_changed_event.dart'; @@ -205,7 +206,7 @@ class _WalletNetworkSettingsViewState .getManager(widget.walletId) .coin; - if (coin == Coin.monero || coin == Coin.epicCash) { + if (coin == Coin.monero || coin == Coin.wownero || coin == Coin.epicCash) { _blocksRemainingSubscription = eventBus.on().listen( (event) async { if (event.walletId == widget.walletId) { @@ -271,6 +272,15 @@ class _WalletNetworkSettingsViewState if (_percent < highestPercent) { _percent = highestPercent.clamp(0.0, 1.0); } + } else if (coin == Coin.wownero) { + double highestPercent = (ref + .read(walletsChangeNotifierProvider) + .getManager(widget.walletId) + .wallet as WowneroWallet) + .highestPercentCached; + if (_percent < highestPercent) { + _percent = highestPercent.clamp(0.0, 1.0); + } } else if (coin == Coin.epicCash) { double highestPercent = (ref .read(walletsChangeNotifierProvider) @@ -545,6 +555,7 @@ class _WalletNetworkSettingsViewState ), ), if (coin == Coin.monero || + coin == Coin.wownero || coin == Coin.epicCash) Text( " (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})", diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index 391b5caec..f68a72c3c 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -239,7 +239,7 @@ class _TransactionDetailsViewState children: [ SelectableText( "$amountPrefix${Format.localizedStringAsFixed( - value: coin == Coin.monero + value: coin == Coin.monero || coin == Coin.wownero ? (amount / 10000.toDecimal()).toDecimal() : amount, locale: ref.watch( @@ -254,7 +254,7 @@ class _TransactionDetailsViewState height: 2, ), SelectableText( - "${Format.localizedStringAsFixed(value: (coin == Coin.monero ? (amount / 10000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch( + "${Format.localizedStringAsFixed(value: (coin == Coin.monero || coin == Coin.wownero ? (amount / 10000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch( localeServiceChangeNotifierProvider .select((value) => value.locale), ), decimalPlaces: 2)} ${ref.watch( @@ -298,14 +298,14 @@ class _TransactionDetailsViewState ], ), ), - if (!(coin == Coin.monero && + if (!((coin == Coin.monero || coin == Coin.wownero) && _transaction.txType.toLowerCase() == "sent") && !((coin == Coin.firo || coin == Coin.firoTestNet) && _transaction.subType == "mint")) const SizedBox( height: 12, ), - if (!(coin == Coin.monero && + if (!((coin == Coin.monero || coin == Coin.wownero) && _transaction.txType.toLowerCase() == "sent") && !((coin == Coin.firo || coin == Coin.firoTestNet) && _transaction.subType == "mint")) @@ -462,7 +462,7 @@ class _TransactionDetailsViewState showFeePending ? _transaction.confirmedStatus ? Format.localizedStringAsFixed( - value: coin == Coin.monero + value: coin == Coin.monero || coin == Coin.wownero ? (fee / 10000.toDecimal()).toDecimal() : fee, locale: ref.watch( @@ -471,7 +471,7 @@ class _TransactionDetailsViewState decimalPlaces: Constants.decimalPlaces) : "Pending" : Format.localizedStringAsFixed( - value: coin == Coin.monero + value: coin == Coin.monero || coin == Coin.wownero ? (fee / 10000.toDecimal()).toDecimal() : fee, locale: ref.watch( diff --git a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart index 728706702..028c04416 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart @@ -750,7 +750,7 @@ class _TransactionSearchViewState } int? amount; if (amountDecimal != null) { - if (widget.coin == Coin.monero) { + if (widget.coin == Coin.monero || widget.coin == Coin.wownero) { amount = (amountDecimal * Decimal.fromInt(Constants.satsPerCoinMonero)) .floor() .toBigInt() diff --git a/lib/services/wallets.dart b/lib/services/wallets.dart index 034db9308..db3011d4e 100644 --- a/lib/services/wallets.dart +++ b/lib/services/wallets.dart @@ -223,7 +223,7 @@ class Wallets extends ChangeNotifier { final shouldSetAutoSync = shouldAutoSyncAll || walletIdsToEnableAutoSync.contains(manager.walletId); - if (manager.coin == Coin.monero) { + if (manager.coin == Coin.monero || manager.coin == Coin.wownero) { walletsToInitLinearly.add(Tuple2(manager, shouldSetAutoSync)); } else { walletInitFutures.add(manager.initializeExisting().then((value) { @@ -312,7 +312,7 @@ class Wallets extends ChangeNotifier { final shouldSetAutoSync = shouldAutoSyncAll || walletIdsToEnableAutoSync.contains(manager.walletId); - if (manager.coin == Coin.monero) { + if (manager.coin == Coin.monero || manager.coin == Coin.wownero) { walletsToInitLinearly.add(Tuple2(manager, shouldSetAutoSync)); } else { walletInitFutures.add(manager.initializeExisting().then((value) { diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index 4b09f92b8..2ffd6f307 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -15,6 +15,7 @@ abstract class DefaultNodes { epicCash, bitcoincash, namecoin, + wownero, bitcoinTestnet, bitcoincashTestnet, dogecoinTestnet, @@ -86,7 +87,7 @@ abstract class DefaultNodes { // TODO: eventually enable ssl and set scheme to https // currently get certificate failure static NodeModel get wownero => NodeModel( - host: "eu-west-2.wow.xmr.pm", + host: "http://eu-west-2.wow.xmr.pm", port: 34568, name: defaultName, id: _nodeId(Coin.wownero), diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index 02570b76c..58a5bf30a 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -85,6 +85,7 @@ class NodeOptionsSheet extends ConsumerWidget { break; case Coin.monero: + case Coin.wownero: try { final uri = Uri.parse(node.host); if (uri.scheme.startsWith("http")) { diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 4a8da2357..468e96dc9 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -170,7 +170,7 @@ class _TransactionCardState extends ConsumerState { fit: BoxFit.scaleDown, child: Builder( builder: (_) { - final amount = coin == Coin.monero + final amount = coin == Coin.monero || coin == Coin.wownero ? (_transaction.amount ~/ 10000) : _transaction.amount; return Text( @@ -210,7 +210,7 @@ class _TransactionCardState extends ConsumerState { builder: (_) { // TODO: modify Format. to take optional Coin parameter so this type oif check isn't done in ui int value = _transaction.amount; - if (coin == Coin.monero) { + if (coin == Coin.monero || coin == Coin.wownero) { value = (value ~/ 10000); }