[][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, auth: Auth) -> Result<Self>[src]

Creates a client to a bitcoind JSON-RPC server.

Can only return Err when using cookie authentication.

pub fn from_jsonrpc(client: Client) -> Client[src]

Create a new Client.

pub fn get_jsonrpc_client(&self) -> &Client[src]

Get the underlying JSONRPC client.

Trait Implementations

impl RpcApi for Client[src]

fn call<T: for<'a> Deserialize<'a>>(
    &self,
    cmd: &str,
    args: &[Value]
) -> Result<T>
[src]

Call an cmd rpc with given args list

fn get_by_id<T: Queryable<Self>>(
    &self,
    id: &<T as Queryable<Self>>::Id
) -> Result<T>
[src]

Query an object implementing Querable type

fn add_multisig_address(
    &self,
    nrequired: usize,
    keys: &[PubKeyOrAddress],
    label: Option<&str>,
    address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
[src]

fn load_wallet(&self, wallet: &str) -> Result<LoadWalletResult>[src]

fn unload_wallet(&self, wallet: Option<&str>) -> Result<()>[src]

fn create_wallet(
    &self,
    wallet: &str,
    disable_private_keys: Option<bool>
) -> Result<LoadWalletResult>
[src]

fn backup_wallet(&self, destination: Option<&str>) -> Result<()>[src]

fn dump_priv_key(&self, address: &Address) -> Result<SecretKey>[src]

fn encrypt_wallet(&self, passphrase: &str) -> Result<()>[src]

fn get_difficulty(&self) -> Result<BigUint>[src]

fn get_connection_count(&self) -> Result<usize>[src]

fn get_block(&self, hash: &Hash) -> Result<Block>[src]

fn get_block_hex(&self, hash: &Hash) -> Result<String>[src]

fn get_block_info(&self, hash: &Hash) -> Result<GetBlockResult>[src]

fn get_block_header_raw(&self, hash: &Hash) -> Result<BlockHeader>[src]

fn get_block_header_verbose(&self, hash: &Hash) -> Result<GetBlockHeaderResult>[src]

fn get_mining_info(&self) -> Result<GetMiningInfoResult>[src]

fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult>[src]

Returns a data structure containing various state info regarding blockchain processing. Read more

fn get_block_count(&self) -> Result<u64>[src]

Returns the numbers of block in the longest chain.

fn get_best_block_hash(&self) -> Result<Hash>[src]

Returns the hash of the best (tip) block in the longest blockchain.

fn get_block_hash(&self, height: u64) -> Result<Hash>[src]

Get block hash at a given height

fn get_raw_transaction(
    &self,
    txid: &Hash,
    block_hash: Option<&Hash>
) -> Result<Transaction>
[src]

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

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

fn get_block_filter(&self, block_hash: &Hash) -> Result<GetBlockFilterResult>[src]

fn get_balance(
    &self,
    minconf: Option<usize>,
    include_watchonly: Option<bool>
) -> Result<Amount>
[src]

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

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

fn list_transactions(
    &self,
    label: Option<&str>,
    count: Option<usize>,
    skip: Option<usize>,
    include_watchonly: Option<bool>
) -> Result<Vec<ListTransactionResult>>
[src]

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

fn get_tx_out_proof(
    &self,
    txids: &[Hash],
    block_hash: Option<&Hash>
) -> Result<Vec<u8>>
[src]

fn import_public_key(
    &self,
    pubkey: &PublicKey,
    label: Option<&str>,
    rescan: Option<bool>
) -> Result<()>
[src]

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

fn import_address(
    &self,
    address: &Address,
    label: Option<&str>,
    rescan: Option<bool>,
    p2sh: Option<bool>
) -> Result<()>
[src]

fn import_multi(
    &self,
    requests: &[ImportMultiRequest],
    options: Option<&ImportMultiOptions>
) -> Result<Vec<ImportMultiResult>>
[src]

fn set_label(&self, address: &Address, label: &str) -> Result<()>[src]

fn key_pool_refill(&self, new_size: Option<usize>) -> Result<()>[src]

fn list_unspent(
    &self,
    minconf: Option<usize>,
    maxconf: Option<usize>,
    addresses: Option<&[Address]>,
    include_unsafe: Option<bool>,
    query_options: Option<ListUnspentQueryOptions>
) -> Result<Vec<ListUnspentResultEntry>>
[src]

fn lock_unspent(&self, outputs: &[OutPoint]) -> Result<bool>[src]

To unlock, use [unlock_unspent].

fn unlock_unspent(&self, outputs: &[OutPoint]) -> Result<bool>[src]

fn list_received_by_address(
    &self,
    address_filter: Option<&Address>,
    minconf: Option<u32>,
    include_empty: Option<bool>,
    include_watchonly: Option<bool>
) -> Result<Vec<ListReceivedByAddressResult>>
[src]

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

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

fn fund_raw_transaction<R: RawTx>(
    &self,
    tx: R,
    options: Option<&FundRawTransactionOptions>,
    is_witness: Option<bool>
) -> Result<FundRawTransactionResult>
[src]

fn sign_raw_transaction<R: RawTx>(
    &self,
    tx: R,
    utxos: Option<&[SignRawTransactionInput]>,
    private_keys: Option<&[PrivateKey]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]

Deprecated

fn sign_raw_transaction_with_wallet<R: RawTx>(
    &self,
    tx: R,
    utxos: Option<&[SignRawTransactionInput]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]

fn sign_raw_transaction_with_key<R: RawTx>(
    &self,
    tx: R,
    privkeys: &[PrivateKey],
    prevtxs: Option<&[SignRawTransactionInput]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]

fn test_mempool_accept<R: RawTx>(
    &self,
    rawtxs: &[R]
) -> Result<Vec<TestMempoolAccept>>
[src]

fn stop(&self) -> Result<()>[src]

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

fn get_new_address(
    &self,
    label: Option<&str>,
    address_type: Option<AddressType>
) -> Result<Address>
[src]

Generate new address under own control

fn generate_to_address(
    &self,
    block_num: u64,
    address: &Address
) -> Result<Vec<Hash>>
[src]

Mine block_num blocks and pay coinbase to address Read more

fn generate(&self, block_num: u64, maxtries: Option<u64>) -> Result<Vec<Hash>>[src]

Mine up to block_num blocks immediately (before the RPC call returns) to an address in the wallet. Read more

fn invalidate_block(&self, block_hash: &Hash) -> Result<()>[src]

Mark a block as invalid by block_hash

fn reconsider_block(&self, block_hash: &Hash) -> Result<()>[src]

Mark a block as valid by block_hash

fn get_raw_mempool(&self) -> Result<Vec<Hash>>[src]

Get txids of all transactions in a memory pool

fn send_to_address(
    &self,
    address: &Address,
    amount: Amount,
    comment: Option<&str>,
    comment_to: Option<&str>,
    subtract_fee: Option<bool>,
    replaceable: Option<bool>,
    confirmation_target: Option<u32>,
    estimate_mode: Option<EstimateMode>
) -> Result<Hash>
[src]

fn get_peer_info(&self) -> Result<Vec<GetPeerInfoResult>>[src]

Returns data about each connected network node as an array of [PeerInfo][] Read more

fn ping(&self) -> Result<()>[src]

Requests that a ping be sent to all other nodes, to measure ping time. Read more

fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Hash>[src]

fn estimate_smartfee<E>(
    &self,
    conf_target: u16,
    estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>
[src]

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. Read more

fn wait_for_block(&self, blockhash: &Hash, 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. Read more

impl Debug for Client[src]

Auto Trait Implementations

impl Unpin for Client

impl Send for Client

impl Sync for Client

impl !RefUnwindSafe for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.