Commit Graph
50 Commits
Author SHA1 Message Date
Michael Mallan 4d05c1f0ff commands: allow rbf for spending txs without saved psbt 2025-01-29 15:54:39 +00:00
Michael Mallan 1c0338610f commands: add is_from_self to listcoins response 2024-12-02 10:08:18 +00:00
Michael Mallan 0f9f1f352c commands: return last poll timestamp from getinfo 2024-10-24 11:24:31 +01:00
Antoine Poinsot 1819988b3f Merge #921: Add optional txids param to listspendtxs
da1ebce5b6 add txids param to listspendtxs (pythcoiner)

Pull request description:

  fix #862
  - [x] daemon
  - [x] tests
  - [x] doc

ACKs for top commit:
  jp1ac4:
    ACK https://github.com/wizardsardine/liana/commit/da1ebce5b6328f8f5636192e7434d1ba598d5516.

Tree-SHA512: 9696a8077bce2ba8f2abc9eda6a4cdc8654c83ffd61bc5b8419ca50e5ecc447dc78d2059e608c16e94306c27f2aaf21a77c879d21a54f24a049337545750cef7
2024-03-09 18:55:01 +01:00
pythcoiner da1ebce5b6 add txids param to listspendtxs 2024-02-24 21:56:48 +01:00
jp1ac4 62bb4aded4 commands: include unconfirmed change as candidates 2024-01-25 14:57:56 +00:00
Antoine Poinsot 79141e2042 Merge #927: commands: include missing amount in spend response
1339898253 commands: include missing amount in response (jp1ac4)

Pull request description:

  This PR follows a discussion around https://github.com/wizardsardine/liana/pull/873#issuecomment-1886715468.

  The GUI uses the `InsufficientFunds` error to get the missing amount when the user is creating a new spend, but it is not straightforward to extract this information in a general way from the RPC error (see https://github.com/wizardsardine/liana/issues/822#issuecomment-1836482355) and instead the spend module's `create_spend` is currently used (see https://github.com/wizardsardine/liana/pull/863).

  With this PR, the missing amount will be included in the `createspend` response rather than as an error.

  These changes are based on suggestions from @darosior and @edouardparis.

  In a follow-up PR, the GUI should revert to using the `createspend` command to calculate the amount left to select.

ACKs for top commit:
  darosior:
    re-ACK 1339898

Tree-SHA512: bf702d6b355339e96e719c1d95824e7941ac4fbaece4ec4cccd00b56ea4683ce7fb0cefc43faa5731b57e7935ef99da3a2c73b84aaeb9fa5f67703c799be2196
2024-01-23 17:33:48 +01:00
jp1ac4 1339898253 commands: include missing amount in response
The GUI uses the InsufficientFunds error to get the missing
amount when the user is creating a new spend.

It is not straightforward to extract this information in a
general way from the RPC error. Instead, this missing amount
will be included in the command response.

These changes are based on suggestions from darosior
and edouardparis.
2024-01-23 15:01:34 +00:00
pythcoiner 79177945ad add timestamp field to getinfo 2024-01-19 13:06:32 +01:00
jp1ac4 5a15c744e7 commands: return warnings from spend creation 2024-01-11 20:06:00 +00:00
edouardparis 572567a7e4 Expose ListCoinsEntry derivation_index and is_change 2023-12-11 13:35:30 +01:00
jp1ac4 5391bfe04c commands: add rbfpsbt command 2023-12-06 17:35:05 +00:00
Antoine Poinsot a77a36cb9e commands: make it possible to create a sweep spend transaction
We leverage the change logic for this. By making it possible to set the
change address to an external address, one can send all the value from
the inputs to this address.
2023-11-24 13:51:42 +01:00
Antoine Poinsot 2e2afc1d7b doc: document deriv index in getnewaddress result 2023-11-16 18:09:51 +01:00
jp1ac4 cfa0f91dd3 commands: auto-select coins if none provided
When creating a new spend, if coin outpoints are not provided,
then coins will be selected automatically.

This automatic selection is such that the transaction fee is
minimized, taking into account the cost of creating any
change output now and the cost of spending it in the future.

If change is added, it must reduce the transaction waste and
be above the dust threshold. This same policy is applied also
in the case of manual coin selection, replacing the previous
logic for determining the change amount. This ensures that
creating a spend with auto-selection and another with manual
selection using the same auto-selected coins will give the
same change amount.
2023-11-14 13:32:53 +00:00
Antoine Poinsot 479efe7494 Merge #709: Implement listadresses
2660b77487 implement listadresses (pythcoiner)

Pull request description:

  address #681

  todo:
  - [x]  implement tests
  - [x] update docs

  edit: i'm really new to rust, don't hesitate to kick my ass when i write stupid code

ACKs for top commit:
  darosior:
    ACK 2660b77487 -- my requests are addressed in followup #808.

Tree-SHA512: a5fdfb4516dc0379bfec1be535e752795dec75d28cbc5b9fa4fe9898fa00b1cfaa9cee3b95f4dfd68365f4585426e1b4457a8366cc4f783600704994f879526f
2023-11-11 14:43:23 +01:00
pythcoiner 2660b77487 implement listadresses 2023-11-10 14:59:44 +01:00
omahs 4fe9397a5e fix typos 2023-11-02 15:02:43 +01:00
Antoine Poinsot 17ca01322e Revert "Merge #722: Only include BIP32 derivations for a single spending path when creating PSBTs"
This reverts commit 7105698263, reversing
changes made to 03c37bd378.

This reverts PR #722. It turns out the Ledger Bitcoin app needs the
BIP32 derivation for all the keys in the Script, not only for the
spending path used. Therefore always create PSBT with all the BIP32
derivations. We'll add a way to prune them for talking to the Bitbox in
a future commit.
2023-10-27 15:46:03 +02:00
edouard 7105698263 Merge #722: Only include BIP32 derivations for a single spending path when creating PSBTs
7f3b0b0218 qa: test a PSBT has only the BIP32 derivations for a single spending path (Antoine Poinsot)
b71bd693d6 qa: don't use a static dummy origin for descriptor xpubs (Antoine Poinsot)
a81d39c81a commands: do not include BIP32 derivations for other spending paths (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK 7f3b0b0218

Tree-SHA512: f0e132edf8d653c5575f843b1e85d995f155a2435a6e6257564dc945562df70ec2049c29d77f7580858d9e4a58290b0798f298f77c18255415c4cf26ccc07f33
2023-10-24 12:40:43 +02:00
edouardandAntoine Poinsot 01ca960370 Delete empty labels when they are updated
In order to delete a label, client sends in the
request a null value as label value.

Co-Authored-by: Antoine Poinsot <darosior@protonmail.com>
2023-10-21 09:21:02 +02:00
Antoine Poinsot a81d39c81a commands: do not include BIP32 derivations for other spending paths
When creating a PSBT, only include the BIP32 derivations in each input
for the spending path this PSBT was created for.

This is to workaround Bitbox only providing a single signature per
input. Most likely other signing devices will have this behaviour too in
the future. See
https://github.com/wizardsardine/liana/pull/706#issuecomment-1744705808.
2023-10-06 18:23:11 +02:00
jp1ac4 eeaf90e522 commands: optionally filter listcoins by status and/or outpoint 2023-09-13 08:49:54 +01:00
edouard bf3eb33900 lianad api: expose coin address 2023-08-28 13:14:21 +02:00
edouard 7338e6f988 Add labels to lianad 2023-08-28 13:14:21 +02:00
Antoine Poinsot 6ab6161078 commands: expose whether a coin is immature in listcoins 2023-07-20 13:42:35 +02:00
jp1ac4 11a280bfe4 doc(api): fix order of params for createspend 2023-06-09 09:18:02 +01:00
pythcoiner 54679343ec replace minisafe by liana 2023-05-13 18:59:49 +02:00
Antoine Poinsot c6c312a011 commands: allow to create send-to-self transactions with 'createspend' 2023-05-04 16:15:09 +02:00
Antoine Poinsot 104c6e1a09 commands: add an 'updated_at' field to listspendtxs entries 2023-04-05 12:41:03 +02:00
Antoine Poinsot d68d0e1134 commands: adapt 'createrecovery' to multiple recovery paths 2023-04-04 11:53:22 +02:00
edouard 103c1950ba Remove change_index from listspendtxs response
Multiple change indexes may be present in a spend
draft transaction and can be detected instead
in the response psbt with the bip32_derivation
outputs fields.
2022-12-20 14:00:16 +01:00
Antoine Poinsot c09ae3f87b commands, jsonrpc: add a new 'createrecovery' command
This is a new command dedicated to the recovery usecase. For now it's
dead simple: sweep all coins that are available through the recovery
path to a given address.
2022-12-09 12:27:47 +01:00
Antoine Poinsot dc61a1c3bd commands: remove discrepancy between blockheight and block_height 2022-12-07 11:42:17 +01:00
edouard 774f969594 Add listtransaction command 2022-11-22 19:31:02 +01:00
edouard 3cd709697b Add listconfirmed command 2022-11-22 19:31:02 +01:00
edouard 873a697ba4 fix: doc/API.md 2022-11-19 11:00:49 +01:00
Antoine Poinsot 073cdd0a89 commands: add a 'rescan_progress' field to 'getinfo'
We make sure to return a value as long as it was not wiped from
database, that's useful in functional tests.
2022-11-14 09:20:27 +01:00
Antoine Poinsot 7866ff46cf commands: add a new 'startrescan' command 2022-11-14 09:20:27 +01:00
Antoine Poinsot eff39ee35a rpc: a new 'broadcastspend' command 2022-10-18 19:54:03 +02:00
Antoine Poinsot 99ab0d7add commands: add a 'spend_info' field to the 'listcoins' entries 2022-10-17 11:47:42 +02:00
Antoine Poinsot 57add1d86b commands: return the DB's block height in 'getinfo'
It makes more sense than to return the Bitcoin backend's. And it's helpful to wait for sync in functional tests.
2022-10-17 11:47:41 +02:00
Antoine Poinsot 92f7ef1225 commands: make listcoins return all coins by default
We'll add some parameters to filter by status and/or outpoints later on.
But for now also list coins that were spent or are being spent.
2022-10-17 11:47:41 +02:00
Antoine Poinsot c73e8a42dd commands: add a new 'delspendtx' command 2022-10-01 14:05:27 +02:00
Antoine Poinsot d5bd10add8 commands: add a change_index field to listspendtxs entries 2022-10-01 13:40:49 +02:00
Antoine Poinsot c6e004806a commands: add a 'list_spend' command (and 'listspendtxs' RPC) 2022-10-01 13:33:08 +02:00
Antoine Poinsot 3dfc7261db jsonrpc: a new 'updatespend' RPC 2022-09-15 11:41:34 +02:00
Antoine Poinsot 7d015bcf43 jsonrpc: add a 'createspend' RPC command
Since the Spend transaction command requires some parameters, this
implements the parameter-getting logic on the JSONRPC side as well.

This allows us to implement an end-to-end functional test of the
transaction flow using an external way to broadcast it. From the input
coins creation, to the Spend transaction broadcast.
2022-09-15 11:41:33 +02:00
Antoine Poinsot 9d0c68dae3 commands: add a 'list_coins' command. 2022-08-18 12:01:27 +02:00
Antoine PoinsotandEdouard Paris 14bd3890dc doc: add an API.md documenting the JSONRPC API.
Co-Authored-By: Edouard Paris <m@edouard.paris>
2022-08-17 19:39:58 +02:00