2573 Commits

Author SHA1 Message Date
thomas
8a9dc083ab Fix sliders background color 2025-04-24 14:43:06 +02:00
Michael Mallan
7d2a1d4d31
fix: ensure spend panel steps use latest wallet
The wallet is used in some steps to get fingerprint aliases.

The recovery panel previously handled a wallet update, but this
was omitted when making the recovery panel part of the spend
panel.

This bug already existed for the final step of a regular spend
where the signing information would show old aliases if these
were updated while defining the spend.
2025-04-24 13:31:10 +01:00
edouardparis
b2f28b94d1
Merge #1671: Refac services module
7085542066006d1d0debbe6fff0b3463ace834f1 Move lianalite to services::connect module (edouardparis)
f3ae84f91c2028d8e53da0d096867c8cf13a54c4 Move keys service to its own submodule (edouardparis)

Pull request description:

  Move the current client implementation for https://keys.wizardsardine.com from `services` to `services::keys`.
  Move the liana-connect client implementation to `services::connect`

ACKs for top commit:
  jp1ac4:
    ACK 7085542066006d1d0debbe6fff0b3463ace834f1.

Tree-SHA512: 853f8cde9de768f0b087125b7ae9a5aae3fec9a5d6085ccf0ae72e6b75c7833424ddf482bcc9eefeea05f35ef59b65727af8f6e0af1efcf0a95217f3d9b74b2c
2025-04-24 14:13:25 +02:00
edouardparis
7c12f6fe12
Merge #1666: Prepare datadir for multiple wallet support
61bc0ffbc85748437da0155ea25a5b741306aef2 tests: use data_directory (edouardparis)
6ccaa0573b42b8e1998f3a780e2f714af3ce9b6d Prepare datadir for multiple wallet support (edouardparis)

Pull request description:

  A new field data_directory is introduced in lianad configuration, it resolves directly to the path of the wallet datadir without the per network reasoning. The previous data_dir field is kept for backward compatibility for already generated configuration file.

ACKs for top commit:
  jp1ac4:
    ACK 61bc0ffbc85748437da0155ea25a5b741306aef2.

Tree-SHA512: da2e1bcda9bbd4b11d29833694bc8f6f88506fd8f2d423c7eb8cab3a58f3e6a0b4330e89393f7cc70e5838d770a1571d8b5bdce1d83b068d1e958be3ee183021
2025-04-24 14:09:07 +02:00
edouardparis
7085542066 Move lianalite to services::connect module 2025-04-24 11:38:19 +02:00
edouardparis
f3ae84f91c Move keys service to its own submodule 2025-04-24 11:28:25 +02:00
edouardparis
61bc0ffbc8 tests: use data_directory 2025-04-23 18:53:56 +02:00
Michael Mallan
356301c79c
feat: add brief overview of recovery feature
This adds some explantory text about the recovery panel.

For consistency, the text stating that no recovery paths are
available will be shown in the same card as when recovery paths
are available, which will help differentiate between this text
and the explanatory text.
2025-04-23 17:24:12 +01:00
Michael Mallan
30aedb3e5b
fix: use singular for one coin 2025-04-23 17:20:27 +01:00
Michael Mallan
eb45d6ef8f
fix: show tooltip above to improve legibility 2025-04-23 17:20:25 +01:00
Michael Mallan
ea8e8453d7
fix: clarify available recovery paths wording
The previous wording could be misleading for recovery paths that
had already been available since many blocks ago.

For the user, it's enough to know that the path is available, i.e.
a spend on this recovery path can be created and broadcast.
2025-04-23 17:18:31 +01:00
edouardparis
6ccaa0573b Prepare datadir for multiple wallet support
A new field data_directory is introduced in lianad configuration, it
resolves directly to the path of the wallet datadir without the per network
reasoning. The previous data_dir field is kept for backward
compatibility for already generated configuration file.
2025-04-23 17:27:28 +02:00
edouardparis
1213858489
Merge #1665: Remove the link between gui config and lianad config
19f5132ee8439ef3d4d27dd7254104d60c8540af Remove the link between gui config and lianad config (edouardparis)

Pull request description:

  This commit is part of preparatory work to support multiple wallets.

  This commit introduces two breaking change:

  The fields daemon_config_path and daemon_rpc_path are removed. The GUI will deduce these values from their expected location in the root data directory.

  Because this link is removed, the gui flag --conf is not useful anymore as it cannot then find the location of the root data directory.

ACKs for top commit:
  jp1ac4:
    ACK 19f5132ee8439ef3d4d27dd7254104d60c8540af.

Tree-SHA512: f883781e935e2253ebc2d4b71331c12efbaa142d45c418d17411c3de0b2288127832de8ff34eb24d07abfdb8e3045b48c3e5c3773857518c3a28df2a7c46263c
2025-04-23 13:50:13 +02:00
edouardparis
a5391d9d5a
Merge #1658: feat: Add coin control to Recovery panel
c7bbbd854ccfb8f2dccb6e7f63b6f4c982cd76c1 feat: enable coin control for recovery spends (Michael Mallan)
c2f964d5b365501ec5a608a8f8333ffeb1edc2b7 fix: load tip height directly rather than from cache (Michael Mallan)
0d9cf43bf9c623221be6ed9882ec7df6e710566d fix: avoid overflow when checking for previous step (Michael Mallan)
83c90b085a8fc3c6f738678a01b63f2811a33600 refactor: get first timelock from descriptor (Michael Mallan)
0514f743daae738c05bb124ce55f0ae01193df01 refactor: add function to filter coins for selection (Michael Mallan)
934d0c76f486016bdd2a7098d14694b9ba470442 fix: grey out next button in case of error (Michael Mallan)
71541c69bae7f8f33659337ad66e7ca161cbcef4 feat: support outpoints recovery parameter (Michael Mallan)

Pull request description:

  This implements #1641.

  The recovery process is treated as a regular spend, with an initial step for selecting the recovery path.

  Further refactoring to `DefineSpend` could be applied in a follow-up to clearly distinguish between the three kinds of spends now handled:
  1) regular primary path spend to external recipient(s)
  2) self-send (using primary path)
  3) recovery spend

ACKs for top commit:
  edouardparis:
    ACK c7bbbd854ccfb8f2dccb6e7f63b6f4c982cd76c1

Tree-SHA512: 2a949bed0e1d1eedc5179544597b36ff124badc31264672765ea77a8a3cd1257334190739ece5da25422d5a9009e6cf58f9f70ae1f0ebe4903aa455342142870
2025-04-23 13:49:35 +02:00
Michael Mallan
c7bbbd854c
feat: enable coin control for recovery spends
The regular spend panel has been updated to allow for recovery
spends.

A recovery spend will use the same panel type as a regular spend,
with an extra step added for selecting the recovery path.
2025-04-23 10:26:55 +01:00
edouardparis
19f5132ee8 Remove the link between gui config and lianad config
This commit is part of preparatory work to support
multiple wallets.

This commit introduces two breaking change:

The fields daemon_config_path and daemon_rpc_path are removed.
The GUI will deduce these values from their expected
location in the root data directory.

Because this link is removed, the gui flag --conf is not useful
anymore as it cannot then find the location of the root data directory.
2025-04-23 11:14:55 +02:00
Michael Mallan
c2f964d5b3
fix: load tip height directly rather than from cache
This ensures the coins are sorted according to the latest
tip height in case the cache has not been recently refreshed.
2025-04-23 09:59:56 +01:00
Michael Mallan
0d9cf43bf9
fix: avoid overflow when checking for previous step 2025-04-23 09:59:54 +01:00
Michael Mallan
83c90b085a
refactor: get first timelock from descriptor 2025-04-23 09:59:52 +01:00
Michael Mallan
0514f743da
refactor: add function to filter coins for selection 2025-04-23 09:59:51 +01:00
Michael Mallan
934d0c76f4
fix: grey out next button in case of error
It should not be possible to click the Next button if there's
any error.

This could arise for a self-send if a very high feerate is chosen
and there are insufficient funds. In this case, the Next button
will now be greyed out until form values are edited and the error
has disappeared.
2025-04-23 09:59:49 +01:00
Michael Mallan
71541c69ba
feat: support outpoints recovery parameter
This changes the GUI daemon trait's create_recovery method to
support passing an outpoints parameter. For now, however, this
method is called with an empty outpoints slice, meaning that all
recoverable coins will be used.
2025-04-23 09:59:44 +01:00
edouardparis
0ff3479d56
Merge #1662: Show fee next to feerate input when creating a new spend
b426d31914bf906d65307bdeb6851430d59b399d Adapt redraft to display fees (thomas)

Pull request description:

  ![Capture d’écran du 2025-04-21 07-41-39](https://github.com/user-attachments/assets/d9de2c77-a458-4116-bce2-e3ca530372cf)

  ![Capture d’écran du 2025-04-21 07-42-33](https://github.com/user-attachments/assets/a9648183-74f2-4ec6-8a8f-8667baa70fea)

  Closes #1653

ACKs for top commit:
  edouardparis:
    ACK b426d31914bf906d65307bdeb6851430d59b399d

Tree-SHA512: 23d3b15d0b3ec560a0a6992c2efe2557b3f5a142c690878a0c67893182560431e14ee3f4e5f9acc0a0adaaa5bcf41656964e9ed96a28da83bf312d0e08c2f4c2
2025-04-23 09:59:32 +02:00
thomas
b426d31914 Adapt redraft to display fees 2025-04-22 14:41:36 +02:00
edouardparis
3837f35714
Merge #1645: Import/Export PSBT from/to file
d86bd20a2fbcec0c3c37dd0cabb5ea02130a88f6 export: better wording when user try to import psbt w/ non owned coins (pythcoiner)
a1918f5eb6009c5e4526edcc57f82f5a1ccec37f export: do not panic if import an insane PSBT (pythcoiner)
3d9440d3ac70451a85b96e780b71d540ec811415 export:cleanup (pythcoiner)
71684e7039252384d18146c06b79d6f7deb9e0e4 gui: integrate import PSBT from file (pythcoiner)
9658cfde3fdbdd5823c3fd9014253bbf2901368a export: finalyze PSBT import (pythcoiner)
0796efae19e2bce521cd55c3f7bbc9f731bbad0e gui: integrate PSBT export instead copy to clipboard (pythcoiner)
64fcf3415481d516d516148aebf57a2a0ff40e42 gui: rename Action => Modal for consistency (pythcoiner)

Pull request description:

  - [x] gui: integrate PSBT export to file
  - [x] export: finalyze import PSBT from file
  - [x] gui integrate PSBT import from file

  ![image](https://github.com/user-attachments/assets/f9eac738-2014-4901-9df3-9cce862ea510)

  ![image](https://github.com/user-attachments/assets/647cd1d1-0f33-43f3-b543-8f64ecd92a31)

  ![image](https://github.com/user-attachments/assets/b2c157d7-ac3a-4944-ac57-99a15088c1c7)

  ![image](https://github.com/user-attachments/assets/287fc5aa-bd36-4431-bedc-1ff8b1b57e83)

  ![image](https://github.com/user-attachments/assets/1b393295-03f3-4c32-9670-0226dfd23dcb)

  Note: this PR is based on #1644

  closes #1632

ACKs for top commit:
  edouardparis:
    ACK d86bd20a2fbcec0c3c37dd0cabb5ea02130a88f6

Tree-SHA512: 8bfde198fd1ff18fe893a64ffa31fd6c0fde2aa54214df7d1e0d1bb2b4ebfc67904160b5d7375e74c180d73ee2f2a754d32bb5be98e548bd7b54106597ce7b49
2025-04-21 10:46:03 +02:00
pythcoiner
d86bd20a2f
export: better wording when user try to import psbt w/ non owned coins 2025-04-21 03:31:52 +02:00
edouardparis
254c5f4a92
Merge #1660: export: add a cross button to the modal
a50fa04519160169ecae9fb56b047ab76303f712 export: remove stop button from the modal (pythcoiner)
968c36fcf6ec4cbad4fa13e9b05c759c1be05752 export: add a cross button to the modal (pythcoiner)

Pull request description:

  This PR add a cross button to the export modal for consistency w/ other modals.

  ![image](https://github.com/user-attachments/assets/07284af0-31e1-4507-adde-e9aa344ff958)

ACKs for top commit:
  edouardparis:
    utACK a50fa04519160169ecae9fb56b047ab76303f712

Tree-SHA512: afbff780a052d6b34275c62bbb7713e49300680752287a822be187d118560404eea252878120c53fbb1147a9b86f55e0f043f1802660e0bf3cbf2a6dc3062af3
2025-04-18 14:42:43 +02:00
pythcoiner
a50fa04519
export: remove stop button from the modal 2025-04-17 18:51:31 +02:00
edouardparis
b4883415f3
Merge #1661: fix: cache coins when first loading GUI with Liana Connect
417a949037b7c33895e34081d9acd23ddd4a10f8 fix: cache coins for remote backend when loading gui (Michael Mallan)
e03d4e17be937cf49f32a9f3d9d80351d7652a9a refactor: add function to get coins to cache (Michael Mallan)

Pull request description:

  With this PR, coins will be cached when first loading a GUI that is using Liana Connect as the backend.

  The cache refreshes less often for Liana Connect (every 2 mins), which means there can be a discrepancy between the coins loaded on a page and those in the cache, especially when first loading the GUI with no coins cached.

  This can be seen when choosing to refresh a coin in the Coins panel. After selecting the coin and the refresh option, the Self-Send page is displayed with coins listed, but the coin that was previously selected in the Coins panel won't be selected here unless the cache has already refreshed. By caching coins at the start, it makes such a scenario less likely to occur when using Liana Connect.

ACKs for top commit:
  edouardparis:
    ACK 417a949037b7c33895e34081d9acd23ddd4a10f8

Tree-SHA512: 1c64fbc7100685575a4e7e20ac95065c0dbaa981f38953659985dcfacc628ebb2870c34e6a82ee8da781485858ce9d6c7414f62fcb61786e50037088e9903212
2025-04-17 16:55:13 +02:00
Michael Mallan
417a949037
fix: cache coins for remote backend when loading gui 2025-04-17 13:46:28 +01:00
Michael Mallan
e03d4e17be
refactor: add function to get coins to cache 2025-04-17 13:45:55 +01:00
pythcoiner
a1918f5eb6
export: do not panic if import an insane PSBT 2025-04-17 10:36:04 +02:00
pythcoiner
968c36fcf6
export: add a cross button to the modal 2025-04-16 19:59:18 +02:00
pythcoiner
3d9440d3ac
export:cleanup 2025-04-16 19:23:18 +02:00
pythcoiner
71684e7039
gui: integrate import PSBT from file 2025-04-16 19:18:14 +02:00
pythcoiner
9658cfde3f
export: finalyze PSBT import 2025-04-16 19:11:00 +02:00
pythcoiner
0796efae19
gui: integrate PSBT export instead copy to clipboard 2025-04-16 19:10:59 +02:00
pythcoiner
64fcf34154
gui: rename Action => Modal for consistency 2025-04-16 19:10:59 +02:00
edouardparis
733c3a6071
Merge #1657: lianad: in update_spend_tx() work on the db_psbt
d637564a117947bd0493eba9bf61a1d84f893aa5 lianad: in update_spend_tx() work on the db_psbt instead of the imported one (pythcoiner)

Pull request description:

  This PR partially fixes #1581.

  Previously the imported PSBT we taken as base and signature added from the PSBT stored in DB, this create issue when the imported PSBT is supplied by a signing device that trim the PSBT (in QRCode context for instance).
  This PR change the logic by taking the PSBT stored in DB as base and add signatures from the imported PSBT.

  ~~Note: the same logic change must be done on `liana-backend`~~
  edit: review the logic on liana-backend, nothing seems to be change on this side, validated by a test by importing a psbt from krux trough Krux(QRCode) => SeedQReader => file => import

ACKs for top commit:
  edouardparis:
    ACK d637564a117947bd0493eba9bf61a1d84f893aa5

Tree-SHA512: 2a14f2387f3ab74e93f4e5b67ff48011bea945bfa897e21f14be40bf40b52460c921c4dcb92899ce46f1aed6096ec8bd97b423341c1660dd3cd081146080572c
2025-04-16 17:57:37 +02:00
pythcoiner
d637564a11
lianad: in update_spend_tx() work on the db_psbt instead of the imported one 2025-04-16 13:08:40 +02:00
edouardparis
1e551e15b1
Merge #1646: lianad: allow to select coins for recovery
2527bcea2eef753fb776e1618c7d4b9b79801a3c fix: timelock parameter is optional (Michael Mallan)
d4151d88d690d49b779402f61d6d506460fd8d87 rpc: allow to choose outpoints in `createrecovery` (Michael Mallan)
8cc723fb3bca3af661e7ace47ee8cb838d7d0db9 commands: allow to specify coins for recovery (Michael Mallan)
ce711ae10afa343c7228abe4be55cb615c3d971b commands: add test for `create_recovery` (Michael Mallan)
21c899f9ec2121e06189a1c6a63c4d7c9f213585 gui: fix docstring (Michael Mallan)

Pull request description:

  This is to resolve #1637.

  The `coins_outpoints` parameter for the recovery command works similarly to the corresponding parameter for a normal spend. An empty slice means that all recoverable coins will be chosen, i.e. the same as the current behaviour.

  In order to maintain backwards compatibility, the new `outpoints` parameter in the `createrecovery` RPC command has been added as an optional parameter in the last position.

  The GUI's use of this RPC command will be updated in a separate PR.

  Note the first commit is an unrelated docstring fix and the second commit adds some preliminary tests for the `create_recovery` command.

ACKs for top commit:
  edouardparis:
    ACK 2527bcea2eef753fb776e1618c7d4b9b79801a3c

Tree-SHA512: 13e13ec2bccf974ad03424c6fba8ce31eb27af23809420f81ed13ebc114a3620aafa612416b2d2338e1444934f1529ebdcaf2391f750e6e915a28f4f49e53d7b
2025-04-15 17:32:12 +02:00
edouardparis
896407aba3
Merge #1644: Add Import/Export Xpub feature
0b2ebd3aaad945afdf8b4dea4931179626663b89 export: typo 'Fail to' => 'Failed to' (pythcoiner)
8dd16fb586b4edc87d602b0a1d6ad396fe5340b3 export: trim string read from files (pythcoiner)
541c63419b1a39d0159ca87492360037e2119fbb installer: integrate import xpub feature (pythcoiner)
98bacb9f4c88ad63c537b7819a437e4e17bdd0b5 export: add import xpub feature (pythcoiner)
d7e388707b3368e12b73b578524b8e0c667ddb92 installer: integrate export xpub feature (pythcoiner)
986a982d8e7148b51bf20e4913502bfa1ce1ffe6 export: add export xpub feature (pythcoiner)

Pull request description:

  - [x] Add export feature to `export`
  - [x] Installer: Export xpub to a file instead copying to clipboard

  ![image](https://github.com/user-attachments/assets/87218f66-08fb-4083-8f37-c5589dae763c)

  - [x] Add import feature to `export`
  - [x] Installer: Add import Xpub feature at descriptor creation step

  before importing key:

  ![image](https://github.com/user-attachments/assets/56d57860-057c-4327-9002-545adff1b1c0)

  after importing key:

  ![image](https://github.com/user-attachments/assets/94cffb17-01b7-4a56-8974-f76a1791428c)

  closes #1633

ACKs for top commit:
  edouardparis:
    ACK 0b2ebd3aaad945afdf8b4dea4931179626663b89

Tree-SHA512: 44540efd25525a6489b27b1a928bac1c94e06720c5ba82e1eeada09abdb967db3f0ec8f2e404274818d1720efc508e19c8d9a5002f1e047c0335c8b8844ef7e1
2025-04-15 10:05:50 +02:00
pythcoiner
0b2ebd3aaa
export: typo 'Fail to' => 'Failed to' 2025-04-14 16:59:12 +02:00
pythcoiner
8dd16fb586
export: trim string read from files 2025-04-14 16:59:11 +02:00
edouardparis
9a623c2eef
Merge #1648: feat: move recovery from settings to own menu
df4528dc767a39fb979579c7cafca1fd49fa3d49 feat: move recovery from settings to own menu (Michael Mallan)

Pull request description:

  This is to resolve #1640.

  The tooltip has been removed for now as the menu buttons don't currently support adding an icon with tooltip, but a tooltip can be re-added later if required (#1647).

ACKs for top commit:
  edouardparis:
    ACK df4528dc767a39fb979579c7cafca1fd49fa3d49

Tree-SHA512: ba4af1cbf61064a2b825fc400f37fdf1f2d621aee73607ed3c70c770867b0a4f4ebe17d0644373e03e4ec54fed6f5ea74beb12e1cda6fe7e720c8e726400fed4
2025-04-14 15:29:32 +02:00
edouardparis
ff693788b2
Merge #1643: filter for confirmed coins when checking recovery paths
2279b332d4c1fd06c761e841ec15adfc2b5787dc filter for confirmed coins when checking recovery paths (Michael Mallan)

Pull request description:

  This is to fix #1636 and consequently fixes #1102. This PR therefore replaces #1144.

  A wallet containing an unconfirmed coin of timelock 1 will no longer show any recovery paths as available.

  The recovery transaction created by `createrecovery` only includes confirmed coins and so we should only consider these coins when checking for available recovery paths. An unconfirmed coin could not be broadcast in a recovery transaction as it would not yet satisfy the timelock constraint.

ACKs for top commit:
  edouardparis:
    utACK 2279b332d4c1fd06c761e841ec15adfc2b5787dc

Tree-SHA512: e1c1891e8d89a02b4eaacf64758c404b73384fe1c5183a6a21c2ad440ca8898cf68148981bc51d142875ac4458f943459227f0bdc7e04aa9cf2f35c22d33fb81
2025-04-14 14:57:20 +02:00
pythcoiner
541c63419b
installer: integrate import xpub feature 2025-04-14 14:20:40 +02:00
pythcoiner
98bacb9f4c
export: add import xpub feature 2025-04-14 09:27:36 +02:00
pythcoiner
d7e388707b
installer: integrate export xpub feature 2025-04-14 09:27:35 +02:00
Michael Mallan
df4528dc76
feat: move recovery from settings to own menu
This will increase visibility of the recovery feature.

The tooltip has been removed for now as the menu buttons don't
currently support adding an icon with tooltip, but a tooltip
can be re-added later if required.
2025-04-09 15:18:33 +01:00