pub struct Client(/* private fields */);

Implementations§

source§

impl Client

source

pub fn new(url: String) -> Self

source

pub fn new_with_config(config: JsonRPCConfig) -> Self

source

pub fn rpc_call<Response>( &self, method: &str, params: &[Value] ) -> Result<Response, Error>where Response: for<'a> Deserialize<'a> + Debug,

Trait Implementations§

source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl JsonRPCClient for Client

source§

fn call<T: for<'a> Deserialize<'a> + Debug>( &self, method: &str, params: &[Value] ) -> Result<T, Error>

Calls a method on the client Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> FlorestaRPC for Twhere T: JsonRPCClient,

source§

fn find_tx_out( &self, tx_id: Txid, outpoint: u32, script: String, height_hint: u32 ) -> Result<Value, Error>

Finds an specific utxo in the chain Read more
source§

fn add_node(&self, node: String) -> Result<bool, Error>

Tells florestad to connect with a peer Read more
source§

fn stop(&self) -> Result<bool, Error>

Stops the florestad process Read more
source§

fn rescan(&self, rescan: u32) -> Result<bool, Error>

Trigger a rescan of the wallet Read more
source§

fn get_roots(&self) -> Result<Vec<String, Global>, Error>

Gets the current accumulator for the chain we’re on Read more
source§

fn get_block(&self, hash: BlockHash) -> Result<GetBlockRes, Error>

Returns a block, given a block hash Read more
source§

fn get_height(&self) -> Result<u32, Error>

Returns the current height of the blockchain
source§

fn get_tx_out(&self, tx_id: Txid, outpoint: u32) -> Result<Value, Error>

Return a cached transaction output Read more
source§

fn get_tx_proof(&self, tx_id: Txid) -> Result<Vec<String, Global>, Error>

Returns the proof that one or more transactions were included in a block Read more
source§

fn get_peer_info(&self) -> Result<Vec<PeerInfo, Global>, Error>

Gets information about the peers we’re connected with Read more
source§

fn get_block_hash(&self, height: u32) -> Result<BlockHash, Error>

Returns the hash of the block at the given height Read more
source§

fn get_transaction( &self, tx_id: Txid, verbosity: Option<bool> ) -> Result<Value, Error>

Gets a transaction from the blockchain Read more
source§

fn load_descriptor(&self, descriptor: String) -> Result<bool, Error>

Loads up a descriptor into the wallet Read more
source§

fn get_block_filter(&self, heigth: u32) -> Result<String, Error>

Get the BIP158 filter for a given block height Read more
source§

fn get_block_header(&self, hash: BlockHash) -> Result<Header, Error>

Returns the block header for the given block hash Read more
source§

fn get_blockchain_info(&self) -> Result<GetBlockchainInfoRes, Error>

Returns general information about the chain we are on Read more
source§

fn send_raw_transaction(&self, tx: String) -> Result<Txid, Error>

Sends a hex-encoded transaction to the network Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.