diff --git a/CHANGELOG.md b/CHANGELOG.md index 30319906..ac39c71a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### **1.2.5** (2023-04-08) + +- Address public keys can now be exported during transaction signing + ### **1.2.4** (2023-04-05) - Add transaction signing from wallet home diff --git a/assets/translations/en.json b/assets/translations/en.json index ca33d22e..c32918b6 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -504,6 +504,7 @@ "reset_modal_title": "Resetting this Wallet", "reset_modal_description": "This will reset the wallet balance and will check all addresses for UTXOs.\nNon-broadcasted transactions will be removed.", "sign_transaction_step_1_description": "Select the address which should sign the transaction", + "sign_transaction_step_1_copy_pubkey": "Copy public key to clipboard", "sign_transaction_step_2": "Enter Transaction Hex", "sign_transaction_input_label": "Transaction Hex", "sign_transaction_step_3": "Sign Transaction", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index df105985..65aa3688 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -25,9 +25,9 @@ LSRequiresIPhoneOS NSCameraUsageDescription - Can we access your camera in order to scan barcodes? + We would like to access your camera to scan QR codes. NSFaceIDUsageDescription - FaceID protects your wallet from unauthorized use. + We would like to use FaceID to protect your wallet from unauthorized use. NSPhotoLibraryUsageDescription We would like to access your filesystem to import the CSV file. UIBackgroundModes diff --git a/lib/screens/wallet/address_selector.dart b/lib/screens/wallet/address_selector.dart index 091d6c98..84dac5a3 100644 --- a/lib/screens/wallet/address_selector.dart +++ b/lib/screens/wallet/address_selector.dart @@ -104,15 +104,10 @@ class _AddressSelectorScreenState extends State { ]; } - Future _onWillPop() async { - Navigator.pop(context, _selectedAddress); - return true; - } - @override Widget build(BuildContext context) { return PopScope( - onPopInvoked: (_) => _onWillPop, + canPop: false, child: Scaffold( appBar: AppBar( centerTitle: true, diff --git a/lib/screens/wallet/wallet_sign_transaction.dart b/lib/screens/wallet/wallet_sign_transaction.dart index 4b748f9c..37854a56 100644 --- a/lib/screens/wallet/wallet_sign_transaction.dart +++ b/lib/screens/wallet/wallet_sign_transaction.dart @@ -206,6 +206,29 @@ class _WalletSignTransactionScreenState } } + void _copyPubKeyToClipboard(String address) async { + final wif = await _walletProvider.getWif( + identifier: _walletName, + address: _signingAddress, + ); + final pubKey = WIF.fromString(wif).privkey.pubkey.hex; + + Clipboard.setData(ClipboardData(text: pubKey)); + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + AppLocalizations.instance.translate( + 'snack_copied', + ), + textAlign: TextAlign.center, + ), + duration: const Duration(seconds: 2), + ), + ); + } + } + Future _performReset(BuildContext ctx) async { return await showDialog( context: context, @@ -310,6 +333,18 @@ class _WalletSignTransactionScreenState small: true, active: !_signingDone, ), + _signingAddress.isNotEmpty && !_signingDone + ? PeerButton( + action: () => _copyPubKeyToClipboard( + _signingAddress, + ), + text: AppLocalizations.instance.translate( + 'sign_transaction_step_1_copy_pubkey', + ), + small: true, + active: !_signingDone, + ) + : Container(), const SizedBox( height: 20, ), diff --git a/lib/widgets/wallet/addresses_tab.dart b/lib/widgets/wallet/addresses_tab.dart index 72234822..ee94acd0 100644 --- a/lib/widgets/wallet/addresses_tab.dart +++ b/lib/widgets/wallet/addresses_tab.dart @@ -821,32 +821,29 @@ class _AddressTabState extends State { applyFilter(); }, ), - Padding( - padding: const EdgeInsets.all(kIsWeb ? 8.0 : 0), - child: ChoiceChip( - backgroundColor: Theme.of(context).colorScheme.background, - selectedColor: Theme.of(context).shadowColor, - visualDensity: const VisualDensity( - horizontal: 0.0, - vertical: -4, - ), - label: AutoSizeText( - AppLocalizations.instance - .translate('addressbook_hide_empty'), - textAlign: TextAlign.center, - minFontSize: 10, - style: TextStyle( - color: Theme.of(context).colorScheme.secondary, - ), + ChoiceChip( + backgroundColor: Theme.of(context).colorScheme.background, + selectedColor: Theme.of(context).shadowColor, + visualDensity: const VisualDensity( + horizontal: 0.0, + vertical: -4, + ), + label: AutoSizeText( + AppLocalizations.instance + .translate('addressbook_hide_empty'), + textAlign: TextAlign.center, + minFontSize: 10, + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, ), - selected: _showEmpty, - onSelected: (_) { - setState(() { - _showEmpty = _; - }); - applyFilter(); - }, ), + selected: _showEmpty, + onSelected: (_) { + setState(() { + _showEmpty = _; + }); + applyFilter(); + }, ), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 10941d93..8c08e078 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: peercoin description: A new Peercoin wallet. -version: 1.2.4+136 +version: 1.2.5+137 environment: sdk: '>=3.2.0 <4.0.0'