Struct bitcoind_json_rpc_regtest::Client
source · pub struct Client { /* private fields */ }
Available on crate feature
26_0
only.Expand description
The version specific client and json types.
THIS IS AVAILABLE FOR ALL VERSION NUMBER FEATURES (eg 25_0
, 24_2
etc). This crate is
unusual in that it expects exactly one version number feature to be selected, docs.rs is not set
up to handle such oddity.
Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.
Implementations§
source§impl Client
impl Client
source§impl Client
impl Client
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo, Error>
source§impl Client
impl Client
sourcepub fn best_block_hash(&self) -> Result<BlockHash, Error>
pub fn best_block_hash(&self) -> Result<BlockHash, Error>
Gets the blockhash of the current chain tip.
pub fn get_best_block_hash(&self) -> Result<GetBestBlockHash, Error>
source§impl Client
impl Client
pub fn get_block_verbosity_zero( &self, hash: &BlockHash, ) -> Result<GetBlockVerbosityZero, Error>
pub fn get_block_verbosity_one( &self, hash: &BlockHash, ) -> Result<GetBlockVerbosityOne, Error>
source§impl Client
impl Client
pub fn generate_to_address( &self, nblocks: usize, address: &Address, ) -> Result<GenerateToAddress, Error>
source§impl Client
impl Client
sourcepub fn server_version(&self) -> Result<usize, Error>
pub fn server_version(&self) -> Result<usize, Error>
Returns the server version field of GetNetworkInfo
.
pub fn get_network_info(&self) -> Result<GetNetworkInfo, Error>
source§impl Client
impl Client
sourcepub fn check_expected_server_version(&self) -> Result<(), Error>
pub fn check_expected_server_version(&self) -> Result<(), Error>
Checks that the JSON-RPC endpoint is for a bitcoind
instance with the expected version.
source§impl Client
impl Client
pub fn send_raw_transaction( &self, tx: &Transaction, ) -> Result<SendRawTransaction, Error>
source§impl Client
impl Client
pub fn create_wallet(&self, wallet: &str) -> Result<CreateWallet, Error>
source§impl Client
impl Client
pub fn unload_wallet(&self, wallet: &str) -> Result<UnloadWallet, Error>
source§impl Client
impl Client
pub fn load_wallet(&self, wallet: &str) -> Result<LoadWallet, Error>
source§impl Client
impl Client
pub fn get_balance(&self) -> Result<GetBalance, Error>
source§impl Client
impl Client
pub fn get_balances(&self) -> Result<GetBalances, Error>
source§impl Client
impl Client
sourcepub fn new_address(&self) -> Result<Address, Error>
pub fn new_address(&self) -> Result<Address, Error>
Gets a new address from bitcoind
and parses it assuming its correct.
sourcepub fn new_address_with_type(&self, ty: AddressType) -> Result<Address, Error>
pub fn new_address_with_type(&self, ty: AddressType) -> Result<Address, Error>
Gets a new address from bitcoind
and parses it assuming its correct.
pub fn get_new_address(&self) -> Result<GetNewAddress, Error>
pub fn get_new_address_with_type( &self, ty: AddressType, ) -> Result<GetNewAddress, Error>
source§impl Client
impl Client
pub fn send_to_address( &self, address: &Address, amount: Amount, ) -> Result<SendToAddress, Error>
source§impl Client
impl Client
pub fn get_transaction(&self, txid: Txid) -> Result<GetTransaction, Error>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more