Commit Graph

446 Commits

Author SHA1 Message Date
Sander van Grieken
2739c2fd7b wizard: bitbox_ view prefixes to bitbox02_ 2023-09-20 14:34:31 +02:00
Sander van Grieken
66e9f502b0 qt: generalize wizard HWW xpub 2023-09-20 14:34:31 +02:00
Sander van Grieken
7dd43fa017 qt: add bitbox02 to new wizard 2023-09-20 14:34:31 +02:00
Sander van Grieken
8663d89f77 qt: add HWW unlock wizardcomponent 2023-09-20 14:34:31 +02:00
Sander van Grieken
65fee652c4 trustedcoin: ChoicesLayout -> ChoiceWidget 2023-09-20 14:34:31 +02:00
Sander van Grieken
7a2633b2de flake happifier 2023-09-20 14:34:31 +02:00
Sander van Grieken
b2a41b6363 qt: jade for new wizard 2023-09-20 14:34:31 +02:00
Sander van Grieken
902290ee8c qt: multisig checks with hardware cosigners 2023-09-20 14:34:31 +02:00
Sander van Grieken
b7ed4c569b wip. trezor works for standard wallet, also for cosigners 2023-09-20 14:34:31 +02:00
Sander van Grieken
3c232d70d1 small fixes 2023-09-20 14:34:31 +02:00
Sander van Grieken
fd28c66670 qt: 2fa implement OTP check 2023-09-20 14:34:31 +02:00
Sander van Grieken
571d16314f qt: introduce electrum/gui/qt_common, implement remaining trustedcoin views,
unify most qml and qt wizard code for trustedcoin,
separate non-GUI trustedcoin wizard definition to trustedcoin.py
2023-09-20 14:34:31 +02:00
Sander van Grieken
15773086e5 qt: initial trustedcoin wizard pages 2023-09-20 14:34:30 +02:00
Sander van Grieken
9e096fbf1e wizard: remove view from is_last_view call, it's never used 2023-09-20 14:34:30 +02:00
SomberNight
201309a7f0 ledger plugin: fix Ledger_Client.construct_new on very old btc app ver
related: https://github.com/spesmilo/electrum/issues/8568#issuecomment-1710162955
2023-09-07 14:47:55 +00:00
SomberNight
a560841f3f lnworker: fix some type hints re hold_invoices 2023-09-06 19:01:41 +00:00
SomberNight
1dd4acce9c Merge branch '202308_rm_kivy'
(PR https://github.com/spesmilo/electrum/pull/8591)
2023-09-06 13:35:57 +00:00
sorenstoutner
ddad5f1320 Fix Revealer Qt layout (#8587)
* Fix Revealer Qt layout

* Add license information
2023-09-05 12:32:38 +00:00
SomberNight
b45c84f24f remove the kivy gui
We now use the qml gui on Android, and haven't been maintaining
the kivy GUI for a while.
2023-08-30 16:47:37 +00:00
ThomasV
a300b8968a swapserver: do not expose the swapserver plugin in qt 2023-08-27 11:10:09 +02:00
SomberNight
b8d410849c fix revealer plugin for python 3.10+
fixes https://github.com/spesmilo/electrum/issues/7719
2023-08-25 23:35:07 +00:00
SomberNight
7482e275b9 follow-up storage/db changes
follow-up b96cc82333
2023-08-22 14:50:30 +00:00
ThomasV
b96cc82333 Make storage a field of db
This comes from the jsonpatch_new branch.
I rather have in master now, because it touches a lot of filese.
2023-08-18 08:08:31 +02:00
ThomasV
9f5f802cd1 config: save ports instead of net addresses (follow-up 012ce1c1bb) 2023-08-11 08:12:54 +02:00
ThomasV
012ce1c1bb Remove SSL options from config.
This is out of scope for Electrum; HTTP services that require SSL
should be exposed to the world through a reverse proxy.
2023-08-10 17:24:29 +02:00
ThomasV
dfa0dd47b7 swapserver: remove config option LIGHTNING_SWAP_HTLC_FIRST; read it from get_pairs instead. 2023-08-10 17:06:31 +02:00
SomberNight
a187210f90 labels plugin: don't log received data
this log line is 120 KB for one of my wallets (not even cherry-picking a large one)
2023-08-10 14:31:15 +00:00
ThomasV
88883d762c swapserver: remove /api from url 2023-08-10 10:29:32 +02:00
ThomasV
fd10ae3a3b New flow for submarine swaps:
- client requests payment_hash from the server
 - client sends an invoice with that hash
 - client waits to receive HTLCs, then broadcasts funding tx

This means that we now use same script for normal and reverse swaps.
The new flow is enabled by setting option LIGHTNING_SWAP_HTLC_FIRST
in the client. The old protocol is still supported server-side.
2023-08-10 09:04:30 +02:00
SomberNight
d51f00e2a3 asyncio.wait_for() is too buggy. use util.wait_for2() instead
wasted some time because asyncio.wait_for() was suppressing cancellations. [0][1][2]
deja vu... [3]

Looks like this is finally getting fixed in cpython 3.12 [4]
So far away...
In attempt to avoid encountering this again, let's try using
asyncio.timeout in 3.11, which is how upstream reimplemented wait_for in 3.12 [4], and
aiorpcx.timeout_after in 3.8-3.10.

[0] https://github.com/python/cpython/issues/86296
[1] https://bugs.python.org/issue42130
[2] https://bugs.python.org/issue45098
[3] https://github.com/kyuupichan/aiorpcX/issues/44
[4] https://github.com/python/cpython/pull/98518
2023-08-04 18:18:21 +00:00
SomberNight
e94d45edd8 swapserver: small clean-up 2023-08-03 17:20:58 +00:00
Sander van Grieken
c068b80d78 qml: fix issues with 2fa, simplify terms and conditions retrieval code 2023-08-03 17:17:06 +02:00
ThomasV
1b14692f30 swapserver: cleanup, add description 2023-07-26 19:20:18 +02:00
ThomasV
351ff1e4b5 swapserver: support prepayment of fees 2023-07-26 19:20:18 +02:00
ThomasV
098c65d732 submarine swap server plugin:
- hold invoices
 - uses the same web API as the Boltz backend
2023-07-26 19:20:18 +02:00
3rd Iteration
0e5cb19408 Add Vendor/Device IDs for CH340 based DIY Jade devices. (#8546)
* Add Vendor/Device IDs for CH340 based DIY Jade devices.

* Add device descriptions to hardwareIDs
2023-07-21 15:14:56 +00:00
Sander van Grieken
b6863b4854 qml: add LabelSync toggle 2023-07-11 12:51:37 +02:00
Toporin
f5a8cc7076 Patch error caused by the method "parse_URI()" being moved and renamed:
Aucun périphérique matériel détecté.
Pour déclencher un nouveau scan, pressez 'Suivant'.

Sur Linux, vous pouvez avoir à ajouter une nouvelle permission à vos règles udev.


Message de débogage
  bitbox02: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading bitbox02 plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  coldcard: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading coldcard plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  digitalbitbox: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading digitalbitbox plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  jade: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading jade plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  keepkey: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading keepkey plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  ledger: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading ledger plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  safe_t: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading safe_t plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  satochip: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading satochip plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  trezor: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading trezor plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
2023-07-10 09:50:35 +01:00
Sander van Grieken
44f83b78e2 trezor: model T is 'T', not '2' 2023-07-07 14:00:27 +02:00
Sander van Grieken
be0ef5f961 trezor: allow PIN of length 50 for T1 firmware >=1.10.0 and TT firmware >=2.4.0 (closes #8526) 2023-07-07 12:33:55 +02:00
SomberNight
eef9680743 trezor plugin: support external pre-signed inputs
closes https://github.com/spesmilo/electrum/issues/8324
2023-06-14 17:03:47 +00:00
SomberNight
4a211adcaa trezor plugin: allow multiple change outputs
see https://github.com/spesmilo/electrum/issues/3920
2023-06-14 17:02:07 +00:00
SomberNight
87cba8bf32 trustedcoin: stricter client-side checks for 2fa fee 2023-06-13 16:52:50 +00:00
SomberNight
a1c24c6261 jade(hw): fix sign_transaction()
same as 9e13246be8

fixes https://github.com/spesmilo/electrum/issues/8463
regression from https://github.com/spesmilo/electrum/pull/8230
2023-06-02 13:48:48 +00:00
Sander van Grieken
2a4d2ac009 payserver: fix import 2023-06-02 13:35:51 +02:00
Marko Bencun
dfed0ef54a bitbox02: display amounts in sats if Electrum's base unit is sat
The BitBox02 has the ability to display all amounts in sats instead of
BTC. This was introduced in v9.13.0. If Electrum is configured to show
sats, we propagate this config to the BitBox02.

This is backwards compatible: users with older firmware will see the
values in BTC regardless of the config.
2023-05-30 23:57:03 +02:00
Marko Bencun
7164f9fd6e bitbox02: update to 6.2.0
6.2.0 was released to put a minimum requirement on hidapi 0.14.0,
which includes the fix for this issue:

https://github.com/libusb/hidapi/issues/531

That bug caused hidapi on macOS 13.3 to report 0 as the interface
number for all hid devices, which led to the bitbox02 multi edition being listed
twice instead of once - once for the main HW wallet interface and once erroneously
For the U2F interface (which should not be listed).
2023-05-30 23:55:52 +02:00
SomberNight
24980feab7 config: introduce ConfigVars
A new config API is introduced, and ~all of the codebase is adapted to it.
The old API is kept but mainly only for dynamic usage where its extra flexibility is needed.

Using examples, the old config API looked this:
```
>>> config.get("request_expiry", 86400)
604800
>>> config.set_key("request_expiry", 86400)
>>>
```

The new config API instead:
```
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS
604800
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS = 86400
>>>
```

The old API operated on arbitrary string keys, the new one uses
a static ~enum-like list of variables.

With the new API:
- there is a single centralised list of config variables, as opposed to
  these being scattered all over
- no more duplication of default values (in the getters)
- there is now some (minimal for now) type-validation/conversion for
  the config values

closes https://github.com/spesmilo/electrum/pull/5640
closes https://github.com/spesmilo/electrum/pull/5649

Note: there is yet a third API added here, for certain niche/abstract use-cases,
where we need a reference to the config variable itself.
It should only be used when needed:
```
>>> var = config.cv.WALLET_PAYREQ_EXPIRY_SECONDS
>>> var
<ConfigVarWithConfig key='request_expiry'>
>>> var.get()
604800
>>> var.set(3600)
>>> var.get_default_value()
86400
>>> var.is_set()
True
>>> var.is_modifiable()
True
```
2023-05-25 17:39:48 +00:00
SomberNight
03ab33f4b2 SimpleConfig: change API of set_key(): "save" is now kwarg-only 2023-05-25 17:37:16 +00:00
SomberNight
9e13246be8 ledger: fix Ledger_Client_Legacy.sign_transaction()
fix signing txs when using old "bitcoin app" (pre-2.1) on the ledger device

```
 33.36 | W | transaction | heyheyhey. cp1. include_sigs=True force_legacy=False use_segwit_ser=True
 33.36 | W | transaction | heyheyhey. cp2. branch1
 33.37 | E | plugins.ledger.ledger |
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 669, in sign_transaction
    rawTx = tx.serialize_to_network()
  File "...\electrum\electrum\transaction.py", line 945, in serialize_to_network
    witness = ''.join(self.serialize_witness(x, estimate_size=estimate_size) for x in inputs)
  File "...\electrum\electrum\transaction.py", line 945, in <genexpr>
    witness = ''.join(self.serialize_witness(x, estimate_size=estimate_size) for x in inputs)
  File "...\electrum\electrum\transaction.py", line 839, in serialize_witness
    sol = desc.satisfy(allow_dummy=estimate_size, sigdata=txin.part_sigs)
  File "...\electrum\electrum\descriptor.py", line 378, in satisfy
    sol = self._satisfy_inner(sigdata=sigdata, allow_dummy=allow_dummy)
  File "...\electrum\electrum\descriptor.py", line 574, in _satisfy_inner
    raise MissingSolutionPiece(f"no sig for {pubkey.hex()}")
electrum.descriptor.MissingSolutionPiece: no sig for 033e92e55923ea25809790f292ee9bd410355ee02492472d9a1ff1b364874d0679
 33.38 | I | plugins.ledger.ledger | no sig for 033e92e55923ea25809790f292ee9bd410355ee02492472d9a1ff1b364874d0679
```

fixes https://github.com/spesmilo/electrum/issues/8365
regression from https://github.com/spesmilo/electrum/pull/8230
2023-05-09 16:17:04 +00:00