This commit is contained in:
Matthew Fosse 2024-06-21 14:12:40 -07:00
parent dd25b1a0f2
commit f7cb8e8c30
5 changed files with 14 additions and 17 deletions

View file

@ -72,7 +72,7 @@ abstract class ElectrumWalletBase
getAccountHDWallet(currency, networkType, seedBytes, xpub, walletInfo.derivationInfo), getAccountHDWallet(currency, networkType, seedBytes, xpub, walletInfo.derivationInfo),
syncStatus = NotConnectedSyncStatus(), syncStatus = NotConnectedSyncStatus(),
_password = password, _password = password,
mnemonic = mnemonic, _mnemonic = mnemonic,
_feeRates = <int>[], _feeRates = <int>[],
_isTransactionUpdating = false, _isTransactionUpdating = false,
isEnabledAutoGenerateSubaddress = true, isEnabledAutoGenerateSubaddress = true,
@ -148,7 +148,7 @@ abstract class ElectrumWalletBase
bool? alwaysScan; bool? alwaysScan;
final bitcoin.HDWallet accountHD; final bitcoin.HDWallet accountHD;
final String? mnemonic; final String? _mnemonic;
bitcoin.HDWallet get hd => accountHD.derive(0); bitcoin.HDWallet get hd => accountHD.derive(0);
final String? passphrase; final String? passphrase;
@ -185,7 +185,7 @@ abstract class ElectrumWalletBase
String get xpub => accountHD.base58!; String get xpub => accountHD.base58!;
@override @override
String? get seed => mnemonic; String? get seed => _mnemonic;
bitcoin.NetworkType networkType; bitcoin.NetworkType networkType;
BasedUtxoNetwork network; BasedUtxoNetwork network;
@ -1005,7 +1005,7 @@ abstract class ElectrumWalletBase
throw UnimplementedError(); throw UnimplementedError();
String toJSON() => json.encode({ String toJSON() => json.encode({
'mnemonic': mnemonic, 'mnemonic': _mnemonic,
'xpub': xpub, 'xpub': xpub,
'passphrase': passphrase ?? '', 'passphrase': passphrase ?? '',
'account_index': walletAddresses.currentReceiveAddressIndexByType, 'account_index': walletAddresses.currentReceiveAddressIndexByType,

View file

@ -79,8 +79,8 @@ class WalletCreationService {
case WalletType.polygon: case WalletType.polygon:
case WalletType.solana: case WalletType.solana:
case WalletType.tron: case WalletType.tron:
return true;
case WalletType.lightning: case WalletType.lightning:
return true;
case WalletType.monero: case WalletType.monero:
case WalletType.none: case WalletType.none:
case WalletType.bitcoin: case WalletType.bitcoin:

View file

@ -158,10 +158,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
color: Theme.of(context) color: Theme.of(context)
.extension<ExchangePageTheme>()! .extension<ExchangePageTheme>()!
.qrCodeColor)), .qrCodeColor)),
child: QrImage( child: QrImage(data: trade.inputAddress ?? fetchingLabel),
data: trade.inputAddress ?? fetchingLabel,
version: 14,
),
)))), )))),
Spacer(flex: 3) Spacer(flex: 3)
]), ]),
@ -254,9 +251,10 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
amountValue: widget amountValue: widget
.exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted, .exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
fee: S.of(popupContext).send_fee, fee: S.of(popupContext).send_fee,
feeValue: widget.exchangeTradeViewModel.sendViewModel feeValue: widget
.pendingTransaction!.feeFormatted, .exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
feeRate: widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeRate, feeRate:
widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeRate,
rightButtonText: S.of(popupContext).send, rightButtonText: S.of(popupContext).send,
leftButtonText: S.of(popupContext).cancel, leftButtonText: S.of(popupContext).cancel,
actionRightButton: () async { actionRightButton: () async {

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart' as qr; import 'package:qr_flutter/qr_flutter.dart' as qr;
import 'package:qr_flutter/qr_flutter.dart';
class QrImage extends StatelessWidget { class QrImage extends StatelessWidget {
QrImage({ QrImage({
@ -23,7 +24,9 @@ class QrImage extends StatelessWidget {
return qr.QrImageView( return qr.QrImageView(
data: data, data: data,
errorCorrectionLevel: errorCorrectionLevel, errorCorrectionLevel: errorCorrectionLevel,
version: version ?? 9,// Previous value: 7 something happened after flutter upgrade monero wallets addresses are longer than ver. 7 ??? // Previous value: 7 something happened after flutter upgrade monero wallets addresses are longer than ver. 7 ???
// changed from 9 to auto
version: version ?? QrVersions.auto,
size: size, size: size,
foregroundColor: foregroundColor, foregroundColor: foregroundColor,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,

View file

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_local_authentication/flutter_local_authentication.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:cake_wallet/view_model/auth_state.dart'; import 'package:cake_wallet/view_model/auth_state.dart';
@ -106,15 +105,12 @@ abstract class AuthViewModelBase with Store {
@action @action
Future<void> biometricAuth() async { Future<void> biometricAuth() async {
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();
try { try {
if (await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated()) { if (await _biometricAuth.canCheckBiometrics() && await _biometricAuth.isAuthenticated()) {
state = ExecutedSuccessfullyState(); state = ExecutedSuccessfullyState();
} else { } else {
throw Exception('Biometric authentication failed'); throw Exception('Biometric authentication failed');
} }
state = ExecutedSuccessfullyState();
} catch (e) { } catch (e) {
state = FailureState(e.toString()); state = FailureState(e.toString());
} }