28 Commits

Author SHA1 Message Date
Alekos Filini
aed2414cad
Merge commit 'refs/pull/214/head' of github.com:bitcoindevkit/bdk 2020-12-07 11:57:32 +01:00
Riccardo Casatta
87eebe466f
[docs] error.rs 2020-12-05 13:25:47 +01:00
Riccardo Casatta
81519555cf
generalize impl_error! macro so that used for other errors type 2020-12-04 11:23:01 +01:00
Alekos Filini
ebfe5db0c3
[wallet] Add a flag to fill-in PSBT_GLOBAL_XPUB 2020-12-01 16:43:38 +01:00
Alekos Filini
7c80aec454
[wallet] Take both spending policies into account in create_tx
This allows specifying different "policy paths" for the internal and external
descriptors, and adds additional checks to make sure they are compatibile (i.e.
the timelocks are expressed in the same unit).

It's still suboptimal, since the `n_sequence`s are per-input and not per-transaction,
so it should be possibile to spend different inputs with different, otherwise
incompatible, `CSV` timelocks, but that requires a larger refactor that
can be done in a future patch.

This commit also tries to clarify how the "policy path" should be used by adding
a fairly detailed example to the docs.
2020-11-13 12:55:42 +01:00
Daniela Brozzoni
99060c5627
[wallet] Add Branch and Bound coin selection 2020-11-13 12:42:06 +01:00
Alekos Filini
36c5a4dc0c
[wallet] Split send_all into set_single_recipient and drain_wallet
Previously `send_all` was particularly confusing, because when used on a
`create_tx` it implied two things:
- spend everything that's in the wallet (if no utxos are specified)
- don't create a change output

But when used on a `bump_fee` it only meant to not add a change output
and instead reduce the only existing output to increase the fee.

This has now been split into two separate options that should hopefully
make it more clear to use, as described in #142.

Additionally, `TxBuilder` now has a "context", that basically allows to
make some flags available only when they are actually meaningful, either
for `create_tx` or `bump_fee`.

Closes #142.
2020-11-05 12:06:43 +01:00
Richard Ulrich
49894ffa6d
Implementing review suggestions from afilini 2020-10-22 09:11:58 +02:00
Steve Myers
aea9abff8a
[ci] Fix clippy warnings, enable clippy checks 2020-10-10 10:31:07 -07:00
Alekos Filini
c51ba4a99f
[keys] Add a way to restrict the networks in which keys are valid
Thanks to the `ToWalletDescriptor` trait we can also very easily validate the checksum
for descriptors that are loaded from strings, if they contain one. Fixes #20.
2020-09-24 09:53:51 +02:00
Alekos Filini
7065c1fed6
Write more docs 2020-09-04 11:44:49 +02:00
Alekos Filini
c0867a6adc
General cleanup for the docs 2020-08-31 15:04:27 +02:00
Alekos Filini
d61e974dbe
Add the license to every file 2020-08-31 11:48:25 +02:00
Alekos Filini
f54243fd18
[error] implement std::error::Error 2020-08-30 20:38:17 +02:00
Alekos Filini
557f7ef8c9
[wallet] Add AddressValidators 2020-08-30 20:36:25 +02:00
Alekos Filini
5777431135
Use miniscript::DescriptorPublicKey
This allows us to remove all our custom "ExtendedDescriptor" implementation since that is
now built directly in miniscript.
2020-08-30 20:36:19 +02:00
Alekos Filini
77c95b93ac
Compact Filters blockchain implementation 2020-08-30 17:23:33 +02:00
Alekos Filini
c12aa3d327
Implement RBF and add a few tests 2020-08-14 12:48:07 +02:00
Alekos Filini
53b5f23fb2
[tests] Add tests for Wallet::create_tx() 2020-08-11 11:31:11 +02:00
Alekos Filini
9e5023670e
[tests] Add a proc macro to generate tests for OnlineBlockchain types 2020-08-10 17:18:17 +02:00
Alekos Filini
499e579824
[wallet] Add a TxBuilder struct to simplify create_tx()'s interface 2020-08-06 14:28:22 +02:00
Alekos Filini
95b2cd4c32
[blockchain] add the Esplora backend 2020-05-07 15:21:54 +02:00
Alekos Filini
45aa001e10
[blockchain] add Error::OfflineClient 2020-05-06 16:50:03 +02:00
Alekos Filini
75a9c30c9a
Add a generalized "Blockchain" interface 2020-05-03 18:16:11 +02:00
Alekos Filini
f605f4b34d
Contribution improvements 2020-04-07 11:19:38 +02:00
Alekos Filini
2a7c7d5272
Policy and contribution 2020-04-07 11:17:46 +02:00
Alekos Filini
1a4e1bd96c
Wallet logic 2020-04-07 11:16:53 +02:00
Alekos Filini
4919ff148b
Move everything in the root 2020-02-07 12:27:10 +01:00