Merge branch 'main' into zano-pr

This commit is contained in:
cyan 2024-11-21 17:36:31 +01:00 committed by GitHub
commit b6630938a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 106 additions and 88 deletions

View file

@ -1,3 +1,3 @@
Monero enhancements Add airgapped Monero wallet support (best used with our new offline app Cupcake)
Introducing StealthEx and LetxExchange New Buy & Sell flow
Bug fixes Bug fixes

View file

@ -1,7 +1,5 @@
Added Litecoin MWEB Add Litecoin Ledger support
Added wallet groups Add airgapped Monero wallet support (best used with our new offline app Cupcake)
Silent Payment enhancements for speed & reliability MWEB fixes and enhancements
Monero enhancements New Buy & Sell flow
Introducing StealthEx and LetxExchange
Additional ERC20 tokens scam detection
Bug fixes Bug fixes

View file

@ -574,6 +574,8 @@ abstract class ElectrumWalletBase
Future<void> connectToNode({required Node node}) async { Future<void> connectToNode({required Node node}) async {
this.node = node; this.node = node;
if (syncStatus is ConnectingSyncStatus) return;
try { try {
syncStatus = ConnectingSyncStatus(); syncStatus = ConnectingSyncStatus();
@ -2216,13 +2218,14 @@ abstract class ElectrumWalletBase
if (syncStatus is NotConnectedSyncStatus || if (syncStatus is NotConnectedSyncStatus ||
syncStatus is LostConnectionSyncStatus || syncStatus is LostConnectionSyncStatus ||
syncStatus is ConnectingSyncStatus) { syncStatus is ConnectingSyncStatus) {
syncStatus = AttemptingSyncStatus(); syncStatus = ConnectedSyncStatus();
startSync();
} }
break; break;
case ConnectionStatus.disconnected: case ConnectionStatus.disconnected:
if (syncStatus is! NotConnectedSyncStatus) { if (syncStatus is! NotConnectedSyncStatus &&
syncStatus is! ConnectingSyncStatus &&
syncStatus is! SyncronizingSyncStatus) {
syncStatus = NotConnectedSyncStatus(); syncStatus = NotConnectedSyncStatus();
} }
break; break;

View file

@ -87,8 +87,8 @@ packages:
dependency: "direct overridden" dependency: "direct overridden"
description: description:
path: "." path: "."
ref: cake-update-v8 ref: cake-update-v9
resolved-ref: fc045a11db3d85d806ca67f75e8b916c706745a2 resolved-ref: "86969a14e337383e14965f5fb45a72a63e5009bc"
url: "https://github.com/cake-tech/bitcoin_base" url: "https://github.com/cake-tech/bitcoin_base"
source: git source: git
version: "4.7.0" version: "4.7.0"

View file

@ -7,7 +7,7 @@ enum DeviceConnectionType {
static List<DeviceConnectionType> supportedConnectionTypes(WalletType walletType, static List<DeviceConnectionType> supportedConnectionTypes(WalletType walletType,
[bool isIOS = false]) { [bool isIOS = false]) {
switch (walletType) { switch (walletType) {
case WalletType.monero: // case WalletType.monero:
case WalletType.bitcoin: case WalletType.bitcoin:
case WalletType.litecoin: case WalletType.litecoin:
case WalletType.ethereum: case WalletType.ethereum:

View file

@ -1,8 +1,4 @@
PODS: PODS:
- barcode_scan2 (0.0.1):
- Flutter
- MTBBarcodeScanner
- SwiftProtobuf
- connectivity_plus (0.0.1): - connectivity_plus (0.0.1):
- Flutter - Flutter
- ReachabilitySwift - ReachabilitySwift
@ -76,6 +72,8 @@ PODS:
- DKPhotoGallery/Resource (0.0.19): - DKPhotoGallery/Resource (0.0.19):
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- fast_scanner (5.1.1):
- Flutter
- file_picker (0.0.1): - file_picker (0.0.1):
- DKImagePickerController/PhotoGallery - DKImagePickerController/PhotoGallery
- Flutter - Flutter
@ -100,7 +98,6 @@ PODS:
- Flutter - Flutter
- integration_test (0.0.1): - integration_test (0.0.1):
- Flutter - Flutter
- MTBBarcodeScanner (5.0.11)
- OrderedSet (5.0.0) - OrderedSet (5.0.0)
- package_info_plus (0.4.5): - package_info_plus (0.4.5):
- Flutter - Flutter
@ -109,12 +106,7 @@ PODS:
- FlutterMacOS - FlutterMacOS
- permission_handler_apple (9.1.1): - permission_handler_apple (9.1.1):
- Flutter - Flutter
- Protobuf (3.28.2)
- ReachabilitySwift (5.2.3) - ReachabilitySwift (5.2.3)
- reactive_ble_mobile (0.0.1):
- Flutter
- Protobuf (~> 3.5)
- SwiftProtobuf (~> 1.0)
- SDWebImage (5.19.7): - SDWebImage (5.19.7):
- SDWebImage/Core (= 5.19.7) - SDWebImage/Core (= 5.19.7)
- SDWebImage/Core (5.19.7) - SDWebImage/Core (5.19.7)
@ -127,11 +119,13 @@ PODS:
- FlutterMacOS - FlutterMacOS
- sp_scanner (0.0.1): - sp_scanner (0.0.1):
- Flutter - Flutter
- SwiftProtobuf (1.27.1)
- SwiftyGif (5.4.5) - SwiftyGif (5.4.5)
- Toast (4.1.1) - Toast (4.1.1)
- uni_links (0.0.1): - uni_links (0.0.1):
- Flutter - Flutter
- universal_ble (0.0.1):
- Flutter
- FlutterMacOS
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
- wakelock_plus (0.0.1): - wakelock_plus (0.0.1):
@ -140,7 +134,6 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- CryptoSwift - CryptoSwift
- cw_haven (from `.symlinks/plugins/cw_haven/ios`) - cw_haven (from `.symlinks/plugins/cw_haven/ios`)
@ -149,6 +142,7 @@ DEPENDENCIES:
- device_display_brightness (from `.symlinks/plugins/device_display_brightness/ios`) - device_display_brightness (from `.symlinks/plugins/device_display_brightness/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- devicelocale (from `.symlinks/plugins/devicelocale/ios`) - devicelocale (from `.symlinks/plugins/devicelocale/ios`)
- fast_scanner (from `.symlinks/plugins/fast_scanner/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
@ -161,12 +155,12 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
- sensitive_clipboard (from `.symlinks/plugins/sensitive_clipboard/ios`) - sensitive_clipboard (from `.symlinks/plugins/sensitive_clipboard/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sp_scanner (from `.symlinks/plugins/sp_scanner/ios`) - sp_scanner (from `.symlinks/plugins/sp_scanner/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`) - uni_links (from `.symlinks/plugins/uni_links/ios`)
- universal_ble (from `.symlinks/plugins/universal_ble/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`) - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
- workmanager (from `.symlinks/plugins/workmanager/ios`) - workmanager (from `.symlinks/plugins/workmanager/ios`)
@ -176,18 +170,13 @@ SPEC REPOS:
- CryptoSwift - CryptoSwift
- DKImagePickerController - DKImagePickerController
- DKPhotoGallery - DKPhotoGallery
- MTBBarcodeScanner
- OrderedSet - OrderedSet
- Protobuf
- ReachabilitySwift - ReachabilitySwift
- SDWebImage - SDWebImage
- SwiftProtobuf
- SwiftyGif - SwiftyGif
- Toast - Toast
EXTERNAL SOURCES: EXTERNAL SOURCES:
barcode_scan2:
:path: ".symlinks/plugins/barcode_scan2/ios"
connectivity_plus: connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios" :path: ".symlinks/plugins/connectivity_plus/ios"
cw_haven: cw_haven:
@ -202,6 +191,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
devicelocale: devicelocale:
:path: ".symlinks/plugins/devicelocale/ios" :path: ".symlinks/plugins/devicelocale/ios"
fast_scanner:
:path: ".symlinks/plugins/fast_scanner/ios"
file_picker: file_picker:
:path: ".symlinks/plugins/file_picker/ios" :path: ".symlinks/plugins/file_picker/ios"
Flutter: Flutter:
@ -226,8 +217,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple: permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios" :path: ".symlinks/plugins/permission_handler_apple/ios"
reactive_ble_mobile:
:path: ".symlinks/plugins/reactive_ble_mobile/ios"
sensitive_clipboard: sensitive_clipboard:
:path: ".symlinks/plugins/sensitive_clipboard/ios" :path: ".symlinks/plugins/sensitive_clipboard/ios"
share_plus: share_plus:
@ -238,6 +227,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sp_scanner/ios" :path: ".symlinks/plugins/sp_scanner/ios"
uni_links: uni_links:
:path: ".symlinks/plugins/uni_links/ios" :path: ".symlinks/plugins/uni_links/ios"
universal_ble:
:path: ".symlinks/plugins/universal_ble/darwin"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
wakelock_plus: wakelock_plus:
@ -246,7 +237,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/workmanager/ios" :path: ".symlinks/plugins/workmanager/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
CryptoSwift: c63a805d8bb5e5538e88af4e44bb537776af11ea CryptoSwift: c63a805d8bb5e5538e88af4e44bb537776af11ea
cw_haven: b3e54e1fbe7b8e6fda57a93206bc38f8e89b898a cw_haven: b3e54e1fbe7b8e6fda57a93206bc38f8e89b898a
@ -257,6 +247,7 @@ SPEC CHECKSUMS:
devicelocale: b22617f40038496deffba44747101255cee005b0 devicelocale: b22617f40038496deffba44747101255cee005b0
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
fast_scanner: 44c00940355a51258cd6c2085734193cd23d95bc
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
@ -266,23 +257,20 @@ SPEC CHECKSUMS:
fluttertoast: 48c57db1b71b0ce9e6bba9f31c940ff4b001293c fluttertoast: 48c57db1b71b0ce9e6bba9f31c940ff4b001293c
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: 13825b8a9334a850581300559b8839134b124670
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
Protobuf: 28c89b24435762f60244e691544ed80f50d82701
ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979 ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3 SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
sensitive_clipboard: d4866e5d176581536c27bb1618642ee83adca986 sensitive_clipboard: d4866e5d176581536c27bb1618642ee83adca986
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sp_scanner: eaa617fa827396b967116b7f1f43549ca62e9a12 sp_scanner: eaa617fa827396b967116b7f1f43549ca62e9a12
SwiftProtobuf: b109bd17979d7993a84da14b1e1fdd8b0ded934a
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6 workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6

View file

@ -230,6 +230,7 @@
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
F6F67323547956BC4F7B67F1 /* [CP] Embed Pods Frameworks */, F6F67323547956BC4F7B67F1 /* [CP] Embed Pods Frameworks */,
777FE2B16F25A3E820834145 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -343,6 +344,23 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
}; };
777FE2B16F25A3E820834145 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1; alwaysOutOfDate = 1;

View file

@ -5,14 +5,10 @@ import 'package:cake_wallet/buy/buy_provider.dart';
import 'package:cake_wallet/buy/buy_quote.dart'; import 'package:cake_wallet/buy/buy_quote.dart';
import 'package:cake_wallet/buy/payment_method.dart'; import 'package:cake_wallet/buy/payment_method.dart';
import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/entities/provider_types.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/utils/device_info.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/currency.dart';
import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:developer'; import 'dart:developer';

View file

@ -253,7 +253,7 @@ Future<void> defaultSettingsMigration(
await removeMoneroWorld(sharedPreferences: sharedPreferences, nodes: nodes); await removeMoneroWorld(sharedPreferences: sharedPreferences, nodes: nodes);
break; break;
case 41: case 41:
_deselectQuantex(sharedPreferences); _deselectExchangeProvider(sharedPreferences, "Quantex");
await _addSethNode(nodes, sharedPreferences); await _addSethNode(nodes, sharedPreferences);
await updateTronNodesWithNowNodes(sharedPreferences: sharedPreferences, nodes: nodes); await updateTronNodesWithNowNodes(sharedPreferences: sharedPreferences, nodes: nodes);
break; break;
@ -262,6 +262,8 @@ Future<void> defaultSettingsMigration(
break; break;
case 43: case 43:
_updateCakeXmrNode(nodes); _updateCakeXmrNode(nodes);
_deselectExchangeProvider(sharedPreferences, "THORChain");
_deselectExchangeProvider(sharedPreferences, "SimpleSwap");
break; break;
case 44: case 44:
await addZanoNodeList(nodes: nodes); await addZanoNodeList(nodes: nodes);
@ -300,12 +302,12 @@ void updateBtcElectrumNodeToUseSSL(Box<Node> nodes, SharedPreferences sharedPref
} }
} }
void _deselectQuantex(SharedPreferences sharedPreferences) { void _deselectExchangeProvider(SharedPreferences sharedPreferences, String providerName) {
final Map<String, dynamic> exchangeProvidersSelection = final Map<String, dynamic> exchangeProvidersSelection =
json.decode(sharedPreferences.getString(PreferencesKey.exchangeProvidersSelection) ?? "{}") json.decode(sharedPreferences.getString(PreferencesKey.exchangeProvidersSelection) ?? "{}")
as Map<String, dynamic>; as Map<String, dynamic>;
exchangeProvidersSelection['Quantex'] = false; exchangeProvidersSelection[providerName] = false;
sharedPreferences.setString( sharedPreferences.setString(
PreferencesKey.exchangeProvidersSelection, PreferencesKey.exchangeProvidersSelection,

View file

@ -89,13 +89,12 @@ class TrocadorExchangeProvider extends ExchangeProvider {
required CryptoCurrency to, required CryptoCurrency to,
required bool isFixedRateMode}) async { required bool isFixedRateMode}) async {
final params = { final params = {
'api_key': apiKey,
'ticker': _normalizeCurrency(from), 'ticker': _normalizeCurrency(from),
'name': from.name, 'name': from.name,
}; };
final uri = await _getUri(coinPath, params); final uri = await _getUri(coinPath, params);
final response = await get(uri); final response = await get(uri, headers: {'API-Key': apiKey});
if (response.statusCode != 200) if (response.statusCode != 200)
throw Exception('Unexpected http status: ${response.statusCode}'); throw Exception('Unexpected http status: ${response.statusCode}');
@ -123,7 +122,6 @@ class TrocadorExchangeProvider extends ExchangeProvider {
if (amount == 0) return 0.0; if (amount == 0) return 0.0;
final params = <String, String>{ final params = <String, String>{
'api_key': apiKey,
'ticker_from': _normalizeCurrency(from), 'ticker_from': _normalizeCurrency(from),
'ticker_to': _normalizeCurrency(to), 'ticker_to': _normalizeCurrency(to),
'network_from': _networkFor(from), 'network_from': _networkFor(from),
@ -136,7 +134,8 @@ class TrocadorExchangeProvider extends ExchangeProvider {
}; };
final uri = await _getUri(newRatePath, params); final uri = await _getUri(newRatePath, params);
final response = await get(uri); final response = await get(uri, headers: {'API-Key': apiKey});
final responseJSON = json.decode(response.body) as Map<String, dynamic>; final responseJSON = json.decode(response.body) as Map<String, dynamic>;
final fromAmount = double.parse(responseJSON['amount_from'].toString()); final fromAmount = double.parse(responseJSON['amount_from'].toString());
final toAmount = double.parse(responseJSON['amount_to'].toString()); final toAmount = double.parse(responseJSON['amount_to'].toString());
@ -161,7 +160,6 @@ class TrocadorExchangeProvider extends ExchangeProvider {
required bool isSendAll, required bool isSendAll,
}) async { }) async {
final params = { final params = {
'api_key': apiKey,
'ticker_from': _normalizeCurrency(request.fromCurrency), 'ticker_from': _normalizeCurrency(request.fromCurrency),
'ticker_to': _normalizeCurrency(request.toCurrency), 'ticker_to': _normalizeCurrency(request.toCurrency),
'network_from': _networkFor(request.fromCurrency), 'network_from': _networkFor(request.fromCurrency),
@ -202,7 +200,7 @@ class TrocadorExchangeProvider extends ExchangeProvider {
params['provider'] = firstAvailableProvider; params['provider'] = firstAvailableProvider;
final uri = await _getUri(createTradePath, params); final uri = await _getUri(createTradePath, params);
final response = await get(uri); final response = await get(uri, headers: {'API-Key': apiKey});
if (response.statusCode == 400) { if (response.statusCode == 400) {
final responseJSON = json.decode(response.body) as Map<String, dynamic>; final responseJSON = json.decode(response.body) as Map<String, dynamic>;
@ -248,8 +246,8 @@ class TrocadorExchangeProvider extends ExchangeProvider {
@override @override
Future<Trade> findTradeById({required String id}) async { Future<Trade> findTradeById({required String id}) async {
final uri = await _getUri(tradePath, {'api_key': apiKey, 'id': id}); final uri = await _getUri(tradePath, {'id': id});
return get(uri).then((response) { return get(uri, headers: {'API-Key': apiKey}).then((response) {
if (response.statusCode != 200) if (response.statusCode != 200)
throw Exception('Unexpected http status: ${response.statusCode}'); throw Exception('Unexpected http status: ${response.statusCode}');

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/core/auth_service.dart'; import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/entities/contact.dart';
import 'package:cake_wallet/entities/contact_base.dart'; import 'package:cake_wallet/entities/contact_base.dart';
import 'package:cake_wallet/entities/contact_record.dart'; import 'package:cake_wallet/entities/contact_record.dart';
import 'package:cake_wallet/entities/wallet_list_order_types.dart'; import 'package:cake_wallet/entities/wallet_list_order_types.dart';
@ -11,14 +12,12 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/filter_theme.dart';
import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart'; import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
class ContactListPage extends BasePage { class ContactListPage extends BasePage {
@ -92,16 +91,19 @@ class ContactPageBody extends StatefulWidget {
class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProviderStateMixin { class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
late ContactListViewModel contactListViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
contactListViewModel = widget.contactListViewModel;
} }
@override @override
void dispose() { void dispose() {
_tabController.dispose(); _tabController.dispose();
contactListViewModel.dispose();
super.dispose(); super.dispose();
} }
@ -238,14 +240,16 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
currencyIcon, currencyIcon,
Padding( Expanded(
padding: EdgeInsets.only(left: 12), child: Padding(
child: Text( padding: EdgeInsets.only(left: 12),
contact.name, child: Text(
style: TextStyle( contact.name,
fontSize: 14, style: TextStyle(
fontWeight: FontWeight.normal, fontSize: 14,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor, fontWeight: FontWeight.normal,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
),
), ),
), ),
), ),
@ -306,13 +310,17 @@ class _ContactListBodyState extends State<ContactListBody> {
@override @override
void dispose() { void dispose() {
widget.tabController.removeListener(_handleTabChange); widget.tabController.removeListener(_handleTabChange);
widget.contactListViewModel.dispose(); if (widget.contactListViewModel.settingsStore.contactListOrder == FilterListOrderType.Custom) {
widget.contactListViewModel.saveCustomOrder();
}
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final contacts = widget.contactListViewModel.contactsToShow; final contacts = widget.contactListViewModel.isEditable
? widget.contactListViewModel.contacts
: widget.contactListViewModel.contactsToShow;
return Scaffold( return Scaffold(
body: Container( body: Container(
child: FilteredList( child: FilteredList(
@ -351,8 +359,9 @@ class _ContactListBodyState extends State<ContactListBody> {
}, },
), ),
), ),
floatingActionButton: floatingActionButton: _isContactsTabActive && widget.contactListViewModel.isEditable
_isContactsTabActive ? filterButtonWidget(context, widget.contactListViewModel) : null, ? filterButtonWidget(context, widget.contactListViewModel)
: null,
); );
} }

View file

@ -56,8 +56,9 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
} }
if (isMoneroOnly) { if (isMoneroOnly) {
return DeviceConnectionType.supportedConnectionTypes(WalletType.monero, Platform.isIOS) // return DeviceConnectionType.supportedConnectionTypes(WalletType.monero, Platform.isIOS)
.isNotEmpty; // .isNotEmpty;
return false;
} }
return true; return true;

View file

@ -136,10 +136,11 @@ abstract class ContactListViewModelBase with Store {
_currency?.tag == element.type.toString(); _currency?.tag == element.type.toString();
} }
void dispose() async { void dispose() => _subscription?.cancel();
_subscription?.cancel();
void saveCustomOrder() {
final List<Contact> contactsSourceCopy = contacts.map((e) => e.original).toList(); final List<Contact> contactsSourceCopy = contacts.map((e) => e.original).toList();
await reorderContacts(contactsSourceCopy); reorderContacts(contactsSourceCopy);
} }
void reorderAccordingToContactList() => void reorderAccordingToContactList() =>

View file

@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST
sp_scanner
) )
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)

View file

@ -6,6 +6,7 @@ import FlutterMacOS
import Foundation import Foundation
import connectivity_plus import connectivity_plus
import cw_mweb
import device_info_plus import device_info_plus
import devicelocale import devicelocale
import fast_scanner import fast_scanner
@ -23,6 +24,7 @@ import wakelock_plus
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
CwMwebPlugin.register(with: registry.registrar(forPlugin: "CwMwebPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin")) DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))

View file

@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_ANDROID_TYPE=$1 APP_ANDROID_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.17.0" MONERO_COM_VERSION="1.18.0"
MONERO_COM_BUILD_NUMBER=103 MONERO_COM_BUILD_NUMBER=105
MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_BUNDLE_ID="com.monero.app"
MONERO_COM_PACKAGE="com.monero.app" MONERO_COM_PACKAGE="com.monero.app"
MONERO_COM_SCHEME="monero.com" MONERO_COM_SCHEME="monero.com"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.20.1" CAKEWALLET_VERSION="4.21.0"
CAKEWALLET_BUILD_NUMBER=233 CAKEWALLET_BUILD_NUMBER=236
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
CAKEWALLET_SCHEME="cakewallet" CAKEWALLET_SCHEME="cakewallet"

View file

@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_IOS_TYPE=$1 APP_IOS_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.17.0" MONERO_COM_VERSION="1.18.0"
MONERO_COM_BUILD_NUMBER=101 MONERO_COM_BUILD_NUMBER=103
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.20.1" CAKEWALLET_VERSION="4.21.0"
CAKEWALLET_BUILD_NUMBER=277 CAKEWALLET_BUILD_NUMBER=281
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
HAVEN_NAME="Haven" HAVEN_NAME="Haven"

View file

@ -14,8 +14,8 @@ if [ -n "$1" ]; then
fi fi
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.10.1" CAKEWALLET_VERSION="1.11.0"
CAKEWALLET_BUILD_NUMBER=37 CAKEWALLET_BUILD_NUMBER=38
if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then
echo "Wrong app type." echo "Wrong app type."

View file

@ -16,13 +16,13 @@ if [ -n "$1" ]; then
fi fi
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.7.0" MONERO_COM_VERSION="1.8.0"
MONERO_COM_BUILD_NUMBER=34 MONERO_COM_BUILD_NUMBER=36
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.13.1" CAKEWALLET_VERSION="1.14.0"
CAKEWALLET_BUILD_NUMBER=93 CAKEWALLET_BUILD_NUMBER=95
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then

View file

@ -1,5 +1,5 @@
#define MyAppName "Cake Wallet" #define MyAppName "Cake Wallet"
#define MyAppVersion "0.1.1" #define MyAppVersion "0.2.0"
#define MyAppPublisher "Cake Labs LLC" #define MyAppPublisher "Cake Labs LLC"
#define MyAppURL "https://cakewallet.com/" #define MyAppURL "https://cakewallet.com/"
#define MyAppExeName "CakeWallet.exe" #define MyAppExeName "CakeWallet.exe"

View file

@ -13,6 +13,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST
sp_scanner
) )
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)