2 releases
| 0.1.1 | Sep 30, 2025 |
|---|---|
| 0.1.0 | Sep 29, 2025 |
#70 in #fuzzing
24 downloads per month
42KB
863 lines
bitcoin-rpc-conversions - Bitcoin RPC Type Conversions
This crate provides type conversion utilities for mapping Bitcoin Core JSON-RPC types to appropriate Rust types.
Features
- Categorizes Bitcoin Core JSON-RPCs into Rust types
- Maps Bitcoin-specific types to rust-bitcoin primitives (
bitcoin::Txid,bitcoin::BlockHash,bitcoin::Amount,bitcoin::Address)
Usage
Add this to your Cargo.toml:
[dependencies]
bitcoin-rpc-conversions = "0.1.0"
Example
use bitcoin_rpc_conversions::{BitcoinRpcType, TypeRegistry};
let category = TypeRegistry::categorize("string", "txid");
assert_eq!(category, BitcoinRpcType::BitcoinTxid);
assert_eq!(category.to_rust_type(), "bitcoin::Txid");
License
MIT or Apache-2.0
bitcoin-rpc-conversions
A Rust crate for converting Bitcoin RPC types to appropriate Rust types.
Usage
[dependencies]
bitcoin-rpc-conversions = "0.1.0"
Example
use bitcoin_rpc_conversions::{BitcoinRpcType, TypeRegistry};
let category = TypeRegistry::categorize("string", "txid");
assert_eq!(category, BitcoinRpcType::BitcoinTxid);
assert_eq!(category.to_rust_type(), "bitcoin::Txid");
License
MIT OR Apache-2.0
Related Projects
Part of the bitcoin-rpc crate ecosystem, providing type-safe Rust primitives for testing and development at the Bitcoin Core JSON-RPC interface.
Dependencies
~8MB
~122K SLoC