From 50b5ebc622fd5742f6e089dd6e25631e76fda237 Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Thu, 14 Mar 2024 20:26:00 +0200 Subject: [PATCH 1/2] Monero update (#1325) * New price API * Fix test app package id * Fix workflow * change environment variable to use pr number [skip ci] * Fix un-needed padding * Fix raw value for usdtSol * Remove duplicate fetching for balance and transactions at start [skip ci] * Fix address validation of spl tokens * Add Service Status * Update lib/src/widgets/service_status_tile.dart Co-authored-by: Konstantin Ullrich * Update lib/src/widgets/services_updates_widget.dart Co-authored-by: Konstantin Ullrich * Update monero version * update sodium script * Change automatic priority fee rate * New versions [skip ci] * Update monero version * Temp remove split per abi * Specifically build monero.com * Revert monero dependencies trial fix * Update Monero Fix Monero Automatic Priority * Fix android script * Fix build_monero.sh android Add svg notification icon * trial 1 * trial 2 * trial 3 * trial 4 * Trial 5 * Trial * revert --------- Co-authored-by: Konstantin Ullrich --- assets/images/notification_icon.png | Bin 471 -> 0 bytes assets/images/notification_icon.svg | 69 ++++++++++++++++++ assets/text/Monerocom_Release_Notes.txt | 2 +- assets/text/Release_Notes.txt | 6 +- cw_core/lib/monero_transaction_priority.dart | 14 ++-- cw_monero/lib/monero_wallet.dart | 4 +- lib/entities/default_settings_migration.dart | 15 ++++ lib/main.dart | 2 +- .../desktop_sidebar/side_menu_item.dart | 32 ++++---- .../desktop_sidebar_wrapper.dart | 13 +++- lib/src/widgets/services_updates_widget.dart | 8 +- .../dashboard/dashboard_view_model.dart | 16 ++-- .../dashboard/desktop_sidebar_view_model.dart | 1 + scripts/android/app_env.sh | 8 +- scripts/android/build_monero.sh | 7 +- scripts/ios/app_env.sh | 8 +- scripts/ios/build_monero.sh | 3 +- scripts/macos/app_env.sh | 8 +- scripts/macos/build_monero.sh | 3 +- 19 files changed, 156 insertions(+), 63 deletions(-) delete mode 100644 assets/images/notification_icon.png create mode 100644 assets/images/notification_icon.svg diff --git a/assets/images/notification_icon.png b/assets/images/notification_icon.png deleted file mode 100644 index a6d60211a0bef9014482e22ba784b9846f173611..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 471 zcmV;|0Vw{7P)X1^@s6+90*i00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP zgD?zKav8uIlul4a@CMBW$p*~^p%XNj06Ib^XgdMjpxppE0ez+KJ0HQuKy>#fu;rJK zB_T2(UDss_xwU}w1!#b8eU=5X=@I8pTi~8cHP(KiKY(_%T7Ag`*$k{HNlRyEs0ZK( z7`z+k3OGBPWWnJbQ<4St^)4!=ESp07lzIp@hhztgXi_wE@Sb8=0)s1k~NS4KQcpDj&Hy|M7~ri;BjzAyHYDf76?<5_t)2KX|r%p zX(w+(o{Kr9=$*IhlkzG^ZZ@(|Seh3n{f&4-q&u*#Z~SWclu+Kr33YrN`Sm(MpMlml zh&IFkp>gwt=T2jzppF@k(0YVrQYzhK4D4C&_gC}MR3BoT{+~#5_3Ar=+5t*%=>_>8 z6B+I9xHcNKn~eET9=-cG@!2r?v;r8*qt__Tu8>q=)F$BzZI?JI{s8Bgz0#>m@Ff5M N002ovPDHLkV1nYWz)t`G diff --git a/assets/images/notification_icon.svg b/assets/images/notification_icon.svg new file mode 100644 index 000000000..099039e67 --- /dev/null +++ b/assets/images/notification_icon.svg @@ -0,0 +1,69 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/assets/text/Monerocom_Release_Notes.txt b/assets/text/Monerocom_Release_Notes.txt index 732e58a18..05f78b809 100644 --- a/assets/text/Monerocom_Release_Notes.txt +++ b/assets/text/Monerocom_Release_Notes.txt @@ -1,2 +1,2 @@ -New themes +In-App live status page for the app services 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 1c2ec154c..05f78b809 100644 --- a/assets/text/Release_Notes.txt +++ b/assets/text/Release_Notes.txt @@ -1,6 +1,2 @@ -Add Solana wallet -Support ALL Bitcoin address types (Legacy, Segwit (both variants), Taproot) -Enhance Sending/Receiving flow for Bitcoin -Improve fee calculations in Bitcoin -New themes +In-App live status page for the app services Bug fixes and enhancements \ No newline at end of file diff --git a/cw_core/lib/monero_transaction_priority.dart b/cw_core/lib/monero_transaction_priority.dart index f5c00ecc7..81058f336 100644 --- a/cw_core/lib/monero_transaction_priority.dart +++ b/cw_core/lib/monero_transaction_priority.dart @@ -1,7 +1,4 @@ import 'package:cw_core/transaction_priority.dart'; -import 'package:cw_core/wallet_type.dart'; -//import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cw_core/enumerable_item.dart'; class MoneroTransactionPriority extends TransactionPriority { const MoneroTransactionPriority({required String title, required int raw}) @@ -12,21 +9,20 @@ class MoneroTransactionPriority extends TransactionPriority { MoneroTransactionPriority.automatic, MoneroTransactionPriority.medium, MoneroTransactionPriority.fast, - MoneroTransactionPriority.fastest + MoneroTransactionPriority.fastest, ]; - static const slow = MoneroTransactionPriority(title: 'Slow', raw: 0); - static const automatic = MoneroTransactionPriority(title: 'Automatic', raw: 1); + static const automatic = MoneroTransactionPriority(title: 'Automatic', raw: 0); + static const slow = MoneroTransactionPriority(title: 'Slow', raw: 1); static const medium = MoneroTransactionPriority(title: 'Medium', raw: 2); static const fast = MoneroTransactionPriority(title: 'Fast', raw: 3); static const fastest = MoneroTransactionPriority(title: 'Fastest', raw: 4); - static const standard = slow; static MoneroTransactionPriority deserialize({required int raw}) { switch (raw) { case 0: - return slow; - case 1: return automatic; + case 1: + return slow; case 2: return medium; case 3: diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 58f63d7ce..5644f6f2e 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -282,9 +282,7 @@ abstract class MoneroWalletBase pendingTransactionDescription = await transaction_history.createTransaction( address: address!, amount: amount, - priorityRaw: _credentials.priority == MoneroTransactionPriority.automatic - ? MoneroTransactionPriority.medium.serialize() - : _credentials.priority.serialize(), + priorityRaw: _credentials.priority.serialize(), accountIndex: walletAddresses.account!.id, preferredInputs: inputs); } diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index fb3e9e80c..0851d00f5 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -201,6 +201,9 @@ Future defaultSettingsMigration( await changeSolanaCurrentNodeToDefault( sharedPreferences: sharedPreferences, nodes: nodes); break; + case 28: + await _updateMoneroPriority(sharedPreferences); + break; default: break; } @@ -215,6 +218,18 @@ Future defaultSettingsMigration( await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version); } +Future _updateMoneroPriority(SharedPreferences sharedPreferences) async { + final currentPriority = + await sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority) ?? + monero!.getDefaultTransactionPriority().serialize(); + + // was set to automatic but automatic should be 0 + if (currentPriority == 1) { + sharedPreferences.setInt(PreferencesKey.moneroTransactionPriority, + monero!.getDefaultTransactionPriority().serialize()); // 0 + } +} + Future _validateWalletInfoBoxData(Box walletInfoSource) async { try { final root = await getApplicationDocumentsDirectory(); diff --git a/lib/main.dart b/lib/main.dart index 0c8a4c094..a87bcfdad 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -163,7 +163,7 @@ Future initializeAppConfigs() async { transactionDescriptions: transactionDescriptions, secureStorage: secureStorage, anonpayInvoiceInfo: anonpayInvoiceInfo, - initialMigrationVersion: 27); + initialMigrationVersion: 28); } Future initialSetup( diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart index 8119e9fd4..940ab54ca 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart @@ -7,13 +7,15 @@ class SideMenuItem extends StatelessWidget { required this.onTap, this.imagePath, this.icon, + this.widget, this.isSelected = false, - }) : assert((icon != null && imagePath == null) || (icon == null && imagePath != null)); + }) : assert(widget != null || icon != null || imagePath != null); final void Function() onTap; final String? imagePath; final IconData? icon; final bool isSelected; + final Widget? widget; Color _setColor(BuildContext context) { if (isSelected) { @@ -28,18 +30,7 @@ class SideMenuItem extends StatelessWidget { return InkWell( child: Padding( padding: EdgeInsets.all(20), - child: icon != null - ? Icon( - icon, - color: _setColor(context), - ) - : Image.asset( - imagePath ?? '', - fit: BoxFit.cover, - height: 30, - width: 30, - color: _setColor(context), - ), + child: widget ?? _getIcon(context), ), onTap: () => onTap.call(), highlightColor: Colors.transparent, @@ -48,4 +39,19 @@ class SideMenuItem extends StatelessWidget { splashColor: Colors.transparent, ); } + + Widget _getIcon(BuildContext context) { + return icon != null + ? Icon( + icon, + color: _setColor(context), + ) + : Image.asset( + imagePath ?? '', + fit: BoxFit.cover, + height: 30, + width: 30, + color: _setColor(context), + ); + } } diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart index f73570048..d0ddb19e6 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart @@ -9,6 +9,7 @@ import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sideba import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart'; import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/bottom_sheet_listener.dart'; +import 'package:cake_wallet/src/widgets/services_updates_widget.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -105,12 +106,18 @@ class DesktopSidebarWrapper extends BasePage { ? selectedIconPath : unselectedIconPath, ), + SideMenuItem( + widget: ServicesUpdatesWidget(dashboardViewModel.getServicesStatus()), + isSelected: desktopSidebarViewModel.currentPage == SidebarItem.status, + onTap: () {}, + ), ], bottomItems: [ SideMenuItem( - imagePath: 'assets/images/support_icon.png', - isSelected: desktopSidebarViewModel.currentPage == SidebarItem.support, - onTap: () => desktopSidebarViewModel.onPageChange(SidebarItem.support)), + imagePath: 'assets/images/support_icon.png', + isSelected: desktopSidebarViewModel.currentPage == SidebarItem.support, + onTap: () => desktopSidebarViewModel.onPageChange(SidebarItem.support), + ), SideMenuItem( imagePath: 'assets/images/settings_outline.png', isSelected: desktopSidebarViewModel.currentPage == SidebarItem.settings, diff --git a/lib/src/widgets/services_updates_widget.dart b/lib/src/widgets/services_updates_widget.dart index 7a8614b75..9557ff6b9 100644 --- a/lib/src/widgets/services_updates_widget.dart +++ b/lib/src/widgets/services_updates_widget.dart @@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/service_status_tile.dart'; import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -96,15 +97,16 @@ class ServicesUpdatesWidget extends StatelessWidget { : null, child: Stack( children: [ - Image.asset( - "assets/images/notification_icon.png", + SvgPicture.asset( + "assets/images/notification_icon.svg", color: Theme.of(context).extension()!.pageTitleTextColor, + width: 30, ), if (state.hasData && state.data!.hasUpdates) Container( height: 7, width: 7, - margin: EdgeInsetsDirectional.only(start: 8), + margin: EdgeInsetsDirectional.only(start: 15), decoration: BoxDecoration( color: Colors.red, shape: BoxShape.circle, diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index a21a92cb4..b02c09f82 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -344,15 +344,13 @@ abstract class DashboardViewModelBase with Store { bool hasExchangeAction; @computed - bool get isEnabledBuyAction => - !settingsStore.disableBuy && availableBuyProviders.isNotEmpty; + bool get isEnabledBuyAction => !settingsStore.disableBuy && availableBuyProviders.isNotEmpty; @observable bool hasBuyAction; @computed - bool get isEnabledSellAction => - !settingsStore.disableSell && availableSellProviders.isNotEmpty; + bool get isEnabledSellAction => !settingsStore.disableSell && availableSellProviders.isNotEmpty; @observable bool hasSellAction; @@ -477,7 +475,8 @@ abstract class DashboardViewModelBase with Store { Future> checkAffectedWallets() async { // await load file - final vulnerableSeedsString = await rootBundle.loadString('assets/text/cakewallet_weak_bitcoin_seeds_hashed_sorted_version1.txt'); + final vulnerableSeedsString = await rootBundle + .loadString('assets/text/cakewallet_weak_bitcoin_seeds_hashed_sorted_version1.txt'); final vulnerableSeeds = vulnerableSeedsString.split("\n"); final walletInfoSource = await CakeHive.openBox(WalletInfo.boxName); @@ -513,13 +512,16 @@ abstract class DashboardViewModelBase with Store { final oldSha = sharedPreferences.getString(PreferencesKey.serviceStatusShaKey); - final hash = await Cryptography.instance.sha256().hash(utf8.encode(res.body)); final currentSha = bytesToHex(hash.bytes); final hasUpdates = oldSha != currentSha; - return ServicesResponse.fromJson(json.decode(res.body) as Map, hasUpdates, currentSha); + return ServicesResponse.fromJson( + json.decode(res.body) as Map, + hasUpdates, + currentSha, + ); } catch (_) { return ServicesResponse([], false, ''); } diff --git a/lib/view_model/dashboard/desktop_sidebar_view_model.dart b/lib/view_model/dashboard/desktop_sidebar_view_model.dart index 543b44b35..52a6dc49b 100644 --- a/lib/view_model/dashboard/desktop_sidebar_view_model.dart +++ b/lib/view_model/dashboard/desktop_sidebar_view_model.dart @@ -5,6 +5,7 @@ part 'desktop_sidebar_view_model.g.dart'; enum SidebarItem { dashboard, transactions, + status, support, settings, } diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index fa3701fa7..eb1aaaacc 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.0" -MONERO_COM_BUILD_NUMBER=77 +MONERO_COM_VERSION="1.11.1" +MONERO_COM_BUILD_NUMBER=78 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.0" -CAKEWALLET_BUILD_NUMBER=196 +CAKEWALLET_VERSION="4.14.1" +CAKEWALLET_BUILD_NUMBER=197 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_SCHEME="cakewallet" diff --git a/scripts/android/build_monero.sh b/scripts/android/build_monero.sh index 7e9b58b6d..fb596e452 100755 --- a/scripts/android/build_monero.sh +++ b/scripts/android/build_monero.sh @@ -1,13 +1,12 @@ #!/bin/sh . ./config.sh -MONERO_BRANCH=release-v0.18.2.2-android_tx_priority_fix +MONERO_BRANCH=release-v0.18.3.2-android MONERO_SRC_DIR=${WORKDIR}/monero git clone https://github.com/cake-tech/monero.git ${MONERO_SRC_DIR} --branch ${MONERO_BRANCH} cd $MONERO_SRC_DIR -git submodule init -git submodule update +git submodule update --init --force for arch in "aarch" "aarch64" "i686" "x86_64" do @@ -59,7 +58,7 @@ cd $MONERO_SRC_DIR rm -rf ./build/release mkdir -p ./build/release cd ./build/release -CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../.. +CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} -D MANUAL_SUBMODULES=1 $FLAGS ../.. make wallet_api -j$THREADS find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 31f0b9548..1c778063d 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.0" -MONERO_COM_BUILD_NUMBER=75 +MONERO_COM_VERSION="1.11.1" +MONERO_COM_BUILD_NUMBER=76 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.14.0" -CAKEWALLET_BUILD_NUMBER=215 +CAKEWALLET_VERSION="4.14.1" +CAKEWALLET_BUILD_NUMBER=216 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/ios/build_monero.sh b/scripts/ios/build_monero.sh index 2c81576f1..6f06f22c1 100755 --- a/scripts/ios/build_monero.sh +++ b/scripts/ios/build_monero.sh @@ -4,7 +4,7 @@ MONERO_URL="https://github.com/cake-tech/monero.git" MONERO_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/monero" -MONERO_VERSION=release-v0.18.2.2_tx_priority_fix +MONERO_VERSION=release-v0.18.3.2 BUILD_TYPE=release PREFIX=${EXTERNAL_IOS_DIR} DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/monero @@ -52,6 +52,7 @@ cmake -D IOS=ON \ -DUNBOUND_INCLUDE_DIR=${EXTERNAL_IOS_INCLUDE_DIR} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DUSE_DEVICE_TREZOR=OFF \ + -DMANUAL_SUBMODULES=1 \ ../.. make wallet_api -j4 find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 4dec47f40..4c84832e6 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.0" -MONERO_COM_BUILD_NUMBER=7 +MONERO_COM_VERSION="1.1.1" +MONERO_COM_BUILD_NUMBER=9 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.7.0" -CAKEWALLET_BUILD_NUMBER=55 +CAKEWALLET_VERSION="1.7.1" +CAKEWALLET_BUILD_NUMBER=56 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then diff --git a/scripts/macos/build_monero.sh b/scripts/macos/build_monero.sh index 2a1ae89a5..1af7ae0e3 100755 --- a/scripts/macos/build_monero.sh +++ b/scripts/macos/build_monero.sh @@ -4,7 +4,7 @@ MONERO_URL="https://github.com/cake-tech/monero.git" MONERO_DIR_PATH="${EXTERNAL_MACOS_SOURCE_DIR}/monero" -MONERO_VERSION=release-v0.18.2.2_tx_priority_fix +MONERO_VERSION=release-v0.18.3.2 BUILD_TYPE=release PREFIX=${EXTERNAL_MACOS_DIR} DEST_LIB_DIR=${EXTERNAL_MACOS_LIB_DIR}/monero @@ -46,6 +46,7 @@ cmake -DARCH=${ARCH} \ -DUNBOUND_INCLUDE_DIR=${EXTERNAL_MACOS_INCLUDE_DIR} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DUSE_DEVICE_TREZOR=OFF \ + -DMANUAL_SUBMODULES=1 \ ../.. make wallet_api -j4 find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; From 27347779fa55232f9ceea6ee4e8c7466101b85a3 Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Mon, 18 Mar 2024 17:45:11 +0200 Subject: [PATCH 2/2] 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 --- assets/text/Monerocom_Release_Notes.txt | 2 ++ assets/text/Release_Notes.txt | 3 +++ cw_monero/lib/monero_wallet.dart | 8 +----- lib/entities/default_settings_migration.dart | 27 +++++++++++++++++++ .../provider/exolix_exchange_provider.dart | 1 + lib/main.dart | 2 +- 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 +++--- 11 files changed, 59 insertions(+), 23 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/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); 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/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); 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( 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