| Crates.io | brk_client |
| lib.rs | brk_client |
| version | 0.1.0-beta.0 |
| created_at | 2026-01-04 10:59:48.510158+00 |
| updated_at | 2026-01-25 13:28:25.728035+00 |
| description | Rust client for the Bitcoin Research Kit API |
| homepage | https://bitcoinresearchkit.org |
| repository | https://github.com/bitcoinresearchkit/brk |
| max_upload_size | |
| id | 2021720 |
| size | 340,781 |
Rust client for the Bitcoin Research Kit API.
[dependencies]
brk_client = "0.1"
use brk_client::{BrkClient, Index};
fn main() -> brk_client::Result<()> {
let client = BrkClient::new("http://localhost:3110");
// Blockchain data (mempool.space compatible)
let block = client.get_block_by_height(800000)?;
let tx = client.get_tx("abc123...")?;
let address = client.get_address("bc1q...")?;
// Metrics API - typed, chainable
let prices = client.metrics()
.price.usd.split.close
.by.dateindex()
.range(Some(-30), None)?; // Last 30 days
// Generic metric fetching
let data = client.get_metric(
"price_close".into(),
Index::DateIndex,
Some(-30), None, None, None,
)?;
Ok(())
}
use brk_client::{BrkClient, BrkClientOptions};
let client = BrkClient::with_options(BrkClientOptions {
base_url: "http://localhost:3110".to_string(),
timeout_secs: 60,
});