From e52b87f5c19b0b28a64cc2b7d7574a992326395a Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 15 Mar 2024 03:56:26 +0200 Subject: [PATCH 1/4] Enable Exolix Improve service updates indicator New versions --- assets/text/Monerocom_Release_Notes.txt | 2 ++ assets/text/Release_Notes.txt | 3 +++ lib/src/widgets/services_updates_widget.dart | 13 +++++++++++-- lib/utils/feature_flag.dart | 2 +- scripts/android/app_env.sh | 8 ++++---- scripts/ios/app_env.sh | 8 ++++---- scripts/macos/app_env.sh | 8 ++++---- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/assets/text/Monerocom_Release_Notes.txt b/assets/text/Monerocom_Release_Notes.txt index 05f78b809..90fcd2a75 100644 --- a/assets/text/Monerocom_Release_Notes.txt +++ b/assets/text/Monerocom_Release_Notes.txt @@ -1,2 +1,4 @@ +Monero enhancements In-App live status page for the app services +Add Exolix exchange provider Bug fixes and enhancements \ No newline at end of file diff --git a/assets/text/Release_Notes.txt b/assets/text/Release_Notes.txt index 05f78b809..d8d4ed830 100644 --- a/assets/text/Release_Notes.txt +++ b/assets/text/Release_Notes.txt @@ -1,2 +1,5 @@ +Monero enhancements +Bitcoin support different address types (Taproot, Segwit P2WPKH/P2WSH, Legacy) In-App live status page for the app services +Add Exolix exchange provider Bug fixes and enhancements \ No newline at end of file diff --git a/lib/src/widgets/services_updates_widget.dart b/lib/src/widgets/services_updates_widget.dart index 9557ff6b9..65dbe5e40 100644 --- a/lib/src/widgets/services_updates_widget.dart +++ b/lib/src/widgets/services_updates_widget.dart @@ -10,17 +10,24 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; -class ServicesUpdatesWidget extends StatelessWidget { +class ServicesUpdatesWidget extends StatefulWidget { final Future servicesResponse; const ServicesUpdatesWidget(this.servicesResponse, {super.key}); + @override + State createState() => _ServicesUpdatesWidgetState(); +} + +class _ServicesUpdatesWidgetState extends State { + bool wasOpened = false; + @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(8.0), child: FutureBuilder( - future: servicesResponse, + future: widget.servicesResponse, builder: (context, state) { return InkWell( onTap: state.hasData @@ -30,6 +37,8 @@ class ServicesUpdatesWidget extends StatelessWidget { .get() .setString(PreferencesKey.serviceStatusShaKey, state.data!.currentSha); + setState(() => wasOpened = true); + showModalBottomSheet( context: context, shape: RoundedRectangleBorder( diff --git a/lib/utils/feature_flag.dart b/lib/utils/feature_flag.dart index 91a4c67ca..2a29bd949 100644 --- a/lib/utils/feature_flag.dart +++ b/lib/utils/feature_flag.dart @@ -1,5 +1,5 @@ class FeatureFlag { static const bool isCakePayEnabled = false; - static const bool isExolixEnabled = false; + static const bool isExolixEnabled = true; static const bool isInAppTorEnabled = false; } \ No newline at end of file diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index eb1aaaacc..02f874d77 100644 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_ANDROID_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.11.1" -MONERO_COM_BUILD_NUMBER=78 +MONERO_COM_VERSION="1.12.0" +MONERO_COM_BUILD_NUMBER=79 MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_PACKAGE="com.monero.app" MONERO_COM_SCHEME="monero.com" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.14.1" -CAKEWALLET_BUILD_NUMBER=197 +CAKEWALLET_VERSION="4.15.0" +CAKEWALLET_BUILD_NUMBER=198 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_SCHEME="cakewallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 1c778063d..b65d3e7a6 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.11.1" -MONERO_COM_BUILD_NUMBER=76 +MONERO_COM_VERSION="1.12.0" +MONERO_COM_BUILD_NUMBER=77 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.14.1" -CAKEWALLET_BUILD_NUMBER=216 +CAKEWALLET_VERSION="4.15.0" +CAKEWALLET_BUILD_NUMBER=217 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 4c84832e6..19a1e6846 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -16,13 +16,13 @@ if [ -n "$1" ]; then fi MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.1.1" -MONERO_COM_BUILD_NUMBER=9 +MONERO_COM_VERSION="1.2.0" +MONERO_COM_BUILD_NUMBER=10 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.7.1" -CAKEWALLET_BUILD_NUMBER=56 +CAKEWALLET_VERSION="1.8.0" +CAKEWALLET_BUILD_NUMBER=57 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then From 4707e627a39dce4804851f1579692cd6c48b46e6 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 15 Mar 2024 04:26:18 +0200 Subject: [PATCH 2/4] Add exolix Api token to limits api --- lib/exchange/provider/exolix_exchange_provider.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/exchange/provider/exolix_exchange_provider.dart b/lib/exchange/provider/exolix_exchange_provider.dart index eb40aff73..9374439f3 100644 --- a/lib/exchange/provider/exolix_exchange_provider.dart +++ b/lib/exchange/provider/exolix_exchange_provider.dart @@ -66,6 +66,7 @@ class ExolixExchangeProvider extends ExchangeProvider { final params = { 'rateType': _getRateType(isFixedRateMode), 'amount': '1', + 'apiToken': apiKey, }; if (isFixedRateMode) { params['coinFrom'] = _normalizeCurrency(to); From c71272b0ca0bc9fc2139a727371cbb70d5354c91 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 15 Mar 2024 14:47:44 +0200 Subject: [PATCH 3/4] Ignore reporting network issues --- cw_monero/lib/monero_wallet.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 5644f6f2e..d00a54c8f 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -574,13 +574,7 @@ abstract class MoneroWalletBase int height = 0; try { height = _getHeightByDate(walletInfo.date); - } catch (e, s) { - onError?.call(FlutterErrorDetails( - exception: e, - stack: s, - library: this.runtimeType.toString(), - )); - } + } catch (_) {} monero_wallet.setRecoveringFromSeed(isRecovery: true); monero_wallet.setRefreshFromBlockHeight(height: height); From 184b3612be929182598d082b1f34b60385028096 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 15 Mar 2024 17:50:43 +0200 Subject: [PATCH 4/4] Change default bitcoin node --- lib/entities/default_settings_migration.dart | 27 ++++++++++++++++++++ lib/main.dart | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 0851d00f5..8ce38e4c4 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -35,6 +35,7 @@ const cakeWalletBitcoinCashDefaultNodeUri = 'bitcoincash.stackwallet.com:50002'; const nanoDefaultNodeUri = 'rpc.nano.to'; const nanoDefaultPowNodeUri = 'rpc.nano.to'; const solanaDefaultNodeUri = 'rpc.ankr.com'; +const newCakeWalletBitcoinUri = 'btc-electrum.cakewallet.com:50002'; Future defaultSettingsMigration( {required int version, @@ -201,9 +202,15 @@ Future defaultSettingsMigration( await changeSolanaCurrentNodeToDefault( sharedPreferences: sharedPreferences, nodes: nodes); break; + case 28: await _updateMoneroPriority(sharedPreferences); break; + + case 29: + await changeDefaultBitcoinNode(nodes, sharedPreferences); + break; + default: break; } @@ -702,6 +709,26 @@ Future changeDefaultMoneroNode( } } +Future changeDefaultBitcoinNode( + Box nodeSource, SharedPreferences sharedPreferences) async { + const cakeWalletBitcoinNodeUriPattern = '.cakewallet.com'; + final currentBitcoinNodeId = + sharedPreferences.getInt(PreferencesKey.currentBitcoinElectrumSererIdKey); + final currentBitcoinNode = + nodeSource.values.firstWhere((node) => node.key == currentBitcoinNodeId); + final needToReplaceCurrentBitcoinNode = + currentBitcoinNode.uri.toString().contains(cakeWalletBitcoinNodeUriPattern); + + final newCakeWalletBitcoinNode = Node(uri: newCakeWalletBitcoinUri, type: WalletType.bitcoin); + + await nodeSource.add(newCakeWalletBitcoinNode); + + if (needToReplaceCurrentBitcoinNode) { + await sharedPreferences.setInt( + PreferencesKey.currentBitcoinElectrumSererIdKey, newCakeWalletBitcoinNode.key as int); + } +} + Future checkCurrentNodes( Box nodeSource, Box powNodeSource, SharedPreferences sharedPreferences) async { final currentMoneroNodeId = sharedPreferences.getInt(PreferencesKey.currentNodeIdKey); diff --git a/lib/main.dart b/lib/main.dart index a87bcfdad..db505f15a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -163,7 +163,7 @@ Future initializeAppConfigs() async { transactionDescriptions: transactionDescriptions, secureStorage: secureStorage, anonpayInvoiceInfo: anonpayInvoiceInfo, - initialMigrationVersion: 28); + initialMigrationVersion: 29); } Future initialSetup(