From 17eddde1d779ae89cfd9b4443ebdf295316cdc26 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Wed, 29 May 2024 15:58:36 +0300 Subject: [PATCH 1/2] Monero.com fixes --- lib/bitcoin/cw_bitcoin.dart | 22 +++++++++++++---- .../wallet_address_list_view_model.dart | 10 ++++---- scripts/android/app_env.sh | 8 +++---- scripts/ios/app_env.sh | 6 ++--- scripts/macos/app_env.sh | 8 +++---- tool/configure.dart | 24 +++++++------------ 6 files changed, 43 insertions(+), 35 deletions(-) diff --git a/lib/bitcoin/cw_bitcoin.dart b/lib/bitcoin/cw_bitcoin.dart index 3708f69fe..634919952 100644 --- a/lib/bitcoin/cw_bitcoin.dart +++ b/lib/bitcoin/cw_bitcoin.dart @@ -234,7 +234,7 @@ class CWBitcoin extends Bitcoin { } @override - BitcoinReceivePageOption getSelectedAddressType(Object wallet) { + ReceivePageOption getSelectedAddressType(Object wallet) { final bitcoinWallet = wallet as ElectrumWallet; return BitcoinReceivePageOption.fromType(bitcoinWallet.walletAddresses.addressPageType); } @@ -246,7 +246,7 @@ class CWBitcoin extends Bitcoin { } @override - List getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all; + List getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all; @override BitcoinAddressType getBitcoinAddressType(ReceivePageOption option) { @@ -465,18 +465,32 @@ class CWBitcoin extends Bitcoin { } @override - List getSilentPaymentAddresses(Object wallet) { + List getSilentPaymentAddresses(Object wallet) { final bitcoinWallet = wallet as ElectrumWallet; return bitcoinWallet.walletAddresses.silentAddresses .where((addr) => addr.type != SegwitAddresType.p2tr) + .map((addr) => ElectrumSubAddress( + id: addr.index, + name: addr.name, + address: addr.address, + txCount: addr.txCount, + balance: addr.balance, + isChange: addr.isHidden)) .toList(); } @override - List getSilentPaymentReceivedAddresses(Object wallet) { + List getSilentPaymentReceivedAddresses(Object wallet) { final bitcoinWallet = wallet as ElectrumWallet; return bitcoinWallet.walletAddresses.silentAddresses .where((addr) => addr.type == SegwitAddresType.p2tr) + .map((addr) => ElectrumSubAddress( + id: addr.index, + name: addr.name, + address: addr.address, + txCount: addr.txCount, + balance: addr.balance, + isChange: addr.isHidden)) .toList(); } diff --git a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart index f470a06c2..6b59c9033 100644 --- a/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart +++ b/lib/view_model/wallet_address_list/wallet_address_list_view_model.dart @@ -336,17 +336,17 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo if (isElectrumWallet) { if (bitcoin!.hasSelectedSilentPayments(wallet)) { final addressItems = bitcoin!.getSilentPaymentAddresses(wallet).map((address) { - final isPrimary = address.index == 0; + final isPrimary = address.id == 0; return WalletAddressListItem( - id: address.index, + id: address.id, isPrimary: isPrimary, name: address.name, address: address.address, txCount: address.txCount, balance: AmountConverter.amountIntToString( walletTypeToCryptoCurrency(type), address.balance), - isChange: address.isHidden, + isChange: address.isChange, ); }); addressList.addAll(addressItems); @@ -355,14 +355,14 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo final receivedAddressItems = bitcoin!.getSilentPaymentReceivedAddresses(wallet).map((address) { return WalletAddressListItem( - id: address.index, + id: address.id, isPrimary: false, name: address.name, address: address.address, txCount: address.txCount, balance: AmountConverter.amountIntToString( walletTypeToCryptoCurrency(type), address.balance), - isChange: address.isHidden, + isChange: address.isChange, isOneTimeReceiveAddress: true, ); }); diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index fe0d1a524..4578fd3d3 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.14.0" -MONERO_COM_BUILD_NUMBER=89 +MONERO_COM_VERSION="1.15.0" +MONERO_COM_BUILD_NUMBER=90 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.17.0" -CAKEWALLET_BUILD_NUMBER=215 +CAKEWALLET_VERSION="4.18.0" +CAKEWALLET_BUILD_NUMBER=216 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 39ccf47e4..ef038b6c7 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.14.0" -MONERO_COM_BUILD_NUMBER=87 +MONERO_COM_VERSION="1.15.0" +MONERO_COM_BUILD_NUMBER=88 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="4.18.0" -CAKEWALLET_BUILD_NUMBER=247 +CAKEWALLET_BUILD_NUMBER=248 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index b226aac81..a04660514 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.4.0" -MONERO_COM_BUILD_NUMBER=20 +MONERO_COM_VERSION="1.5.0" +MONERO_COM_BUILD_NUMBER=21 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.10.0" -CAKEWALLET_BUILD_NUMBER=77 +CAKEWALLET_VERSION="1.11.0" +CAKEWALLET_BUILD_NUMBER=78 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then diff --git a/tool/configure.dart b/tool/configure.dart index 24819c085..fc9bd5b91 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -71,30 +71,26 @@ Future generateBitcoin(bool hasImplementation) async { final outputFile = File(bitcoinOutputPath); const bitcoinCommonHeaders = """ import 'dart:typed_data'; -import 'package:cw_core/node.dart'; +import 'package:bitcoin_base/bitcoin_base.dart'; import 'package:cake_wallet/view_model/hardware_wallet/ledger_view_model.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cw_core/hardware/hardware_account_data.dart'; +import 'package:cw_core/node.dart'; +import 'package:cw_core/output_info.dart'; import 'package:cw_core/pending_transaction.dart'; import 'package:cw_core/receive_page_option.dart'; +import 'package:cw_core/transaction_priority.dart'; +import 'package:cw_core/unspent_coins_info.dart'; import 'package:cw_core/unspent_transaction_output.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_credentials.dart'; import 'package:cw_core/wallet_info.dart'; -import 'package:cw_core/transaction_priority.dart'; -import 'package:cw_core/output_info.dart'; -import 'package:cw_core/unspent_coins_info.dart'; import 'package:cw_core/wallet_service.dart'; import 'package:cw_core/wallet_type.dart'; -import 'package:cake_wallet/view_model/send/output.dart'; -import 'package:cake_wallet/store/settings_store.dart'; import 'package:hive/hive.dart'; import 'package:ledger_flutter/ledger_flutter.dart'; -import 'package:bitcoin_base/bitcoin_base.dart'; import 'package:bitcoin_flutter/bitcoin_flutter.dart' as btc; -import 'package:bip32/bip32.dart' as bip32; import 'package:bip39/bip39.dart' as bip39; -import 'package:hive/hive.dart'; """; const bitcoinCWHeaders = """ import 'package:cw_bitcoin/utils.dart'; @@ -115,9 +111,7 @@ import 'package:cw_bitcoin/bitcoin_address_record.dart'; import 'package:cw_bitcoin/bitcoin_transaction_credentials.dart'; import 'package:cw_bitcoin/litecoin_wallet_service.dart'; import 'package:cw_core/get_height_by_date.dart'; -import 'package:cw_core/node.dart'; import 'package:cw_bitcoin/script_hash.dart'; -import 'package:cw_bitcoin/pending_bitcoin_transaction.dart'; import 'package:cw_bitcoin/bitcoin_hardware_wallet_service.dart'; import 'package:mobx/mobx.dart'; """; @@ -167,8 +161,8 @@ abstract class Bitcoin { Object createBitcoinTransactionCredentialsRaw(List outputs, {TransactionPriority? priority, required int feeRate}); String getAddress(Object wallet); - List getSilentPaymentAddresses(Object wallet); - List getSilentPaymentReceivedAddresses(Object wallet); + List getSilentPaymentAddresses(Object wallet); + List getSilentPaymentReceivedAddresses(Object wallet); Future estimateFakeSendAllTxAmount(Object wallet, TransactionPriority priority); List getSubAddresses(Object wallet); @@ -193,8 +187,8 @@ abstract class Bitcoin { Future> getDerivationsFromMnemonic( {required String mnemonic, required Node node, String? passphrase}); Future setAddressType(Object wallet, dynamic option); - BitcoinReceivePageOption getSelectedAddressType(Object wallet); - List getBitcoinReceivePageOptions(); + ReceivePageOption getSelectedAddressType(Object wallet); + List getBitcoinReceivePageOptions(); BitcoinAddressType getBitcoinAddressType(ReceivePageOption option); bool hasSelectedSilentPayments(Object wallet); bool isBitcoinReceivePageOption(ReceivePageOption option); From fb6be41c0ac4e84f904962d5008bd2243e01b864 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Wed, 29 May 2024 16:38:47 +0300 Subject: [PATCH 2/2] update sp_scanner to include windows and linux --- cw_bitcoin/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cw_bitcoin/pubspec.yaml b/cw_bitcoin/pubspec.yaml index 1710df79b..40f3c6e29 100644 --- a/cw_bitcoin/pubspec.yaml +++ b/cw_bitcoin/pubspec.yaml @@ -45,7 +45,7 @@ dependencies: sp_scanner: git: url: https://github.com/cake-tech/sp_scanner - ref: sp_v1.0.0 + ref: sp_v2.0.0 dev_dependencies: