Mweb enhancements 4 (#1768)

* [skip-ci] show mweb confirmations, show last mweb balance while syncing

* potential send-all fix

* [skip-ci] undo fix that didn't work

* [skip-ci] undo unnecessary changes

* [skip ci] add export mweb logs screen

* [skip ci] cleanup

* confirmation fixes

* catch electrum call errors

* [skip ci] undo some changes

* potential electrum fixes + mweb logs display only last 10000 characters

* Add question mark and link to MWEB card

* updates

* show negative unconfirmed mweb balanaces + other fixes [skip ci]

* error handling

* [skip ci] [wip] check if node supports mweb

* check fee before building tx

* [skip ci] minor

* [skip ci] minor

* mweb node setting [wip] [skip ci]

* prioritize mweb coins when selecting inputs from the pool

* potential connection edgecase fix

* translations + mweb node fixes

* don't use mweb for exchange refund address

* add peg in / out labels and make 6 confs only show up for peg in / out

* bump bitcoin_base version to v9

* [skip ci] fix logs page

* don't fetch txinfo for non-mweb addresses [skip ci]

* fix non-mweb confirmations

* rename always scan to enable mweb

* Update litecoin_wallet_addresses.dart

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* Update cw_mweb.dart

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* [skip ci] review updates pt.1

* [skip ci] minor code cleanup

* [skip ci] use exception handler

* exception handling [skip ci]

* [skip ci] exception handling

* trigger build

* pegout label fixes

* fix showing change transactions on peg-out

* minor code cleanup and minor peg-out fix

* final balance fixes

* non-mweb confirmations potential fix

* [skip ci] wip

* trigger build

---------

Co-authored-by: tuxpizza <tuxsudo@tux.pizza>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Matthew Fosse
2024-11-07 04:57:36 +02:00
committed by GitHub
co-authored by Omar Hatem tuxpizza
parent 109d9b458e
commit c8cfc2cff1
55 changed files with 821 additions and 207 deletions
+20 -5
View File
@@ -120,6 +120,7 @@ abstract class SettingsStoreBase with Store {
required this.mwebCardDisplay,
required this.mwebEnabled,
required this.hasEnabledMwebBefore,
required this.mwebNodeUri,
TransactionPriority? initialBitcoinTransactionPriority,
TransactionPriority? initialMoneroTransactionPriority,
TransactionPriority? initialWowneroTransactionPriority,
@@ -358,8 +359,8 @@ abstract class SettingsStoreBase with Store {
reaction(
(_) => bitcoinSeedType,
(BitcoinSeedType bitcoinSeedType) => sharedPreferences.setInt(
PreferencesKey.bitcoinSeedType, bitcoinSeedType.raw));
(BitcoinSeedType bitcoinSeedType) =>
sharedPreferences.setInt(PreferencesKey.bitcoinSeedType, bitcoinSeedType.raw));
reaction(
(_) => nanoSeedType,
@@ -442,8 +443,10 @@ abstract class SettingsStoreBase with Store {
reaction((_) => useTronGrid,
(bool useTronGrid) => _sharedPreferences.setBool(PreferencesKey.useTronGrid, useTronGrid));
reaction((_) => useMempoolFeeAPI,
(bool useMempoolFeeAPI) => _sharedPreferences.setBool(PreferencesKey.useMempoolFeeAPI, useMempoolFeeAPI));
reaction(
(_) => useMempoolFeeAPI,
(bool useMempoolFeeAPI) =>
_sharedPreferences.setBool(PreferencesKey.useMempoolFeeAPI, useMempoolFeeAPI));
reaction((_) => defaultNanoRep,
(String nanoRep) => _sharedPreferences.setString(PreferencesKey.defaultNanoRep, nanoRep));
@@ -591,6 +594,11 @@ abstract class SettingsStoreBase with Store {
(bool hasEnabledMwebBefore) =>
_sharedPreferences.setBool(PreferencesKey.hasEnabledMwebBefore, hasEnabledMwebBefore));
reaction(
(_) => mwebNodeUri,
(String mwebNodeUri) =>
_sharedPreferences.setString(PreferencesKey.mwebNodeUri, mwebNodeUri));
this.nodes.observe((change) {
if (change.newValue != null && change.key != null) {
_saveCurrentNode(change.newValue!, change.key!);
@@ -822,6 +830,9 @@ abstract class SettingsStoreBase with Store {
@observable
bool hasEnabledMwebBefore;
@observable
String mwebNodeUri;
final SecureStorage _secureStorage;
final SharedPreferences _sharedPreferences;
final BackgroundTasks _backgroundTasks;
@@ -988,6 +999,8 @@ abstract class SettingsStoreBase with Store {
final mwebEnabled = sharedPreferences.getBool(PreferencesKey.mwebEnabled) ?? false;
final hasEnabledMwebBefore =
sharedPreferences.getBool(PreferencesKey.hasEnabledMwebBefore) ?? false;
final mwebNodeUri = sharedPreferences.getString(PreferencesKey.mwebNodeUri) ??
"ltc-electrum.cakewallet.com:9333";
// If no value
if (pinLength == null || pinLength == 0) {
@@ -1259,6 +1272,7 @@ abstract class SettingsStoreBase with Store {
mwebAlwaysScan: mwebAlwaysScan,
mwebCardDisplay: mwebCardDisplay,
mwebEnabled: mwebEnabled,
mwebNodeUri: mwebNodeUri,
hasEnabledMwebBefore: hasEnabledMwebBefore,
initialMoneroTransactionPriority: moneroTransactionPriority,
initialWowneroTransactionPriority: wowneroTransactionPriority,
@@ -1686,7 +1700,8 @@ abstract class SettingsStoreBase with Store {
deviceName = windowsInfo.productName;
} catch (e) {
print(e);
print('likely digitalProductId is null wait till https://github.com/fluttercommunity/plus_plugins/pull/3188 is merged');
print(
'likely digitalProductId is null wait till https://github.com/fluttercommunity/plus_plugins/pull/3188 is merged');
deviceName = "Windows Device";
}
}