pub struct Client { /* private fields */ }
Expand description
An async
client for interacting with a bitcoind
instance.
Implementations§
Trait Implementations§
Source§impl Broadcaster for Client
impl Broadcaster for Client
Source§async fn send_raw_transaction(&self, tx: &Transaction) -> ClientResult<Txid>
async fn send_raw_transaction(&self, tx: &Transaction) -> ClientResult<Txid>
Sends a raw transaction to the network. Read more
Source§async fn test_mempool_accept(
&self,
tx: &Transaction,
) -> ClientResult<Vec<TestMempoolAccept>>
async fn test_mempool_accept( &self, tx: &Transaction, ) -> ClientResult<Vec<TestMempoolAccept>>
Tests if a raw transaction is valid.
Source§async fn submit_package(
&self,
txs: &[Transaction],
) -> ClientResult<SubmitPackage>
async fn submit_package( &self, txs: &[Transaction], ) -> ClientResult<SubmitPackage>
Submit a package of raw transactions (serialized, hex-encoded) to local node. Read more
Source§impl Reader for Client
impl Reader for Client
Source§async fn estimate_smart_fee(&self, conf_target: u16) -> ClientResult<u64>
async fn estimate_smart_fee(&self, conf_target: u16) -> ClientResult<u64>
Estimates the approximate fee per kilobyte needed for a transaction
to begin confirmation within conf_target blocks if possible and return
the number of blocks for which the estimate is valid. Read more
Source§async fn get_block_header(&self, hash: &BlockHash) -> ClientResult<Header>
async fn get_block_header(&self, hash: &BlockHash) -> ClientResult<Header>
Gets a
Header
with the given hash.Source§async fn get_block(&self, hash: &BlockHash) -> ClientResult<Block>
async fn get_block(&self, hash: &BlockHash) -> ClientResult<Block>
Gets a
Block
with the given hash.Source§async fn get_block_height(&self, hash: &BlockHash) -> ClientResult<u64>
async fn get_block_height(&self, hash: &BlockHash) -> ClientResult<u64>
Gets a block height with the given hash.
Source§async fn get_block_header_at(&self, height: u64) -> ClientResult<Header>
async fn get_block_header_at(&self, height: u64) -> ClientResult<Header>
Gets a
Header
at given height.Source§async fn get_block_at(&self, height: u64) -> ClientResult<Block>
async fn get_block_at(&self, height: u64) -> ClientResult<Block>
Gets a
Block
at given height.Source§async fn get_block_count(&self) -> ClientResult<u64>
async fn get_block_count(&self) -> ClientResult<u64>
Gets the height of the most-work fully-validated chain. Read more
Source§async fn get_block_hash(&self, height: u64) -> ClientResult<BlockHash>
async fn get_block_hash(&self, height: u64) -> ClientResult<BlockHash>
Gets the
BlockHash
at given height.Source§async fn get_blockchain_info(&self) -> ClientResult<GetBlockchainInfo>
async fn get_blockchain_info(&self) -> ClientResult<GetBlockchainInfo>
Gets various state info regarding blockchain processing.
Source§async fn get_current_timestamp(&self) -> ClientResult<u32>
async fn get_current_timestamp(&self) -> ClientResult<u32>
Gets the timestamp in the block header of the current best block in bitcoin. Read more
Source§async fn get_raw_mempool(&self) -> ClientResult<Vec<Txid>>
async fn get_raw_mempool(&self) -> ClientResult<Vec<Txid>>
Gets all transaction ids in mempool.
Source§async fn get_raw_transaction_verbosity_zero(
&self,
txid: &Txid,
) -> ClientResult<GetRawTransactionVerbosityZero>
async fn get_raw_transaction_verbosity_zero( &self, txid: &Txid, ) -> ClientResult<GetRawTransactionVerbosityZero>
Gets a raw transaction by its
Txid
.Source§async fn get_raw_transaction_verbosity_one(
&self,
txid: &Txid,
) -> ClientResult<GetRawTransactionVerbosityOne>
async fn get_raw_transaction_verbosity_one( &self, txid: &Txid, ) -> ClientResult<GetRawTransactionVerbosityOne>
Gets a raw transaction by its
Txid
.Source§async fn get_tx_out(
&self,
txid: &Txid,
vout: u32,
include_mempool: bool,
) -> ClientResult<GetTxOut>
async fn get_tx_out( &self, txid: &Txid, vout: u32, include_mempool: bool, ) -> ClientResult<GetTxOut>
Returns details about an unspent transaction output.
Source§impl Signer for Client
impl Signer for Client
Source§async fn sign_raw_transaction_with_wallet(
&self,
tx: &Transaction,
prev_outputs: Option<Vec<PreviousTransactionOutput>>,
) -> ClientResult<SignRawTransactionWithWallet>
async fn sign_raw_transaction_with_wallet( &self, tx: &Transaction, prev_outputs: Option<Vec<PreviousTransactionOutput>>, ) -> ClientResult<SignRawTransactionWithWallet>
Signs a transaction using the keys available in the underlying Bitcoin
client’s wallet and returns a signed transaction. Read more
Source§async fn get_xpriv(&self) -> ClientResult<Option<Xpriv>>
async fn get_xpriv(&self) -> ClientResult<Option<Xpriv>>
Gets the underlying
Xpriv
from the wallet.Source§async fn import_descriptors(
&self,
descriptors: Vec<ImportDescriptor>,
wallet_name: String,
) -> ClientResult<Vec<ImportDescriptorResult>>
async fn import_descriptors( &self, descriptors: Vec<ImportDescriptor>, wallet_name: String, ) -> ClientResult<Vec<ImportDescriptorResult>>
Imports the descriptors into the wallet.
Source§impl Wallet for Client
impl Wallet for Client
Source§async fn get_new_address(&self) -> ClientResult<Address>
async fn get_new_address(&self) -> ClientResult<Address>
Generates new address under own control for the underlying Bitcoin
client’s wallet.
Source§async fn get_transaction(&self, txid: &Txid) -> ClientResult<GetTransaction>
async fn get_transaction(&self, txid: &Txid) -> ClientResult<GetTransaction>
Gets information related to a transaction. Read more
Source§async fn get_utxos(&self) -> ClientResult<Vec<ListUnspent>>
async fn get_utxos(&self) -> ClientResult<Vec<ListUnspent>>
Gets all Unspent Transaction Outputs (UTXOs) for the underlying Bitcoin
client’s wallet.
Source§async fn list_transactions(
&self,
count: Option<usize>,
) -> ClientResult<Vec<ListTransactions>>
async fn list_transactions( &self, count: Option<usize>, ) -> ClientResult<Vec<ListTransactions>>
Lists transactions in the underlying Bitcoin client’s wallet. Read more
Source§async fn list_wallets(&self) -> ClientResult<Vec<String>>
async fn list_wallets(&self) -> ClientResult<Vec<String>>
Lists all wallets in the underlying Bitcoin client.
Source§async fn create_raw_transaction(
&self,
raw_tx: CreateRawTransaction,
) -> ClientResult<Transaction>
async fn create_raw_transaction( &self, raw_tx: CreateRawTransaction, ) -> ClientResult<Transaction>
Creates a raw transaction.
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