Struct bitcoind_json_rpc_client::client_sync::v24::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.

Implementations§

source§

impl Client

source

pub fn new(url: &str) -> Self

Creates a client to a bitcoind JSON-RPC server without authentication.

source

pub fn new_with_auth(url: &str, auth: Auth) -> Result<Self>

Creates a client to a bitcoind JSON-RPC server without authentication.

source

pub fn call<T: for<'a> Deserialize<'a>>( &self, method: &str, args: &[Value], ) -> Result<T>

Call an RPC method with given args list.

source§

impl Client

source§

impl Client

source

pub fn best_block_hash(&self) -> Result<BlockHash>

Gets the blockhash of the current chain tip.

source

pub fn get_best_block_hash(&self) -> Result<GetBestBlockHash>

source§

impl Client

source

pub fn get_block(&self, hash: &BlockHash) -> Result<Block>

Gets a block by blockhash.

source

pub fn get_block_verbosity_zero( &self, hash: &BlockHash, ) -> Result<GetBlockVerbosityZero>

source

pub fn get_block_verbosity_one( &self, hash: &BlockHash, ) -> Result<GetBlockVerbosityOne>

source§

impl Client

source

pub fn get_tx_out(&self, txid: Txid, vout: u64) -> Result<GetTxOut>

source§

impl Client

source

pub fn stop(&self) -> Result<String>

source§

impl Client

source

pub fn generate_to_address( &self, nblocks: usize, address: &Address, ) -> Result<GenerateToAddress>

source§

impl Client

source

pub fn server_version(&self) -> Result<usize>

Returns the server version field of GetNetworkInfo.

source

pub fn get_network_info(&self) -> Result<GetNetworkInfo>

source§

impl Client

source

pub fn check_expected_server_version(&self) -> Result<()>

Checks that the JSON-RPC endpoint is for a bitcoind instance with the expected version.

source§

impl Client

source§

impl Client

source

pub fn create_wallet(&self, wallet: &str) -> Result<CreateWallet>

source§

impl Client

source

pub fn unload_wallet(&self, wallet: &str) -> Result<UnloadWallet>

source§

impl Client

source

pub fn load_wallet(&self, wallet: &str) -> Result<LoadWallet>

source§

impl Client

source§

impl Client

source§

impl Client

source

pub fn new_address(&self) -> Result<Address>

Gets a new address from bitcoind and parses it assuming its correct.

source

pub fn new_address_with_type(&self, ty: AddressType) -> Result<Address>

Gets a new address from bitcoind and parses it assuming its correct.

source

pub fn get_new_address(&self) -> Result<GetNewAddress>

source

pub fn get_new_address_with_type( &self, ty: AddressType, ) -> Result<GetNewAddress>

source§

impl Client

source

pub fn send_to_address( &self, address: &Address<NetworkChecked>, amount: Amount, ) -> Result<Txid>

source§

impl Client

Trait Implementations§

source§

impl Debug for Client

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Client

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 T
where 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 T
where 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 T
where 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.