#blockchain #pactus #json-rpc

pactus-jsonrpc

Rust client for interacting with the Pactus blockchain via JSON-RPC

3 stable releases

new 1.10.1 Oct 30, 2025
1.10.0 Oct 27, 2025
1.9.4 Oct 2, 2025
1.9.3 Oct 1, 2025

#735 in Magic Beans

Download history 279/week @ 2025-10-01 24/week @ 2025-10-08 22/week @ 2025-10-15 99/week @ 2025-10-22

424 downloads per month

MIT license

88KB
756 lines

Pactus JSON-RPC Client

A Rust client library for interacting with the Pactus blockchain via JSON-RPC.

Example

use jsonrpsee::http_client::HttpClient;
use pactus_jsonrpc::pactus::PactusOpenRPC;

#[tokio::main]
async fn main() {
    let client = HttpClient::builder().build("http://127.0.0.1:8545").unwrap();
    let rpc: PactusOpenRPC<HttpClient> = PactusOpenRPC::new(client);

    let info = rpc.pactus_blockchain_get_blockchain_info().await.unwrap();
    println!("get_blockchain_info Response: {:?}", info);
}

pactus-jsonrpc

Rust client for interacting with the Pactus blockchain via JSON-RPC.

Installation

cargo add pactus-jsonrpc

Usage

use jsonrpsee::http_client::HttpClient;
use pactus_jsonrpc::pactus::PactusOpenRPC;

#[tokio::main]
async fn main() {
    let client = HttpClient::builder().build("http://127.0.0.1:8545").unwrap();
    let rpc: PactusOpenRPC<HttpClient> = PactusOpenRPC::new(client);

    let info = rpc.pactus_blockchain_get_blockchain_info().await.unwrap();
    println!("get_blockchain_info Response: {:?}", info);
}

Dependencies

~11–24MB
~283K SLoC