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
impl Client
Source§impl Client
impl Client
Sourcepub fn check_expected_server_version(&self) -> Result<()>
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
impl Client
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo>
Source§impl Client
impl Client
Sourcepub fn best_block_hash(&self) -> Result<BlockHash>
pub fn best_block_hash(&self) -> Result<BlockHash>
Gets the blockhash of the current chain tip.
pub fn get_best_block_hash(&self) -> Result<GetBestBlockHash>
Source§impl Client
impl Client
pub fn get_block_verbosity_zero( &self, hash: BlockHash, ) -> Result<GetBlockVerbosityZero>
pub fn get_block_verbosity_one( &self, hash: BlockHash, ) -> Result<GetBlockVerbosityOne>
Source§impl Client
impl Client
pub fn get_block_count(&self) -> Result<GetBlockCount>
Source§impl Client
impl Client
pub fn get_block_hash(&self, height: u64) -> Result<GetBlockHash>
Source§impl Client
impl Client
pub fn get_block_header(&self, hash: &BlockHash) -> Result<GetBlockHeader>
pub fn get_block_header_verbose( &self, hash: &BlockHash, ) -> Result<GetBlockHeaderVerbose>
Source§impl Client
impl Client
pub fn get_block_stats_by_height(&self, height: u32) -> Result<GetBlockStats>
pub fn get_block_stats_by_block_hash( &self, hash: &BlockHash, ) -> Result<GetBlockStats>
Source§impl Client
impl Client
pub fn get_chain_tips(&self) -> Result<GetChainTips>
Source§impl Client
impl Client
pub fn get_chain_tx_stats(&self) -> Result<GetChainTxStats>
Source§impl Client
impl Client
pub fn get_difficulty(&self) -> Result<GetDifficulty>
Source§impl Client
impl Client
pub fn get_mempool_ancestors(&self, txid: Txid) -> Result<GetMempoolAncestors>
Source§impl Client
impl Client
pub fn get_memory_info(&self) -> Result<GetMemoryInfoStats>
Source§impl Client
impl Client
pub fn generate_to_address( &self, nblocks: usize, address: &Address, ) -> Result<GenerateToAddress>
Source§impl Client
impl Client
pub fn get_added_node_info(&self) -> Result<GetAddedNodeInfo>
Source§impl Client
impl Client
pub fn get_net_totals(&self) -> Result<GetNetTotals>
Source§impl Client
impl Client
Sourcepub fn server_version(&self) -> Result<usize>
pub fn server_version(&self) -> Result<usize>
Returns the server version field of GetNetworkInfo
.
pub fn get_network_info(&self) -> Result<GetNetworkInfo>
Source§impl Client
impl Client
pub fn get_peer_info(&self) -> Result<GetPeerInfo>
Source§impl Client
impl Client
pub fn send_raw_transaction( &self, tx: &Transaction, ) -> Result<SendRawTransaction>
Source§impl Client
impl Client
pub fn create_wallet(&self, wallet: &str) -> Result<CreateWallet>
Source§impl Client
impl Client
pub fn load_wallet(&self, wallet: &str) -> Result<LoadWallet>
Source§impl Client
impl Client
Sourcepub fn new_address(&self) -> Result<Address>
pub fn new_address(&self) -> Result<Address>
Gets a new address from bitcoind
and parses it assuming its correct.
Sourcepub fn new_address_with_type(&self, ty: AddressType) -> Result<Address>
pub fn new_address_with_type(&self, ty: AddressType) -> Result<Address>
Gets a new address from bitcoind
and parses it assuming its correct.
pub fn get_new_address(&self) -> Result<GetNewAddress>
pub fn get_new_address_with_type( &self, ty: AddressType, ) -> Result<GetNewAddress>
Source§impl Client
impl Client
pub fn get_balance(&self) -> Result<GetBalance>
Source§impl Client
impl Client
pub fn send_to_address( &self, address: &Address<NetworkChecked>, amount: Amount, ) -> Result<SendToAddress>
Source§impl Client
impl Client
pub fn get_transaction(&self, txid: Txid) -> Result<GetTransaction>
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