brk_client
Rust client for the Bitcoin Research Kit API.
crates.io | docs.rs
AI clients can use the same API through the official stateless, read-only MCP
endpoint at mcp.bitview.space. No authentication
is required.
Installation
[dependencies]
brk_client = "0.1"
Quick Start
use brk_client::{BrkClient, Index};
fn main() -> brk_client::Result<()> {
let client = BrkClient::new("http://localhost:3110");
let block = client.get_block_by_height(800000)?;
let tx = client.get_tx("a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d")?;
let address = client.get_address("bc1q...")?;
let prices = client.metrics()
.price.usd.split.close
.by.dateindex()
.range(Some(-30), None)?;
let data = client.get_metric(
"price_close".into(),
Index::DateIndex,
Some(-30), None, None, None,
)?;
Ok(())
}
Configuration
use brk_client::{BrkClient, BrkClientOptions};
let client = BrkClient::with_options(BrkClientOptions {
base_url: "http://localhost:3110".to_string(),
timeout_secs: 60,
});