pub struct BitcoinTestClient { /* private fields */ }Implementations§
Source§impl BitcoinTestClient
impl BitcoinTestClient
Sourcepub async fn new() -> Result<Self, TransportError>
pub async fn new() -> Result<Self, TransportError>
Creates a new Bitcoin test client with default configuration (regtest network).
use bitcoin_rpc_midas::test_node::client::BitcoinTestClient;
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let client = BitcoinTestClient::new().await?;
Ok(())
}Sourcepub async fn new_with_network(network: Network) -> Result<Self, TransportError>
pub async fn new_with_network(network: Network) -> Result<Self, TransportError>
Creates a new Bitcoin test client with a specific network.
use bitcoin_rpc_midas::test_node::client::BitcoinTestClient;
use bitcoin::Network;
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let client = BitcoinTestClient::new_with_network(Network::Bitcoin).await?;
Ok(())
}Sourcepub async fn new_with_manager<M: NodeManagerTrait + 'static>(
node_manager: M,
) -> Result<Self, TransportError>
pub async fn new_with_manager<M: NodeManagerTrait + 'static>( node_manager: M, ) -> Result<Self, TransportError>
Creates a new Bitcoin test client with a specific node manager.
This allows for custom node configuration and lifecycle management.
The node manager must implement the NodeManager trait.
use bitcoin_rpc_midas::test_node::client::BitcoinTestClient;
use bitcoin_rpc_midas::node::BitcoinNodeManager;
use bitcoin_rpc_midas::test_config::TestConfig;
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let config = TestConfig::default();
let node_manager = BitcoinNodeManager::new_with_config(&config)?;
let client = BitcoinTestClient::new_with_manager(node_manager).await?;
Ok(())
}Sourcepub async fn ensure_wallet_with_options(
&mut self,
wallet_name: impl Into<String>,
opts: WalletOptions,
) -> Result<String, TransportError>
pub async fn ensure_wallet_with_options( &mut self, wallet_name: impl Into<String>, opts: WalletOptions, ) -> Result<String, TransportError>
Ensures a wallet exists using the given options. Loads the wallet if it already exists. Returns the wallet name.
Sourcepub async fn ensure_default_wallet(
&mut self,
name: impl Into<String>,
) -> Result<String, TransportError>
pub async fn ensure_default_wallet( &mut self, name: impl Into<String>, ) -> Result<String, TransportError>
Shortcut for ensure_wallet_with_options("test_wallet", WalletOptions::default().with_descriptors())
Sourcepub async fn mine_blocks(
&mut self,
num_blocks: u64,
maxtries: u64,
) -> Result<(String, Value), TransportError>
pub async fn mine_blocks( &mut self, num_blocks: u64, maxtries: u64, ) -> Result<(String, Value), TransportError>
Helper method to mine blocks to a new address
Sourcepub async fn reset_chain(&mut self) -> Result<(), TransportError>
pub async fn reset_chain(&mut self) -> Result<(), TransportError>
Resets the blockchain to a clean state. This method:
- First attempts to prune the blockchain to height 0
- If blocks remain, invalidates all blocks except genesis
- Reconsiders the genesis block to maintain a valid chain
Sourcepub async fn stop_node(&mut self) -> Result<(), TransportError>
pub async fn stop_node(&mut self) -> Result<(), TransportError>
Stops the Bitcoin node if one is running. This is automatically called when the client is dropped.
Sourcepub fn node_manager(&self) -> Option<&dyn NodeManagerTrait>
pub fn node_manager(&self) -> Option<&dyn NodeManagerTrait>
Returns a reference to the node manager if one exists. This can be used to access node configuration and control the node lifecycle.
Sourcepub fn batch(&self) -> BatchBuilder
pub fn batch(&self) -> BatchBuilder
Begin a JSON-RPC batch against this test node
Sourcepub async fn abandontransaction(&self, txid: Txid) -> Result<(), TransportError>
pub async fn abandontransaction(&self, txid: Txid) -> Result<(), TransportError>
Mark in-wallet transaction
Sourcepub async fn abortrescan(&self) -> Result<AbortrescanResponse, TransportError>
pub async fn abortrescan(&self) -> Result<AbortrescanResponse, TransportError>
Stops current wallet rescan triggered by an RPC call, e.g. by a rescanblockchain call. Note: Use “getwalletinfo” to query the scanning progress.
Sourcepub async fn addconnection(
&self,
address: String,
connection_type: String,
v2transport: bool,
) -> Result<AddconnectionResponse, TransportError>
pub async fn addconnection( &self, address: String, connection_type: String, v2transport: bool, ) -> Result<AddconnectionResponse, TransportError>
Open an outbound connection to a specified node. This RPC is for testing only.
Sourcepub async fn addnode(
&self,
node: String,
command: String,
v2transport: bool,
) -> Result<(), TransportError>
pub async fn addnode( &self, node: String, command: String, v2transport: bool, ) -> Result<(), TransportError>
Attempts to add or remove a node from the addnode list. Or try a connection to a node once. 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). Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.
Sourcepub async fn addpeeraddress(
&self,
address: String,
port: u16,
tried: bool,
) -> Result<AddpeeraddressResponse, TransportError>
pub async fn addpeeraddress( &self, address: String, port: u16, tried: bool, ) -> Result<AddpeeraddressResponse, TransportError>
Add the address of a potential peer to an address manager table. This RPC is for testing only.
Sourcepub async fn analyzepsbt(
&self,
psbt: String,
) -> Result<AnalyzepsbtResponse, TransportError>
pub async fn analyzepsbt( &self, psbt: String, ) -> Result<AnalyzepsbtResponse, TransportError>
Analyzes and provides information about the current status of a PSBT and its inputs
Sourcepub async fn backupwallet(
&self,
destination: String,
) -> Result<(), TransportError>
pub async fn backupwallet( &self, destination: String, ) -> Result<(), TransportError>
Safely copies the current wallet file to the specified destination, which can either be a directory or a path with a filename.
Sourcepub async fn bumpfee(
&self,
txid: Txid,
options: Value,
) -> Result<BumpfeeResponse, TransportError>
pub async fn bumpfee( &self, txid: Txid, options: Value, ) -> Result<BumpfeeResponse, TransportError>
Bumps the fee of a transaction T, replacing it with a new transaction B. A transaction with the given txid must be in the wallet. The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist. All inputs in the original transaction will be included in the replacement transaction. The command will fail if the wallet or mempool contains a transaction that spends one of T“s outputs. By default, the new fee will be calculated automatically using the estimatesmartfee RPC. The user can specify a confirmation target for estimatesmartfee. Alternatively, the user can specify a fee rate in sat/vB for the new transaction. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node“s mempool.
- WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
Sourcepub async fn clearbanned(&self) -> Result<(), TransportError>
pub async fn clearbanned(&self) -> Result<(), TransportError>
Clear all banned IPs.
Sourcepub async fn combinepsbt(
&self,
txs: Vec<Value>,
) -> Result<CombinepsbtResponse, TransportError>
pub async fn combinepsbt( &self, txs: Vec<Value>, ) -> Result<CombinepsbtResponse, TransportError>
Combine multiple partially signed Bitcoin transactions into one transaction. Implements the Combiner role.
Sourcepub async fn combinerawtransaction(
&self,
txs: Vec<Value>,
) -> Result<CombinerawtransactionResponse, TransportError>
pub async fn combinerawtransaction( &self, txs: Vec<Value>, ) -> Result<CombinerawtransactionResponse, TransportError>
Combine multiple partially signed transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction.
Sourcepub async fn converttopsbt(
&self,
hexstring: String,
permitsigdata: bool,
iswitness: bool,
) -> Result<ConverttopsbtResponse, TransportError>
pub async fn converttopsbt( &self, hexstring: String, permitsigdata: bool, iswitness: bool, ) -> Result<ConverttopsbtResponse, TransportError>
Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction createpsbt and walletcreatefundedpsbt should be used for new applications.
Sourcepub async fn createmultisig(
&self,
nrequired: u32,
keys: Vec<String>,
address_type: String,
) -> Result<CreatemultisigResponse, TransportError>
pub async fn createmultisig( &self, nrequired: u32, keys: Vec<String>, address_type: String, ) -> Result<CreatemultisigResponse, TransportError>
Creates a multi-signature address with n signatures of m keys required. It returns a json object with the address and redeemScript.
Sourcepub async fn createpsbt(
&self,
inputs: Vec<Value>,
outputs: Vec<Value>,
locktime: u32,
replaceable: bool,
version: u32,
) -> Result<CreatepsbtResponse, TransportError>
pub async fn createpsbt( &self, inputs: Vec<Value>, outputs: Vec<Value>, locktime: u32, replaceable: bool, version: u32, ) -> Result<CreatepsbtResponse, TransportError>
Creates a transaction in the Partially Signed Transaction format. Implements the Creator role. Note that the transaction“s inputs are not signed, and it is not stored in the wallet or transmitted to the network.
Sourcepub async fn createrawtransaction(
&self,
inputs: Vec<Value>,
outputs: Vec<Value>,
locktime: u32,
replaceable: bool,
version: u32,
) -> Result<CreaterawtransactionResponse, TransportError>
pub async fn createrawtransaction( &self, inputs: Vec<Value>, outputs: Vec<Value>, locktime: u32, replaceable: bool, version: u32, ) -> Result<CreaterawtransactionResponse, TransportError>
Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. Returns hex-encoded raw transaction. Note that the transaction“s inputs are not signed, and it is not stored in the wallet or transmitted to the network.
Sourcepub async fn createwallet(
&self,
wallet_name: String,
disable_private_keys: bool,
blank: bool,
passphrase: String,
avoid_reuse: bool,
descriptors: bool,
load_on_startup: bool,
external_signer: bool,
) -> Result<CreatewalletResponse, TransportError>
pub async fn createwallet( &self, wallet_name: String, disable_private_keys: bool, blank: bool, passphrase: String, avoid_reuse: bool, descriptors: bool, load_on_startup: bool, external_signer: bool, ) -> Result<CreatewalletResponse, TransportError>
Creates and loads a new wallet.
Sourcepub async fn createwalletdescriptor(
&self,
_type: String,
options: Value,
) -> Result<CreatewalletdescriptorResponse, TransportError>
pub async fn createwalletdescriptor( &self, _type: String, options: Value, ) -> Result<CreatewalletdescriptorResponse, TransportError>
Creates the wallet“s descriptor for the given address type. The address type must be one that the wallet does not already have a descriptor for. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn decodepsbt(
&self,
psbt: String,
) -> Result<DecodepsbtResponse, TransportError>
pub async fn decodepsbt( &self, psbt: String, ) -> Result<DecodepsbtResponse, TransportError>
Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction.
Sourcepub async fn decoderawtransaction(
&self,
hexstring: String,
iswitness: bool,
) -> Result<DecoderawtransactionResponse, TransportError>
pub async fn decoderawtransaction( &self, hexstring: String, iswitness: bool, ) -> Result<DecoderawtransactionResponse, TransportError>
Return a JSON object representing the serialized, hex-encoded transaction.
Sourcepub async fn decodescript(
&self,
hexstring: String,
) -> Result<DecodescriptResponse, TransportError>
pub async fn decodescript( &self, hexstring: String, ) -> Result<DecodescriptResponse, TransportError>
Decode a hex-encoded script.
Sourcepub async fn deriveaddresses(
&self,
descriptor: String,
range: Value,
) -> Result<DeriveaddressesResponse, TransportError>
pub async fn deriveaddresses( &self, descriptor: String, range: Value, ) -> Result<DeriveaddressesResponse, TransportError>
Derives one or more addresses corresponding to an output descriptor.
Examples of output descriptors are:
pkh(
In the above,
Sourcepub async fn descriptorprocesspsbt(
&self,
psbt: String,
descriptors: Vec<Value>,
sighashtype: String,
bip32derivs: bool,
finalize: bool,
) -> Result<DescriptorprocesspsbtResponse, TransportError>
pub async fn descriptorprocesspsbt( &self, psbt: String, descriptors: Vec<Value>, sighashtype: String, bip32derivs: bool, finalize: bool, ) -> Result<DescriptorprocesspsbtResponse, TransportError>
Update all segwit inputs in a PSBT with information from output descriptors, the UTXO set or the mempool. Then, sign the inputs we are able to with information from the output descriptors.
Sourcepub async fn disconnectnode(
&self,
address: String,
nodeid: u64,
) -> Result<(), TransportError>
pub async fn disconnectnode( &self, address: String, nodeid: u64, ) -> Result<(), TransportError>
Immediately disconnects from the specified peer node.
Strictly one out of “address” and “nodeid” can be provided to identify the node.
To disconnect by nodeid, either set “address” to the empty string, or call using the named “nodeid” argument only.
Sourcepub async fn dumptxoutset(
&self,
path: String,
_type: String,
options: Value,
) -> Result<DumptxoutsetResponse, TransportError>
pub async fn dumptxoutset( &self, path: String, _type: String, options: Value, ) -> Result<DumptxoutsetResponse, TransportError>
Write the serialized UTXO set to a file. This can be used in loadtxoutset afterwards if this snapshot height is supported in the chainparams as well.
Unless the “latest” type is requested, the node will roll back to the requested height and network activity will be suspended during this process. Because of this it is discouraged to interact with the node in any other way during the execution of this call to avoid inconsistent results and race conditions, particularly RPCs that interact with blockstorage.
This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn echo(
&self,
arg0: String,
arg1: String,
arg2: String,
arg3: String,
arg4: String,
arg5: String,
arg6: String,
arg7: String,
arg8: String,
arg9: String,
) -> Result<EchoResponse, TransportError>
pub async fn echo( &self, arg0: String, arg1: String, arg2: String, arg3: String, arg4: String, arg5: String, arg6: String, arg7: String, arg8: String, arg9: String, ) -> Result<EchoResponse, TransportError>
Simply echo back the input arguments. This command is for testing.
It will return an internal bug report when arg9=“trigger_internal_bug” is passed.
The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
Sourcepub async fn echoipc(
&self,
arg: String,
) -> Result<EchoipcResponse, TransportError>
pub async fn echoipc( &self, arg: String, ) -> Result<EchoipcResponse, TransportError>
Echo back the input argument, passing it through a spawned process in a multiprocess build. This command is for testing.
Sourcepub async fn echojson(
&self,
arg0: String,
arg1: String,
arg2: String,
arg3: String,
arg4: String,
arg5: String,
arg6: String,
arg7: String,
arg8: String,
arg9: String,
) -> Result<EchojsonResponse, TransportError>
pub async fn echojson( &self, arg0: String, arg1: String, arg2: String, arg3: String, arg4: String, arg5: String, arg6: String, arg7: String, arg8: String, arg9: String, ) -> Result<EchojsonResponse, TransportError>
Simply echo back the input arguments. This command is for testing.
It will return an internal bug report when arg9=“trigger_internal_bug” is passed.
The difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in bitcoin-cli and the GUI. There is no server-side difference.
Sourcepub async fn encryptwallet(
&self,
passphrase: String,
) -> Result<EncryptwalletResponse, TransportError>
pub async fn encryptwallet( &self, passphrase: String, ) -> Result<EncryptwalletResponse, TransportError>
Encrypts the wallet with “passphrase”. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior to making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. ** IMPORTANT ** For security reasons, the encryption process will generate a new HD seed, resulting in the creation of a fresh set of active descriptors. Therefore, it is crucial to securely back up the newly generated wallet file using the backupwallet RPC.
Sourcepub async fn enumeratesigners(
&self,
) -> Result<EnumeratesignersResponse, TransportError>
pub async fn enumeratesigners( &self, ) -> Result<EnumeratesignersResponse, TransportError>
Returns a list of external signers from -signer.
Sourcepub async fn estimaterawfee(
&self,
conf_target: u64,
threshold: u64,
) -> Result<EstimaterawfeeResponse, TransportError>
pub async fn estimaterawfee( &self, conf_target: u64, threshold: u64, ) -> Result<EstimaterawfeeResponse, TransportError>
WARNING: This interface is unstable and may disappear or change!
WARNING: This is an advanced API call that is tightly coupled to the specific implementation of fee estimation. The parameters it can be called with and the results it returns will change if the internal implementation changes.
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible. Uses virtual transaction size as defined in BIP 141 (witness data is discounted).
Sourcepub async fn estimatesmartfee(
&self,
conf_target: u64,
estimate_mode: String,
) -> Result<EstimatesmartfeeResponse, TransportError>
pub async fn estimatesmartfee( &self, conf_target: u64, estimate_mode: String, ) -> Result<EstimatesmartfeeResponse, TransportError>
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted).
Sourcepub async fn finalizepsbt(
&self,
psbt: String,
extract: bool,
) -> Result<FinalizepsbtResponse, TransportError>
pub async fn finalizepsbt( &self, psbt: String, extract: bool, ) -> Result<FinalizepsbtResponse, TransportError>
Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be created which has the final_scriptSig and final_scriptwitness fields filled for inputs that are complete. Implements the Finalizer and Extractor roles.
Sourcepub async fn fundrawtransaction(
&self,
hexstring: String,
options: Value,
iswitness: bool,
) -> Result<FundrawtransactionResponse, TransportError>
pub async fn fundrawtransaction( &self, hexstring: String, options: Value, iswitness: bool, ) -> Result<FundrawtransactionResponse, TransportError>
If the transaction has no inputs, they will be automatically selected to meet its out value. It will add at most one change output to the outputs. No existing outputs will be modified unless “subtractFeeFromOutputs” is specified. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransactionwithkey or signrawtransactionwithwallet for that. All existing inputs must either have their previous output transaction be in the wallet or be in the UTXO set. Solving data must be provided for non-wallet inputs. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importdescriptors (to calculate fees). You can see whether this is the case by checking the “solvable” field in the listunspent output. Note that if specifying an exact fee rate, the resulting transaction may have a higher fee rate if the transaction has unconfirmed inputs. This is because the wallet will attempt to make the entire package have the given fee rate, not the resulting transaction.
Sourcepub async fn generate(&self) -> Result<(), TransportError>
pub async fn generate(&self) -> Result<(), TransportError>
has been replaced by the -generate cli option. Refer to -help for more information.
Sourcepub async fn generateblock(
&self,
output: String,
transactions: Vec<Value>,
submit: bool,
) -> Result<GenerateblockResponse, TransportError>
pub async fn generateblock( &self, output: String, transactions: Vec<Value>, submit: bool, ) -> Result<GenerateblockResponse, TransportError>
Mine a set of ordered transactions to a specified address or descriptor and return the block hash.
Sourcepub async fn generatetoaddress(
&self,
nblocks: u64,
address: String,
maxtries: u64,
) -> Result<GeneratetoaddressResponse, TransportError>
pub async fn generatetoaddress( &self, nblocks: u64, address: String, maxtries: u64, ) -> Result<GeneratetoaddressResponse, TransportError>
Mine to a specified address and return the block hashes.
Sourcepub async fn generatetodescriptor(
&self,
num_blocks: u64,
descriptor: String,
maxtries: u64,
) -> Result<GeneratetodescriptorResponse, TransportError>
pub async fn generatetodescriptor( &self, num_blocks: u64, descriptor: String, maxtries: u64, ) -> Result<GeneratetodescriptorResponse, TransportError>
Mine to a specified descriptor and return the block hashes.
Sourcepub async fn getaddednodeinfo(
&self,
node: String,
) -> Result<GetaddednodeinfoResponse, TransportError>
pub async fn getaddednodeinfo( &self, node: String, ) -> Result<GetaddednodeinfoResponse, TransportError>
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)
Sourcepub async fn getaddressesbylabel(
&self,
label: String,
) -> Result<GetaddressesbylabelResponse, TransportError>
pub async fn getaddressesbylabel( &self, label: String, ) -> Result<GetaddressesbylabelResponse, TransportError>
Returns the list of addresses assigned the specified label.
Sourcepub async fn getaddressinfo(
&self,
address: String,
) -> Result<GetaddressinfoResponse, TransportError>
pub async fn getaddressinfo( &self, address: String, ) -> Result<GetaddressinfoResponse, TransportError>
Return information about the given bitcoin address. Some of the information will only be present if the address is in the active wallet.
Sourcepub async fn getaddrmaninfo(
&self,
) -> Result<GetaddrmaninfoResponse, TransportError>
pub async fn getaddrmaninfo( &self, ) -> Result<GetaddrmaninfoResponse, TransportError>
Provides information about the node“s address manager by returning the number of addresses in the new and tried tables and their sum for all networks.
Sourcepub async fn getbalance(
&self,
dummy: Option<String>,
minconf: u32,
include_watchonly: bool,
avoid_reuse: bool,
) -> Result<GetbalanceResponse, TransportError>
pub async fn getbalance( &self, dummy: Option<String>, minconf: u32, include_watchonly: bool, avoid_reuse: bool, ) -> Result<GetbalanceResponse, TransportError>
Returns the total available balance. The available balance is what the wallet considers currently spendable, and is thus affected by options which limit spendability such as -spendzeroconfchange.
Sourcepub async fn getbalances(&self) -> Result<GetbalancesResponse, TransportError>
pub async fn getbalances(&self) -> Result<GetbalancesResponse, TransportError>
Returns an object with all balances in BTC.
Sourcepub async fn getbestblockhash(
&self,
) -> Result<GetbestblockhashResponse, TransportError>
pub async fn getbestblockhash( &self, ) -> Result<GetbestblockhashResponse, TransportError>
Returns the hash of the best (tip) block in the most-work fully-validated chain.
Sourcepub async fn getblock(
&self,
blockhash: BlockHash,
verbosity: u32,
) -> Result<GetblockResponse, TransportError>
pub async fn getblock( &self, blockhash: BlockHash, verbosity: u32, ) -> Result<GetblockResponse, TransportError>
If verbosity is 0, returns a string that is serialized, hex-encoded data for block “hash”.
If verbosity is 1, returns an Object with information about block
Sourcepub async fn getblockchaininfo(
&self,
) -> Result<GetblockchaininfoResponse, TransportError>
pub async fn getblockchaininfo( &self, ) -> Result<GetblockchaininfoResponse, TransportError>
Returns an object containing various state info regarding blockchain processing.
Sourcepub async fn getblockcount(
&self,
) -> Result<GetblockcountResponse, TransportError>
pub async fn getblockcount( &self, ) -> Result<GetblockcountResponse, TransportError>
Returns the height of the most-work fully-validated chain. The genesis block has height 0.
Sourcepub async fn getblockfilter(
&self,
blockhash: BlockHash,
filtertype: String,
) -> Result<GetblockfilterResponse, TransportError>
pub async fn getblockfilter( &self, blockhash: BlockHash, filtertype: String, ) -> Result<GetblockfilterResponse, TransportError>
Retrieve a BIP 157 content filter for a particular block.
Sourcepub async fn getblockfrompeer(
&self,
blockhash: BlockHash,
peer_id: u64,
) -> Result<GetblockfrompeerResponse, TransportError>
pub async fn getblockfrompeer( &self, blockhash: BlockHash, peer_id: u64, ) -> Result<GetblockfrompeerResponse, TransportError>
Attempt to fetch block from a given peer.
We must have the header for this block, e.g. using submitheader. The block will not have any undo data which can limit the usage of the block data in a context where the undo data is needed. Subsequent calls for the same block may cause the response from the previous peer to be ignored. Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old. When a peer does not respond with a block, we will disconnect. Note: The block could be re-pruned as soon as it is received.
Returns an empty JSON object if the request was successfully scheduled.
Sourcepub async fn getblockhash(
&self,
height: u64,
) -> Result<GetblockhashResponse, TransportError>
pub async fn getblockhash( &self, height: u64, ) -> Result<GetblockhashResponse, TransportError>
Returns hash of block in best-block-chain at height provided.
Sourcepub async fn getblockheader(
&self,
blockhash: BlockHash,
verbose: bool,
) -> Result<GetblockheaderResponse, TransportError>
pub async fn getblockheader( &self, blockhash: BlockHash, verbose: bool, ) -> Result<GetblockheaderResponse, TransportError>
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader “hash”.
If verbose is true, returns an Object with information about blockheader
Sourcepub async fn getblockstats(
&self,
hash_or_height: HashOrHeight,
stats: Vec<String>,
) -> Result<GetblockstatsResponse, TransportError>
pub async fn getblockstats( &self, hash_or_height: HashOrHeight, stats: Vec<String>, ) -> Result<GetblockstatsResponse, TransportError>
Compute per block statistics for a given window. All amounts are in satoshis. It won“t work for some heights with pruning.
Sourcepub async fn getblocktemplate(
&self,
template_request: Value,
) -> Result<(), TransportError>
pub async fn getblocktemplate( &self, template_request: Value, ) -> Result<(), TransportError>
If the request parameters include a “mode” key, that is used to explicitly select between the default “template” request or a “proposal”. It returns data needed to construct a block to work on. For full specification, see BIPs 22, 23, 9, and 145: https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki
Sourcepub async fn getchainstates(
&self,
) -> Result<GetchainstatesResponse, TransportError>
pub async fn getchainstates( &self, ) -> Result<GetchainstatesResponse, TransportError>
Return information about chainstates.
Sourcepub async fn getchaintips(&self) -> Result<GetchaintipsResponse, TransportError>
pub async fn getchaintips(&self) -> Result<GetchaintipsResponse, TransportError>
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
Sourcepub async fn getchaintxstats(
&self,
nblocks: u64,
blockhash: BlockHash,
) -> Result<GetchaintxstatsResponse, TransportError>
pub async fn getchaintxstats( &self, nblocks: u64, blockhash: BlockHash, ) -> Result<GetchaintxstatsResponse, TransportError>
Compute statistics about the total number and rate of transactions in the chain.
Sourcepub async fn getconnectioncount(
&self,
) -> Result<GetconnectioncountResponse, TransportError>
pub async fn getconnectioncount( &self, ) -> Result<GetconnectioncountResponse, TransportError>
Returns the number of connections to other nodes.
Sourcepub async fn getdeploymentinfo(
&self,
blockhash: BlockHash,
) -> Result<GetdeploymentinfoResponse, TransportError>
pub async fn getdeploymentinfo( &self, blockhash: BlockHash, ) -> Result<GetdeploymentinfoResponse, TransportError>
Returns an object containing various state info regarding deployments of consensus changes.
Sourcepub async fn getdescriptoractivity(
&self,
blockhashes: Vec<Value>,
scanobjects: Vec<Value>,
include_mempool: bool,
) -> Result<GetdescriptoractivityResponse, TransportError>
pub async fn getdescriptoractivity( &self, blockhashes: Vec<Value>, scanobjects: Vec<Value>, include_mempool: bool, ) -> Result<GetdescriptoractivityResponse, TransportError>
Get spend and receive activity associated with a set of descriptors for a set of blocks. This command pairs well with the relevant_blocks output of scanblocks().
This call may take several minutes. If you encounter timeouts, try specifying no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn getdescriptorinfo(
&self,
descriptor: String,
) -> Result<GetdescriptorinfoResponse, TransportError>
pub async fn getdescriptorinfo( &self, descriptor: String, ) -> Result<GetdescriptorinfoResponse, TransportError>
Analyses a descriptor.
Sourcepub async fn getdifficulty(
&self,
) -> Result<GetdifficultyResponse, TransportError>
pub async fn getdifficulty( &self, ) -> Result<GetdifficultyResponse, TransportError>
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
Sourcepub async fn gethdkeys(
&self,
options: Value,
) -> Result<GethdkeysResponse, TransportError>
pub async fn gethdkeys( &self, options: Value, ) -> Result<GethdkeysResponse, TransportError>
List all BIP 32 HD keys in the wallet and which descriptors use them.
Sourcepub async fn getindexinfo(
&self,
index_name: String,
) -> Result<GetindexinfoResponse, TransportError>
pub async fn getindexinfo( &self, index_name: String, ) -> Result<GetindexinfoResponse, TransportError>
Returns the status of one or all available indices currently running in the node.
Sourcepub async fn getmemoryinfo(
&self,
mode: String,
) -> Result<GetmemoryinfoResponse, TransportError>
pub async fn getmemoryinfo( &self, mode: String, ) -> Result<GetmemoryinfoResponse, TransportError>
Returns an object containing information about memory usage.
Sourcepub async fn getmempoolancestors(
&self,
txid: Txid,
verbose: bool,
) -> Result<GetmempoolancestorsResponse, TransportError>
pub async fn getmempoolancestors( &self, txid: Txid, verbose: bool, ) -> Result<GetmempoolancestorsResponse, TransportError>
If txid is in the mempool, returns all in-mempool ancestors.
Sourcepub async fn getmempooldescendants(
&self,
txid: Txid,
verbose: bool,
) -> Result<GetmempooldescendantsResponse, TransportError>
pub async fn getmempooldescendants( &self, txid: Txid, verbose: bool, ) -> Result<GetmempooldescendantsResponse, TransportError>
If txid is in the mempool, returns all in-mempool descendants.
Sourcepub async fn getmempoolentry(
&self,
txid: Txid,
) -> Result<GetmempoolentryResponse, TransportError>
pub async fn getmempoolentry( &self, txid: Txid, ) -> Result<GetmempoolentryResponse, TransportError>
Returns mempool data for given transaction
Sourcepub async fn getmempoolinfo(
&self,
) -> Result<GetmempoolinfoResponse, TransportError>
pub async fn getmempoolinfo( &self, ) -> Result<GetmempoolinfoResponse, TransportError>
Returns details on the active state of the TX memory pool.
Sourcepub async fn getmininginfo(
&self,
) -> Result<GetmininginfoResponse, TransportError>
pub async fn getmininginfo( &self, ) -> Result<GetmininginfoResponse, TransportError>
Returns a json object containing mining-related information.
Sourcepub async fn getnettotals(&self) -> Result<GetnettotalsResponse, TransportError>
pub async fn getnettotals(&self) -> Result<GetnettotalsResponse, TransportError>
Returns information about network traffic, including bytes in, bytes out, and current system time.
Sourcepub async fn getnetworkhashps(
&self,
nblocks: u64,
height: u64,
) -> Result<GetnetworkhashpsResponse, TransportError>
pub async fn getnetworkhashps( &self, nblocks: u64, height: u64, ) -> Result<GetnetworkhashpsResponse, TransportError>
Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.
Sourcepub async fn getnetworkinfo(
&self,
) -> Result<GetnetworkinfoResponse, TransportError>
pub async fn getnetworkinfo( &self, ) -> Result<GetnetworkinfoResponse, TransportError>
Returns an object containing various state info regarding P2P networking.
Sourcepub async fn getnewaddress(
&self,
label: String,
address_type: String,
) -> Result<GetnewaddressResponse, TransportError>
pub async fn getnewaddress( &self, label: String, address_type: String, ) -> Result<GetnewaddressResponse, TransportError>
Returns a new Bitcoin address for receiving payments. If “label” is specified, it is added to the address book so payments received with the address will be associated with “label”.
Sourcepub async fn getnodeaddresses(
&self,
count: u64,
network: String,
) -> Result<GetnodeaddressesResponse, TransportError>
pub async fn getnodeaddresses( &self, count: u64, network: String, ) -> Result<GetnodeaddressesResponse, TransportError>
Return known addresses, after filtering for quality and recency. These can potentially be used to find new peers in the network. The total number of addresses known to the node may be higher.
Sourcepub async fn getorphantxs(
&self,
verbosity: u32,
) -> Result<GetorphantxsResponse, TransportError>
pub async fn getorphantxs( &self, verbosity: u32, ) -> Result<GetorphantxsResponse, TransportError>
Shows transactions in the tx orphanage.
EXPERIMENTAL warning: this call may be changed in future releases.
Sourcepub async fn getpeerinfo(&self) -> Result<GetpeerinfoResponse, TransportError>
pub async fn getpeerinfo(&self) -> Result<GetpeerinfoResponse, TransportError>
Returns data about each connected network peer as a json array of objects.
Sourcepub async fn getprioritisedtransactions(
&self,
) -> Result<GetprioritisedtransactionsResponse, TransportError>
pub async fn getprioritisedtransactions( &self, ) -> Result<GetprioritisedtransactionsResponse, TransportError>
Returns a map of all user-created (see prioritisetransaction) fee deltas by txid, and whether the tx is present in mempool.
Sourcepub async fn getrawaddrman(
&self,
) -> Result<GetrawaddrmanResponse, TransportError>
pub async fn getrawaddrman( &self, ) -> Result<GetrawaddrmanResponse, TransportError>
EXPERIMENTAL warning: this call may be changed in future releases.
Returns information on all address manager entries for the new and tried tables.
Sourcepub async fn getrawchangeaddress(
&self,
address_type: String,
) -> Result<GetrawchangeaddressResponse, TransportError>
pub async fn getrawchangeaddress( &self, address_type: String, ) -> Result<GetrawchangeaddressResponse, TransportError>
Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.
Sourcepub async fn getrawmempool(
&self,
verbose: bool,
mempool_sequence: bool,
) -> Result<GetrawmempoolResponse, TransportError>
pub async fn getrawmempool( &self, verbose: bool, mempool_sequence: bool, ) -> Result<GetrawmempoolResponse, TransportError>
Returns all transaction ids in memory pool as a json array of string transaction ids.
Hint: use getmempoolentry to fetch a specific transaction from the mempool.
Sourcepub async fn getrawtransaction(
&self,
txid: Txid,
verbosity: u32,
blockhash: BlockHash,
) -> Result<GetrawtransactionResponse, TransportError>
pub async fn getrawtransaction( &self, txid: Txid, verbosity: u32, blockhash: BlockHash, ) -> Result<GetrawtransactionResponse, TransportError>
By default, this call only returns a transaction if it is in the mempool. If -txindex is enabled and no blockhash argument is passed, it will return the transaction if it is in the mempool or any block. If a blockhash argument is passed, it will return the transaction if the specified block is available and the transaction is in that block.
Hint: Use gettransaction for wallet transactions.
If verbosity is 0 or omitted, returns the serialized transaction as a hex-encoded string. If verbosity is 1, returns a JSON Object with information about the transaction. If verbosity is 2, returns a JSON Object with information about the transaction, including fee and prevout information.
Sourcepub async fn getreceivedbyaddress(
&self,
address: String,
minconf: u32,
include_immature_coinbase: bool,
) -> Result<GetreceivedbyaddressResponse, TransportError>
pub async fn getreceivedbyaddress( &self, address: String, minconf: u32, include_immature_coinbase: bool, ) -> Result<GetreceivedbyaddressResponse, TransportError>
Returns the total amount received by the given address in transactions with at least minconf confirmations.
Sourcepub async fn getreceivedbylabel(
&self,
label: String,
minconf: u32,
include_immature_coinbase: bool,
) -> Result<GetreceivedbylabelResponse, TransportError>
pub async fn getreceivedbylabel( &self, label: String, minconf: u32, include_immature_coinbase: bool, ) -> Result<GetreceivedbylabelResponse, TransportError>
Returns the total amount received by addresses with
Sourcepub async fn getrpcinfo(&self) -> Result<GetrpcinfoResponse, TransportError>
pub async fn getrpcinfo(&self) -> Result<GetrpcinfoResponse, TransportError>
Returns details of the RPC server.
Sourcepub async fn gettransaction(
&self,
txid: Txid,
include_watchonly: bool,
verbose: bool,
) -> Result<GettransactionResponse, TransportError>
pub async fn gettransaction( &self, txid: Txid, include_watchonly: bool, verbose: bool, ) -> Result<GettransactionResponse, TransportError>
Get detailed information about in-wallet transaction
Sourcepub async fn gettxout(
&self,
txid: Txid,
n: u32,
include_mempool: bool,
) -> Result<(), TransportError>
pub async fn gettxout( &self, txid: Txid, n: u32, include_mempool: bool, ) -> Result<(), TransportError>
Returns details about an unspent transaction output.
Sourcepub async fn gettxoutproof(
&self,
txids: Vec<Txid>,
blockhash: BlockHash,
) -> Result<GettxoutproofResponse, TransportError>
pub async fn gettxoutproof( &self, txids: Vec<Txid>, blockhash: BlockHash, ) -> Result<GettxoutproofResponse, TransportError>
Returns a hex-encoded proof that “txid” was included in a block.
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).
Sourcepub async fn gettxoutsetinfo(
&self,
hash_type: String,
hash_or_height: HashOrHeight,
use_index: bool,
) -> Result<GettxoutsetinfoResponse, TransportError>
pub async fn gettxoutsetinfo( &self, hash_type: String, hash_or_height: HashOrHeight, use_index: bool, ) -> Result<GettxoutsetinfoResponse, TransportError>
Returns statistics about the unspent transaction output set. Note this call may take some time if you are not using coinstatsindex.
Sourcepub async fn gettxspendingprevout(
&self,
outputs: Vec<Value>,
) -> Result<GettxspendingprevoutResponse, TransportError>
pub async fn gettxspendingprevout( &self, outputs: Vec<Value>, ) -> Result<GettxspendingprevoutResponse, TransportError>
Scans the mempool to find transactions spending any of the given outputs
Sourcepub async fn getwalletinfo(
&self,
) -> Result<GetwalletinfoResponse, TransportError>
pub async fn getwalletinfo( &self, ) -> Result<GetwalletinfoResponse, TransportError>
Returns an object containing various wallet state info.
Sourcepub async fn getzmqnotifications(
&self,
) -> Result<GetzmqnotificationsResponse, TransportError>
pub async fn getzmqnotifications( &self, ) -> Result<GetzmqnotificationsResponse, TransportError>
Returns information about the active ZeroMQ notifications.
Sourcepub async fn help(
&self,
command: String,
) -> Result<HelpResponse, TransportError>
pub async fn help( &self, command: String, ) -> Result<HelpResponse, TransportError>
List all commands, or get help for a specified command.
Sourcepub async fn importdescriptors(
&self,
requests: Vec<Value>,
) -> Result<ImportdescriptorsResponse, TransportError>
pub async fn importdescriptors( &self, requests: Vec<Value>, ) -> Result<ImportdescriptorsResponse, TransportError>
Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup. When importing descriptors with multipath key expressions, if the multipath specifier contains exactly two elements, the descriptor produced from the second element will be imported as an internal descriptor.
Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls may report that the imported keys, addresses or scripts exist but related transactions are still missing. The rescan is significantly faster if block filters are available (using startup option “-blockfilterindex=1”).
Sourcepub async fn importmempool(
&self,
filepath: String,
options: Value,
) -> Result<ImportmempoolResponse, TransportError>
pub async fn importmempool( &self, filepath: String, options: Value, ) -> Result<ImportmempoolResponse, TransportError>
Import a mempool.dat file and attempt to add its contents to the mempool. Warning: Importing untrusted files is dangerous, especially if metadata from the file is taken over.
Sourcepub async fn importprunedfunds(
&self,
rawtransaction: String,
txoutproof: String,
) -> Result<(), TransportError>
pub async fn importprunedfunds( &self, rawtransaction: String, txoutproof: String, ) -> Result<(), TransportError>
Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.
Sourcepub async fn invalidateblock(
&self,
blockhash: BlockHash,
) -> Result<(), TransportError>
pub async fn invalidateblock( &self, blockhash: BlockHash, ) -> Result<(), TransportError>
Permanently marks a block as invalid, as if it violated a consensus rule.
Sourcepub async fn joinpsbts(
&self,
txs: Vec<Value>,
) -> Result<JoinpsbtsResponse, TransportError>
pub async fn joinpsbts( &self, txs: Vec<Value>, ) -> Result<JoinpsbtsResponse, TransportError>
Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs No input in any of the PSBTs can be in more than one of the PSBTs.
Sourcepub async fn keypoolrefill(&self, newsize: u64) -> Result<(), TransportError>
pub async fn keypoolrefill(&self, newsize: u64) -> Result<(), TransportError>
Refills each descriptor keypool in the wallet up to the specified number of new keys. By default, descriptor wallets have 4 active ranged descriptors (“legacy”, “p2sh-segwit”, “bech32”, “bech32m”), each with 1000 entries.
Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn listaddressgroupings(
&self,
) -> Result<ListaddressgroupingsResponse, TransportError>
pub async fn listaddressgroupings( &self, ) -> Result<ListaddressgroupingsResponse, TransportError>
Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions
Sourcepub async fn listbanned(&self) -> Result<ListbannedResponse, TransportError>
pub async fn listbanned(&self) -> Result<ListbannedResponse, TransportError>
List all manually banned IPs/Subnets.
Sourcepub async fn listdescriptors(
&self,
private: bool,
) -> Result<ListdescriptorsResponse, TransportError>
pub async fn listdescriptors( &self, private: bool, ) -> Result<ListdescriptorsResponse, TransportError>
List all descriptors present in a wallet.
Sourcepub async fn listlabels(
&self,
purpose: String,
) -> Result<ListlabelsResponse, TransportError>
pub async fn listlabels( &self, purpose: String, ) -> Result<ListlabelsResponse, TransportError>
Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
Sourcepub async fn listlockunspent(
&self,
) -> Result<ListlockunspentResponse, TransportError>
pub async fn listlockunspent( &self, ) -> Result<ListlockunspentResponse, TransportError>
Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending.
Sourcepub async fn listreceivedbyaddress(
&self,
minconf: u32,
include_empty: bool,
include_watchonly: bool,
address_filter: String,
include_immature_coinbase: bool,
) -> Result<ListreceivedbyaddressResponse, TransportError>
pub async fn listreceivedbyaddress( &self, minconf: u32, include_empty: bool, include_watchonly: bool, address_filter: String, include_immature_coinbase: bool, ) -> Result<ListreceivedbyaddressResponse, TransportError>
List balances by receiving address.
Sourcepub async fn listreceivedbylabel(
&self,
minconf: u32,
include_empty: bool,
include_watchonly: bool,
include_immature_coinbase: bool,
) -> Result<ListreceivedbylabelResponse, TransportError>
pub async fn listreceivedbylabel( &self, minconf: u32, include_empty: bool, include_watchonly: bool, include_immature_coinbase: bool, ) -> Result<ListreceivedbylabelResponse, TransportError>
List received transactions by label.
Sourcepub async fn listsinceblock(
&self,
blockhash: BlockHash,
target_confirmations: u64,
include_watchonly: bool,
include_removed: bool,
include_change: bool,
label: String,
) -> Result<ListsinceblockResponse, TransportError>
pub async fn listsinceblock( &self, blockhash: BlockHash, target_confirmations: u64, include_watchonly: bool, include_removed: bool, include_change: bool, label: String, ) -> Result<ListsinceblockResponse, TransportError>
Get all transactions in blocks since block [blockhash], or all transactions if omitted. If “blockhash” is no longer a part of the main chain, transactions from the fork point onward are included. Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the “removed” array.
Sourcepub async fn listtransactions(
&self,
label: String,
count: u64,
skip: u64,
include_watchonly: bool,
) -> Result<ListtransactionsResponse, TransportError>
pub async fn listtransactions( &self, label: String, count: u64, skip: u64, include_watchonly: bool, ) -> Result<ListtransactionsResponse, TransportError>
If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
Returns up to “count” most recent transactions skipping the first “from” transactions.
Sourcepub async fn listunspent(
&self,
minconf: u32,
maxconf: u32,
addresses: Vec<String>,
include_unsafe: bool,
query_options: Value,
) -> Result<ListunspentResponse, TransportError>
pub async fn listunspent( &self, minconf: u32, maxconf: u32, addresses: Vec<String>, include_unsafe: bool, query_options: Value, ) -> Result<ListunspentResponse, TransportError>
Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses.
Sourcepub async fn listwalletdir(
&self,
) -> Result<ListwalletdirResponse, TransportError>
pub async fn listwalletdir( &self, ) -> Result<ListwalletdirResponse, TransportError>
Returns a list of wallets in the wallet directory.
Sourcepub async fn listwallets(&self) -> Result<ListwalletsResponse, TransportError>
pub async fn listwallets(&self) -> Result<ListwalletsResponse, TransportError>
Returns a list of currently loaded wallets. For full information on the wallet, use “getwalletinfo”
Sourcepub async fn loadtxoutset(
&self,
path: String,
) -> Result<LoadtxoutsetResponse, TransportError>
pub async fn loadtxoutset( &self, path: String, ) -> Result<LoadtxoutsetResponse, TransportError>
Load the serialized UTXO set from a file. Once this snapshot is loaded, its contents will be deserialized into a second chainstate data structure, which is then used to sync to the network“s tip. Meanwhile, the original chainstate will complete the initial block download process in the background, eventually validating up to the block that the snapshot is based upon.
The result is a usable bitcoind instance that is current with the network tip in a matter of minutes rather than hours. UTXO snapshot are typically obtained from third-party sources (HTTP, torrent, etc.) which is reasonable since their contents are always checked by hash.
You can find more information on this process in the assumeutxo design document (https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md).
Sourcepub async fn loadwallet(
&self,
filename: String,
load_on_startup: bool,
) -> Result<LoadwalletResponse, TransportError>
pub async fn loadwallet( &self, filename: String, load_on_startup: bool, ) -> Result<LoadwalletResponse, TransportError>
Loads a wallet from a wallet file or directory. Note that all wallet command-line options used when starting bitcoind will be applied to the new wallet.
Sourcepub async fn lockunspent(
&self,
unlock: bool,
transactions: Vec<Value>,
persistent: bool,
) -> Result<LockunspentResponse, TransportError>
pub async fn lockunspent( &self, unlock: bool, transactions: Vec<Value>, persistent: bool, ) -> Result<LockunspentResponse, TransportError>
Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins. Manually selected coins are automatically unlocked. Locks are stored in memory only, unless persistent=true, in which case they will be written to the wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not. Also see the listunspent call
Sourcepub async fn logging(
&self,
include: Vec<Value>,
exclude: Vec<Value>,
) -> Result<LoggingResponse, TransportError>
pub async fn logging( &self, include: Vec<Value>, exclude: Vec<Value>, ) -> Result<LoggingResponse, TransportError>
Gets and sets the logging configuration. When called without an argument, returns the list of categories with status that are currently being debug logged or not. When called with arguments, adds or removes categories from debug logging and return the lists above. The arguments are evaluated in order “include”, “exclude”. If an item is both included and excluded, it will thus end up being excluded. The valid logging categories are: addrman, bench, blockstorage, cmpctblock, coindb, estimatefee, http, i2p, ipc, leveldb, libevent, mempool, mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan, selectcoins, tor, txpackages, txreconciliation, validation, walletdb, zmq In addition, the following are available as category names with special meanings:
- “all”, “1” : represent all logging categories.
Sourcepub async fn migratewallet(
&self,
wallet_name: String,
passphrase: String,
) -> Result<MigratewalletResponse, TransportError>
pub async fn migratewallet( &self, wallet_name: String, passphrase: String, ) -> Result<MigratewalletResponse, TransportError>
Migrate the wallet to a descriptor wallet. A new wallet backup will need to be made.
The migration process will create a backup of the wallet before migrating. This backup
file will be named
This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
Sourcepub async fn mockscheduler(&self, delta_time: u64) -> Result<(), TransportError>
pub async fn mockscheduler(&self, delta_time: u64) -> Result<(), TransportError>
Bump the scheduler into the future (-regtest only)
Sourcepub async fn ping(&self) -> Result<(), TransportError>
pub async fn ping(&self) -> Result<(), TransportError>
Requests that a ping be sent to all other nodes, to measure ping time. Results are provided in getpeerinfo. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
Sourcepub async fn preciousblock(
&self,
blockhash: BlockHash,
) -> Result<(), TransportError>
pub async fn preciousblock( &self, blockhash: BlockHash, ) -> Result<(), TransportError>
Treats a block as if it were received before others with the same work.
A later preciousblock call can override the effect of an earlier one.
The effects of preciousblock are not retained across restarts.
Sourcepub async fn prioritisetransaction(
&self,
txid: Txid,
dummy: Option<String>,
fee_delta: f64,
) -> Result<PrioritisetransactionResponse, TransportError>
pub async fn prioritisetransaction( &self, txid: Txid, dummy: Option<String>, fee_delta: f64, ) -> Result<PrioritisetransactionResponse, TransportError>
Accepts the transaction into mined blocks at a higher (or lower) priority
Sourcepub async fn pruneblockchain(
&self,
height: u64,
) -> Result<PruneblockchainResponse, TransportError>
pub async fn pruneblockchain( &self, height: u64, ) -> Result<PruneblockchainResponse, TransportError>
Attempts to delete block and undo data up to a specified height or timestamp, if eligible for pruning.
Requires -prune to be enabled at startup. While pruned data may be re-fetched in some cases (e.g., via getblockfrompeer), local deletion is irreversible.
Sourcepub async fn psbtbumpfee(
&self,
txid: Txid,
options: Value,
) -> Result<PsbtbumpfeeResponse, TransportError>
pub async fn psbtbumpfee( &self, txid: Txid, options: Value, ) -> Result<PsbtbumpfeeResponse, TransportError>
Bumps the fee of a transaction T, replacing it with a new transaction B. Returns a PSBT instead of creating and signing a new transaction. A transaction with the given txid must be in the wallet. The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist. All inputs in the original transaction will be included in the replacement transaction. The command will fail if the wallet or mempool contains a transaction that spends one of T“s outputs. By default, the new fee will be calculated automatically using the estimatesmartfee RPC. The user can specify a confirmation target for estimatesmartfee. Alternatively, the user can specify a fee rate in sat/vB for the new transaction. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node“s mempool.
- WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
Sourcepub async fn reconsiderblock(
&self,
blockhash: BlockHash,
) -> Result<(), TransportError>
pub async fn reconsiderblock( &self, blockhash: BlockHash, ) -> Result<(), TransportError>
Removes invalidity status of a block, its ancestors and its descendants, reconsider them for activation. This can be used to undo the effects of invalidateblock.
Sourcepub async fn removeprunedfunds(&self, txid: Txid) -> Result<(), TransportError>
pub async fn removeprunedfunds(&self, txid: Txid) -> Result<(), TransportError>
Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.
Sourcepub async fn rescanblockchain(
&self,
start_height: u64,
stop_height: u64,
) -> Result<RescanblockchainResponse, TransportError>
pub async fn rescanblockchain( &self, start_height: u64, stop_height: u64, ) -> Result<RescanblockchainResponse, TransportError>
Rescan the local blockchain for wallet related transactions. Note: Use “getwalletinfo” to query the scanning progress. The rescan is significantly faster if block filters are available (using startup option “-blockfilterindex=1”).
Sourcepub async fn restorewallet(
&self,
wallet_name: String,
backup_file: String,
load_on_startup: bool,
) -> Result<RestorewalletResponse, TransportError>
pub async fn restorewallet( &self, wallet_name: String, backup_file: String, load_on_startup: bool, ) -> Result<RestorewalletResponse, TransportError>
Restores and loads a wallet from backup.
The rescan is significantly faster if block filters are available (using startup option “-blockfilterindex=1”).
Sourcepub async fn savemempool(&self) -> Result<SavemempoolResponse, TransportError>
pub async fn savemempool(&self) -> Result<SavemempoolResponse, TransportError>
Dumps the mempool to disk. It will fail until the previous dump is fully loaded.
Sourcepub async fn scanblocks(
&self,
action: String,
scanobjects: Vec<Value>,
start_height: u64,
stop_height: u64,
filtertype: String,
options: Value,
) -> Result<(), TransportError>
pub async fn scanblocks( &self, action: String, scanobjects: Vec<Value>, start_height: u64, stop_height: u64, filtertype: String, options: Value, ) -> Result<(), TransportError>
Return relevant blockhashes for given descriptors (requires blockfilterindex). This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn scantxoutset(
&self,
action: String,
scanobjects: Vec<Value>,
) -> Result<ScantxoutsetResponse, TransportError>
pub async fn scantxoutset( &self, action: String, scanobjects: Vec<Value>, ) -> Result<ScantxoutsetResponse, TransportError>
Scans the unspent transaction output set for entries that match certain output descriptors. Examples of output descriptors are: addr(
) Outputs whose output script corresponds to the specified address (does not include P2PK) raw(In the above,
Sourcepub async fn schema(&self) -> Result<SchemaResponse, TransportError>
pub async fn schema(&self) -> Result<SchemaResponse, TransportError>
Return RPC command JSON Schema descriptions.
Sourcepub async fn send(
&self,
outputs: Vec<Value>,
conf_target: u64,
estimate_mode: String,
fee_rate: f64,
options: Value,
version: u32,
) -> Result<SendResponse, TransportError>
pub async fn send( &self, outputs: Vec<Value>, conf_target: u64, estimate_mode: String, fee_rate: f64, options: Value, version: u32, ) -> Result<SendResponse, TransportError>
EXPERIMENTAL warning: this call may be changed in future releases.
Send a transaction.
Sourcepub async fn sendall(
&self,
recipients: Vec<Value>,
conf_target: u64,
estimate_mode: String,
fee_rate: f64,
options: Value,
) -> Result<SendallResponse, TransportError>
pub async fn sendall( &self, recipients: Vec<Value>, conf_target: u64, estimate_mode: String, fee_rate: f64, options: Value, ) -> Result<SendallResponse, TransportError>
EXPERIMENTAL warning: this call may be changed in future releases.
Spend the value of all (or specific) confirmed UTXOs and unconfirmed change in the wallet to one or more recipients.
Unconfirmed inbound UTXOs and locked UTXOs will not be spent. Sendall will respect the avoid_reuse wallet flag.
If your wallet contains many small inputs, either because it received tiny payments or as a result of accumulating change, consider using send_max to exclude inputs that are worth less than the fees needed to spend them.
Sourcepub async fn sendmany(
&self,
dummy: Option<String>,
amounts: Value,
minconf: u32,
comment: String,
subtractfeefrom: Vec<Value>,
replaceable: bool,
conf_target: u64,
estimate_mode: String,
fee_rate: f64,
verbose: bool,
) -> Result<SendmanyResponse, TransportError>
pub async fn sendmany( &self, dummy: Option<String>, amounts: Value, minconf: u32, comment: String, subtractfeefrom: Vec<Value>, replaceable: bool, conf_target: u64, estimate_mode: String, fee_rate: f64, verbose: bool, ) -> Result<SendmanyResponse, TransportError>
Send multiple times. Amounts are double-precision floating point numbers. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn sendmsgtopeer(
&self,
peer_id: u64,
msg_type: String,
msg: String,
) -> Result<SendmsgtopeerResponse, TransportError>
pub async fn sendmsgtopeer( &self, peer_id: u64, msg_type: String, msg: String, ) -> Result<SendmsgtopeerResponse, TransportError>
Send a p2p message to a peer specified by id. The message type and body must be provided, the message header will be generated. This RPC is for testing only.
Sourcepub async fn sendrawtransaction(
&self,
hexstring: String,
maxfeerate: f64,
maxburnamount: f64,
) -> Result<SendrawtransactionResponse, TransportError>
pub async fn sendrawtransaction( &self, hexstring: String, maxfeerate: f64, maxburnamount: f64, ) -> Result<SendrawtransactionResponse, TransportError>
Submit a raw transaction (serialized, hex-encoded) to local node and network.
The transaction will be sent unconditionally to all peers, so using sendrawtransaction for manual rebroadcast may degrade privacy by leaking the transaction“s origin, as nodes will normally not rebroadcast non-wallet transactions already in their mempool.
A specific exception, RPC_TRANSACTION_ALREADY_IN_UTXO_SET, may throw if the transaction cannot be added to the mempool.
Related RPCs: createrawtransaction, signrawtransactionwithkey
Sourcepub async fn sendtoaddress(
&self,
address: String,
amount: Amount,
comment: String,
comment_to: String,
subtractfeefromamount: bool,
replaceable: bool,
conf_target: u64,
estimate_mode: String,
avoid_reuse: bool,
fee_rate: f64,
verbose: bool,
) -> Result<SendtoaddressResponse, TransportError>
pub async fn sendtoaddress( &self, address: String, amount: Amount, comment: String, comment_to: String, subtractfeefromamount: bool, replaceable: bool, conf_target: u64, estimate_mode: String, avoid_reuse: bool, fee_rate: f64, verbose: bool, ) -> Result<SendtoaddressResponse, TransportError>
Send an amount to a given address. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn setban(
&self,
subnet: String,
command: String,
bantime: u64,
absolute: bool,
) -> Result<(), TransportError>
pub async fn setban( &self, subnet: String, command: String, bantime: u64, absolute: bool, ) -> Result<(), TransportError>
Attempts to add or remove an IP/Subnet from the banned list.
Sourcepub async fn setlabel(
&self,
address: String,
label: String,
) -> Result<(), TransportError>
pub async fn setlabel( &self, address: String, label: String, ) -> Result<(), TransportError>
Sets the label associated with the given address.
Sourcepub async fn setmocktime(&self, timestamp: u64) -> Result<(), TransportError>
pub async fn setmocktime(&self, timestamp: u64) -> Result<(), TransportError>
Set the local time to given timestamp (-regtest only)
Sourcepub async fn setnetworkactive(
&self,
state: bool,
) -> Result<SetnetworkactiveResponse, TransportError>
pub async fn setnetworkactive( &self, state: bool, ) -> Result<SetnetworkactiveResponse, TransportError>
Disable/enable all p2p network activity.
Sourcepub async fn settxfee(
&self,
amount: Amount,
) -> Result<SettxfeeResponse, TransportError>
pub async fn settxfee( &self, amount: Amount, ) -> Result<SettxfeeResponse, TransportError>
(DEPRECATED) Set the transaction fee rate in BTC/kvB for this wallet. Overrides the global -paytxfee command line parameter. Can be deactivated by passing 0 as the fee. In that case automatic fee selection will be used by default.
Sourcepub async fn setwalletflag(
&self,
flag: String,
value: bool,
) -> Result<SetwalletflagResponse, TransportError>
pub async fn setwalletflag( &self, flag: String, value: bool, ) -> Result<SetwalletflagResponse, TransportError>
Change the state of the given wallet flag for a wallet.
Sourcepub async fn signmessage(
&self,
address: String,
message: String,
) -> Result<SignmessageResponse, TransportError>
pub async fn signmessage( &self, address: String, message: String, ) -> Result<SignmessageResponse, TransportError>
Sign a message with the private key of an address Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn signmessagewithprivkey(
&self,
privkey: String,
message: String,
) -> Result<SignmessagewithprivkeyResponse, TransportError>
pub async fn signmessagewithprivkey( &self, privkey: String, message: String, ) -> Result<SignmessagewithprivkeyResponse, TransportError>
Sign a message with the private key of an address
Sourcepub async fn signrawtransactionwithkey(
&self,
hexstring: String,
privkeys: Vec<String>,
prevtxs: Vec<Value>,
sighashtype: String,
) -> Result<SignrawtransactionwithkeyResponse, TransportError>
pub async fn signrawtransactionwithkey( &self, hexstring: String, privkeys: Vec<String>, prevtxs: Vec<Value>, sighashtype: String, ) -> Result<SignrawtransactionwithkeyResponse, TransportError>
Sign inputs for raw transaction (serialized, hex-encoded). The second argument is an array of base58-encoded private keys that will be the only keys used to sign the transaction. The third optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain.
Sourcepub async fn signrawtransactionwithwallet(
&self,
hexstring: String,
prevtxs: Vec<Value>,
sighashtype: String,
) -> Result<SignrawtransactionwithwalletResponse, TransportError>
pub async fn signrawtransactionwithwallet( &self, hexstring: String, prevtxs: Vec<Value>, sighashtype: String, ) -> Result<SignrawtransactionwithwalletResponse, TransportError>
Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn simulaterawtransaction(
&self,
rawtxs: Vec<Value>,
options: Value,
) -> Result<SimulaterawtransactionResponse, TransportError>
pub async fn simulaterawtransaction( &self, rawtxs: Vec<Value>, options: Value, ) -> Result<SimulaterawtransactionResponse, TransportError>
Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
Sourcepub async fn stop(&self, wait: u64) -> Result<StopResponse, TransportError>
pub async fn stop(&self, wait: u64) -> Result<StopResponse, TransportError>
Request a graceful shutdown of Bitcoin Core.
Sourcepub async fn submitblock(
&self,
hexdata: String,
dummy: Option<String>,
) -> Result<(), TransportError>
pub async fn submitblock( &self, hexdata: String, dummy: Option<String>, ) -> Result<(), TransportError>
Attempts to submit new block to network. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
Sourcepub async fn submitheader(&self, hexdata: String) -> Result<(), TransportError>
pub async fn submitheader(&self, hexdata: String) -> Result<(), TransportError>
Decode the given hexdata as a header and submit it as a candidate chain tip if valid. Throws when the header is invalid.
Sourcepub async fn submitpackage(
&self,
package: Vec<Value>,
maxfeerate: f64,
maxburnamount: f64,
) -> Result<SubmitpackageResponse, TransportError>
pub async fn submitpackage( &self, package: Vec<Value>, maxfeerate: f64, maxburnamount: f64, ) -> Result<SubmitpackageResponse, TransportError>
Submit a package of raw transactions (serialized, hex-encoded) to local node. The package will be validated according to consensus and mempool policy rules. If any transaction passes, it will be accepted to mempool. This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies. Warning: successful submission does not mean the transactions will propagate throughout the network.
Sourcepub async fn syncwithvalidationinterfacequeue(
&self,
) -> Result<(), TransportError>
pub async fn syncwithvalidationinterfacequeue( &self, ) -> Result<(), TransportError>
Waits for the validation interface queue to catch up on everything that was there when we entered this function.
Sourcepub async fn testmempoolaccept(
&self,
rawtxs: Vec<Value>,
maxfeerate: f64,
) -> Result<TestmempoolacceptResponse, TransportError>
pub async fn testmempoolaccept( &self, rawtxs: Vec<Value>, maxfeerate: f64, ) -> Result<TestmempoolacceptResponse, TransportError>
Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
If multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other.
If one transaction fails, other transactions may not be fully validated (the “allowed” key will be blank).
The maximum number of transactions allowed is 25.
This checks if transactions violate the consensus or policy rules.
See sendrawtransaction call.
Sourcepub async fn unloadwallet(
&self,
wallet_name: String,
load_on_startup: bool,
) -> Result<UnloadwalletResponse, TransportError>
pub async fn unloadwallet( &self, wallet_name: String, load_on_startup: bool, ) -> Result<UnloadwalletResponse, TransportError>
Unloads the wallet referenced by the request endpoint or the wallet_name argument. If both are specified, they must be identical.
Sourcepub async fn uptime(&self) -> Result<UptimeResponse, TransportError>
pub async fn uptime(&self) -> Result<UptimeResponse, TransportError>
Returns the total uptime of the server.
Sourcepub async fn utxoupdatepsbt(
&self,
psbt: String,
descriptors: Vec<Value>,
) -> Result<UtxoupdatepsbtResponse, TransportError>
pub async fn utxoupdatepsbt( &self, psbt: String, descriptors: Vec<Value>, ) -> Result<UtxoupdatepsbtResponse, TransportError>
Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, txindex, or the mempool.
Sourcepub async fn validateaddress(
&self,
address: String,
) -> Result<ValidateaddressResponse, TransportError>
pub async fn validateaddress( &self, address: String, ) -> Result<ValidateaddressResponse, TransportError>
Return information about the given bitcoin address.
Sourcepub async fn verifychain(
&self,
checklevel: u32,
nblocks: u64,
) -> Result<VerifychainResponse, TransportError>
pub async fn verifychain( &self, checklevel: u32, nblocks: u64, ) -> Result<VerifychainResponse, TransportError>
Verifies blockchain database.
Sourcepub async fn verifymessage(
&self,
address: String,
signature: String,
message: String,
) -> Result<VerifymessageResponse, TransportError>
pub async fn verifymessage( &self, address: String, signature: String, message: String, ) -> Result<VerifymessageResponse, TransportError>
Verify a signed message.
Sourcepub async fn verifytxoutproof(
&self,
proof: String,
) -> Result<VerifytxoutproofResponse, TransportError>
pub async fn verifytxoutproof( &self, proof: String, ) -> Result<VerifytxoutproofResponse, TransportError>
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain
Sourcepub async fn waitforblock(
&self,
blockhash: BlockHash,
timeout: u64,
) -> Result<WaitforblockResponse, TransportError>
pub async fn waitforblock( &self, blockhash: BlockHash, timeout: u64, ) -> Result<WaitforblockResponse, TransportError>
Waits for a specific new block and returns useful info about it.
Returns the current block on timeout or exit.
Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn waitforblockheight(
&self,
height: u64,
timeout: u64,
) -> Result<WaitforblockheightResponse, TransportError>
pub async fn waitforblockheight( &self, height: u64, timeout: u64, ) -> Result<WaitforblockheightResponse, TransportError>
Waits for (at least) block height and returns the height and hash of the current tip.
Returns the current block on timeout or exit.
Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn waitfornewblock(
&self,
timeout: u64,
current_tip: String,
) -> Result<WaitfornewblockResponse, TransportError>
pub async fn waitfornewblock( &self, timeout: u64, current_tip: String, ) -> Result<WaitfornewblockResponse, TransportError>
Waits for any new block and returns useful info about it.
Returns the current block on timeout or exit.
Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)
Sourcepub async fn walletcreatefundedpsbt(
&self,
inputs: Vec<Value>,
outputs: Vec<Value>,
locktime: u32,
options: Value,
bip32derivs: bool,
version: u32,
) -> Result<WalletcreatefundedpsbtResponse, TransportError>
pub async fn walletcreatefundedpsbt( &self, inputs: Vec<Value>, outputs: Vec<Value>, locktime: u32, options: Value, bip32derivs: bool, version: u32, ) -> Result<WalletcreatefundedpsbtResponse, TransportError>
Creates and funds a transaction in the Partially Signed Transaction format. Implements the Creator and Updater roles. All existing inputs must either have their previous output transaction be in the wallet or be in the UTXO set. Solving data must be provided for non-wallet inputs.
Sourcepub async fn walletdisplayaddress(
&self,
address: String,
) -> Result<WalletdisplayaddressResponse, TransportError>
pub async fn walletdisplayaddress( &self, address: String, ) -> Result<WalletdisplayaddressResponse, TransportError>
Display address on an external signer for verification.
Sourcepub async fn walletlock(&self) -> Result<(), TransportError>
pub async fn walletlock(&self) -> Result<(), TransportError>
Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.
Sourcepub async fn walletpassphrase(
&self,
passphrase: String,
timeout: u64,
) -> Result<(), TransportError>
pub async fn walletpassphrase( &self, passphrase: String, timeout: u64, ) -> Result<(), TransportError>
Stores the wallet decryption key in memory for “timeout” seconds. This is needed prior to performing transactions related to private keys such as sending bitcoins
Note: Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.
Sourcepub async fn walletpassphrasechange(
&self,
oldpassphrase: String,
newpassphrase: String,
) -> Result<(), TransportError>
pub async fn walletpassphrasechange( &self, oldpassphrase: String, newpassphrase: String, ) -> Result<(), TransportError>
Changes the wallet passphrase from “oldpassphrase” to “newpassphrase”.
Sourcepub async fn walletprocesspsbt(
&self,
psbt: String,
sign: bool,
sighashtype: String,
bip32derivs: bool,
finalize: bool,
) -> Result<WalletprocesspsbtResponse, TransportError>
pub async fn walletprocesspsbt( &self, psbt: String, sign: bool, sighashtype: String, bip32derivs: bool, finalize: bool, ) -> Result<WalletprocesspsbtResponse, TransportError>
Update a PSBT with input information from our wallet and then sign inputs that we can sign for. Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
Sourcepub async fn send_to_address_with_conf_target(
&self,
address: String,
amount: Amount,
conf_target: u64,
estimate_mode: String,
) -> Result<Value, TransportError>
pub async fn send_to_address_with_conf_target( &self, address: String, amount: Amount, conf_target: u64, estimate_mode: String, ) -> Result<Value, TransportError>
Helper method to send bitcoin to an address with either a confirmation target or fee rate. This is a more ergonomic wrapper around sendtoaddress that prevents specifying both conf_target and fee_rate.
Parameters:
- address: The destination address
- amount: The amount to send
- conf_target: The confirmation target in blocks
- estimate_mode: The fee estimate mode (“economical” or “conservative”)