Skip to content

Commit

Permalink
1.2.3 (#243)
Browse files Browse the repository at this point in the history
* version bump

* upgrade coinlib_flutter to

* skeleton for experimental features settings

* allow to activate and deactivate experimental features

* replace tab class with enum

* allow option to add watchonly wallet

* introduce watchOnly for wallet

* don't count watchOnly towards nOfWalletOfLetterCode

* wallets found in scan can not by watchOnly

* show watch only icon in wallet list

* fix tests

* don't generate unused address for watchOnly wallet

* bottom navigation for watchOnly wallet

* reduce menu items for watchOnly

* pass watchOnly to address tab

* introduce watchOnly address book

* move addr book search bar to walletHome appBar

* first sucessful watch only wallet

* make whole "watch only" line clickable

* bring over slidable from addr book

* introduce isWatchOnly to address model

* return isWatchOnly addresses from getWatchedWalletScriptHashes

* refactor addressbook slidable

* fix layouting and colors for new addr book

* properly remove watchOnly addresses

* show place holders if no addresses are configured

* migrate edit dialog and 2dos

* changelog

* upgrade dart and linter

* fix onSurface colors

* fix appBarTheme in light mode

* fix send tab for regular wallets

* 2do

* more theming 2dos

* fix e2e new key test and 2dos for theming

* adapt snack bar colors to material 3

* changelog

* add cancel button to wallet reset

* give ModalBottomSheetContainer responsive width

* 2do is checked

* fix addr book issue in dark mode

* make watched icon explicitly black for dark mode

* upgrade coinlib

* convert slidable to expandable

* finalize watch only address book
  • Loading branch information
willyfromtheblock authored Nov 30, 2023
1 parent f28e8b5 commit cc5a2c7
Show file tree
Hide file tree
Showing 74 changed files with 1,181 additions and 222 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### **1.2.3** (2023-11-30)
* Experimental features are now available in Settings
* "Watch only" wallets are the first available feature that can be enabled. These wallets can only monitor the balance of an address and cannot spend coins.
* App now uses Material 3 design language

### **1.2.2** (2023-09-27)
* Change the options for purchasing Peercoin on some devices

Expand Down
5 changes: 5 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@
"app_settings_price_feed_disable_button": "Disable Price Feed API",
"app_settings_price_feed_search": "Search currency code",
"app_settings_language_search": "Search language",
"app_settings_experimental_features": "Experimental Features",
"app_settings_experimental_feature_watchOnlyWallets": "Watch only wallets",
"app_settings_price_alert_content": "This will enable our privacy friendly price data feed.\nIt can be disabled anytime.",
"app_wallets": "Wallets",
"watch_only": "Watch only",
"addresses_none": "No addresses found",
"authenticate_biometric_hint": "Verify identity",
"authenticate_biometric_reason": "Please authenticate.",
"authenticate_biometric_title": "Authentication required",
Expand Down Expand Up @@ -319,6 +323,7 @@
"receive_website_faucet": "You can receive free testnet coins on this faucet.",
"scan_qr": "Scan QR-Code",
"search": "Search",
"search_address": "Search address",
"select_coin": "Please select a coin",
"send": "Send",
"send_address": "Address",
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void main() async {
}

class PeercoinApp extends StatelessWidget {
const PeercoinApp({Key? key}) : super(key: key);
const PeercoinApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down
1 change: 1 addition & 0 deletions lib/models/experimental_features.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enum ExperimentalFeatures { watchOnlyWallets }
12 changes: 12 additions & 0 deletions lib/models/hive/app_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class AppOptionsStore extends HiveObject {
@HiveField(10, defaultValue: [])
List<String> _walletOrder = [];

@HiveField(11, defaultValue: [])
List<String> _activatedExperimentalFeatures = [];

AppOptionsStore(this._allowBiometrics);

bool get allowBiometrics {
Expand Down Expand Up @@ -142,4 +145,13 @@ class AppOptionsStore extends HiveObject {
List<String> get walletOrder {
return _walletOrder;
}

set activatedExperimentalFeatures(List<String> newFeatures) {
_activatedExperimentalFeatures = newFeatures;
save();
}

List<String> get activatedExperimentalFeatures {
return _activatedExperimentalFeatures;
}
}
10 changes: 7 additions & 3 deletions lib/models/hive/app_options.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions lib/models/hive/coin_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ class CoinWallet extends HiveObject {
@HiveField(10, defaultValue: false)
bool _dueForRescan = false;

@HiveField(11, defaultValue: false)
bool _watchOnly = false;

CoinWallet(
this._name,
this._title,
this._letterCode,
this._walletIndex,
this._dueForRescan,
this._watchOnly,
);

set addNewAddress(WalletAddress newAddress) {
Expand All @@ -70,6 +74,10 @@ class CoinWallet extends HiveObject {
return _balance;
}

bool get watchOnly {
return _watchOnly;
}

set balance(int newBalance) {
_balance = newBalance;
save();
Expand Down Expand Up @@ -179,6 +187,11 @@ class CoinWallet extends HiveObject {
save();
}

void removeTransaction(WalletTransaction tx) {
_transactions.removeWhere((element) => element.txid == tx.txid);
save();
}

void putUtxo(WalletUtxo newUtxo) {
_utxos.add(newUtxo);
save();
Expand Down
7 changes: 5 additions & 2 deletions lib/models/hive/coin_wallet.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/models/hive/wallet_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class WalletAddress extends HiveObject {
int notificationBackendCount = 0;
@HiveField(8, defaultValue: false)
bool isWatched = false;
@HiveField(9, defaultValue: false)
bool isWatchOnly = false;

WalletAddress({
required this.address,
Expand All @@ -29,6 +31,7 @@ class WalletAddress extends HiveObject {
required this.status,
required this.isOurs,
required this.wif,
required this.isWatchOnly,
});

set newStatus(String? newStatus) {
Expand Down
7 changes: 5 additions & 2 deletions lib/models/hive/wallet_address.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions lib/providers/app_settings_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,15 @@ class AppSettingsProvider with ChangeNotifier {
_appOptions.walletOrder = newOrder;
notifyListeners();
}

List<String> get activatedExperimentalFeatures {
return _appOptions.activatedExperimentalFeatures;
}

void setActivatedExperimentalFeatures(
List<String> newFeatures,
) {
_appOptions.activatedExperimentalFeatures = newFeatures;
notifyListeners();
}
}
Loading

0 comments on commit cc5a2c7

Please sign in to comment.