Crate monero_rpc

source ·
Expand description

Monero daemon and wallet RPC library written in asynchronous Rust.

Usage

Generate the base RpcClient with RpcClientBuilder and use the methods RpcClient::daemon, RpcClient::daemon_rpc, or RpcClient::wallet to retrieve the specialized RPC client.

On a DaemonJsonRpcClient you can call DaemonJsonRpcClient::regtest to get a RegtestDaemonJsonRpcClient instance that enables RPC call specific to regtest such as RegtestDaemonJsonRpcClient::generate_blocks.

use monero_rpc::RpcClientBuilder;

let client = RpcClientBuilder::new()
    .build("http://node.monerooutreach.org:18081")?;
let daemon = client.daemon();
let regtest_daemon = daemon.regtest();

The client can be initialized with a proxy, for example a socks5 proxy to enable Tor:

use monero_rpc::RpcClientBuilder;

let client = RpcClientBuilder::new()
    .proxy_address("socks5://127.0.0.1:9050")
    .build("http://node.monerooutreach.org:18081")?;

Re-exports

Structs

Enums

Traits

  • Get bytes and parse from str interface.