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
pub use monero;
Structs
- Return type of wallet
get_address
. - Return type of wallet
get_balance
. - Return type of daemon
on_get_block_hash
. - Return type of daemon
get_block_header
andget_block_headers_range
. - Configuration filter for
GetTransfersSelector
. - Return type of daemon
get_block_template
. - Result of
RpcClient::daemon
to interact with JSON RPC Methods on daemon. - Result of
RpcClient::daemon_rpc
to interact with methods on daemon called with their own extensions. - Return type of regtest daemon RPC
generate_blocks
- Argument type of wallet
generate_from_keys
. - Return type of wallet
get_accounts
. - Argument type of wallet
get_transfers
. - Return sub-type of wallet
get_accounts
. - Return type of wallet
get_transfer
andget_transfers
. - Wrapper type to help serializating types through string.
- Sub-type of
IncomingTransfers
. Represent one incoming transfer. - Return type of wallet
incoming_transfers
. - Helper type to partially decode
as_json
string fields in other RPC return types. - Return type of wallet
import_key_images
. - Return type of wallet
get_payments
. - Return type of wallet
refresh
. - Result of
DaemonJsonRpcClient::regtest
to enable methods for daemons in regtest mode. - Base RPC client. It is useless on its own, please see the attached methods to see how to transform it into a specialized client.
- Builder for generating a configured
RpcClient
. - Used to export and import signed key images. Return type of wallet
export_key_images
and argument type of walletimport_key_images
. - Return type of wallet
sign_transfer
. - Sub-type of
BalanceData
’s return type of walletget_balance
. - Sub-type of
AddressData
’s return type of walletget_address
. - Argument type of wallet
sweep_all
. - Return type of wallet
sweep_all
. - Sub-type of
TransactionsResponse
’s return type of daemon RPCget_transactions
. - Return type of daemon RPC
get_transactions
. - Return type of wallet
transfer
. - Argument type of wallet
transfer
. - Result of
RpcClient::wallet
to interact with a Monero wallet RPC daemon. - Return type of wallet
generate_from_keys
.
Enums
- Selector for daemon
get_block_header
. - Part of return type of wallet
get_transfers
. - Helper type to unwrap RPC results.
- Monero uses two type of private key in its cryptographic system: (1) a view key, and (2) a spend key.
- RpcAuthentication
rpc_authentication
Method of authentication to be used when connecting to an RPC endpoint. - Sub-type of
GotTransfer
. - Argument type of wallet
transfer
. - Argument type of wallet
incoming_transfers
.
Traits
- Get bytes and parse from
str
interface.