Commit Graph

3587 Commits

Author SHA1 Message Date
ThomasV
dff1d5b0c1 Merge pull request #9694 from accumulator/qml_psbt_over_nostr
psbt_nostr: split generic and UI parts, implement for qml
2025-04-15 18:12:17 +02:00
ThomasV
70ab4f2190 Fix password passed to daemon.load_wallet
The password should not be an empty string.

Traceback (most recent call last):
  File "/opt/electrum/electrum/gui/qt/__init__.py", line 377, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "/opt/electrum/electrum/gui/qt/__init__.py", line 446, in _start_wizard_to_select_or_create_wallet
    wallet = self.daemon.load_wallet(wallet_file, d['password'], upgrade=True)
  File "/opt/electrum/electrum/daemon.py", line 461, in func_wrapper
    return func(self, *args, **kwargs)
  File "/opt/electrum/electrum/daemon.py", line 474, in load_wallet
    wallet.unlock(password)
  File "/opt/electrum/electrum/wallet.py", line 3418, in unlock
    self.check_password(password)
  File "/opt/electrum/electrum/wallet.py", line 3069, in check_password
    raise InvalidPassword("password given but wallet has no password")
electrum.util.InvalidPassword: password given but wallet has no password
2025-04-15 18:01:25 +02:00
Sander van Grieken
3b97ab7407 plugins: psbt_nostr: qt: offer 3 choices for each PSBT; 'Open, Discard, Save to wallet' 2025-04-15 17:38:11 +02:00
ThomasV
34a8ec64f8 move audio_modem icons to plugin dir, so that the plugin is self-contained.
This requires changing the API of OverlayControlMixin.addButton
2025-04-15 15:34:01 +02:00
Sander van Grieken
60bd6327ce plugins: psbt_nostr: let GUI handle a received PSBTs one by one by pausing receiving additional PSBTs until PSBT dialog is closed.
Accepting a PSBT opens the Tx dialog and pauses receiving additional PSBTs until the Tx dialog is closed.
Rejecting a PSBT will start a cooldown and accept all pending PSBTs into the history for later inspection.
2025-04-15 14:06:57 +02:00
Sander van Grieken
3ff84f08a6 plugins: psbt_nostr: implement for qml 2025-04-15 14:06:29 +02:00
ThomasV
147b3fae1b Merge pull request #9725 from accumulator/qt_seedwidget_copy_button
qt: SeedWidget: for xpubs, show copy button next to QR button.
2025-04-15 12:27:08 +02:00
ThomasV
1162f45bd5 plugins: minor tweaks
- add icon to PluginDialog
 - add icon to psbt_nosr
 - rename 'PSBT Nostr' as 'Nostr Multisig'
2025-04-15 12:23:03 +02:00
Sander van Grieken
24d03340da qt: SeedWidget: for xpubs, show copy button next to QR button.
This is only used when displaying wallet xpub in wizard for multisig setup.
2025-04-15 11:00:39 +02:00
ThomasV
0831fc3b80 plugins: move wallet-related settings to the wallet menu
Plugins should use the init_menubar hook.
References are kept to the various menu objects.
2025-04-15 10:01:00 +02:00
ThomasV
8c028f7528 Add/remove plugins from GUI
- both internal and external plugins require GUI install
   (except internal HW plugins, which are 'auto-loaded' and hidden)
 - remove init_qt hook
 - in Qt, reload wallet windows if plugin enabled/disabled
 - add 'uninstall' button to PluginDialog
 - add 'add plugins' button to wizard hw screen
 - add icons to the plugin list
2025-04-15 08:35:10 +02:00
f321x
e72de47ef0 Remove LIGHTNING_LEGACY_ADD_TRAMPOLINE config option to prevent too large onion payload
The option to add a 2nd trampoline hop to legacy trampoline payments requires too much space in the trampoline onion.
Because the trampoline onion has only limited space of 400b and the payload with 2nd t hop and no r_tags already requires 392b it is essentially unusable for payments that require routing hints to be included in the onion
(because the receiver has no direct channel to the 2nd trampoline node)
as there is no space left to include them (1r_tag == ~52b).
2025-04-14 09:35:41 +02:00
ThomasV
eff8b65355 Plugins: pass wallet to settings_dialog
Also, remove settings_widget method.
The widget should always be a button.

nwc: is_initialized -> initialized
2025-04-12 11:09:15 +02:00
ThomasV
a500d5194d make plugins dialog available in tray
This makes it possible to install a third-party plugin from
the wizard, before creating a wallet, e.g. for a hardware wallet.
2025-04-11 10:27:34 +02:00
ThomasV
737417fb80 Userspace plugins:
- Allow plugins saved as zipfiles in user data dir
 - plugins are authorized with a user chosen password
 - pubkey derived from password is saved with admin permissions
2025-04-11 08:45:28 +02:00
Sander van Grieken
ad4aafa2e4 qml: add ellipsis to buttons that are followed by another chance to bail 2025-04-10 19:52:44 +02:00
accumulator
ca01830ea5 Merge pull request #9708 from accumulator/qml_channelopener_user_feedback
qml: when opening channel, validate and show user feedback if amount outside acceptable range
2025-04-10 13:30:47 +02:00
ThomasV
c5e9ef558f Merge pull request #9675 from f321x/nwc
plugin: implement Nostr Wallet Connect (NIP47) plugin
2025-04-10 10:58:16 +02:00
accumulator
e4fc4980ab Merge pull request #9720 from accumulator/qml_singletons
qml: simplify QEConfig and QEDaemon use.
2025-04-10 10:23:29 +02:00
f321x
253ab6849a implement NIP47 plugin 2025-04-10 10:22:29 +02:00
accumulator
61a1ef7504 Merge pull request #9676 from accumulator/qml_send_to_same_address_invoice_status_fix
qml: don't confuse second payment to same address with previous uncon…
2025-04-10 10:21:02 +02:00
Sander van Grieken
eb29b7c95c qml: simplify QEConfig and QEDaemon use.
force QEDaemon singleton, and refer to QEDaemon.instance where possible
In cases where we would run into circular dependencies, pass the instance

also refer to singleton QEConfig instead of passing instance in qeapp.py
2025-04-09 13:44:26 +02:00
Sander van Grieken
7391a1039d qml: don't confuse second payment to same address with previous unconfirmed payment to that address
QEInvoiceParser creates a zero amount output invoice when pasting an address, which would return the
wrong status when calling wallet.get_invoice_status() (there is some address heuristic in
wallet._is_onchain_invoice_paid which is associating with the previous payment)
2025-04-09 13:19:46 +02:00
ThomasV
fe11fa3f4f Merge pull request #9716 from f321x/fix_swap_exception
swaps: make swap transport use shared timeout value
2025-04-09 12:06:52 +02:00
accumulator
96793d6e43 Merge pull request #9713 from accumulator/improve_not_enough_funds_mentioning_frozen
wallet,gui: improve not_enough_funds_mentioning_frozen
2025-04-09 09:33:41 +02:00
Sander van Grieken
d28899c572 wallet,gui: improve not_enough_funds_mentioning_frozen 2025-04-09 09:32:21 +02:00
f321x
aace9aab91 make swap transport use shared timeout value 2025-04-08 17:44:17 +02:00
ghost43
aef2a7a8a9 Merge pull request #9705 from accumulator/qml_freeze_reused_address_utxos
qml: add config option WALLET_FREEZE_REUSED_ADDRESS_UTXOS
2025-04-08 14:07:57 +00:00
Sander van Grieken
6e8f97d36a qml: add config option WALLET_FREEZE_REUSED_ADDRESS_UTXOS 2025-04-07 19:48:20 +02:00
ghost43
5dad7c55fd Merge pull request #9704 from f321x/future_tx_fee
tx / gui: Disable output value rounding for 0 fee tx and don't show relay fee warning in gui
2025-04-07 15:40:11 +00:00
f321x
23c0887a5c qml: pass updated fee policy to make_tx function when opening channel 2025-04-07 14:08:15 +02:00
Sander van Grieken
8b54f6445c qml: when opening channel, validate and show user feedback if amount outside acceptable range 2025-04-07 13:25:47 +02:00
accumulator
746c13b32d Merge pull request #9674 from accumulator/qml_lightning_invoice_insufficient_balance
qml: show insufficient balance text for lightning invoice without fal…
2025-04-07 12:09:17 +02:00
f321x
8d84008f5b disable output value rounding for 0 fee tx and remove relay fee warning from gui 2025-04-07 11:52:43 +02:00
f321x
8b7e967555 call QEChannelOpener.validate() on updateMaxAmount 2025-04-07 10:16:48 +02:00
Sander van Grieken
71801de7ea qml: show insufficient balance text for lightning invoice without fallback and insufficient ln send capacity 2025-04-07 10:02:25 +02:00
accumulator
bc4fcd8b83 Merge pull request #9682 from accumulator/android_permissions_support
Android >=13 permissions support
2025-04-05 11:47:27 +02:00
ThomasV
dee76b2137 Merge pull request #9660 from f321x/swap_announce_liquidity
swaps: Announce available liquidity instead of static maximum value
2025-04-04 18:04:34 +02:00
f321x
17a9a91e1f announce actual available liquidity as swap provider 2025-04-04 15:06:50 +02:00
ThomasV
181c132fee Merge pull request #9666 from accumulator/qml_close_invoicedialog_after_onchain_broadcast_success
qml: auto close invoicedialog after successful onchain tx broadcast
2025-04-03 17:18:31 +02:00
Sander van Grieken
f76218ea83 qml: introduce InfoBanner allowing a clickable sticky message to stay below header and
implement ln utxo reserve check with warning. Clicking shows a suggestion to swap.
2025-04-03 14:39:05 +02:00
Sander van Grieken
3fd64b60ab qml: show warning in ConfirmTxDialog if max amount cannot be fully sent due to channel reserve requirements. 2025-04-03 14:39:05 +02:00
ThomasV
32807462b0 qt: add warning about low utxo reserve 2025-04-03 14:39:05 +02:00
ThomasV
b339b1e7e3 ln_utxo_reserve
When we send max, decrease sent amount in order to keep some
reserve utxo, in order to be able to sweep lightning channels.
2025-04-03 14:39:05 +02:00
Sander van Grieken
1ac885ea40 qml: add android permission methods in AppController 2025-04-03 12:37:17 +02:00
SomberNight
5c233ac325 ci: enable more flake8 stuff
```
$ export ELECTRUM_LINTERS=E9,E101,E129,E273,E274,E703,E71,E722,F5,F6,F7,F8,W191,W29,B
$ export ELECTRUM_LINTERS_IGNORE=B007,B009,B010,B019,B036,F541,F841
$ flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
./electrum/commands.py:98:1: F811 redefinition of unused 'format_satoshis' from line 48
def format_satoshis(x):
^
./electrum/commands.py:437:9: F811 redefinition of unused 'Mnemonic' from line 62
        from .mnemonic import Mnemonic
        ^
./electrum/gui/qt/wizard/wallet.py:37:5: F811 redefinition of unused 'Daemon' from line 14
    from electrum.daemon import Daemon
    ^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'Optional' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'TYPE_CHECKING' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/plugin.py:966:13: F811 redefinition of unused 'hid' from line 593
            import hid
            ^
./electrum/plugin.py:1040:13: F811 redefinition of unused 'hid' from line 593
            import hid
            ^
./electrum/util.py:44:1: F811 redefinition of unused 'json' from line 26
import json
^
./electrum/util.py:46:1: F811 redefinition of unused 'NamedTuple' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:46:1: F811 redefinition of unused 'Optional' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:1456:56: F811 redefinition of unused 'traceback' from line 34
        async def __aexit__(self, exc_type, exc_value, traceback):
                                                       ^
./electrum/wallet_db.py:536:9: F811 redefinition of unused 'LOCAL' from line 46
        LOCAL = 1
        ^
./electrum/wallet_db.py:537:9: F811 redefinition of unused 'REMOTE' from line 46
        REMOTE = -1
        ^
./tests/test_bitcoin.py:28:1: F811 redefinition of unused 'bitcoin' from line 9
from electrum import crypto, constants, bitcoin
^
./tests/test_txbatcher.py:11:1: F811 redefinition of unused 'Transaction' from line 7
from electrum.transaction import Transaction, PartialTxInput, PartialTxOutput, TxOutpoint
^
./tests/test_wallet_vertical.py:20:1: F811 redefinition of unused 'Transaction' from line 10
from electrum.transaction import Transaction, PartialTxOutput, tx_from_any, Sighash
^
16    F811 redefinition of unused 'format_satoshis' from line 48
16

```
2025-04-02 16:21:59 +00:00
SomberNight
55281295b7 ci: bump flake8 to new version
```
./electrum/commands.py:144:9: F824 `global known_commands` is unused: name is never assigned in scope
        global known_commands
        ^
./electrum/commands.py:1916:9: F824 `global known_commands` is unused: name is never assigned in scope
        global known_commands
        ^
./electrum/gui/qt/main_window.py:2405:13: F824 `nonlocal done` is unused: name is never assigned in scope
            nonlocal done
            ^
./electrum/i18n.py:52:5: F824 `global language` is unused: name is never assigned in scope
    global language
    ^
./electrum/plugin.py:189:9: F824 `global _root_permission_cache` is unused: name is never assigned in scope
        global _root_permission_cache
        ^
5     F824 `global known_commands` is unused: name is never assigned in scope
5

```
2025-04-02 14:56:53 +00:00
Sander van Grieken
1559129016 qml: properly destroy ExceptionDialog after close, improve encapsulation 2025-03-28 14:51:12 +01:00
Sander van Grieken
1d07895e8c qml: fix #9677 2025-03-27 19:16:29 +01:00
accumulator
bf317af30b Merge pull request #9672 from accumulator/qt_swaps_handle_usercancelled
qt: handle UserCancelled when initializing swapmanager and requesting…
2025-03-27 13:30:49 +01:00