Crate monero_rpc

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§

AccountCreation
Return type of create_wallet.
AddressData
Return type of wallet get_address.
BalanceData
Return type of wallet get_balance.
BlockHash
Return type of daemon on_get_block_hash.
BlockHeaderResponse
Return type of daemon get_block_header and get_block_headers_range.
BlockHeightFilter
Configuration filter for GetTransfersSelector.
BlockTemplate
Return type of daemon get_block_template.
DaemonJsonRpcClient
Result of RpcClient::daemon to interact with JSON RPC Methods on daemon.
DaemonRpcClient
Result of RpcClient::daemon_rpc to interact with methods on daemon called with their own extensions.
Destination
Destinations for GetTransferCategory::Out : true
GenerateBlocksResponse
Return type of regtest daemon RPC generate_blocks
GenerateFromKeysArgs
Argument type of wallet generate_from_keys.
GetAccountsData
Return type of wallet get_accounts.
GetTransfersSelector
Argument type of wallet get_transfers.
GotAccount
Return sub-type of wallet get_accounts.
GotTransfer
Return type of wallet get_transfer and get_transfers.
HashString
Wrapper type to help serializating types through string.
IncomingTransfer
Sub-type of IncomingTransfers. Represent one incoming transfer.
IncomingTransfers
Return type of wallet incoming_transfers.
JsonTransaction
Helper type to partially decode as_json string fields in other RPC return types.
KeyImageImportResponse
Return type of wallet import_key_images.
Payment
Return type of wallet get_payments.
RefreshData
Return type of wallet refresh.
RegtestDaemonJsonRpcClient
Result of DaemonJsonRpcClient::regtest to enable methods for daemons in regtest mode.
RestoreDeterministicWalletArgs
Argument type of wallet restore_deterministic_wallet.
RpcClient
Base RPC client. It is useless on its own, please see the attached methods to see how to transform it into a specialized client.
RpcClientBuilder
Builder for generating a configured RpcClient.
SignedKeyImage
Used to export and import signed key images. Return type of wallet export_key_images and argument type of wallet import_key_images.
SignedTransferOutput
Return type of wallet sign_transfer.
SubaddressBalanceData
Sub-type of BalanceData’s return type of wallet get_balance.
SubaddressData
Sub-type of AddressData’s return type of wallet get_address.
SweepAllArgs
Argument type of wallet sweep_all.
SweepAllData
Return type of wallet sweep_all.
Transaction
Sub-type of TransactionsResponse’s return type of daemon RPC get_transactions.
TransactionsResponse
Return type of daemon RPC get_transactions.
TransferData
Return type of wallet transfer.
TransferOptions
Argument type of wallet transfer.
TxProofOutput
Return type of check_tx_proof.
WalletClient
Result of RpcClient::wallet to interact with a Monero wallet RPC daemon.
WalletCreation
Return type of wallet generate_from_keys.
WalletRestoration
Return type of wallet restore_deterministic_wallet.

Enums§

GetBlockHeaderSelector
Selector for daemon get_block_header.
GetTransfersCategory
Part of return type of wallet get_transfers.
MoneroResult
Helper type to unwrap RPC results.
PrivateKeyType
Monero uses two type of private key in its cryptographic system: (1) a view key, and (2) a spend key.
RpcAuthenticationrpc_authentication
Method of authentication to be used when connecting to an RPC endpoint.
TransferHeight
Sub-type of GotTransfer.
TransferPriority
Argument type of wallet transfer.
TransferType
Argument type of wallet incoming_transfers.

Traits§

HashType
Get bytes and parse from str interface.