[−][src]Struct bitcoincore_rpc::Client
Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.
Methods
impl Client
[src]
pub fn new(url: String, user: Option<String>, pass: Option<String>) -> Self
[src]
Creates a client to a bitcoind JSON-RPC server.
pub fn from_jsonrpc(client: Client) -> Client
[src]
Create a new Client.
pub fn get_by_id<T: Queryable>(&self, id: &<T as Queryable>::Id) -> Result<T>
[src]
Query an object implementing Querable
type
pub fn call<T: for<'a> Deserialize<'a>>(
&self,
cmd: &str,
args: &[Value]
) -> Result<T>
[src]
&self,
cmd: &str,
args: &[Value]
) -> Result<T>
Call an cmd
rpc with given args
list
pub fn add_multisig_address(
&self,
nrequired: usize,
keys: Vec<PubKeyOrAddress>,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
[src]
&self,
nrequired: usize,
keys: Vec<PubKeyOrAddress>,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
pub fn backup_wallet(&self, destination: Option<&str>) -> Result<()>
[src]
pub fn dump_priv_key(&self, address: &Address) -> Result<String>
[src]
pub fn encrypt_wallet(&self, passphrase: &str) -> Result<()>
[src]
pub fn get_difficulty(&self) -> Result<BigUint>
[src]
pub fn get_connection_count(&self) -> Result<usize>
[src]
pub fn get_block(&self, hash: &Sha256dHash) -> Result<Block>
[src]
pub fn get_block_hex(&self, hash: &Sha256dHash) -> Result<String>
[src]
pub fn get_block_info(&self, hash: &Sha256dHash) -> Result<GetBlockResult>
[src]
pub fn get_block_header_raw(&self, hash: &Sha256dHash) -> Result<BlockHeader>
[src]
pub fn get_block_header_verbose(
&self,
hash: &Sha256dHash
) -> Result<GetBlockHeaderResult>
[src]
&self,
hash: &Sha256dHash
) -> Result<GetBlockHeaderResult>
pub fn get_mining_info(&self) -> Result<GetMiningInfoResult>
[src]
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult>
[src]
Returns a data structure containing various state info regarding blockchain processing.
pub fn get_block_count(&self) -> Result<u64>
[src]
Returns the numbers of block in the longest chain.
pub fn get_best_block_hash(&self) -> Result<Sha256dHash>
[src]
Returns the hash of the best (tip) block in the longest blockchain.
pub fn get_block_hash(&self, height: u64) -> Result<Sha256dHash>
[src]
Get block hash at a given height
pub fn get_raw_transaction(
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<Transaction>
[src]
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<Transaction>
pub fn get_raw_transaction_hex(
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<String>
[src]
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<String>
pub fn get_raw_transaction_verbose(
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<GetRawTransactionResult>
[src]
&self,
txid: &Sha256dHash,
block_hash: Option<&Sha256dHash>
) -> Result<GetRawTransactionResult>
pub fn get_received_by_address(
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
[src]
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
pub fn get_transaction(
&self,
txid: &Sha256dHash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
[src]
&self,
txid: &Sha256dHash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
pub fn get_tx_out(
&self,
txid: &Sha256dHash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
[src]
&self,
txid: &Sha256dHash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
pub fn import_priv_key(
&self,
privkey: &str,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
[src]
&self,
privkey: &str,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
pub fn key_pool_refill(&self, new_size: Option<usize>) -> Result<()>
[src]
pub fn list_unspent(
&self,
minconf: Option<usize>,
maxconf: Option<usize>,
addresses: Option<Vec<&Address>>,
include_unsafe: Option<bool>,
query_options: Option<HashMap<&str, &str>>
) -> Result<Vec<ListUnspentResult>>
[src]
&self,
minconf: Option<usize>,
maxconf: Option<usize>,
addresses: Option<Vec<&Address>>,
include_unsafe: Option<bool>,
query_options: Option<HashMap<&str, &str>>
) -> Result<Vec<ListUnspentResult>>
pub fn create_raw_transaction_hex(
&self,
utxos: &[CreateRawTransactionInput],
outs: Option<&HashMap<String, f64>>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
[src]
&self,
utxos: &[CreateRawTransactionInput],
outs: Option<&HashMap<String, f64>>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
pub fn create_raw_transaction(
&self,
utxos: &[CreateRawTransactionInput],
outs: Option<&HashMap<String, f64>>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
[src]
&self,
utxos: &[CreateRawTransactionInput],
outs: Option<&HashMap<String, f64>>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
pub fn sign_raw_transaction(
&self,
tx: HexBytes,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&str]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]
&self,
tx: HexBytes,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&str]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
pub fn stop(&self) -> Result<()>
[src]
pub fn sign_raw_transaction_with_wallet(
&self,
tx: HexBytes,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]
&self,
tx: HexBytes,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
pub fn verify_message(
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
[src]
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
pub fn get_new_address(
&self,
account: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
[src]
&self,
account: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
Generate new address under own control
If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'.
pub fn generate_to_address(
&self,
block_num: u64,
address: &str
) -> Result<Vec<Sha256dHash>>
[src]
&self,
block_num: u64,
address: &str
) -> Result<Vec<Sha256dHash>>
Mine block_num
blocks and pay coinbase to address
Returns hashes of the generated blocks
pub fn invalidate_block(&self, block_hash: &Sha256dHash) -> Result<()>
[src]
Mark a block as invalid by block_hash
pub fn send_to_address(
&self,
addr: &str,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>
) -> Result<Sha256dHash>
[src]
&self,
addr: &str,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>
) -> Result<Sha256dHash>
pub fn get_peer_info(&self) -> Result<Vec<GetPeerInfoResult>>
[src]
Returns data about each connected network node as an array of
PeerInfo
pub fn ping(&self) -> Result<()>
[src]
Requests that a ping be sent to all other nodes, to measure ping time.
Results provided in getpeerinfo
, pingtime
and pingwait
fields
are decimal seconds.
Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
pub fn send_raw_transaction(&self, tx: &str) -> Result<String>
[src]
pub fn estimate_smartfee<E>(
&self,
conf_target: u16,
estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>
[src]
&self,
conf_target: u16,
estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>
pub fn wait_for_new_block(&self, timeout: u64) -> Result<BlockRef>
[src]
Waits for a specific new block and returns useful info about it. Returns the current block on timeout or exit.
Arguments
timeout
: Time in milliseconds to wait for a response. 0 indicates no timeout.
pub fn wait_for_block(
&self,
blockhash: &Sha256dHash,
timeout: u64
) -> Result<BlockRef>
[src]
&self,
blockhash: &Sha256dHash,
timeout: u64
) -> Result<BlockRef>
Waits for a specific new block and returns useful info about it. Returns the current block on timeout or exit.
Arguments
blockhash
: Block hash to wait for.timeout
: Time in milliseconds to wait for a response. 0 indicates no timeout.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Typeable for T where
T: Any,
T: Any,