mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
fix: generic fixes after anypay (#3543)
* fix android CI * feat: add anypay core models, parser and routing engine * feat: add anypay resolver, anypay service and wallet switch service * refactor: route the send page payment flow through anypay service * fix: show message when there's no swap providers for a pair and reset the trade guard on dismissal * refactor: merge the swap from network and send to network decision pages together and clean up anypay widgets * feat: reapply deep links to a currently open send flow and register the solana scheme * feat: add support for zcash address detection to anypay and other minor fixes * refactor: remove trailing icon * feat: hide swap flow for sp and mweb addresses * feat: enhance zcash address detection and deeplink handling * fix: pin bitcoin_base * refactor: Move the anypay decision navigation out of the send page and address minor review comments * refactor: Move the anypay decision navigation out of the send page and address minor review comments * feat: handle exception in switch service and mvoe balance compute to call site * refactor: combine anypay entry points to one and extract selected mode widget * fix: tx priority for doge * chore: add dogecoin to isElectrumWallet util * fix: annoying mobx error --------- Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
This commit is contained in:
co-authored by
Czarek Nakamoto
parent
484f42aa8b
commit
419d8cdeb4
@@ -63,7 +63,8 @@ class PreferencesKey {
|
||||
static const zanoTransactionPriority = 'current_fee_priority_zano';
|
||||
static const wowneroTransactionPriority = 'current_fee_priority_wownero';
|
||||
static const decredTransactionPriority = 'current_fee_priority_decred';
|
||||
static const zcashTransactionPriority = 'current_fee_priority_decred';
|
||||
static const zcashTransactionPriority = 'current_fee_priority_zcash';
|
||||
static const dogecoinTransactionPriority = 'current_fee_priority_dogecoin';
|
||||
static const customBitcoinFeeRate = 'custom_electrum_fee_rate';
|
||||
static const silentPaymentsCardDisplay = 'silentPaymentsCardDisplay';
|
||||
static const mwebCardDisplay = 'mwebCardDisplay';
|
||||
|
||||
@@ -215,12 +215,7 @@ class _NewSendPageState extends State<NewSendPage> {
|
||||
final _addressFocusNode = FocusNode();
|
||||
final _disposers = <ReactionDisposer>[];
|
||||
StreamSubscription<Uri>? _deepLinkSubscription;
|
||||
late final AnyPayFlow _anyPayFlow = AnyPayFlow(
|
||||
anyPayService: widget.anyPayService,
|
||||
sendViewModel: widget.sendViewModel,
|
||||
authService: widget.authService,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
);
|
||||
late final AnyPayFlow _anyPayFlow;
|
||||
ContactRecord? newContactAddress;
|
||||
|
||||
bool _justHandledPasteButton = false;
|
||||
@@ -228,6 +223,12 @@ class _NewSendPageState extends State<NewSendPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_anyPayFlow = AnyPayFlow(
|
||||
anyPayService: widget.anyPayService,
|
||||
sendViewModel: widget.sendViewModel,
|
||||
authService: widget.authService,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
);
|
||||
_addInputControllers();
|
||||
|
||||
_disposers.add(
|
||||
|
||||
@@ -32,6 +32,7 @@ bool isElectrumWallet(WalletType walletType) {
|
||||
case WalletType.bitcoin:
|
||||
case WalletType.litecoin:
|
||||
case WalletType.bitcoinCash:
|
||||
case WalletType.dogecoin:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'dart:io';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin.dart';
|
||||
import 'package:cake_wallet/core/utilities.dart';
|
||||
import 'package:cake_wallet/decred/decred.dart';
|
||||
import 'package:cake_wallet/dogecoin/dogecoin.dart';
|
||||
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
|
||||
import 'package:cake_wallet/core/secure_storage.dart';
|
||||
import 'package:cake_wallet/di.dart';
|
||||
@@ -168,6 +169,7 @@ abstract class SettingsStoreBase with Store {
|
||||
TransactionPriority? initialZanoTransactionPriority,
|
||||
TransactionPriority? initialDecredTransactionPriority,
|
||||
TransactionPriority? initialZcashTransactionPriority,
|
||||
TransactionPriority? initialDogecoinTransactionPriority,
|
||||
Country? initialCakePayCountry})
|
||||
: nodes = ObservableMap<WalletType, Node>.of(nodes),
|
||||
powNodes = ObservableMap<WalletType, Node>.of(powNodes),
|
||||
@@ -273,6 +275,9 @@ abstract class SettingsStoreBase with Store {
|
||||
if (initialZcashTransactionPriority != null) {
|
||||
priority[WalletType.zcash] = initialZcashTransactionPriority;
|
||||
}
|
||||
if (initialDogecoinTransactionPriority != null) {
|
||||
priority[WalletType.dogecoin] = initialDogecoinTransactionPriority;
|
||||
}
|
||||
|
||||
if (initialCakePayCountry != null) {
|
||||
selectedCakePayCountry = initialCakePayCountry;
|
||||
@@ -345,6 +350,9 @@ abstract class SettingsStoreBase with Store {
|
||||
case WalletType.zcash:
|
||||
key = PreferencesKey.zcashTransactionPriority;
|
||||
break;
|
||||
case WalletType.dogecoin:
|
||||
key = PreferencesKey.dogecoinTransactionPriority;
|
||||
break;
|
||||
default:
|
||||
key = null;
|
||||
}
|
||||
@@ -1194,6 +1202,7 @@ abstract class SettingsStoreBase with Store {
|
||||
TransactionPriority? zanoTransactionPriority;
|
||||
TransactionPriority? decredTransactionPriority;
|
||||
TransactionPriority? zcashTransactionPriority;
|
||||
TransactionPriority? dogecoinTransactionPriority;
|
||||
|
||||
if (sharedPreferences.getInt(PreferencesKey.havenTransactionPriority) != null) {
|
||||
havenTransactionPriority = monero?.deserializeMoneroTransactionPriority(
|
||||
@@ -1241,6 +1250,10 @@ abstract class SettingsStoreBase with Store {
|
||||
zcashTransactionPriority = zcash?.deserializeZcashTransactionPriority(
|
||||
raw: sharedPreferences.getInt(PreferencesKey.zcashTransactionPriority)!);
|
||||
}
|
||||
if (sharedPreferences.getInt(PreferencesKey.dogecoinTransactionPriority) != null) {
|
||||
dogecoinTransactionPriority = dogecoin?.deserializeDogeCoinTransactionPriority(
|
||||
sharedPreferences.getInt(PreferencesKey.dogecoinTransactionPriority)!);
|
||||
}
|
||||
|
||||
moneroTransactionPriority ??= monero?.getDefaultTransactionPriority();
|
||||
bitcoinTransactionPriority ??= bitcoin?.getMediumTransactionPriority();
|
||||
@@ -1256,6 +1269,7 @@ abstract class SettingsStoreBase with Store {
|
||||
bscTransactionPriority ??= evm?.getDefaultTransactionPriority();
|
||||
zanoTransactionPriority ??= zano?.getDefaultTransactionPriority();
|
||||
zcashTransactionPriority ??= zcash?.getDefaultTransactionPriority();
|
||||
dogecoinTransactionPriority ??= dogecoin?.getDefaultTransactionPriority();
|
||||
|
||||
final currentBalanceDisplayMode = BalanceDisplayMode.deserialize(
|
||||
raw: sharedPreferences.getInt(PreferencesKey.currentBalanceDisplayModeKey)!);
|
||||
@@ -1744,6 +1758,7 @@ abstract class SettingsStoreBase with Store {
|
||||
initialBitcoinCashTransactionPriority: bitcoinCashTransactionPriority,
|
||||
initialDecredTransactionPriority: decredTransactionPriority,
|
||||
initialZcashTransactionPriority: zcashTransactionPriority,
|
||||
initialDogecoinTransactionPriority: dogecoinTransactionPriority,
|
||||
initialShouldRequireTOTP2FAForAccessingWallet: shouldRequireTOTP2FAForAccessingWallet,
|
||||
initialShouldRequireTOTP2FAForSendsToContact: shouldRequireTOTP2FAForSendsToContact,
|
||||
initialShouldRequireTOTP2FAForSendsToNonContact: shouldRequireTOTP2FAForSendsToNonContact,
|
||||
@@ -1847,6 +1862,11 @@ abstract class SettingsStoreBase with Store {
|
||||
priority[WalletType.zcash] = zcash!.deserializeZcashTransactionPriority(
|
||||
raw: sharedPreferences.getInt(PreferencesKey.zcashTransactionPriority)!);
|
||||
}
|
||||
if (dogecoin != null &&
|
||||
sharedPreferences.getInt(PreferencesKey.dogecoinTransactionPriority) != null) {
|
||||
priority[WalletType.dogecoin] = dogecoin!.deserializeDogeCoinTransactionPriority(
|
||||
sharedPreferences.getInt(PreferencesKey.dogecoinTransactionPriority)!);
|
||||
}
|
||||
|
||||
final generateSubaddresses =
|
||||
sharedPreferences.getInt(PreferencesKey.autoGenerateSubaddressStatusKey);
|
||||
|
||||
@@ -167,9 +167,10 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
|
||||
bool get isEVMWallet => isEVMCompatibleChain(walletType);
|
||||
|
||||
@action
|
||||
CryptoCurrency _outputCryptoCurrencyHandler([CryptoCurrency? override]) {
|
||||
if (override != null && override != selectedCryptoCurrency) selectedCryptoCurrency = override;
|
||||
if (override != null && override != selectedCryptoCurrency) {
|
||||
runInAction(() => selectedCryptoCurrency = override);
|
||||
}
|
||||
|
||||
return selectedCryptoCurrency;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user