Crates.io | mempool_rust |
lib.rs | mempool_rust |
version | 0.1.1 |
source | src |
created_at | 2023-01-09 11:46:29.134359 |
updated_at | 2023-01-09 17:31:44.556097 |
description | A Rust library for the Mempool bitcoin API |
homepage | |
repository | https://github.com/0xtlt/mempool_rust |
max_upload_size | |
id | 754357 |
size | 13,641 |
⚠️: The library is under development, it is still missing a lot of features that will come soon. ⚠️
An ergonomic, Mempool API Client for Rust.
[dependencies]
tokio = { version = "1.0", features = ["full"] }
mempool_rust = "0.1"
And then the code:
use mempool_rust::MempoolClient;
#[tokio::main]
async fn main() {
let client = MempoolClient::new(
"https://mempool.space",
None,
)
.unwrap();
// OR with tor
let client = MempoolClient::new(
"http://url.onion",
Some("socks5h://127.0.0.1:9050"),
)
.unwrap();
let blocks = client.get_blocks(None).await.unwrap();
println!("{:#?}", blocks);
}
Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)