[−][src]Trait bitcoincore_rpc::RpcApi
Required methods
fn call<T: for<'a> Deserialize<'a>>(
&self,
cmd: &str,
args: &[Value]
) -> Result<T>
&self,
cmd: &str,
args: &[Value]
) -> Result<T>
Call a cmd
rpc with given args
list
Provided methods
fn get_by_id<T: Queryable<Self>>(
&self,
id: &<T as Queryable<Self>>::Id
) -> Result<T>
&self,
id: &<T as Queryable<Self>>::Id
) -> Result<T>
Query an object implementing Querable
type
fn add_multisig_address(
&self,
nrequired: usize,
keys: &[PubKeyOrAddress],
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
&self,
nrequired: usize,
keys: &[PubKeyOrAddress],
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
fn backup_wallet(&self, destination: Option<&str>) -> Result<()>
fn dump_priv_key(&self, address: &Address) -> Result<SecretKey>
fn encrypt_wallet(&self, passphrase: &str) -> Result<()>
fn get_difficulty(&self) -> Result<BigUint>
fn get_connection_count(&self) -> Result<usize>
fn get_block(&self, hash: &Hash) -> Result<Block>
fn get_block_hex(&self, hash: &Hash) -> Result<String>
fn get_block_info(&self, hash: &Hash) -> Result<GetBlockResult>
fn get_block_header_raw(&self, hash: &Hash) -> Result<BlockHeader>
fn get_block_header_verbose(&self, hash: &Hash) -> Result<GetBlockHeaderResult>
fn get_mining_info(&self) -> Result<GetMiningInfoResult>
fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult>
Returns a data structure containing various state info regarding blockchain processing.
fn get_block_count(&self) -> Result<u64>
Returns the numbers of block in the longest chain.
fn get_best_block_hash(&self) -> Result<Hash>
Returns the hash of the best (tip) block in the longest blockchain.
fn get_block_hash(&self, height: u64) -> Result<Hash>
Get block hash at a given height
fn get_raw_transaction(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<Transaction>
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<Transaction>
fn get_raw_transaction_hex(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<String>
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<String>
fn get_raw_transaction_verbose(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<GetRawTransactionResult>
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<GetRawTransactionResult>
fn get_received_by_address(
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
fn get_transaction(
&self,
txid: &Hash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
&self,
txid: &Hash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
fn get_tx_out(
&self,
txid: &Hash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
&self,
txid: &Hash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
fn get_tx_out_proof(
&self,
txids: &[Hash],
block_hash: Option<Hash>
) -> Result<Vec<u8>>
&self,
txids: &[Hash],
block_hash: Option<Hash>
) -> Result<Vec<u8>>
fn import_priv_key(
&self,
privkey: &SecretKey,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
&self,
privkey: &SecretKey,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
fn import_address(
&self,
address: &Address,
label: Option<&str>,
rescan: Option<bool>,
p2sh: Option<bool>
) -> Result<()>
&self,
address: &Address,
label: Option<&str>,
rescan: Option<bool>,
p2sh: Option<bool>
) -> Result<()>
fn key_pool_refill(&self, new_size: Option<usize>) -> Result<()>
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>>
&self,
minconf: Option<usize>,
maxconf: Option<usize>,
addresses: Option<Vec<&Address>>,
include_unsafe: Option<bool>,
query_options: Option<HashMap<&str, &str>>
) -> Result<Vec<ListUnspentResult>>
fn list_received_by_address(
&self,
address_filter: Option<&Address>,
minconf: Option<u32>,
include_empty: Option<bool>,
include_watchonly: Option<bool>
) -> Result<Vec<ListReceivedByAddressResult>>
&self,
address_filter: Option<&Address>,
minconf: Option<u32>,
include_empty: Option<bool>,
include_watchonly: Option<bool>
) -> Result<Vec<ListReceivedByAddressResult>>
fn create_raw_transaction_hex(
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
fn create_raw_transaction(
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
fn fund_raw_transaction<R: RawTx>(
&self,
tx: R,
options: Option<FundRawTransactionOptions>,
is_witness: Option<bool>
) -> Result<FundRawTransactionResult>
&self,
tx: R,
options: Option<FundRawTransactionOptions>,
is_witness: Option<bool>
) -> Result<FundRawTransactionResult>
fn sign_raw_transaction<R: RawTx>(
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&PrivateKey]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&PrivateKey]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn sign_raw_transaction_with_wallet<R: RawTx>(
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn sign_raw_transaction_with_key<R: RawTx>(
&self,
tx: R,
privkeys: &[&PrivateKey],
prevtxs: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
&self,
tx: R,
privkeys: &[&PrivateKey],
prevtxs: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn test_mempool_accept(&self, rawtxs: &[&str]) -> Result<Vec<TestMempoolAccept>>
fn stop(&self) -> Result<()>
fn verify_message(
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
fn get_new_address(
&self,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
&self,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
Generate new address under own control
fn generate_to_address(
&self,
block_num: u64,
address: &str
) -> Result<Vec<Hash>>
&self,
block_num: u64,
address: &str
) -> Result<Vec<Hash>>
Mine block_num
blocks and pay coinbase to address
Returns hashes of the generated blocks
fn generate(&self, block_num: u64, maxtries: Option<u64>) -> Result<Vec<Hash>>
Mine up to block_num blocks immediately (before the RPC call returns) to an address in the wallet.
fn invalidate_block(&self, block_hash: &Hash) -> Result<()>
Mark a block as invalid by block_hash
fn send_to_address(
&self,
address: &Address,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>,
replaceable: Option<bool>,
confirmation_target: Option<u32>,
estimate_mode: Option<EstimateMode>
) -> Result<Hash>
&self,
address: &Address,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>,
replaceable: Option<bool>,
confirmation_target: Option<u32>,
estimate_mode: Option<EstimateMode>
) -> Result<Hash>
fn get_peer_info(&self) -> Result<Vec<GetPeerInfoResult>>
Returns data about each connected network node as an array of
PeerInfo
fn ping(&self) -> Result<()>
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.
fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Hash>
fn estimate_smartfee<E>(
&self,
conf_target: u16,
estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>
&self,
conf_target: u16,
estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>
fn wait_for_new_block(&self, 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
timeout
: Time in milliseconds to wait for a response. 0 indicates no timeout.
fn wait_for_block(&self, blockhash: &Hash, 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.
Implementors
impl RpcApi for Client
[src]
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
fn get_by_id<T: Queryable<Self>>(
&self,
id: &<T as Queryable<Self>>::Id
) -> Result<T>
[src]
&self,
id: &<T as Queryable<Self>>::Id
) -> Result<T>
fn add_multisig_address(
&self,
nrequired: usize,
keys: &[PubKeyOrAddress],
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
[src]
&self,
nrequired: usize,
keys: &[PubKeyOrAddress],
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<AddMultiSigAddressResult>
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]
fn get_block_count(&self) -> Result<u64>
[src]
fn get_best_block_hash(&self) -> Result<Hash>
[src]
fn get_block_hash(&self, height: u64) -> Result<Hash>
[src]
fn get_raw_transaction(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<Transaction>
[src]
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<Transaction>
fn get_raw_transaction_hex(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<String>
[src]
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<String>
fn get_raw_transaction_verbose(
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<GetRawTransactionResult>
[src]
&self,
txid: &Hash,
block_hash: Option<&Hash>
) -> Result<GetRawTransactionResult>
fn get_received_by_address(
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
[src]
&self,
address: &Address,
minconf: Option<u32>
) -> Result<Amount>
fn get_transaction(
&self,
txid: &Hash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
[src]
&self,
txid: &Hash,
include_watchonly: Option<bool>
) -> Result<GetTransactionResult>
fn get_tx_out(
&self,
txid: &Hash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
[src]
&self,
txid: &Hash,
vout: u32,
include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>
fn get_tx_out_proof(
&self,
txids: &[Hash],
block_hash: Option<Hash>
) -> Result<Vec<u8>>
[src]
&self,
txids: &[Hash],
block_hash: Option<Hash>
) -> Result<Vec<u8>>
fn import_priv_key(
&self,
privkey: &SecretKey,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
[src]
&self,
privkey: &SecretKey,
label: Option<&str>,
rescan: Option<bool>
) -> Result<()>
fn import_address(
&self,
address: &Address,
label: Option<&str>,
rescan: Option<bool>,
p2sh: Option<bool>
) -> Result<()>
[src]
&self,
address: &Address,
label: Option<&str>,
rescan: Option<bool>,
p2sh: Option<bool>
) -> Result<()>
fn key_pool_refill(&self, new_size: Option<usize>) -> Result<()>
[src]
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>>
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]
&self,
address_filter: Option<&Address>,
minconf: Option<u32>,
include_empty: Option<bool>,
include_watchonly: Option<bool>
) -> Result<Vec<ListReceivedByAddressResult>>
fn create_raw_transaction_hex(
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
[src]
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<String>
fn create_raw_transaction(
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
[src]
&self,
utxos: &[CreateRawTransactionInput],
outs: &HashMap<String, f64>,
locktime: Option<i64>,
replaceable: Option<bool>
) -> Result<Transaction>
fn fund_raw_transaction<R: RawTx>(
&self,
tx: R,
options: Option<FundRawTransactionOptions>,
is_witness: Option<bool>
) -> Result<FundRawTransactionResult>
[src]
&self,
tx: R,
options: Option<FundRawTransactionOptions>,
is_witness: Option<bool>
) -> Result<FundRawTransactionResult>
fn sign_raw_transaction<R: RawTx>(
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&PrivateKey]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
private_keys: Option<&[&PrivateKey]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn sign_raw_transaction_with_wallet<R: RawTx>(
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]
&self,
tx: R,
utxos: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn sign_raw_transaction_with_key<R: RawTx>(
&self,
tx: R,
privkeys: &[&PrivateKey],
prevtxs: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
[src]
&self,
tx: R,
privkeys: &[&PrivateKey],
prevtxs: Option<&[SignRawTransactionInput]>,
sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>
fn test_mempool_accept(&self, rawtxs: &[&str]) -> Result<Vec<TestMempoolAccept>>
[src]
fn stop(&self) -> Result<()>
[src]
fn verify_message(
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
[src]
&self,
address: &Address,
signature: &Signature,
message: &str
) -> Result<bool>
fn get_new_address(
&self,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
[src]
&self,
label: Option<&str>,
address_type: Option<AddressType>
) -> Result<String>
fn generate_to_address(
&self,
block_num: u64,
address: &str
) -> Result<Vec<Hash>>
[src]
&self,
block_num: u64,
address: &str
) -> Result<Vec<Hash>>
fn generate(&self, block_num: u64, maxtries: Option<u64>) -> Result<Vec<Hash>>
[src]
fn invalidate_block(&self, block_hash: &Hash) -> Result<()>
[src]
fn send_to_address(
&self,
address: &Address,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>,
replaceable: Option<bool>,
confirmation_target: Option<u32>,
estimate_mode: Option<EstimateMode>
) -> Result<Hash>
[src]
&self,
address: &Address,
amount: f64,
comment: Option<&str>,
comment_to: Option<&str>,
substract_fee: Option<bool>,
replaceable: Option<bool>,
confirmation_target: Option<u32>,
estimate_mode: Option<EstimateMode>
) -> Result<Hash>
fn get_peer_info(&self) -> Result<Vec<GetPeerInfoResult>>
[src]
fn ping(&self) -> Result<()>
[src]
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]
&self,
conf_target: u16,
estimate_mode: Option<EstimateMode>
) -> Result<EstimateSmartFeeResult>