pub trait RpcApi: Sized {
Show 114 methods // Required method fn call<T: for<'a> Deserialize<'a>>( &self, cmd: &str, args: &[Value] ) -> Result<T>; // Provided methods fn get_by_id<T: Queryable<Self>>( &self, id: &<T as Queryable<Self>>::Id ) -> Result<T> { ... } fn get_network_info(&self) -> Result<GetNetworkInfoResult> { ... } fn get_index_info(&self) -> Result<GetIndexInfoResult> { ... } fn version(&self) -> Result<usize> { ... } fn add_multisig_address( &self, nrequired: usize, keys: &[PubKeyOrAddress<'_>], label: Option<&str>, address_type: Option<AddressType> ) -> Result<AddMultiSigAddressResult> { ... } fn load_wallet(&self, wallet: &str) -> Result<LoadWalletResult> { ... } fn unload_wallet( &self, wallet: Option<&str> ) -> Result<Option<UnloadWalletResult>> { ... } fn create_wallet( &self, wallet: &str, disable_private_keys: Option<bool>, blank: Option<bool>, passphrase: Option<&str>, avoid_reuse: Option<bool> ) -> Result<LoadWalletResult> { ... } fn list_wallets(&self) -> Result<Vec<String>> { ... } fn list_wallet_dir(&self) -> Result<Vec<String>> { ... } fn get_wallet_info(&self) -> Result<GetWalletInfoResult> { ... } fn backup_wallet(&self, destination: Option<&str>) -> Result<()> { ... } fn dump_private_key(&self, address: &Address) -> Result<PrivateKey> { ... } fn encrypt_wallet(&self, passphrase: &str) -> Result<()> { ... } fn get_difficulty(&self) -> Result<f64> { ... } fn get_connection_count(&self) -> Result<usize> { ... } fn get_block(&self, hash: &BlockHash) -> Result<Block> { ... } fn get_block_hex(&self, hash: &BlockHash) -> Result<String> { ... } fn get_block_info(&self, hash: &BlockHash) -> Result<GetBlockResult> { ... } fn get_block_header(&self, hash: &BlockHash) -> Result<Header> { ... } fn get_block_header_info( &self, hash: &BlockHash ) -> Result<GetBlockHeaderResult> { ... } fn get_mining_info(&self) -> Result<GetMiningInfoResult> { ... } fn get_block_template( &self, mode: GetBlockTemplateModes, rules: &[GetBlockTemplateRules], capabilities: &[GetBlockTemplateCapabilities] ) -> Result<GetBlockTemplateResult> { ... } fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult> { ... } fn get_block_count(&self) -> Result<u64> { ... } fn get_best_block_hash(&self) -> Result<BlockHash> { ... } fn get_block_hash(&self, height: u64) -> Result<BlockHash> { ... } fn get_block_stats(&self, height: u64) -> Result<GetBlockStatsResult> { ... } fn get_block_stats_fields( &self, height: u64, fields: &[BlockStatsFields] ) -> Result<GetBlockStatsResultPartial> { ... } fn get_raw_transaction( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<Transaction> { ... } fn get_raw_transaction_hex( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<String> { ... } fn get_raw_transaction_info( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<GetRawTransactionResult> { ... } fn get_block_filter( &self, block_hash: &BlockHash ) -> Result<GetBlockFilterResult> { ... } fn get_balance( &self, minconf: Option<usize>, include_watchonly: Option<bool> ) -> Result<Amount> { ... } fn get_balances(&self) -> Result<GetBalancesResult> { ... } fn get_received_by_address( &self, address: &Address, minconf: Option<u32> ) -> Result<Amount> { ... } fn get_transaction( &self, txid: &Txid, include_watchonly: Option<bool> ) -> Result<GetTransactionResult> { ... } fn list_transactions( &self, label: Option<&str>, count: Option<usize>, skip: Option<usize>, include_watchonly: Option<bool> ) -> Result<Vec<ListTransactionResult>> { ... } fn list_since_block( &self, blockhash: Option<&BlockHash>, target_confirmations: Option<usize>, include_watchonly: Option<bool>, include_removed: Option<bool> ) -> Result<ListSinceBlockResult> { ... } fn get_tx_out( &self, txid: &Txid, vout: u32, include_mempool: Option<bool> ) -> Result<Option<GetTxOutResult>> { ... } fn get_tx_out_proof( &self, txids: &[Txid], block_hash: Option<&BlockHash> ) -> Result<Vec<u8>> { ... } fn import_public_key( &self, pubkey: &PublicKey, label: Option<&str>, rescan: Option<bool> ) -> Result<()> { ... } fn import_private_key( &self, privkey: &PrivateKey, label: Option<&str>, rescan: Option<bool> ) -> Result<()> { ... } fn import_address( &self, address: &Address, label: Option<&str>, rescan: Option<bool> ) -> Result<()> { ... } fn import_address_script( &self, script: &Script, label: Option<&str>, rescan: Option<bool>, p2sh: Option<bool> ) -> Result<()> { ... } fn import_multi( &self, requests: &[ImportMultiRequest<'_>], options: Option<&ImportMultiOptions> ) -> Result<Vec<ImportMultiResult>> { ... } fn import_descriptors( &self, req: ImportDescriptors ) -> Result<Vec<ImportMultiResult>> { ... } fn set_label(&self, address: &Address, label: &str) -> Result<()> { ... } fn key_pool_refill(&self, new_size: Option<usize>) -> Result<()> { ... } fn list_unspent( &self, minconf: Option<usize>, maxconf: Option<usize>, addresses: Option<&[&Address<NetworkChecked>]>, include_unsafe: Option<bool>, query_options: Option<ListUnspentQueryOptions> ) -> Result<Vec<ListUnspentResultEntry>> { ... } fn lock_unspent(&self, outputs: &[OutPoint]) -> Result<bool> { ... } fn unlock_unspent(&self, outputs: &[OutPoint]) -> Result<bool> { ... } fn unlock_unspent_all(&self) -> Result<bool> { ... } fn list_received_by_address( &self, address_filter: Option<&Address>, minconf: Option<u32>, include_empty: Option<bool>, include_watchonly: Option<bool> ) -> Result<Vec<ListReceivedByAddressResult>> { ... } fn create_psbt( &self, inputs: &[CreateRawTransactionInput], outputs: &HashMap<String, Amount>, locktime: Option<i64>, replaceable: Option<bool> ) -> Result<String> { ... } fn create_raw_transaction_hex( &self, utxos: &[CreateRawTransactionInput], outs: &HashMap<String, Amount>, locktime: Option<i64>, replaceable: Option<bool> ) -> Result<String> { ... } fn create_raw_transaction( &self, utxos: &[CreateRawTransactionInput], outs: &HashMap<String, Amount>, locktime: Option<i64>, replaceable: Option<bool> ) -> Result<Transaction> { ... } fn decode_raw_transaction<R: RawTx>( &self, tx: R, is_witness: Option<bool> ) -> Result<DecodeRawTransactionResult> { ... } fn fund_raw_transaction<R: RawTx>( &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> { ... } fn sign_raw_transaction_with_wallet<R: RawTx>( &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> { ... } fn test_mempool_accept<R: RawTx>( &self, rawtxs: &[R] ) -> Result<Vec<TestMempoolAcceptResult>> { ... } fn stop(&self) -> Result<String> { ... } fn verify_message( &self, address: &Address, signature: &Signature, message: &str ) -> Result<bool> { ... } fn get_new_address( &self, label: Option<&str>, address_type: Option<AddressType> ) -> Result<Address<NetworkUnchecked>> { ... } fn get_raw_change_address( &self, address_type: Option<AddressType> ) -> Result<Address<NetworkUnchecked>> { ... } fn get_address_info( &self, address: &Address ) -> Result<GetAddressInfoResult> { ... } fn generate_to_address( &self, block_num: u64, address: &Address<NetworkChecked> ) -> Result<Vec<BlockHash>> { ... } fn generate( &self, block_num: u64, maxtries: Option<u64> ) -> Result<Vec<BlockHash>> { ... } fn invalidate_block(&self, block_hash: &BlockHash) -> Result<()> { ... } fn reconsider_block(&self, block_hash: &BlockHash) -> Result<()> { ... } fn get_mempool_info(&self) -> Result<GetMempoolInfoResult> { ... } fn get_raw_mempool(&self) -> Result<Vec<Txid>> { ... } fn get_raw_mempool_verbose( &self ) -> Result<HashMap<Txid, GetMempoolEntryResult>> { ... } fn get_mempool_entry(&self, txid: &Txid) -> Result<GetMempoolEntryResult> { ... } fn get_chain_tips(&self) -> Result<GetChainTipsResult> { ... } fn send_to_address( &self, address: &Address<NetworkChecked>, 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<Txid> { ... } fn add_node(&self, addr: &str) -> Result<()> { ... } fn remove_node(&self, addr: &str) -> Result<()> { ... } fn onetry_node(&self, addr: &str) -> Result<()> { ... } fn disconnect_node(&self, addr: &str) -> Result<()> { ... } fn disconnect_node_by_id(&self, node_id: u32) -> Result<()> { ... } fn get_added_node_info( &self, node: Option<&str> ) -> Result<Vec<GetAddedNodeInfoResult>> { ... } fn get_node_addresses( &self, count: Option<usize> ) -> Result<Vec<GetNodeAddressesResult>> { ... } fn list_banned(&self) -> Result<Vec<ListBannedResult>> { ... } fn clear_banned(&self) -> Result<()> { ... } fn add_ban(&self, subnet: &str, bantime: u64, absolute: bool) -> Result<()> { ... } fn remove_ban(&self, subnet: &str) -> Result<()> { ... } fn set_network_active(&self, state: bool) -> Result<bool> { ... } fn get_peer_info(&self) -> Result<Vec<GetPeerInfoResult>> { ... } fn ping(&self) -> Result<()> { ... } fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Txid> { ... } fn estimate_smart_fee( &self, conf_target: u16, estimate_mode: Option<EstimateMode> ) -> Result<EstimateSmartFeeResult> { ... } fn wait_for_new_block(&self, timeout: u64) -> Result<BlockRef> { ... } fn wait_for_block( &self, blockhash: &BlockHash, timeout: u64 ) -> Result<BlockRef> { ... } fn wallet_create_funded_psbt( &self, inputs: &[CreateRawTransactionInput], outputs: &HashMap<String, Amount>, locktime: Option<i64>, options: Option<WalletCreateFundedPsbtOptions>, bip32derivs: Option<bool> ) -> Result<WalletCreateFundedPsbtResult> { ... } fn wallet_process_psbt( &self, psbt: &str, sign: Option<bool>, sighash_type: Option<SigHashType>, bip32derivs: Option<bool> ) -> Result<WalletProcessPsbtResult> { ... } fn get_descriptor_info(&self, desc: &str) -> Result<GetDescriptorInfoResult> { ... } fn join_psbt(&self, psbts: &[String]) -> Result<String> { ... } fn combine_psbt(&self, psbts: &[String]) -> Result<String> { ... } fn combine_raw_transaction(&self, hex_strings: &[String]) -> Result<String> { ... } fn finalize_psbt( &self, psbt: &str, extract: Option<bool> ) -> Result<FinalizePsbtResult> { ... } fn derive_addresses( &self, descriptor: &str, range: Option<[u32; 2]> ) -> Result<Vec<Address<NetworkUnchecked>>> { ... } fn rescan_blockchain( &self, start_from: Option<usize>, stop_height: Option<usize> ) -> Result<(usize, Option<usize>)> { ... } fn get_tx_out_set_info( &self, hash_type: Option<TxOutSetHashType>, hash_or_height: Option<HashOrHeight>, use_index: Option<bool> ) -> Result<GetTxOutSetInfoResult> { ... } fn get_net_totals(&self) -> Result<GetNetTotalsResult> { ... } fn get_network_hash_ps( &self, nblocks: Option<u64>, height: Option<u64> ) -> Result<f64> { ... } fn uptime(&self) -> Result<u64> { ... } fn submit_block(&self, block: &Block) -> Result<()> { ... } fn submit_block_bytes(&self, block_bytes: &[u8]) -> Result<()> { ... } fn submit_block_hex(&self, block_hex: &str) -> Result<()> { ... } fn scan_tx_out_set_blocking( &self, descriptors: &[ScanTxOutRequest] ) -> Result<ScanTxOutResult> { ... }
}

Required Methods§

source

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

Call a cmd rpc with given args list

Provided Methods§

source

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

Query an object implementing Querable type

Examples found in repository?
examples/test_against_node.rs (line 38)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main_result() -> Result<(), Error> {
    let mut args = std::env::args();

    let _exe_name = args.next().unwrap();

    let url = args.next().expect("Usage: <rpc_url> <username> <password>");
    let user = args.next().expect("no user given");
    let pass = args.next().expect("no pass given");

    let rpc = Client::new(&url, Auth::UserPass(user, pass)).unwrap();

    let _blockchain_info = rpc.get_blockchain_info()?;

    let best_block_hash = rpc.get_best_block_hash()?;
    println!("best block hash: {}", best_block_hash);
    let bestblockcount = rpc.get_block_count()?;
    println!("best block height: {}", bestblockcount);
    let best_block_hash_by_height = rpc.get_block_hash(bestblockcount)?;
    println!("best block hash by height: {}", best_block_hash_by_height);
    assert_eq!(best_block_hash_by_height, best_block_hash);

    let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
    println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
    let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
    println!("tx by `get`: {}", bitcoin_tx.txid());

    Ok(())
}
source

fn get_network_info(&self) -> Result<GetNetworkInfoResult>

source

fn get_index_info(&self) -> Result<GetIndexInfoResult>

source

fn version(&self) -> Result<usize>

source

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

source

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

source

fn unload_wallet( &self, wallet: Option<&str> ) -> Result<Option<UnloadWalletResult>>

source

fn create_wallet( &self, wallet: &str, disable_private_keys: Option<bool>, blank: Option<bool>, passphrase: Option<&str>, avoid_reuse: Option<bool> ) -> Result<LoadWalletResult>

source

fn list_wallets(&self) -> Result<Vec<String>>

source

fn list_wallet_dir(&self) -> Result<Vec<String>>

source

fn get_wallet_info(&self) -> Result<GetWalletInfoResult>

source

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

source

fn dump_private_key(&self, address: &Address) -> Result<PrivateKey>

source

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

source

fn get_difficulty(&self) -> Result<f64>

source

fn get_connection_count(&self) -> Result<usize>

source

fn get_block(&self, hash: &BlockHash) -> Result<Block>

source

fn get_block_hex(&self, hash: &BlockHash) -> Result<String>

source

fn get_block_info(&self, hash: &BlockHash) -> Result<GetBlockResult>

source

fn get_block_header(&self, hash: &BlockHash) -> Result<Header>

source

fn get_block_header_info( &self, hash: &BlockHash ) -> Result<GetBlockHeaderResult>

source

fn get_mining_info(&self) -> Result<GetMiningInfoResult>

source

fn get_block_template( &self, mode: GetBlockTemplateModes, rules: &[GetBlockTemplateRules], capabilities: &[GetBlockTemplateCapabilities] ) -> Result<GetBlockTemplateResult>

source

fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult>

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

Examples found in repository?
examples/test_against_node.rs (line 28)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main_result() -> Result<(), Error> {
    let mut args = std::env::args();

    let _exe_name = args.next().unwrap();

    let url = args.next().expect("Usage: <rpc_url> <username> <password>");
    let user = args.next().expect("no user given");
    let pass = args.next().expect("no pass given");

    let rpc = Client::new(&url, Auth::UserPass(user, pass)).unwrap();

    let _blockchain_info = rpc.get_blockchain_info()?;

    let best_block_hash = rpc.get_best_block_hash()?;
    println!("best block hash: {}", best_block_hash);
    let bestblockcount = rpc.get_block_count()?;
    println!("best block height: {}", bestblockcount);
    let best_block_hash_by_height = rpc.get_block_hash(bestblockcount)?;
    println!("best block hash by height: {}", best_block_hash_by_height);
    assert_eq!(best_block_hash_by_height, best_block_hash);

    let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
    println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
    let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
    println!("tx by `get`: {}", bitcoin_tx.txid());

    Ok(())
}
source

fn get_block_count(&self) -> Result<u64>

Returns the numbers of block in the longest chain.

Examples found in repository?
examples/test_against_node.rs (line 32)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main_result() -> Result<(), Error> {
    let mut args = std::env::args();

    let _exe_name = args.next().unwrap();

    let url = args.next().expect("Usage: <rpc_url> <username> <password>");
    let user = args.next().expect("no user given");
    let pass = args.next().expect("no pass given");

    let rpc = Client::new(&url, Auth::UserPass(user, pass)).unwrap();

    let _blockchain_info = rpc.get_blockchain_info()?;

    let best_block_hash = rpc.get_best_block_hash()?;
    println!("best block hash: {}", best_block_hash);
    let bestblockcount = rpc.get_block_count()?;
    println!("best block height: {}", bestblockcount);
    let best_block_hash_by_height = rpc.get_block_hash(bestblockcount)?;
    println!("best block hash by height: {}", best_block_hash_by_height);
    assert_eq!(best_block_hash_by_height, best_block_hash);

    let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
    println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
    let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
    println!("tx by `get`: {}", bitcoin_tx.txid());

    Ok(())
}
source

fn get_best_block_hash(&self) -> Result<BlockHash>

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

Examples found in repository?
examples/test_against_node.rs (line 30)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main_result() -> Result<(), Error> {
    let mut args = std::env::args();

    let _exe_name = args.next().unwrap();

    let url = args.next().expect("Usage: <rpc_url> <username> <password>");
    let user = args.next().expect("no user given");
    let pass = args.next().expect("no pass given");

    let rpc = Client::new(&url, Auth::UserPass(user, pass)).unwrap();

    let _blockchain_info = rpc.get_blockchain_info()?;

    let best_block_hash = rpc.get_best_block_hash()?;
    println!("best block hash: {}", best_block_hash);
    let bestblockcount = rpc.get_block_count()?;
    println!("best block height: {}", bestblockcount);
    let best_block_hash_by_height = rpc.get_block_hash(bestblockcount)?;
    println!("best block hash by height: {}", best_block_hash_by_height);
    assert_eq!(best_block_hash_by_height, best_block_hash);

    let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
    println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
    let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
    println!("tx by `get`: {}", bitcoin_tx.txid());

    Ok(())
}
source

fn get_block_hash(&self, height: u64) -> Result<BlockHash>

Get block hash at a given height

Examples found in repository?
examples/test_against_node.rs (line 34)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main_result() -> Result<(), Error> {
    let mut args = std::env::args();

    let _exe_name = args.next().unwrap();

    let url = args.next().expect("Usage: <rpc_url> <username> <password>");
    let user = args.next().expect("no user given");
    let pass = args.next().expect("no pass given");

    let rpc = Client::new(&url, Auth::UserPass(user, pass)).unwrap();

    let _blockchain_info = rpc.get_blockchain_info()?;

    let best_block_hash = rpc.get_best_block_hash()?;
    println!("best block hash: {}", best_block_hash);
    let bestblockcount = rpc.get_block_count()?;
    println!("best block height: {}", bestblockcount);
    let best_block_hash_by_height = rpc.get_block_hash(bestblockcount)?;
    println!("best block hash by height: {}", best_block_hash_by_height);
    assert_eq!(best_block_hash_by_height, best_block_hash);

    let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
    println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
    let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
    println!("tx by `get`: {}", bitcoin_tx.txid());

    Ok(())
}
source

fn get_block_stats(&self, height: u64) -> Result<GetBlockStatsResult>

source

fn get_block_stats_fields( &self, height: u64, fields: &[BlockStatsFields] ) -> Result<GetBlockStatsResultPartial>

source

fn get_raw_transaction( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<Transaction>

source

fn get_raw_transaction_hex( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<String>

source

fn get_raw_transaction_info( &self, txid: &Txid, block_hash: Option<&BlockHash> ) -> Result<GetRawTransactionResult>

source

fn get_block_filter( &self, block_hash: &BlockHash ) -> Result<GetBlockFilterResult>

source

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

source

fn get_balances(&self) -> Result<GetBalancesResult>

source

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

source

fn get_transaction( &self, txid: &Txid, include_watchonly: Option<bool> ) -> Result<GetTransactionResult>

source

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

source

fn list_since_block( &self, blockhash: Option<&BlockHash>, target_confirmations: Option<usize>, include_watchonly: Option<bool>, include_removed: Option<bool> ) -> Result<ListSinceBlockResult>

source

fn get_tx_out( &self, txid: &Txid, vout: u32, include_mempool: Option<bool> ) -> Result<Option<GetTxOutResult>>

source

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

source

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

source

fn import_private_key( &self, privkey: &PrivateKey, label: Option<&str>, rescan: Option<bool> ) -> Result<()>

source

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

source

fn import_address_script( &self, script: &Script, label: Option<&str>, rescan: Option<bool>, p2sh: Option<bool> ) -> Result<()>

source

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

source

fn import_descriptors( &self, req: ImportDescriptors ) -> Result<Vec<ImportMultiResult>>

source

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

source

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

source

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

source

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

To unlock, use [unlock_unspent].

source

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

source

fn unlock_unspent_all(&self) -> Result<bool>

Unlock all unspent UTXOs.

source

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

source

fn create_psbt( &self, inputs: &[CreateRawTransactionInput], outputs: &HashMap<String, Amount>, locktime: Option<i64>, replaceable: Option<bool> ) -> Result<String>

source

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

source

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

source

fn decode_raw_transaction<R: RawTx>( &self, tx: R, is_witness: Option<bool> ) -> Result<DecodeRawTransactionResult>

source

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

source

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

👎Deprecated
source

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

source

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

source

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

source

fn stop(&self) -> Result<String>

source

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

source

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

Generate new address under own control

source

fn get_raw_change_address( &self, address_type: Option<AddressType> ) -> Result<Address<NetworkUnchecked>>

Generate new address for receiving change

source

fn get_address_info(&self, address: &Address) -> Result<GetAddressInfoResult>

source

fn generate_to_address( &self, block_num: u64, address: &Address<NetworkChecked> ) -> Result<Vec<BlockHash>>

Mine block_num blocks and pay coinbase to address

Returns hashes of the generated blocks

source

fn generate( &self, block_num: u64, maxtries: Option<u64> ) -> Result<Vec<BlockHash>>

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

source

fn invalidate_block(&self, block_hash: &BlockHash) -> Result<()>

Mark a block as invalid by block_hash

source

fn reconsider_block(&self, block_hash: &BlockHash) -> Result<()>

Mark a block as valid by block_hash

source

fn get_mempool_info(&self) -> Result<GetMempoolInfoResult>

Returns details on the active state of the TX memory pool

source

fn get_raw_mempool(&self) -> Result<Vec<Txid>>

Get txids of all transactions in a memory pool

source

fn get_raw_mempool_verbose( &self ) -> Result<HashMap<Txid, GetMempoolEntryResult>>

Get details for the transactions in a memory pool

source

fn get_mempool_entry(&self, txid: &Txid) -> Result<GetMempoolEntryResult>

Get mempool data for given transaction

source

fn get_chain_tips(&self) -> Result<GetChainTipsResult>

Get information about all known tips in the block tree, including the main chain as well as stale branches.

source

fn send_to_address( &self, address: &Address<NetworkChecked>, 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<Txid>

source

fn add_node(&self, addr: &str) -> Result<()>

Attempts to add a node to the addnode list. Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).

source

fn remove_node(&self, addr: &str) -> Result<()>

Attempts to remove a node from the addnode list.

source

fn onetry_node(&self, addr: &str) -> Result<()>

Attempts to connect to a node without permanently adding it to the addnode list.

source

fn disconnect_node(&self, addr: &str) -> Result<()>

Immediately disconnects from the specified peer node.

source

fn disconnect_node_by_id(&self, node_id: u32) -> Result<()>

source

fn get_added_node_info( &self, node: Option<&str> ) -> Result<Vec<GetAddedNodeInfoResult>>

Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)

source

fn get_node_addresses( &self, count: Option<usize> ) -> Result<Vec<GetNodeAddressesResult>>

Return known addresses which can potentially be used to find new nodes in the network

source

fn list_banned(&self) -> Result<Vec<ListBannedResult>>

List all banned IPs/Subnets.

source

fn clear_banned(&self) -> Result<()>

Clear all banned IPs.

source

fn add_ban(&self, subnet: &str, bantime: u64, absolute: bool) -> Result<()>

Attempts to add an IP/Subnet to the banned list.

source

fn remove_ban(&self, subnet: &str) -> Result<()>

Attempts to remove an IP/Subnet from the banned list.

source

fn set_network_active(&self, state: bool) -> Result<bool>

Disable/enable all p2p network activity.

source

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

Returns data about each connected network node as an array of PeerInfo

source

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.

source

fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Txid>

source

fn estimate_smart_fee( &self, conf_target: u16, estimate_mode: Option<EstimateMode> ) -> Result<EstimateSmartFeeResult>

source

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
  1. timeout: Time in milliseconds to wait for a response. 0 indicates no timeout.
source

fn wait_for_block( &self, blockhash: &BlockHash, 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
  1. blockhash: Block hash to wait for.
  2. timeout: Time in milliseconds to wait for a response. 0 indicates no timeout.
source

fn wallet_create_funded_psbt( &self, inputs: &[CreateRawTransactionInput], outputs: &HashMap<String, Amount>, locktime: Option<i64>, options: Option<WalletCreateFundedPsbtOptions>, bip32derivs: Option<bool> ) -> Result<WalletCreateFundedPsbtResult>

source

fn wallet_process_psbt( &self, psbt: &str, sign: Option<bool>, sighash_type: Option<SigHashType>, bip32derivs: Option<bool> ) -> Result<WalletProcessPsbtResult>

source

fn get_descriptor_info(&self, desc: &str) -> Result<GetDescriptorInfoResult>

source

fn join_psbt(&self, psbts: &[String]) -> Result<String>

source

fn combine_psbt(&self, psbts: &[String]) -> Result<String>

source

fn combine_raw_transaction(&self, hex_strings: &[String]) -> Result<String>

source

fn finalize_psbt( &self, psbt: &str, extract: Option<bool> ) -> Result<FinalizePsbtResult>

source

fn derive_addresses( &self, descriptor: &str, range: Option<[u32; 2]> ) -> Result<Vec<Address<NetworkUnchecked>>>

source

fn rescan_blockchain( &self, start_from: Option<usize>, stop_height: Option<usize> ) -> Result<(usize, Option<usize>)>

source

fn get_tx_out_set_info( &self, hash_type: Option<TxOutSetHashType>, hash_or_height: Option<HashOrHeight>, use_index: Option<bool> ) -> Result<GetTxOutSetInfoResult>

Returns statistics about the unspent transaction output set. Note this call may take some time if you are not using coinstatsindex.

source

fn get_net_totals(&self) -> Result<GetNetTotalsResult>

Returns information about network traffic, including bytes in, bytes out, and current time.

source

fn get_network_hash_ps( &self, nblocks: Option<u64>, height: Option<u64> ) -> Result<f64>

Returns the estimated network hashes per second based on the last n blocks.

source

fn uptime(&self) -> Result<u64>

Returns the total uptime of the server in seconds

source

fn submit_block(&self, block: &Block) -> Result<()>

Submit a block

source

fn submit_block_bytes(&self, block_bytes: &[u8]) -> Result<()>

Submit a raw block

source

fn submit_block_hex(&self, block_hex: &str) -> Result<()>

Submit a block as a hex string

source

fn scan_tx_out_set_blocking( &self, descriptors: &[ScanTxOutRequest] ) -> Result<ScanTxOutResult>

Implementors§