diff --git a/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt b/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt new file mode 100644 index 000000000..3ea4c29ad --- /dev/null +++ b/android/app/src/main/kotlin/com/cakewallet/cake_wallet/MainActivity.kt @@ -0,0 +1,6 @@ +package com.cakewallet.cake_wallet + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 22f6e230d..969ed63e6 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -1ec95e8df881a4b938eb38fddbcc8f19 \ No newline at end of file +09c81fe0a3d701eb6da3bd2c6fc5ec65 \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile index cd011b7b6..46c468f1a 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +platform :ios, '9.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0c5421744..e1e57b6c1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -117,6 +117,6 @@ SPEC CHECKSUMS: SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef -PODFILE CHECKSUM: 6856e7141d486377eb0aa3b6d88e4b952e4ff514 +PODFILE CHECKSUM: ade2ba43f8c2af4060c025bfd25a553d068ab914 COCOAPODS: 1.9.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bf2823282..b4a58d67e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -351,7 +351,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -439,7 +439,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -488,7 +488,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/entities/ios_legacy_helper.dart b/lib/entities/ios_legacy_helper.dart index e69de29bb..1e4a2fba5 100644 --- a/lib/entities/ios_legacy_helper.dart +++ b/lib/entities/ios_legacy_helper.dart @@ -0,0 +1,15 @@ +import 'dart:async'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; + +const platform = + const MethodChannel('com.cakewallet.cakewallet/legacy_wallet_migration'); + +Future readTradeList( + {@required String key, @required String salt}) async => + await platform.invokeMethod('read_trade_list', {'key': key, 'salt': salt}); + +Future readEncryptedFile(String url, + {@required String key, @required String salt}) async => + await platform.invokeMethod( + 'read_encrypted_file', {'url': url, 'key': key, 'salt': salt}); diff --git a/lib/monero/monero_transaction_history.dart b/lib/monero/monero_transaction_history.dart index 42c9a682b..5d8b99a8c 100644 --- a/lib/monero/monero_transaction_history.dart +++ b/lib/monero/monero_transaction_history.dart @@ -3,7 +3,6 @@ import 'package:mobx/mobx.dart'; import 'package:cw_monero/transaction_history.dart' as monero_transaction_history; import 'package:cake_wallet/core/transaction_history.dart'; -import 'package:cake_wallet/entities/transaction_info.dart'; import 'package:cake_wallet/monero/monero_transaction_info.dart'; part 'monero_transaction_history.g.dart'; @@ -44,5 +43,9 @@ abstract class MoneroTransactionHistoryBase @override void fetchTransactionsAsync( void Function(MoneroTransactionInfo transaction) onTransactionLoaded, - {void Function() onFinished}) {} + {void Function() onFinished}) async { + final transactions = await fetchTransactions(); + transactions.values.forEach((tx) => onTransactionLoaded(tx)); + onFinished?.call(); + } } diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index 1d3455994..7d7e0c9c5 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -1,20 +1,22 @@ -import 'package:cake_wallet/entities/wallet_info.dart'; -import 'package:cake_wallet/monero/monero_transaction_creation_credentials.dart'; import 'package:flutter/foundation.dart'; import 'package:mobx/mobx.dart'; import 'package:cw_monero/wallet.dart'; import 'package:cw_monero/wallet.dart' as monero_wallet; +import 'package:cw_monero/transaction_history.dart' as transaction_history; +import 'package:cake_wallet/monero/monero_transaction_creation_credentials.dart'; +import 'package:cake_wallet/monero/pending_monero_transaction.dart'; import 'package:cake_wallet/monero/monero_wallet_keys.dart'; import 'package:cake_wallet/monero/monero_balance.dart'; import 'package:cake_wallet/monero/monero_transaction_history.dart'; import 'package:cake_wallet/monero/monero_subaddress_list.dart'; import 'package:cake_wallet/monero/monero_account_list.dart'; -import 'package:cake_wallet/core/wallet_base.dart'; -import 'package:cake_wallet/entities/sync_status.dart'; import 'package:cake_wallet/monero/account.dart'; import 'package:cake_wallet/monero/subaddress.dart'; -import 'package:cake_wallet/entities/node.dart'; import 'package:cake_wallet/core/pending_transaction.dart'; +import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cake_wallet/entities/sync_status.dart'; +import 'package:cake_wallet/entities/wallet_info.dart'; +import 'package:cake_wallet/entities/node.dart'; import 'package:cake_wallet/entities/transaction_priority.dart'; part 'monero_wallet.g.dart'; @@ -134,15 +136,15 @@ abstract class MoneroWalletBase extends WalletBase with Store { @override Future createTransaction(Object credentials) async { final _credentials = credentials as MoneroTransactionCreationCredentials; - // final transactionDescription = await transaction_history.createTransaction( - // address: _credentials.address, - // paymentId: _credentials.paymentId, - // amount: _credentials.amount, - // priorityRaw: _credentials.priority.serialize(), - // accountIndex: _account.value.id); + final pendingTransactionDescription = + await transaction_history.createTransaction( + address: _credentials.address, + paymentId: _credentials.paymentId, + amount: _credentials.amount, + priorityRaw: _credentials.priority.serialize(), + accountIndex: account.id); - // return PendingTransaction.fromTransactionDescription( - // transactionDescription); + return PendingMoneroTransaction(pendingTransactionDescription); } @override @@ -243,8 +245,7 @@ abstract class MoneroWalletBase extends WalletBase with Store { } } - void _askForUpdateTransactionHistory() => - null; // await getHistory().update(); + void _askForUpdateTransactionHistory() => transactionHistory.updateAsync(); int _getFullBalance() => monero_wallet.getFullBalance(accountIndex: account.id); diff --git a/lib/monero/pending_monero_transaction.dart b/lib/monero/pending_monero_transaction.dart new file mode 100644 index 000000000..3c4859f2c --- /dev/null +++ b/lib/monero/pending_monero_transaction.dart @@ -0,0 +1,25 @@ +import 'package:cw_monero/structs/pending_transaction.dart'; +import 'package:cw_monero/transaction_history.dart' + as monero_transaction_history; +import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cake_wallet/core/amount_converter.dart'; +import 'package:cake_wallet/core/pending_transaction.dart'; + +class PendingMoneroTransaction with PendingTransaction { + PendingMoneroTransaction(this.pendingTransactionDescription); + + final PendingTransactionDescription pendingTransactionDescription; + + @override + String get amountFormatted => AmountConverter.amountIntToString( + CryptoCurrency.xmr, pendingTransactionDescription.amount); + + @override + String get feeFormatted => AmountConverter.amountIntToString( + CryptoCurrency.xmr, pendingTransactionDescription.fee); + + @override + Future commit() async => + monero_transaction_history.commitTransactionFromPointerAddress( + address: pendingTransactionDescription.pointerAddress); +}