[][src]Struct bitcoincore_rpc::Client

pub struct Client { /* fields omitted */ }

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]

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]

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]

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]

pub fn get_raw_transaction_hex(
    &self,
    txid: &Sha256dHash,
    block_hash: Option<&Sha256dHash>
) -> Result<String>
[src]

pub fn get_raw_transaction_verbose(
    &self,
    txid: &Sha256dHash,
    block_hash: Option<&Sha256dHash>
) -> Result<GetRawTransactionResult>
[src]

pub fn get_received_by_address(
    &self,
    address: &Address,
    minconf: Option<u32>
) -> Result<Amount>
[src]

pub fn get_transaction(
    &self,
    txid: &Sha256dHash,
    include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
[src]

pub fn get_tx_out(
    &self,
    txid: &Sha256dHash,
    vout: u32,
    include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
[src]

pub fn import_priv_key(
    &self,
    privkey: &str,
    label: Option<&str>,
    rescan: Option<bool>
) -> Result<()>
[src]

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]

pub fn create_raw_transaction_hex(
    &self,
    utxos: &[CreateRawTransactionInput],
    outs: Option<&HashMap<String, f64>>,
    locktime: Option<i64>,
    replaceable: Option<bool>
) -> Result<String>
[src]

pub fn create_raw_transaction(
    &self,
    utxos: &[CreateRawTransactionInput],
    outs: Option<&HashMap<String, f64>>,
    locktime: Option<i64>,
    replaceable: Option<bool>
) -> Result<Transaction>
[src]

pub fn sign_raw_transaction(
    &self,
    tx: HexBytes,
    utxos: Option<&[SignRawTransactionInput]>,
    private_keys: Option<&[&str]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]

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]

pub fn verify_message(
    &self,
    address: &Address,
    signature: &Signature,
    message: &str
) -> Result<bool>
[src]

pub fn get_new_address(
    &self,
    account: Option<&str>,
    address_type: Option<AddressType>
) -> Result<String>
[src]

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]

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]

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]

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

  1. 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]

Waits for a specific new block and returns useful info about it. Returns the current block on timeout or exit.

Arguments

  1. blockhash: Block hash to wait for.
  2. timeout: Time in milliseconds to wait for a response. 0 indicates no timeout.

Auto Trait Implementations

impl Send for Client

impl Sync for Client

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.