Commit Graph

1563 Commits

Author SHA1 Message Date
f321x cb023e22e4 qml: 2fa: make 2fa setup qr code clickable
This will make the 2fa app open when the user clicks on the qr code,
much more convenient than manually copy pasting the secret.
2026-03-24 14:50:45 +01:00
SomberNight 42ad18b216 rm bip70 support
- could not find a single project that still actually cares about bip70 [0]
    - well except maybe BitPay.
        - but I cannot test with BitPay:
            - they have a testnet3 staging environment on test.bitpay.com
                - but the SSL cert they use for bip70 has expired in 2021
                - the webUI probably also has not been updated since then...
                    - they claim to have added LN support in 2022 in a blog post,
                        but it's not there on test.bitpay.com
            - on mainnet, they require KYC before payment
                - < ... angry noises >
            - their loss then, I don't care.
- this is code that no one wants to maintain

- this does not yet delete the signed bip70 payment data for historical txs
    - but it is no longer possible to export it from the GUI

[0]: https://bitcoinops.org/en/topics/bip70-payment-protocol/
2026-03-20 18:12:55 +00:00
SomberNight 2ea8d11524 fixup prev 2026-03-20 13:49:16 +00:00
Sander van Grieken 03e95accdc qt, qml: for new transaction notifications, instead of using sign, explicitly say sent/received.
For multiple transactions, split summary in total sent/received and a balance change.

move duplicated code to wallet.get_user_notifications_for_new_txns()
2026-03-20 12:52:22 +01:00
f321x f56e6318e3 swaps: make SwapManager.percentage Decimal
If SwapManager.percentage was a 0.2 float, rounding differences would
cause an exception in the fee calculation inverse sanity check when entering 20
000 sats into the SwapDialog. By making self.percentage a decimal we can
prevent this kind of issue.

```
File "/home/user/code/vibecoding_vm/electrum/electrum/gui/qt/swap_dialog.py", line 294, in on_send_edited
    recv_amount = self.swap_manager.get_recv_amount(send_amount, is_reverse=self.is_reverse)
  File "/home/user/code/vibecoding_vm/electrum/electrum/submarine_swaps.py", line 1320, in get_recv_amount
    if abs(send_amount - inverted_send_amount) > 1:
           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
```
2026-03-19 09:17:34 +01:00
f321x d85985cdf2 qml: rbf/cancel: fix type error
self.oldfeeRate is initialized as int in `QETxRbfFeeBumper` and
`QETxCanceller`. However QML expects it to be a string. Initializing
it as string fixes the exception. Previously this didn't happen as
`Abstract_Wallet.add_info_from_wallet_and_network()` would never
return False, so the `get_tx()` method would immediately overwrite
the self.oldfeeRate variable with a string.

```
 20.95 | D | gui.qml.qetxfinalizer | TxMonMixin.__init__
 20.95 | E | gui.qml.qeapp.Exception_Hook | exception caught by crash reporter
TypeError: unable to convert a Python 'int' object to a C++ 'QString' instance
```
2026-03-09 14:39:40 +01:00
f321x 3d13d478c9 qml: rbf/cancel: abort update if adding tx info fails
Early return the update() methods of QETxRbfFeeBumper and QETxCanceller
if it fails to fetch missing tx information from the Network to prevent
an exception in `Abstract_Wallet.bump_fee()` and
`Abstract_Wallet.dscancel()`. See
https://github.com/spesmilo/electrum/issues/5502#issuecomment-40213084270
2026-03-09 14:19:36 +01:00
Sander van Grieken 91efb3e1f4 common_qt: move QtEventListener and qt_event_listener decorator to common_qt 2026-03-03 13:03:46 +01:00
SomberNight 3afa2fcdf3 locale: gui: show translation completion percentage in language names
In the GUIs, on the language-select screen, show e.g.
  Czech (100%), Danish (13%), Dutch (54%)
instead of
  Czech, Danish, Dutch

- we count the source strings when creating the .pot PO-template file
  and add an "X-Electrum-SourceStringCount" header to it, in the push_locale.py script that uploads the .pot file to crowdin.
  - later, when we run electrum-locale/update.py to download the translations in .po files, these files will also contain the same header.
  - then when the build_locale.sh script compiles those .po files, we can read the header and use it to populate a new "stats.json" file
    that we place in electrum/locale/locale/ and bundle in the all release binaries/distributables.
    - stats.json also includes the number of translated strings for each lang
- at runtime we simply read stats.json and use the values to calculate the percentages
  - a prior implementation did not pre-calc stats.json but did all calculations at runtime (by opening all .mo translations)
    - however that was deemed to slow, hence the build-time pre-calc
      - runtime calc took 40 ms on my laptop, so I guess it could easily take 10x that on an old phone
- just as we have always been very tolerant of any locale files or even the whole locale/ dir missing, we also tolerate stats.json missing
2026-02-21 03:40:09 +00:00
SomberNight cf25990973 locale: don't translate string "Electrum", "BIP39" 2026-02-19 16:13:44 +00:00
Sander van Grieken b10b14c2f8 qml: ReceiveDetailsDialog use proper ButtonContainer 2026-02-19 17:12:17 +01:00
f321x f573ab2d56 android: biometry: catch java import errors
Catch JavaError when trying to load the java classes of the biometry
module on startup. This can raise if the device is on an old API version
and the loaded java class depends on apis unknown to the os.

Fixes #10470

```
02-17 10:07:25.714  5254  5270 I python  :   0.47 | E | __main__ | daemon.run_gui errored
02-17 10:07:25.714  5254  5270 I python  : Traceback (most recent call last):
02-17 10:07:25.714  5254  5270 I python  :   File "app/main.py", line 514, in handle_cmd
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/daemon.py", line 653, in run_gui
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/__init__.py", line 38, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/qeapp.py", line 49, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/qebiometrics.py", line 33, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/reflect.py", line 243, in autoclass
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_export_class.pxi", line 877, in jnius.jnius.JavaMethod.__call__
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_export_class.pxi", line 964, in jnius.jnius.JavaMethod.call_method
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_utils.pxi", line 79, in jnius.jnius.check_exception
02-17 10:07:25.714  5254  5270 I python  : jnius.jnius.JavaException: JVM exception occurred: Failed resolution of: Landroid/hardware/biometrics/BiometricPrompt$AuthenticationResult; java.lang.NoClassDefFoundError
```
2026-02-17 10:18:21 +01:00
SomberNight 61a6ab1d95 locale: don't translate URL, like wtf
please, use common sense :(
I guess it was a copy-paste error, but still, treat all _() and qsTr() calls as "scary" and as potential attack vectors. Don't blindly call _(): every call needs to be weighed separately.
2026-02-14 09:25:39 +00:00
f321x 2fd74c1884 qml: wizard: differentiate between create_storage exc types
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
2026-02-04 11:56:51 +01:00
f321x 5952d8c614 qml: validate server address in ServerConfig
Same as Qt, validate the server address the user enters and prevent the
user from continuing in the wizard or clicking 'Ok' in the ServerConfig
if the entered address is clearly invalid.
2026-01-26 14:40:02 +01:00
f321x d6b6fb8a6b qml: shorten max brightnes preference string
Shorten the max brightness preference string so it fits in a single line
and disable it if the system is not on Android.
2026-01-21 10:37:45 +01:00
f321x 5d31401211 qml: require authentication for message signing
Requests authentication when trying to sign a message if "Payment
Authentication" is enabled.
2026-01-21 10:21:18 +01:00
f321x 8e5ea8e12d qml: protect Address Private Keys from screenshots
Address private keys weren't protected from screenshots.
2026-01-21 10:21:17 +01:00
f321x aaa314b36e qml: Preferences: disable screenshot protection if !Android
Disables the "Always allow Screenshots" switch in the preferences if the
App isn't running on Android. QML doesn't have screenshot protection
outside of Android so this toggle is misleading.
2026-01-21 10:21:06 +01:00
f321x f8c44886f4 qml: Preferences: add "Security" section
Adds a separate "Security" section to the qml preferences which contains
security related toggles so the Preferences are less mixed up.
2026-01-21 10:19:29 +01:00
f321x 07f61ebd5a qml: PasswordDialog: show error on invalid password
Currently the PasswordDialog on QML would just close if the user enters
an incorrect password. This is confusing as the user doesn't know why
the dialog closed and if it initiated any action or not.

With the change the PasswordDialog will get the ability to show an error
message and will show "Invalid Password" if an incorrect password is
entered.
I also used it for the password unification warning ("Need to enter
similar password ...") instead of showing a separate popup.
2026-01-20 12:30:31 +01:00
ThomasV bf1e0103e4 Merge pull request #10423 from SomberNight/202601_qml_open_passwordless_wallets
qml: fix: allow opening passwordless wallets
2026-01-20 09:29:58 +01:00
SomberNight 6d9ec72853 qml: QEDaemon.setPassword to restore invariant wallets are unlocked
fixes https://github.com/spesmilo/electrum/issues/10415
2026-01-19 17:09:02 +00:00
SomberNight 5b915fbff8 qml: fix: allow opening passwordless wallets
This must be an old regression.
The GUI was not allowing to open a wallet that did not have a password set:
it prompted for a password and did not accept any string (should at least accept empty "").

Without this, it was only possible to open a passwordless wallet if that was the first wallet the user opened
(as otherwise we would overwrite the empty pw with the pw of the current wallet).
2026-01-19 16:41:57 +00:00
ghost43 ece52b0a4e Merge pull request #10340 from f321x/fingerprint
android: implement biometric authentication (fingerprint)
2026-01-19 15:22:17 +00:00
user 47efb8b108 qml: remove pin code authentication
Completely removes the pin code authentication from qml. The config
option in the wallet preferences has been renamed to "Payment
authentication" and now either asks for the Android system
authentication (Biometric or system pin/password) if enabled or will ask
for the wallet password as fallback.
2026-01-19 14:07:25 +01:00
ghost43 5266b3d61e Merge pull request #10371 from accumulator/qml_manual_fee_feerate_edit
qml: allow manual editing of fee/feerate
2026-01-15 14:43:08 +00:00
SomberNight 8a3d9fd758 qml: FeePicker: restrict abs/rate editing to mimic wallet.bump_fee/cpfp 2026-01-14 16:53:30 +00:00
SomberNight ca597942fd qml: (trivial) qeinvoice: add type hint 2026-01-14 16:13:00 +00:00
f321x b599ae7d4a qml: fix invalid QEInvoiceParser state
Fixes the issue described in #10406.
When scanning a lightning invoice we would pass it to
`QEInvoiceParser.fromResolvedPaymentIdentifier()`, however
`fromResolvedPaymentIdentifier()` doesn't reset the state of
`QEInvoiceParser._lnurlData` which is used in QML to evaluate
`payImmediately: invoiceParser.isLnurlPay` in the `onValidationSuccess`
connection.

This change calls `clear()` in `fromResolvedPaymentIdentifier()` to
ensure that `QEInvoiceParser` state gets reset when loading a new invoice.
However when retrieving a bolt11 from a lnurl-pay callback we don't
wan't to reset `QEInvoiceParser._lnurlData` so that `payImmediately` is
true when confirming the lnurl pay dialog, for that I skip calling
`fromResolvedPaymentIdentifier()` and instead call `validateRecipient()`
directly so the `QEInvoiceParser` state doesn't get reset in this case.
2026-01-14 11:42:55 +01:00
f321x 6450187902 qeqrscanner: check requestCode on activity result 2026-01-13 18:10:07 +01:00
user 5dd3dda238 android: implement biometric authentication
Allows to unlock the android app with the android biometric api (e.g.
fingerprint). Can be enabled in the settings.
2026-01-13 18:10:00 +01:00
SomberNight 65f245f475 qml: FeePicker: hide "Target" line in "Manual" mode
instead use font colors to hint which textedit is being used for target
2026-01-12 18:42:14 +00:00
SomberNight f387300ab2 qml: FeePicker: use UI_UNIT_NAME constants, instead of hardcoding 2026-01-12 18:41:52 +00:00
f321x 04b7b683ed qml: add close no-op to QEQRScanner to fix type error
Adds close() no-op method to QEQRScanner to prevent type errors like
this:
```
01-02 17:28:09.645 10543 10565 I python  : 162.27 | W | gui.qml.qeapp | file:///data/data/org.electrum.electrum/files/app/electrum/gui/qml/components/SweepDialog.qml:123: TypeError: Property 'close' of object QEQRScanner(0xdd32f66fb600)
is not a function
```
2026-01-08 11:14:06 +01:00
SomberNight 1006e8092f lnworker: split LNWallet and LNWorker: LNWallet "has an" LNWorker
- LNWallet no longer "is-an" LNWorker, instead LNWallet "has-an" LNWorker
- the motivation is to make the unit tests nicer, and allow writing unit tests for more things
  - I hope this makes it possible to e.g. test lnsweep in the unit tests
  - some stuff we would previously have to write a regtest for, maybe we can write a unit test for, now
- in unit tests, MockLNWallet now
  - inherits LNWallet
  - the Wallet is no longer being mocked
2026-01-05 15:55:31 +00:00
ghost43 ca410beae1 Merge pull request #10385 from f321x/bump_zxingcpp
android: bump barcodescannerview, allow tap to focus, rm 16kb patch
2025-12-22 18:27:44 +00:00
ghost43 a50f963a61 Merge pull request #10373 from accumulator/qml_helpdialog_styling
qml: improve HelpDialog styling
2025-12-22 17:29:57 +00:00
f321x d1368db313 android: qr scanner: allow tap to focus
Allow tap to focus in the android qr scanner as some devices don't
support autofocus. This should allow them to focus on some qr code.
2025-12-22 15:02:01 +01:00
ghost43 844a3143d4 Merge pull request #10378 from SomberNight/202512_network_gui_disconnected_servers
network gui: always show bookmarked servers in list
2025-12-19 12:26:09 +00:00
ThomasV baf877252d Merge pull request #10345 from f321x/enforce_unified_password_qml_button
qml: limit creation of new wallets to existing password
2025-12-18 19:25:04 +01:00
f321x 6bb8afebe5 qml: fix incorrect index when deleting wallet
QEWalletListModel.remove_wallet was calling beginRemoveRows with i
instead of remove as index, causing it to not delete the wallet from the
list and the wallet list becoming broken after deleting a wallet.
2025-12-18 17:54:54 +01:00
f321x aee0f8fb54 qml: OpenWalletDialog: load any wallet if password matches
If the user has wallets with different passwords (non-unified pw) and
enters a password on startup that fails to unlock the recently used
wallet this change will automatically open any other wallet if there
is another wallet that can be unlocked with this password.
2025-12-18 17:54:52 +01:00
f321x ba379b7da4 qml: LoadingWalletDialog: fix ressource leak
When closing the OpenWalletDialog without unlocking a wallet the
LoadingWalletDialog wouldn't get properly cleaned up as the
LoadingWalletDialog.visible was never set true. This causes the
connections to accumulate and the callbacks won't get unregistered after
closing the LoadingWalletDialog again.
2025-12-18 17:54:51 +01:00
f321x 70084750ef qml: show wallet list as root if no wallet is loaded
Shows Wallets.qml as root if no wallet is loaded and removes the logic
for no loaded wallet from the WalletMainView as WalletMainView won't be
shown anymore without a Daemon.currentWallet.
2025-12-18 17:54:28 +01:00
SomberNight cb3c286fe2 network: disconnected servers: do not filter out bookmarked raw ":t"
In the GUI, when displaying the list of disconnected servers, we were
filtering to only ":s" servers. Instead now we also show ":t" servers
if they are bookmarked.

Also, if bookmarked, we also show disconnected .onion servers, even
when not using a Tor proxy.

fixes https://github.com/spesmilo/electrum/issues/10374
2025-12-18 14:27:54 +00:00
SomberNight 21fa6114eb network: dedupe qt/qml get_disconnected_server_addrs code 2025-12-18 14:07:43 +00:00
f321x 02abc0e6cd qml: enforce single password on password change
If a qml user with non-uniform wallet passwords tries to change their wallet
password this will force them to change it to a password that is used by
at least one other wallet. This will guide them towards a single wallet
password and prevents the number of different passwords from increasing.
2025-12-18 13:10:36 +01:00
Sander van Grieken 0d812500e1 qml: QERequestDetails process request update via event loop.
This allows backend to process all callbacks before we start querying the payment database

should fix #10116
2025-12-18 12:40:53 +01:00
f321x 378a9e6112 qml: disable 'Create Wallet' before first unlock
If the user has not unlocked any wallet yet and tries to create a new
wallet in the overview a dialog will prompt them to first unlock an
existing wallet in order to be able to create a new wallet.

This ensures they remember at least one password so they can complete
the wizard. The wizard will ask them for an existing password later and
it would be annoying for the user to go through all steps (writing down
the seed etc.) only to find out they need a password they don't
remember. This way they can reinstall the app right before going through
the wizard.
2025-12-18 11:07:37 +01:00