Struct electrum_jsonrpc::Electrum[][src]

pub struct Electrum { /* fields omitted */ }
Expand description

Electrum JSON-RPC client.

Client represents methods for making json-rpc calls to Electrum daemon.

Examples


#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Electrum::new(
        "dummy_login".to_string(),
        "dummy_password".to_string(),
        "http://127.0.0.1:7000".to_string(),
    )?;

    let resp = client.get_help().await?;

    Ok(())
}

Implementations

Create new ElectrumRpc instance

List all available JSON-RPC calls

Fetch the blockchain network info

Return the balance of your wallet.

Return the transaction history of any address. Note: This is a walletless server query, results are not checked by SPV.

Return the balance of any address. Note: This is a walletless server query, results are not checked by SPV.

List wallets opened in daemon

Open wallet in daemon

Create a new wallet

List wallet addresses. Returns the list of all addresses in your wallet. Use optional arguments to filter the results

Watch an address. Every time the address changes, a http POST is sent to the URL. Call with an None URL to stop watching an address.

Restore a wallet from text. text can be a seed phrase, a master public key, a master private key, a list of bitcoin addresses or bitcoin private keys.

Sign a transaction. The wallet keys will be used unless a private key is provided.

Broadcast a transaction to the network.

Create a transaction.

Create a multi-output transaction.

Close opened wallet.

Create a payment request, using the first unused address of the wallet. The address will be considered as used after this operation. If no payment is received, the address will be considered as unused if the payment request is deleted from the wallet.

List the payment requests you made. You can combine pending, expired and paid flags for filtering.

Return current suggested fee rate (in sat/kvByte), according to config settings of electrum.

Wallet onchain history. Returns the transaction history of your wallet.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.