Commit Graph
195 Commits
Author SHA1 Message Date
Riccardo Casatta 6d1d5d5f57 use electurm-client updated 2020-11-30 13:25:23 +01:00
Riccardo Casatta c9079a7292 Allow to set concurrency in Esplora config and optionally pass it in repl 2020-11-18 11:55:20 +01:00
Riccardo Casatta 4c59809f8e Make esplora call in parallel 2020-11-18 11:08:19 +01:00
Riccardo Casatta ae16c8b602 fix typo 2020-11-18 09:27:01 +01:00
Riccardo Casatta b79fa27aa4 Remove unused varaint HeaderParseFail 2020-11-17 18:54:34 +01:00
Riccardo Casatta 42480ea37b Bring less data around 2020-11-17 16:38:19 +01:00
Riccardo Casatta 02c0ad2fca eagerly unwrap height option, save one collect 2020-11-17 16:37:10 +01:00
Riccardo Casatta 16fde66c6a use flatten instead of unwrap_or 2020-11-17 15:24:26 +01:00
Riccardo Casatta 2844ddec63 avoid a max() call by checking minus or equal 2020-11-17 15:20:33 +01:00
Riccardo Casatta 7a58d3dd7a Use filter_map instead of filter and map 2020-11-17 15:16:18 +01:00
Riccardo Casatta 4d1617f4e0 use proper type for EsploraHeader, make conversion to BlockHeader infallible 2020-11-17 15:08:04 +01:00
Riccardo Casatta 2f39a19b01 Use our Instant struct to be compatible with wasm 2020-11-17 14:25:27 +01:00
Riccardo Casatta c5dba115a0 [sync] Improve sync
Make every request in batch, to save round trip times
Fetch timestamp of blockheader to populate timestamp field in transaction
Remove listunspent requests because we can compute it from our history
2020-11-17 09:39:43 +01:00
Steve Myers 4f7355ec82 [ci] Fix all-keys and cli-utils tests 2020-10-28 21:34:04 -07:00
Alekos Filini 0caad5f3d9 [blockchain] Fix receiving a coinbase using Electrum/Esplora
Closes #107
2020-10-13 11:56:59 +02:00
Steve Myers aea9abff8a [ci] Fix clippy warnings, enable clippy checks 2020-10-10 10:31:07 -07:00
Alekos Filini 5b0fd3bba0 [blockchain] Document AnyBlockchain and ConfigurableBlockchain 2020-09-15 15:38:59 +02:00
Alekos Filini e5cc8d9529 [blockchain] Add an AnyBlockchain enum to allow switching at runtime
This is related to #43
2020-09-15 12:03:07 +02:00
Alekos Filini 5eee18bed2 [blockchain] Add a trait to create Blockchains from a configuration
This is the first set of changes for #42
2020-09-15 12:03:04 +02:00
Alekos Filini d7ee38cc52 Rename the library to bdk 2020-09-14 15:13:43 -07:00
Alekos Filini efdd11762c [blockchain] Simplify the architecture of blockchain traits
Instead of having two traits, `Blockchain` and `OnlineBlockchain` that need
to be implemented by the user, only the relevant one (`OnlineBlockchain`, here
renamed to `Blockchain`) will need to be implemented, since we provide a
blanket implementation for the "marker" trait (previously `Blockchain`, here
renamed to `BlockchainMarker`).

Users of the library will probably never need to implement `BlockchainMarker`
by itself, since we expose the `OfflineBlockchain` type that already does
that and should be good for any "offline" wallet. Still, it's exposed since
they might need to import it to define types with generics.
2020-09-10 10:45:07 +02:00
LLFourn 6a2d0db674 Remove assumed "/api" prefix from esplora
It is not necessary that esplora is hosted with a /api prefix
2020-09-05 14:00:50 +10:00
Alekos Filini 7b58a4ad6f Fix the last_derivation_index calculation
It should be set to `0` if not transactions are found during sync.

Closes #44
2020-09-04 21:53:31 +02:00
Alekos Filini 43cb0331bf Rename the crate to just "magical" 2020-09-04 17:01:33 +02:00
Alekos Filini 7065c1fed6 Write more docs 2020-09-04 11:44:49 +02:00
Alekos Filini 6b9c363937 Write the docs for blockchain::* 2020-09-03 11:36:07 +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 895c6b0808 [blockchain] impl OnlineBlockchain for types wrapped in Arc 2020-08-30 20:38:14 +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 ddc2bded99 [compact_filters] Add support for Tor 2020-08-30 17:24:04 +02:00
Alekos Filini 77c95b93ac Compact Filters blockchain implementation 2020-08-30 17:23:33 +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 c90c752f21 [wallet] Add force_non_witness_utxo() to TxBuilder 2020-08-10 17:18:15 +02:00
Alekos Filini 8d9ccf8d0b [wallet] Allow limiting the use of internal utxos in TxBuilder 2020-08-10 17:18:13 +02:00
Alekos Filini 08792b2fcd [wallet] Add a type convert fee units, add Wallet::estimate_fee() 2020-08-07 11:23:46 +02:00
Alekos Filini 0954049df0 [wallet] Cleanup, remove unnecessary mutable references 2020-08-06 14:28:12 +02:00
Alekos Filini 4fcf7ac89e Make the blockchain interface async again on wasm32-unknown-unknown
The procedural macro `#[maybe_async]` makes a method or every method of a trait
"async" whenever the target_arch is `wasm32`, and leaves them untouched on
every other platform.

The macro `maybe_await!($e:expr)` can be used to call `maybe_async` methods on
multi-platform code: it expands to `$e` on non-wasm32 platforms and to
`$e.await` on wasm32.

The macro `await_or_block!($e:expr)` can be used to contain async code as much
as possible: it expands to `tokio::runtime::Runtime::new().unwrap().block_on($e)`
on non-wasm32 platforms, and to `$e.await` on wasm32.
2020-07-20 20:02:24 +02:00
Alekos Filini 123984e99d Remove async, upgrade electrum-client 2020-07-17 09:44:01 +02:00
Alekos Filini ea62337f0d [database] Replace DerivationPaths with single u32s 2020-06-30 15:21:14 +02:00
Alekos Filini 0cc9e1cdea [blockchain] Use async I/O in the various blockchain impls 2020-05-07 17:36:45 +02:00
Alekos Filini 95b2cd4c32 [blockchain] add the Esplora backend 2020-05-07 15:21:54 +02:00
Alekos Filini e32559a06a [wallet] Add an option to change the assumed current height 2020-05-06 17:17:14 +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