#bitcoin #rpc #client #api


Throttled Bitcoin RPC API client for Rust

3 releases

0.1.2 Feb 8, 2019
0.1.1 Jan 24, 2019
0.1.0 Jan 24, 2019
Download history 21/week @ 2019-01-19 3/week @ 2019-01-26 6/week @ 2019-02-02

11 downloads per month


657 lines

Throttled Bitcoin RPC Client

This crate started as a fork of JeanDudey's Bitcoin RPC client, but has since been almost entirely rewritten.

This crate implements an Bitcoin RPC client in Rust, it does not intend to be a complete implementation of all the bitcoin rpc methods so if you need some method you can create a pull request for it.


Works with LTC and DOGE using relevant compiler flags.


Add this to your Cargo.toml:

throttled_bitcoin_rpc = "0.1.0"

And this to your crate root:

extern crate throttled_bitcoin_rpc;

Example: Connecting to bitcoin rpc server

extern crate throttled_bitcoin_rpc;

use throttled_bitcoin_rpc::BitcoinRpcClient;

fn main() {
    let client = BitcoinRpcClient::new(
        3, // max number of concurrent requests
        10, // max number of requests per second
        1000, // max size of batched requests

    let block_count = match client.getblockcount().unwrap();

    println!("Block count: {}", block_count);
    let txs = vec![
    use throttled_bitcoin_rpc::BatchRequest;
    let mut batcher = client::batcher::<String>();
    for txid in txs {
        batcher.getrawtransaction(txid.to_owned(), false).unwrap();
    println!("Raw TxData: {:?}", batcher.send().unwrap());


~307K SLoC