New versions (#1334)

* Enable Exolix Improve service updates indicator New versions * Add exolix Api token to limits api * Ignore reporting network issues * Change default bitcoin node

Omar Hatem committed Mar 18, 2024 at 17:45 UTC 27347779fa55232f9ceea6ee4e8c7466101b85a3
11 files changed +59 -23
assets/text/Monerocom_Release_Notes.txt
+2
@@ -1,2 +1,4 @@
1 +Monero enhancements
2 In-App live status page for the app services
3 +Add Exolix exchange provider
4 Bug fixes and enhancements
\ No newline at end of file
assets/text/Release_Notes.txt
+3
@@ -1,2 +1,5 @@
1 +Monero enhancements
2 +Bitcoin support different address types (Taproot, Segwit P2WPKH/P2WSH, Legacy)
3 In-App live status page for the app services
4 +Add Exolix exchange provider
5 Bug fixes and enhancements
\ No newline at end of file
cw_monero/lib/monero_wallet.dart
+1 -7
@@ -574,13 +574,7 @@ abstract class MoneroWalletBase
574 int height = 0;
575 try {
576 height = _getHeightByDate(walletInfo.date);
577 - } catch (e, s) {
578 - onError?.call(FlutterErrorDetails(
579 - exception: e,
580 - stack: s,
581 - library: this.runtimeType.toString(),
582 - ));
583 - }
577 + } catch (_) {}
578
579 monero_wallet.setRecoveringFromSeed(isRecovery: true);
580 monero_wallet.setRefreshFromBlockHeight(height: height);
lib/entities/default_settings_migration.dart
+27
@@ -35,6 +35,7 @@ const cakeWalletBitcoinCashDefaultNodeUri = 'bitcoincash.stackwallet.com:50002';
35 const nanoDefaultNodeUri = 'rpc.nano.to';
36 const nanoDefaultPowNodeUri = 'rpc.nano.to';
37 const solanaDefaultNodeUri = 'rpc.ankr.com';
38 +const newCakeWalletBitcoinUri = 'btc-electrum.cakewallet.com:50002';
39
40 Future<void> defaultSettingsMigration(
41 {required int version,
@@ -201,9 +202,15 @@ Future<void> defaultSettingsMigration(
202 await changeSolanaCurrentNodeToDefault(
203 sharedPreferences: sharedPreferences, nodes: nodes);
204 break;
205 +
206 case 28:
207 await _updateMoneroPriority(sharedPreferences);
208 break;
209 +
210 + case 29:
211 + await changeDefaultBitcoinNode(nodes, sharedPreferences);
212 + break;
213 +
214 default:
215 break;
216 }
@@ -702,6 +709,26 @@ Future<void> changeDefaultMoneroNode(
709 }
710 }
711
712 +Future<void> changeDefaultBitcoinNode(
713 + Box<Node> nodeSource, SharedPreferences sharedPreferences) async {
714 + const cakeWalletBitcoinNodeUriPattern = '.cakewallet.com';
715 + final currentBitcoinNodeId =
716 + sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey);
717 + final currentBitcoinNode =
718 + nodeSource.values.firstWhere((node) => node.key == currentBitcoinNodeId);
719 + final needToReplaceCurrentBitcoinNode =
720 + currentBitcoinNode.uri.toString().contains(cakeWalletBitcoinNodeUriPattern);
721 +
722 + final newCakeWalletBitcoinNode = Node(uri: newCakeWalletBitcoinUri, type: WalletType.bitcoin);
723 +
724 + await nodeSource.add(newCakeWalletBitcoinNode);
725 +
726 + if (needToReplaceCurrentBitcoinNode) {
727 + await sharedPreferences.setInt(
728 + PreferencesKey.currentBitcoinElectrumSererIdKey, newCakeWalletBitcoinNode.key as int);
729 + }
730 +}
731 +
732 Future<void> checkCurrentNodes(
733 Box<Node> nodeSource, Box<Node> powNodeSource, SharedPreferences sharedPreferences) async {
734 final currentMoneroNodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey);
lib/exchange/provider/exolix_exchange_provider.dart
+1
@@ -66,6 +66,7 @@ class ExolixExchangeProvider extends ExchangeProvider {
66 final params = <String, String>{
67 'rateType': _getRateType(isFixedRateMode),
68 'amount': '1',
69 + 'apiToken': apiKey,
70 };
71 if (isFixedRateMode) {
72 params['coinFrom'] = _normalizeCurrency(to);
lib/main.dart
+1 -1
@@ -163,7 +163,7 @@ Future<void> initializeAppConfigs() async {
163 transactionDescriptions: transactionDescriptions,
164 secureStorage: secureStorage,
165 anonpayInvoiceInfo: anonpayInvoiceInfo,
166 - initialMigrationVersion: 28);
166 + initialMigrationVersion: 29);
167 }
168
169 Future<void> initialSetup(
lib/src/widgets/services_updates_widget.dart
+11 -2
@@ -10,17 +10,24 @@ import 'package:flutter_svg/flutter_svg.dart';
10 import 'package:shared_preferences/shared_preferences.dart';
11 import 'package:url_launcher/url_launcher.dart';
12
13 -class ServicesUpdatesWidget extends StatelessWidget {
13 +class ServicesUpdatesWidget extends StatefulWidget {
14 final Future<ServicesResponse> servicesResponse;
15
16 const ServicesUpdatesWidget(this.servicesResponse, {super.key});
17
18 + @override
19 + State<ServicesUpdatesWidget> createState() => _ServicesUpdatesWidgetState();
20 +}
21 +
22 +class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
23 + bool wasOpened = false;
24 +
25 @override
26 Widget build(BuildContext context) {
27 return Padding(
28 padding: const EdgeInsets.all(8.0),
29 child: FutureBuilder<ServicesResponse>(
23 - future: servicesResponse,
30 + future: widget.servicesResponse,
31 builder: (context, state) {
32 return InkWell(
33 onTap: state.hasData
@@ -30,6 +37,8 @@ class ServicesUpdatesWidget extends StatelessWidget {
37 .get<SharedPreferences>()
38 .setString(PreferencesKey.serviceStatusShaKey, state.data!.currentSha);
39
40 + setState(() => wasOpened = true);
41 +
42 showModalBottomSheet(
43 context: context,
44 shape: RoundedRectangleBorder(
lib/utils/feature_flag.dart
+1 -1
@@ -1,5 +1,5 @@
1 class FeatureFlag {
2 static const bool isCakePayEnabled = false;
3 - static const bool isExolixEnabled = false;
3 + static const bool isExolixEnabled = true;
4 static const bool isInAppTorEnabled = false;
5 }
\ No newline at end of file
scripts/android/app_env.sh
+4 -4
@@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
15 APP_ANDROID_TYPE=$1
16
17 MONERO_COM_NAME="Monero.com"
18 -MONERO_COM_VERSION="1.11.1"
19 -MONERO_COM_BUILD_NUMBER=78
18 +MONERO_COM_VERSION="1.12.0"
19 +MONERO_COM_BUILD_NUMBER=79
20 MONERO_COM_BUNDLE_ID="com.monero.app"
21 MONERO_COM_PACKAGE="com.monero.app"
22 MONERO_COM_SCHEME="monero.com"
23
24 CAKEWALLET_NAME="Cake Wallet"
25 -CAKEWALLET_VERSION="4.14.1"
26 -CAKEWALLET_BUILD_NUMBER=197
25 +CAKEWALLET_VERSION="4.15.0"
26 +CAKEWALLET_BUILD_NUMBER=198
27 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
28 CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
29 CAKEWALLET_SCHEME="cakewallet"
scripts/ios/app_env.sh
+4 -4
@@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
13 APP_IOS_TYPE=$1
14
15 MONERO_COM_NAME="Monero.com"
16 -MONERO_COM_VERSION="1.11.1"
17 -MONERO_COM_BUILD_NUMBER=76
16 +MONERO_COM_VERSION="1.12.0"
17 +MONERO_COM_BUILD_NUMBER=77
18 MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
19
20 CAKEWALLET_NAME="Cake Wallet"
21 -CAKEWALLET_VERSION="4.14.1"
22 -CAKEWALLET_BUILD_NUMBER=216
21 +CAKEWALLET_VERSION="4.15.0"
22 +CAKEWALLET_BUILD_NUMBER=217
23 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
24
25 HAVEN_NAME="Haven"
scripts/macos/app_env.sh
+4 -4
@@ -16,13 +16,13 @@ if [ -n "$1" ]; then
16 fi
17
18 MONERO_COM_NAME="Monero.com"
19 -MONERO_COM_VERSION="1.1.1"
20 -MONERO_COM_BUILD_NUMBER=9
19 +MONERO_COM_VERSION="1.2.0"
20 +MONERO_COM_BUILD_NUMBER=10
21 MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
22
23 CAKEWALLET_NAME="Cake Wallet"
24 -CAKEWALLET_VERSION="1.7.1"
25 -CAKEWALLET_BUILD_NUMBER=56
24 +CAKEWALLET_VERSION="1.8.0"
25 +CAKEWALLET_BUILD_NUMBER=57
26 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
27
28 if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then