Struct electrum_jsonrpc::Electrum [−][src]
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
impl Electrum[src]
pub fn new(login: String, password: String, address: String) -> Result<Self>[src]
Create new ElectrumRpc instance
pub async fn get_help(&self) -> Result<Response<Body>>[src]
List all available JSON-RPC calls
pub async fn get_info(&self) -> Result<Response<Body>>[src]
Fetch the blockchain network info
pub async fn get_balance(&self) -> Result<Response<Body>>[src]
Return the balance of your wallet.
pub async fn list_wallets(&self) -> Result<Response<Body>>[src]
List wallets opened in daemon
pub async fn load_wallet(
&self,
wallet_path: Option<Box<Path>>,
password: Option<String>
) -> Result<Response<Body>>[src]
&self,
wallet_path: Option<Box<Path>>,
password: Option<String>
) -> Result<Response<Body>>
Open wallet in daemon
pub async fn create_wallet(&self) -> Result<Response<Body>>[src]
Create a new wallet
pub async fn list_addresses(&self) -> Result<Response<Body>>[src]
List wallet addresses. Returns the list of all addresses in your wallet. Use optional arguments to filter the results
pub async fn notify(
&self,
address: BtcAddress,
url: Option<Uri>
) -> Result<Response<Body>>[src]
&self,
address: BtcAddress,
url: Option<Uri>
) -> Result<Response<Body>>
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.
pub async fn restore_wallet(&self, text: String) -> Result<Response<Body>>[src]
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.
pub async fn close_wallet(&self) -> Result<Response<Body>>[src]
Close opened wallet.
Auto Trait Implementations
impl !RefUnwindSafe for Electrum[src]
impl Send for Electrum[src]
impl Sync for Electrum[src]
impl Unpin for Electrum[src]
impl !UnwindSafe for Electrum[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,