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

View file

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

View file

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

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart' as qr;
import 'package:qr_flutter/qr_flutter.dart';
class QrImage extends StatelessWidget {
QrImage({
@ -23,7 +24,9 @@ class QrImage extends StatelessWidget {
return qr.QrImageView(
data: data,
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,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,

View file

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