Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ dependencies = [
"bitcoin",
"bitreq",
"electrsd",
"esplora-types",
"hex-conservative 0.2.2",
"log",
"native-tls",
Expand All @@ -406,6 +407,14 @@ dependencies = [
"tokio",
]

[[package]]
name = "esplora-types"
version = "0.1.0"
dependencies = [
"bitcoin",
"serde",
]

[[package]]
name = "fastrand"
version = "2.1.1"
Expand Down Expand Up @@ -972,9 +981,9 @@ dependencies = [

[[package]]
name = "spin"
version = "0.9.2"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5"
checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"

[[package]]
name = "subtle"
Expand Down
9 changes: 9 additions & 0 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ dependencies = [
"bitcoin",
"bitreq",
"electrsd",
"esplora-types",
"hex-conservative",
"log",
"native-tls",
Expand All @@ -332,6 +333,14 @@ dependencies = [
"tokio",
]

[[package]]
name = "esplora-types"
version = "0.1.0"
dependencies = [
"bitcoin",
"serde",
]

[[package]]
name = "fastrand"
version = "2.4.1"
Expand Down
95 changes: 4 additions & 91 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,94 +1,7 @@
[package]
name = "esplora-client"
version = "0.13.0"
edition = "2021"
authors = [
"Alekos Filini <alekos.filini@gmail.com>",
"Bitcoin Dev Kit Developers"
]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/bitcoindevkit/rust-esplora-client"
repository = "https://github.com/bitcoindevkit/rust-esplora-client"
documentation = "https://docs.rs/esplora-client/"
description = "Asynchronous and blocking clients and types for interacting with Esplora servers over HTTP"
keywords = ["bitcoin", "esplora"]
readme = "README.md"
rust-version = "1.75.0" # MSRV
[workspace]
members = ["esplora-client", "esplora-types"]
resolver = "2"

[lib]
name = "esplora_client"
path = "src/lib.rs"

[dependencies]
serde = { version = "1.0.194", features = ["derive"] }
serde_json = { version = "1.0.117", features = ["std"], default-features = false }
bitcoin = { version = "0.32", features = ["serde", "std"], default-features = false }
hex = { version = "0.2.2", package = "hex-conservative" }
bitreq = { version = "0.3.7", optional = true }
# Default runtime when running async tests
tokio = { version = "1", features = ["time"], optional = true }

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
electrsd = { version = "0.40.0", default-features = false, features = ["legacy", "esplora_a33e97e1", "bitcoind_download", "bitcoind_29_0"] }
# These pins are needed for `Cargo-minimal.lock`:
tar = { version = "0.4.45" } # blame: electrsd v0.38.0 -> bitcoind -> tar
log = { version = "0.4.29" } # blame: electrsd v0.38.0 -> bitcoind -> corepc_client
openssl-sys = { version = "0.9.114" } # blame: bitreq v0.3.5 -> native-tls -> openssl
openssl = { version = "0.10.78" } # blame: match `openssl-sys`
native-tls = { version = "0.2.11" } # blame: bitreq v0.3.5 -> native-tls
tempfile = { version = "=3.15.0" } # blame: tempfile >=v3.16 requires getrandom >=v0.3
security-framework = { version = "=2.11.1" } # blame: rustls-native-certs 0.8.3 → security-framework 3.x (edition2024)

[features]
default = ["blocking", "blocking-https", "async", "async-https", "tokio"]

tokio = ["dep:tokio"]
async = ["bitreq/async", "bitreq/proxy", "bitreq/json-using-serde", "tokio?/time"]
async-https = ["async", "bitreq/async-https"]
async-https-native = ["async", "bitreq/async-https-native-tls"]
async-https-rustls = ["async", "bitreq/async-https-rustls"]
async-https-rustls-probe = ["async", "bitreq/async-https-rustls-probe"]

blocking = ["bitreq/proxy", "bitreq/json-using-serde"]
blocking-https = ["blocking", "bitreq/https"]
blocking-https-native = ["blocking", "bitreq/https-native-tls"]
blocking-https-rustls = ["blocking", "bitreq/https-rustls"]
blocking-https-rustls-probe = ["blocking", "bitreq/https-rustls-probe"]

[package.metadata.rbmt.toolchains]
[workspace.metadata.rbmt.toolchains]
stable = "1.96.1"
nightly = "nightly-2026-07-03"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.rbmt.lint]
allowed_duplicates = [
"getrandom",
"windows-sys",
"wit-bindgen",
]

[package.metadata.rbmt.test]
# Don't test these features in isolation
exclude_features = [
"tokio",
"async-https",
"async-https-native",
"async-https-rustls",
"async-https-rustls-probe",
"blocking-https",
"blocking-https-native",
"blocking-https-rustls",
"blocking-https-rustls-probe",
]
# Run tests using these exact feature sets
exact_features = [
["async", "blocking"],
["async-https", "blocking-https", "tokio"],
["async-https-native", "blocking-https-native", "tokio"],
["async-https-rustls", "blocking-https-rustls", "tokio"],
["async-https-rustls-probe", "blocking-https-rustls-probe", "tokio"],
]
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# rust-esplora-client

<p>
<a href="https://crates.io/crates/esplora-client"><img src="https://img.shields.io/crates/v/esplora-client.svg"/></a>
<a href="https://docs.rs/esplora-client"><img src="https://img.shields.io/badge/docs.rs-esplora--client-blue"/></a>
<a href="https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html"><img src="https://img.shields.io/badge/MSRV-1.75.0%2B-orange.svg"/></a>
<a href="https://github.com/bitcoindevkit/rust-esplora-client/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT%2FApache--2.0-red.svg"/></a>
<a href="https://github.com/bitcoindevkit/rust-esplora-client/actions/workflows/rust.yml"><img src="https://github.com/bitcoindevkit/rust-esplora-client/actions/workflows/rust.yml/badge.svg"></a>
</p>

Asynchronous and blocking clients and types for interacting with Esplora servers over HTTP.

## Crates in this repository

This is a Cargo workspace containing two crates:

| Crate | Description | Badges |
|---|---|---|
| [`esplora-client`](./esplora-client) | Blocking and async HTTP clients for the Esplora API. | [![Crate Info](https://img.shields.io/crates/v/esplora-client.svg)](https://crates.io/crates/esplora-client) [![API Docs](https://img.shields.io/badge/docs.rs-esplora--client-blue)](https://docs.rs/esplora-client) |
| [`esplora-types`](./esplora-types) | The Esplora request/response types, with no HTTP client dependency. | [![Crate Info](https://img.shields.io/crates/v/esplora-types.svg)](https://crates.io/crates/esplora-types) [![API Docs](https://img.shields.io/badge/docs.rs-esplora--types-blue)](https://docs.rs/esplora-types) |

`esplora-client` re-exports every `esplora-types` item under its own top level and under `esplora_client::api`, so existing code that imports from `esplora-client` alone continues to work unchanged.

## Developing

This project uses [`just`](https://github.com/casey/just) for command running, and
Expand Down Expand Up @@ -45,7 +54,7 @@ Available recipes:

## Minimum Supported Rust Version

This library should compile with any combination of features on Rust 1.75.0.
Both crates in this workspace should compile with any combination of features on Rust 1.75.0.

To build with the MSRV toolchain, copy `Cargo-minimal.lock` to `Cargo.lock`.

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md → esplora-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Changed

* feat: split types into a new `esplora-types` crate, re-exported as `esplora_client::api` [#XXX]
* chore!: remove deprecated `BlockSummary` and `get_block` [#225]

### Fixed
Expand Down
91 changes: 91 additions & 0 deletions esplora-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[package]
name = "esplora-client"
version = "0.13.0"
edition = "2021"
authors = [
"Alekos Filini <alekos.filini@gmail.com>",
"Bitcoin Dev Kit Developers"
]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/bitcoindevkit/rust-esplora-client"
repository = "https://github.com/bitcoindevkit/rust-esplora-client"
documentation = "https://docs.rs/esplora-client/"
description = "Asynchronous and blocking clients and types for interacting with Esplora servers over HTTP"
keywords = ["bitcoin", "esplora"]
readme = "README.md"
rust-version = "1.75.0" # MSRV

[lib]
name = "esplora_client"
path = "src/lib.rs"

[dependencies]
esplora-types = { path = "../esplora-types", version = "0.1.0" }
serde = { version = "1.0.194", features = ["derive"] }
serde_json = { version = "1.0.117", features = ["std"], default-features = false }
bitcoin = { version = "0.32", features = ["serde", "std"], default-features = false }
hex = { version = "0.2.2", package = "hex-conservative" }
bitreq = { version = "0.3.7", optional = true }
# Default runtime when running async tests
tokio = { version = "1", features = ["time"], optional = true }

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
electrsd = { version = "0.40.0", default-features = false, features = ["legacy", "esplora_a33e97e1", "bitcoind_download", "bitcoind_29_0"] }
# These pins are needed for `Cargo-minimal.lock`:
tar = { version = "0.4.45" } # blame: electrsd v0.38.0 -> bitcoind -> tar
log = { version = "0.4.29" } # blame: electrsd v0.38.0 -> bitcoind -> corepc_client
openssl-sys = { version = "0.9.114" } # blame: bitreq v0.3.5 -> native-tls -> openssl
openssl = { version = "0.10.78" } # blame: match `openssl-sys`
native-tls = { version = "0.2.11" } # blame: bitreq v0.3.5 -> native-tls
tempfile = { version = "=3.15.0" } # blame: tempfile >=v3.16 requires getrandom >=v0.3
security-framework = { version = "=2.11.1" } # blame: rustls-native-certs 0.8.3 → security-framework 3.x (edition2024)

[features]
default = ["blocking", "blocking-https", "async", "async-https", "tokio"]

tokio = ["dep:tokio"]
async = ["bitreq/async", "bitreq/proxy", "bitreq/json-using-serde", "tokio?/time"]
async-https = ["async", "bitreq/async-https"]
async-https-native = ["async", "bitreq/async-https-native-tls"]
async-https-rustls = ["async", "bitreq/async-https-rustls"]
async-https-rustls-probe = ["async", "bitreq/async-https-rustls-probe"]

blocking = ["bitreq/proxy", "bitreq/json-using-serde"]
blocking-https = ["blocking", "bitreq/https"]
blocking-https-native = ["blocking", "bitreq/https-native-tls"]
blocking-https-rustls = ["blocking", "bitreq/https-rustls"]
blocking-https-rustls-probe = ["blocking", "bitreq/https-rustls-probe"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.rbmt.lint]
allowed_duplicates = [
"getrandom",
"windows-sys",
"wit-bindgen",
]

[package.metadata.rbmt.test]
# Don't test these features in isolation
exclude_features = [
"tokio",
"async-https",
"async-https-native",
"async-https-rustls",
"async-https-rustls-probe",
"blocking-https",
"blocking-https-native",
"blocking-https-rustls",
"blocking-https-rustls-probe",
]
# Run tests using these exact feature sets
exact_features = [
["async", "blocking"],
["async-https", "blocking-https", "tokio"],
["async-https-native", "blocking-https-native", "tokio"],
["async-https-rustls", "blocking-https-rustls", "tokio"],
["async-https-rustls-probe", "blocking-https-rustls-probe", "tokio"],
]
5 changes: 5 additions & 0 deletions esplora-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Esplora Client

Asynchronous and blocking clients for interacting with Esplora servers over HTTP.

See [`esplora-types`](../esplora-types) if you only need the request/response types, with no HTTP client dependency.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib.rs → esplora-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ use std::time::Duration;
#[cfg(feature = "async")]
pub use r#async::Sleeper;

pub mod api;
pub use esplora_types as api;
#[cfg(feature = "async")]
pub mod r#async;
#[cfg(feature = "blocking")]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the testenv specific to the esplora clients? If it isn't or doesn't have to be can it be shared somehow between the esplora-client and future mempoolspace-client tests? Don't need to change anything right now but something to think about for a future PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed testenv isn't Esplora-specific, and it'd make sense to share it once mempool-client gets its own tests. I'll factor that in when I open that PR.

File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions esplora-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "esplora-types"
version = "0.1.0"
edition = "2021"
authors = [
"Alekos Filini <alekos.filini@gmail.com>",
"Bitcoin Dev Kit Developers"
]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/bitcoindevkit/rust-esplora-client"
repository = "https://github.com/bitcoindevkit/rust-esplora-client"
documentation = "https://docs.rs/esplora-types/"
description = "Shared types for interacting with Esplora-compliant servers"
keywords = ["bitcoin", "esplora"]
readme = "README.md"
rust-version = "1.75.0" # MSRV

[lib]
name = "esplora_types"

[dependencies]
serde = { version = "1.0.194", features = ["derive"] }
bitcoin = { version = "0.32", features = ["serde"], default-features = false }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

8 changes: 8 additions & 0 deletions esplora-types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Esplora Types

Shared, transport-agnostic types and deserializers for the
[Esplora API](https://github.com/Blockstream/esplora/blob/master/API.md).

This crate has no HTTP client dependency. See
[`esplora-client`](../esplora-client) for a blocking and async HTTP client
built on these types.
8 changes: 5 additions & 3 deletions src/api.rs → esplora-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// SPDX-License-Identifier: MIT OR Apache-2.0

//! # Esplora API
//! # Esplora Types
//!
//! This module implements the types and deserializers
//! needed to interact with an Esplora-compliant server.
//! Shared, transport-agnostic types and deserializers for interacting with
//! an Esplora-compliant server. This crate has no HTTP client dependency;
//! see [`esplora-client`](https://docs.rs/esplora-client) for a blocking and
//! async HTTP client built on these types.
//!
//! Refer to the [Esplora API] specification for the complete API reference.
//!
Expand Down
Loading