Enum bdk::descriptor::error::Error
source · pub enum Error {
+ 
Error
Enum bdk::descriptor::error::Error
source · pub enum Error {
InvalidHdKeyPath,
InvalidDescriptorChecksum,
HardenedDerivationXpub,
@@ -25,7 +25,7 @@
Pk(Error)
Key-related error
Miniscript(Error)
Miniscript error
Hex(HexToBytesError)
Hex decoding error
-Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<P> From<Error> for CreateTxError<P>
impl<P> From<Error> for CreateTxError<P>
source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<Error> for CreateTxError
impl From<Error> for CreateTxError
source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Enum bdk::descriptor::policy::PolicyError
source · pub enum PolicyError {
+ 
PolicyError
Enum bdk::descriptor::policy::PolicyError
source · pub enum PolicyError {
NotEnoughItemsSelected(String),
IndexOutOfRange(usize),
AddOnLeaf,
@@ -13,7 +13,7 @@
AddOnPartialComplete
Can not add to an item that is Satisfaction::PartialComplete
MixedTimelockUnits
Can not merge CSV or timelock values unless both are less than or both are equal or greater than 500_000_000
IncompatibleConditions
Incompatible conditions (not currently used)
-Trait Implementations§
source§impl Debug for PolicyError
impl Debug for PolicyError
source§impl Display for PolicyError
impl Display for PolicyError
source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<P> From<PolicyError> for CreateTxError<P>
impl<P> From<PolicyError> for CreateTxError<P>
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
source§impl PartialEq<PolicyError> for PolicyError
impl PartialEq<PolicyError> for PolicyError
source§fn eq(&self, other: &PolicyError) -> bool
fn eq(&self, other: &PolicyError) -> bool
self and other values to be equal, and is used
+Trait Implementations§
source§impl Debug for PolicyError
impl Debug for PolicyError
source§impl Display for PolicyError
impl Display for PolicyError
source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<PolicyError> for CreateTxError
impl From<PolicyError> for CreateTxError
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
source§impl PartialEq<PolicyError> for PolicyError
impl PartialEq<PolicyError> for PolicyError
source§fn eq(&self, other: &PolicyError) -> bool
fn eq(&self, other: &PolicyError) -> bool
impl Eq for PolicyError
impl StructuralEq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnwindSafe for PolicyError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
Enum bdk::wallet::coin_selection::Error
source · pub enum Error {
+ 
Error
Enum bdk::wallet::coin_selection::Error
source · pub enum Error {
InsufficientFunds {
needed: u64,
available: u64,
@@ -14,7 +14,7 @@
the desired outputs plus fee, if there is not such combination this error is thrown
BnBTotalTriesExceeded
Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow exponentially, thus a limit is set, and when hit, this error is thrown
-Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Enum bdk::wallet::ApplyBlockError
source · pub enum ApplyBlockError {
+ 
ApplyBlockError
Enum bdk::wallet::ApplyBlockError
source · pub enum ApplyBlockError {
CannotConnect(CannotConnectError),
UnexpectedConnectedToHash {
connected_to_hash: BlockHash,
@@ -10,7 +10,7 @@
UnexpectedConnectedToHash
Fields
connected_to_hash: BlockHashBlock hash of connected_to.
expected_hash: BlockHashExpected block hash of connected_to, as derived from block.
Occurs when the connected_to hash does not match the hash derived from block.
Trait Implementations§
source§impl Debug for ApplyBlockError
impl Debug for ApplyBlockError
source§impl Display for ApplyBlockError
impl Display for ApplyBlockError
source§impl Error for ApplyBlockError
impl Error for ApplyBlockError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for ApplyBlockError
impl Send for ApplyBlockError
impl Sync for ApplyBlockError
impl Unpin for ApplyBlockError
impl UnwindSafe for ApplyBlockError
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Debug for ApplyBlockError
impl Debug for ApplyBlockError
source§impl Display for ApplyBlockError
impl Display for ApplyBlockError
source§impl Error for ApplyBlockError
impl Error for ApplyBlockError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for ApplyBlockError
impl Send for ApplyBlockError
impl Sync for ApplyBlockError
impl Unpin for ApplyBlockError
impl UnwindSafe for ApplyBlockError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Enum bdk::wallet::InsertTxError
source · pub enum InsertTxError {
+ 
InsertTxError
Enum bdk::wallet::InsertTxError
source · The error variant that occurs when the caller attempts to insert a transaction with a confirmation height that is greater than the internal chain tip.
-Trait Implementations§
source§impl Debug for InsertTxError
impl Debug for InsertTxError
source§impl Display for InsertTxError
impl Display for InsertTxError
source§impl Error for InsertTxError
impl Error for InsertTxError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for InsertTxError
impl Send for InsertTxError
impl Sync for InsertTxError
impl Unpin for InsertTxError
impl UnwindSafe for InsertTxError
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Debug for InsertTxError
impl Debug for InsertTxError
source§impl Display for InsertTxError
impl Display for InsertTxError
source§impl Error for InsertTxError
impl Error for InsertTxError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for InsertTxError
impl Send for InsertTxError
impl Sync for InsertTxError
impl Unpin for InsertTxError
impl UnwindSafe for InsertTxError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
pub enum LoadError<L> {
+ 
LoadError
pub enum LoadError {
Descriptor(DescriptorError),
- Load(L),
+ Persist(Error),
NotInitialized,
MissingNetwork,
MissingGenesis,
}Expand description
Variants§
Descriptor(DescriptorError)
There was a problem with the passed-in descriptor(s).
-Load(L)
Loading data from the persistence backend failed.
+Persist(Error)
Loading data from the persistence backend failed.
NotInitialized
Wallet not initialized, persistence backend is empty.
MissingNetwork
Data loaded from persistence is missing network type.
MissingGenesis
Data loaded from persistence is missing genesis hash.
-Trait Implementations§
source§impl<L> Error for LoadError<L>where
L: Display + Debug,
impl<L> Error for LoadError<L>where
L: Display + Debug,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl<L> RefUnwindSafe for LoadError<L>where
L: RefUnwindSafe,
impl<L> Send for LoadError<L>where
L: Send,
impl<L> Sync for LoadError<L>where
L: Sync,
impl<L> Unpin for LoadError<L>where
L: Unpin,
impl<L> UnwindSafe for LoadError<L>where
L: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Trait Implementations§
source§impl Error for LoadError
impl Error for LoadError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl !RefUnwindSafe for LoadError
impl Send for LoadError
impl Sync for LoadError
impl Unpin for LoadError
impl !UnwindSafe for LoadError
Blanket Implementations§
pub enum NewError<W> {
+ 
NewError
pub enum NewError {
NonEmptyDatabase,
Descriptor(DescriptorError),
- Write(W),
+ Persist(Error),
}Expand description
The error type when constructing a fresh Wallet.
Methods new and new_with_genesis_hash may return this error.
Variants§
NonEmptyDatabase
Database already has data.
Descriptor(DescriptorError)
There was problem with the passed-in descriptor(s).
-Write(W)
We were unable to write the walletâs data to the persistence backend.
-Trait Implementations§
source§impl<W> Error for NewError<W>where
W: Display + Debug,
impl<W> Error for NewError<W>where
W: Display + Debug,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl<W> RefUnwindSafe for NewError<W>where
W: RefUnwindSafe,
impl<W> Send for NewError<W>where
W: Send,
impl<W> Sync for NewError<W>where
W: Sync,
impl<W> Unpin for NewError<W>where
W: Unpin,
impl<W> UnwindSafe for NewError<W>where
W: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Trait Implementations§
source§impl Error for NewError
impl Error for NewError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl !RefUnwindSafe for NewError
impl Send for NewError
impl Sync for NewError
impl Unpin for NewError
impl !UnwindSafe for NewError
Blanket Implementations§
Enum bdk::wallet::NewOrLoadError
source · pub enum NewOrLoadError<W, L> {
+ 
NewOrLoadError
Enum bdk::wallet::NewOrLoadError
source · pub enum NewOrLoadError {
Descriptor(DescriptorError),
- Write(W),
- Load(L),
+ Persist(Error),
NotInitialized,
LoadedGenesisDoesNotMatch {
expected: BlockHash,
@@ -15,8 +14,7 @@
}Expand description
Error type for when we try load a Wallet from persistence and creating it if non-existent.
Methods new_or_load and new_or_load_with_genesis_hash may return this error.
Variants§
Descriptor(DescriptorError)
There is a problem with the passed-in descriptor.
-Write(W)
Writing to the persistence backend failed.
-Load(L)
Loading from the persistence backend failed.
+Persist(Error)
Either writing to or loading from the persistence backend failed.
NotInitialized
Wallet is not initialized, persistence backend is empty.
LoadedGenesisDoesNotMatch
Fields
expected: BlockHashThe expected genesis block hash.
got: Option<BlockHash>The block hash loaded from persistence.
@@ -24,9 +22,9 @@LoadedNetworkDoesNotMatch
Fields
expected: NetworkThe expected network type.
The loaded network type does not match what was provided.
-Trait Implementations§
source§impl<W, L> Error for NewOrLoadError<W, L>where
W: Display + Debug,
L: Display + Debug,
impl<W, L> Error for NewOrLoadError<W, L>where
W: Display + Debug,
L: Display + Debug,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl<W, L> RefUnwindSafe for NewOrLoadError<W, L>where
L: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, L> Send for NewOrLoadError<W, L>where
L: Send,
W: Send,
impl<W, L> Sync for NewOrLoadError<W, L>where
L: Sync,
W: Sync,
impl<W, L> Unpin for NewOrLoadError<W, L>where
L: Unpin,
W: Unpin,
impl<W, L> UnwindSafe for NewOrLoadError<W, L>where
L: UnwindSafe,
W: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Trait Implementations§
source§impl Debug for NewOrLoadError
impl Debug for NewOrLoadError
source§impl Display for NewOrLoadError
impl Display for NewOrLoadError
source§impl Error for NewOrLoadError
impl Error for NewOrLoadError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl !RefUnwindSafe for NewOrLoadError
impl Send for NewOrLoadError
impl Sync for NewOrLoadError
impl Unpin for NewOrLoadError
impl !UnwindSafe for NewOrLoadError
Blanket Implementations§
Enum bdk::wallet::error::BuildFeeBumpError
source · pub enum BuildFeeBumpError {
+ 
BuildFeeBumpError
Enum bdk::wallet::error::BuildFeeBumpError
source · pub enum BuildFeeBumpError {
UnknownUtxo(OutPoint),
TransactionNotFound(Txid),
TransactionConfirmed(Txid),
@@ -11,7 +11,7 @@
TransactionConfirmed(Txid)
Happens when trying to bump a transaction that is already confirmed
IrreplaceableTransaction(Txid)
Trying to replace a tx that has a sequence >= 0xFFFFFFFE
Node doesnât have data to estimate a fee rate
-Trait Implementations§
source§impl Debug for BuildFeeBumpError
impl Debug for BuildFeeBumpError
source§impl Display for BuildFeeBumpError
impl Display for BuildFeeBumpError
source§impl Error for BuildFeeBumpError
impl Error for BuildFeeBumpError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for BuildFeeBumpError
impl Send for BuildFeeBumpError
impl Sync for BuildFeeBumpError
impl Unpin for BuildFeeBumpError
impl UnwindSafe for BuildFeeBumpError
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Debug for BuildFeeBumpError
impl Debug for BuildFeeBumpError
source§impl Display for BuildFeeBumpError
impl Display for BuildFeeBumpError
source§impl Error for BuildFeeBumpError
impl Error for BuildFeeBumpError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl RefUnwindSafe for BuildFeeBumpError
impl Send for BuildFeeBumpError
impl Sync for BuildFeeBumpError
impl Unpin for BuildFeeBumpError
impl UnwindSafe for BuildFeeBumpError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Enum bdk::wallet::error::CreateTxError
source · pub enum CreateTxError<P> {
+ 
CreateTxError
Enum bdk::wallet::error::CreateTxError
source · pub enum CreateTxError {
Show 22 variants
Descriptor(DescriptorError),
- Persist(P),
+ Persist(Error),
Policy(PolicyError),
SpendingPolicyRequired(KeychainKind),
Version0,
@@ -37,7 +37,7 @@
MiniscriptPsbt(MiniscriptPsbtError),
}Expand description
Error returned from TxBuilder::finish
Variants§
Descriptor(DescriptorError)
There was a problem with the descriptors passed in
-Persist(P)
We were unable to write wallet data to the persistence backend
+Persist(Error)
We were unable to load wallet data from or write wallet data to the persistence backend
Policy(PolicyError)
There was a problem while extracting and manipulating policies
SpendingPolicyRequired(KeychainKind)
Spending policy is not compatible with this KeychainKind
Version0
Requested invalid transaction version â0â
@@ -68,9 +68,9 @@ explicit origin providedUnknownUtxo
Happens when trying to spend an UTXO that is not in the internal database
MissingNonWitnessUtxo(OutPoint)
Missing non_witness_utxo on foreign utxo for given OutPoint
MiniscriptPsbt(MiniscriptPsbtError)
Miniscript PSBT error
-Trait Implementations§
source§impl<P: Debug> Debug for CreateTxError<P>
impl<P: Debug> Debug for CreateTxError<P>
source§impl<P> Display for CreateTxError<P>where
P: Display,
impl<P> Display for CreateTxError<P>where
P: Display,
source§impl<P: Display + Debug> Error for CreateTxError<P>
impl<P: Display + Debug> Error for CreateTxError<P>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<P> From<Error> for CreateTxError<P>
impl<P> From<Error> for CreateTxError<P>
source§impl<P> From<Error> for CreateTxError<P>
impl<P> From<Error> for CreateTxError<P>
source§impl<P> From<Error> for CreateTxError<P>
impl<P> From<Error> for CreateTxError<P>
source§impl<P> From<MiniscriptPsbtError> for CreateTxError<P>
impl<P> From<MiniscriptPsbtError> for CreateTxError<P>
source§fn from(err: MiniscriptPsbtError) -> Self
fn from(err: MiniscriptPsbtError) -> Self
source§impl<P> From<PolicyError> for CreateTxError<P>
impl<P> From<PolicyError> for CreateTxError<P>
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
Auto Trait Implementations§
impl<P> !RefUnwindSafe for CreateTxError<P>
impl<P> Send for CreateTxError<P>where
P: Send,
impl<P> Sync for CreateTxError<P>where
P: Sync,
impl<P> Unpin for CreateTxError<P>where
P: Unpin,
impl<P> !UnwindSafe for CreateTxError<P>
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Trait Implementations§
source§impl Debug for CreateTxError
impl Debug for CreateTxError
source§impl Display for CreateTxError
impl Display for CreateTxError
source§impl Error for CreateTxError
impl Error for CreateTxError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<Error> for CreateTxError
impl From<Error> for CreateTxError
source§impl From<Error> for CreateTxError
impl From<Error> for CreateTxError
source§impl From<Error> for CreateTxError
impl From<Error> for CreateTxError
source§impl From<MiniscriptPsbtError> for CreateTxError
impl From<MiniscriptPsbtError> for CreateTxError
source§fn from(err: MiniscriptPsbtError) -> Self
fn from(err: MiniscriptPsbtError) -> Self
source§impl From<PolicyError> for CreateTxError
impl From<PolicyError> for CreateTxError
source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CreateTxError
impl Send for CreateTxError
impl Sync for CreateTxError
impl Unpin for CreateTxError
impl !UnwindSafe for CreateTxError
Blanket Implementations§
Enum bdk::wallet::error::MiniscriptPsbtError
source · pub enum MiniscriptPsbtError {
+ 
MiniscriptPsbtError
Enum bdk::wallet::error::MiniscriptPsbtError
source · pub enum MiniscriptPsbtError {
Conversion(ConversionError),
UtxoUpdate(UtxoUpdateError),
OutputUpdate(OutputUpdateError),
@@ -7,7 +7,7 @@
Variants§
Conversion(ConversionError)
Descriptor key conversion error
UtxoUpdate(UtxoUpdateError)
Return error type for PsbtExt::update_input_with_descriptor
OutputUpdate(OutputUpdateError)
Return error type for PsbtExt::update_output_with_descriptor
-Trait Implementations§
source§impl Clone for MiniscriptPsbtError
impl Clone for MiniscriptPsbtError
source§fn clone(&self) -> MiniscriptPsbtError
fn clone(&self) -> MiniscriptPsbtError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MiniscriptPsbtError
impl Debug for MiniscriptPsbtError
source§impl Display for MiniscriptPsbtError
impl Display for MiniscriptPsbtError
source§impl Error for MiniscriptPsbtError
impl Error for MiniscriptPsbtError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<P> From<MiniscriptPsbtError> for CreateTxError<P>
impl<P> From<MiniscriptPsbtError> for CreateTxError<P>
source§fn from(err: MiniscriptPsbtError) -> Self
fn from(err: MiniscriptPsbtError) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for MiniscriptPsbtError
impl Send for MiniscriptPsbtError
impl Sync for MiniscriptPsbtError
impl Unpin for MiniscriptPsbtError
impl UnwindSafe for MiniscriptPsbtError
Blanket Implementations§
source§impl<T> From<T> for T
impl<T> From<T> for T
Trait Implementations§
source§impl Clone for MiniscriptPsbtError
impl Clone for MiniscriptPsbtError
source§fn clone(&self) -> MiniscriptPsbtError
fn clone(&self) -> MiniscriptPsbtError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for MiniscriptPsbtError
impl Debug for MiniscriptPsbtError
source§impl Display for MiniscriptPsbtError
impl Display for MiniscriptPsbtError
source§impl Error for MiniscriptPsbtError
impl Error for MiniscriptPsbtError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<MiniscriptPsbtError> for CreateTxError
impl From<MiniscriptPsbtError> for CreateTxError
source§fn from(err: MiniscriptPsbtError) -> Self
fn from(err: MiniscriptPsbtError) -> Self
Auto Trait Implementations§
impl RefUnwindSafe for MiniscriptPsbtError
impl Send for MiniscriptPsbtError
impl Sync for MiniscriptPsbtError
impl Unpin for MiniscriptPsbtError
impl UnwindSafe for MiniscriptPsbtError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Expand description
Errors that can be thrown by the Wallet

Module error
Expand description
Errors that can be thrown by the Wallet
Enums
Wallet::build_fee_bumpTxBuilder::finishExpand description
Wallet export
+
Module export
Expand description
Wallet export
This modules implements the wallet export format used by FullyNoded.
Examples
Import from JSON
let import = r#"{
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/struct.FullyNodedExport.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/struct.FullyNodedExport.html
index 4a85585cd2..9942b504a8 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/struct.FullyNodedExport.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/struct.FullyNodedExport.html
@@ -1,5 +1,5 @@
FullyNodedExport in bdk::wallet::export - Rust Struct bdk::wallet::export::FullyNodedExport
source · pub struct FullyNodedExport {
+ 
FullyNodedExport
Struct bdk::wallet::export::FullyNodedExport
source · pub struct FullyNodedExport {
pub blockheight: u32,
pub label: String,
/* private fields */
@@ -7,7 +7,7 @@
For a usage example see this moduleâs documentation.
Fields§
§blockheight: u32Earliest block to rescan when looking for the walletâs transactions
§label: StringArbitrary label for the wallet
-Implementations§
source§impl FullyNodedExport
sourcepub fn export_wallet<D>(
wallet: &Wallet<D>,
label: &str,
include_blockheight: bool
) -> Result<Self, &'static str>
Export a wallet
+Implementations§
source§impl FullyNodedExport
sourcepub fn export_wallet(
wallet: &Wallet,
label: &str,
include_blockheight: bool
) -> Result<Self, &'static str>
Export a wallet
This function returns an error if it determines that the walletâs descriptor(s) are not
supported by Bitcoin Core or donât follow the standard derivation paths defined by BIP44
and others.
@@ -15,9 +15,9 @@ and others.
for the oldest transaction it knows and use that as the earliest block to rescan.
If the database is empty or include_blockheight is false, the blockheight field
returned will be 0.
-sourcepub fn descriptor(&self) -> String
Return the external descriptor
-sourcepub fn change_descriptor(&self) -> Option<String>
Return the internal descriptor, if present
-Trait Implementations§
source§impl Debug for FullyNodedExport
source§impl<'de> Deserialize<'de> for FullyNodedExport
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromStr for FullyNodedExport
source§impl Serialize for FullyNodedExport
Auto Trait Implementations§
§impl RefUnwindSafe for FullyNodedExport
§impl Send for FullyNodedExport
§impl Sync for FullyNodedExport
§impl Unpin for FullyNodedExport
§impl UnwindSafe for FullyNodedExport
Blanket Implementations§
Trait Implementations§
source§impl Debug for FullyNodedExport
source§impl<'de> Deserialize<'de> for FullyNodedExport
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl FromStr for FullyNodedExport
source§impl Serialize for FullyNodedExport
Auto Trait Implementations§
§impl RefUnwindSafe for FullyNodedExport
§impl Send for FullyNodedExport
§impl Sync for FullyNodedExport
§impl Unpin for FullyNodedExport
§impl UnwindSafe for FullyNodedExport
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/type.WalletExport.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/type.WalletExport.html
index 6874264e03..15c5c7fe8c 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/type.WalletExport.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/export/type.WalletExport.html
@@ -1,3 +1,3 @@
WalletExport in bdk::wallet::export - Rust Type Definition bdk::wallet::export::WalletExport
source · pub type WalletExport = FullyNodedExport;
ðDeprecated since 0.18.0: Please use [FullyNodedExport] insteadExpand description
Alias for FullyNodedExport
+ 
WalletExport
Type Definition bdk::wallet::export::WalletExport
source · pub type WalletExport = FullyNodedExport;
ðDeprecated since 0.18.0: Please use [FullyNodedExport] insteadExpand description
Alias for FullyNodedExport
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html
index f27b8adf6e..a0b18b5536 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/fn.wallet_name_from_descriptor.html
@@ -1,4 +1,4 @@
wallet_name_from_descriptor in bdk::wallet - Rust Function bdk::wallet::wallet_name_from_descriptor
source · pub fn wallet_name_from_descriptor<T>(
descriptor: T,
change_descriptor: Option<T>,
network: Network,
secp: &Secp256k1<All>
) -> Result<String, DescriptorError>where
T: IntoWalletDescriptor,
Expand description
Deterministically generate a unique name given the descriptors defining the wallet
+ 
Function bdk::wallet::wallet_name_from_descriptor
source · pub fn wallet_name_from_descriptor<T>(
descriptor: T,
change_descriptor: Option<T>,
network: Network,
secp: &Secp256k1<All>
) -> Result<String, DescriptorError>where
T: IntoWalletDescriptor,
Expand description
Deterministically generate a unique name given the descriptors defining the wallet
Compatible with wallet_name_from_descriptor
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/index.html
index 06f6157ec7..678bdbb480 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/index.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/index.html
@@ -1,5 +1,5 @@
bdk::wallet - Rust Expand description
Wallet
+ 
Module wallet
Expand description
Wallet
This module defines the Wallet.
Modules
Coin selectionWallet exportGeneralized signersTransaction builderStructs
A derived address and the index it was found at.
For convenience this automatically derefs to AddressBalance, differentiated into various categories.A Bitcoin walletEnums
The address index selection strategy to use to derived an address from the walletâs external
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html
index 3565a89a7f..1f77a98726 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html
@@ -1,5 +1,5 @@
Wallet in bdk::wallet - Rust pub struct Wallet<D = ()> { /* private fields */ }
Expand description
A Bitcoin wallet
+ 
Wallet
pub struct Wallet { /* private fields */ }
Expand description
A Bitcoin wallet
The Wallet acts as a way of coherently interfacing with output descriptors and related transactions.
Its main components are:
@@ -8,13 +8,13 @@ Its main components are:
Implementations§
source§impl Wallet
sourcepub fn new_no_persist<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
network: Network
) -> Result<Self, DescriptorError>
Creates a wallet that does not persist data.
sourcepub fn new_no_persist_with_genesis_hash<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
network: Network,
genesis_hash: BlockHash
) -> Result<Self, DescriptorError>
Creates a wallet that does not persist data, with a custom genesis hash.
-source§impl<D> Wallet<D>where
D: PersistBackend<ChangeSet, WriteError = Infallible>,
sourcepub fn get_address(&mut self, address_index: AddressIndex) -> AddressInfo
Infallibly return a derived address using the external descriptor, see AddressIndex for
+
source§impl Wallet
sourcepub fn get_address(&mut self, address_index: AddressIndex) -> AddressInfo
Infallibly return a derived address using the external descriptor, see AddressIndex for
available address index selection strategies. If none of the keys in the descriptor are derivable
(i.e. does not end with /*) then the same address will always be returned for any AddressIndex.
Panics
This panics when the caller requests for an address of derivation index greater than the
BIP32 max index.
-sourcepub fn get_internal_address(
&mut self,
address_index: AddressIndex
) -> AddressInfo
Infallibly return a derived address using the internal (change) descriptor.
+sourcepub fn get_internal_address(
&mut self,
address_index: AddressIndex
) -> AddressInfo
Infallibly return a derived address using the internal (change) descriptor.
If the wallet doesnât have an internal descriptor it will use the external descriptor.
see AddressIndex for available address index selection strategies. If none of the keys
in the descriptor are derivable (i.e. does not end with /*) then the same address will always
@@ -22,21 +22,21 @@ be returned for any
Panics
This panics when the caller requests for an address of derivation index greater than the
BIP32 max index.
-
source§impl<D> Wallet<D>
sourcepub fn new<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: D,
network: Network
) -> Result<Self, NewError<D::WriteError>>where
D: PersistBackend<ChangeSet>,
Initialize an empty Wallet.
-sourcepub fn new_with_genesis_hash<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: D,
network: Network,
genesis_hash: BlockHash
) -> Result<Self, NewError<D::WriteError>>where
D: PersistBackend<ChangeSet>,
Initialize an empty Wallet with a custom genesis hash.
+source§impl Wallet
sourcepub fn new<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: impl PersistBackend<ChangeSet> + Send + Sync + 'static,
network: Network
) -> Result<Self, NewError>
Initialize an empty Wallet.
+sourcepub fn new_with_genesis_hash<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: impl PersistBackend<ChangeSet> + Send + Sync + 'static,
network: Network,
genesis_hash: BlockHash
) -> Result<Self, NewError>
Initialize an empty Wallet with a custom genesis hash.
This is like Wallet::new with an additional genesis_hash parameter. This is useful
for syncing from alternative networks.
-sourcepub fn load<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: D
) -> Result<Self, LoadError<D::LoadError>>where
D: PersistBackend<ChangeSet>,
Load Wallet from the given persistence backend.
-sourcepub fn new_or_load<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: D,
network: Network
) -> Result<Self, NewOrLoadError<D::WriteError, D::LoadError>>where
D: PersistBackend<ChangeSet>,
Either loads Wallet from persistence, or initializes it if it does not exist.
+sourcepub fn load<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: impl PersistBackend<ChangeSet> + Send + Sync + 'static
) -> Result<Self, LoadError>
Load Wallet from the given persistence backend.
+sourcepub fn new_or_load<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: impl PersistBackend<ChangeSet> + Send + Sync + 'static,
network: Network
) -> Result<Self, NewOrLoadError>
sourcepub fn new_or_load_with_genesis_hash<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: D,
network: Network,
genesis_hash: BlockHash
) -> Result<Self, NewOrLoadError<D::WriteError, D::LoadError>>where
D: PersistBackend<ChangeSet>,
Either loads Wallet from persistence, or initializes it if it does not exist (with a
+
sourcepub fn new_or_load_with_genesis_hash<E: IntoWalletDescriptor>(
descriptor: E,
change_descriptor: Option<E>,
db: impl PersistBackend<ChangeSet> + Send + Sync + 'static,
network: Network,
genesis_hash: BlockHash
) -> Result<Self, NewOrLoadError>
Either loads Wallet from persistence, or initializes it if it does not exist (with a
custom genesis hash).
This method will fail if the loaded Wallet has different parameters to those provided.
This is like Wallet::new_or_load with an additional genesis_hash parameter. This is
useful for syncing from alternative networks.
-sourcepub fn keychains(&self) -> &BTreeMap<KeychainKind, ExtendedDescriptor>
Iterator over all keychains in this wallet
-sourcepub fn try_get_address(
&mut self,
address_index: AddressIndex
) -> Result<AddressInfo, D::WriteError>where
D: PersistBackend<ChangeSet>,
Return a derived address using the external descriptor, see AddressIndex for
+
sourcepub fn keychains(&self) -> &BTreeMap<KeychainKind, ExtendedDescriptor>
Iterator over all keychains in this wallet
+sourcepub fn try_get_address(
&mut self,
address_index: AddressIndex
) -> Result<AddressInfo>
Return a derived address using the external descriptor, see AddressIndex for
available address index selection strategies. If none of the keys in the descriptor are derivable
(i.e. does not end with /*) then the same address will always be returned for any AddressIndex.
A PersistBackend<ChangeSet>::WriteError will result if unable to persist the new address
@@ -44,7 +44,7 @@ to the PersistBackend.
Panics
This panics when the caller requests for an address of derivation index greater than the
BIP32 max index.
-sourcepub fn try_get_internal_address(
&mut self,
address_index: AddressIndex
) -> Result<AddressInfo, D::WriteError>where
D: PersistBackend<ChangeSet>,
Return a derived address using the internal (change) descriptor.
+sourcepub fn try_get_internal_address(
&mut self,
address_index: AddressIndex
) -> Result<AddressInfo>
Return a derived address using the internal (change) descriptor.
If the wallet doesnât have an internal descriptor it will use the external descriptor.
A PersistBackend<ChangeSet>::WriteError will result if unable to persist the new address
to the PersistBackend.
@@ -54,32 +54,32 @@ be returned for any
Panics
This panics when the caller requests for an address of derivation index greater than the
BIP32 max index.
-sourcepub fn is_mine(&self, script: &Script) -> bool
Return whether or not a script is part of this wallet (either internal or external)
-sourcepub fn derivation_of_spk(&self, spk: &Script) -> Option<(KeychainKind, u32)>
Finds how the wallet derived the script pubkey spk.
+sourcepub fn is_mine(&self, script: &Script) -> bool
Return whether or not a script is part of this wallet (either internal or external)
+sourcepub fn derivation_of_spk(&self, spk: &Script) -> Option<(KeychainKind, u32)>
Finds how the wallet derived the script pubkey spk.
Will only return Some(_) if the wallet has given out the spk.
-sourcepub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_
Return the list of unspent outputs of this wallet
-sourcepub fn list_output(&self) -> impl Iterator<Item = LocalOutput> + '_
List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).
+sourcepub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_
Return the list of unspent outputs of this wallet
+sourcepub fn list_output(&self) -> impl Iterator<Item = LocalOutput> + '_
List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).
To list only unspent outputs (UTXOs), use Wallet::list_unspent instead.
-sourcepub fn checkpoints(&self) -> CheckPointIter
Get all the checkpoints the wallet is currently storing indexed by height.
-sourcepub fn latest_checkpoint(&self) -> CheckPoint
Returns the latest checkpoint.
-sourcepub fn all_unbounded_spk_iters(
&self
) -> BTreeMap<KeychainKind, impl Iterator<Item = (u32, ScriptBuf)> + Clone>
Get unbounded script pubkey iterators for both Internal and External keychains.
+sourcepub fn checkpoints(&self) -> CheckPointIter
Get all the checkpoints the wallet is currently storing indexed by height.
+sourcepub fn latest_checkpoint(&self) -> CheckPoint
Returns the latest checkpoint.
+sourcepub fn all_unbounded_spk_iters(
&self
) -> BTreeMap<KeychainKind, impl Iterator<Item = (u32, ScriptBuf)> + Clone>
Get unbounded script pubkey iterators for both Internal and External keychains.
This is intended to be used when doing a full scan of your addresses (e.g. after restoring
from seed words). You pass the BTreeMap of iterators to a blockchain data source (e.g.
electrum server) which will go through each address until it reaches a stop gap.
Note carefully that iterators go over all script pubkeys on the keychains (not what
script pubkeys the wallet is storing internally).
-sourcepub fn unbounded_spk_iter(
&self,
keychain: KeychainKind
) -> impl Iterator<Item = (u32, ScriptBuf)> + Clone
Get an unbounded script pubkey iterator for the given keychain.
+sourcepub fn unbounded_spk_iter(
&self,
keychain: KeychainKind
) -> impl Iterator<Item = (u32, ScriptBuf)> + Clone
Get an unbounded script pubkey iterator for the given keychain.
See all_unbounded_spk_iters for more documentation
-sourcepub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput>
Returns the utxo owned by this wallet corresponding to outpoint if it exists in the
+
sourcepub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput>
Returns the utxo owned by this wallet corresponding to outpoint if it exists in the
walletâs database.
-sourcepub fn insert_txout(&mut self, outpoint: OutPoint, txout: TxOut)where
D: PersistBackend<ChangeSet>,
Inserts a [TxOut] at [OutPoint] into the walletâs transaction graph.
+sourcepub fn insert_txout(&mut self, outpoint: OutPoint, txout: TxOut)
Inserts a [TxOut] at [OutPoint] into the walletâs transaction graph.
This is used for providing a previous outputâs value so that we can use calculate_fee
or calculate_fee_rate on a given transaction. Outputs inserted with this method will
not be returned in list_unspent or list_output.
Any inserted TxOuts are not persisted until commit is called.
WARNING: This should only be used to add TxOuts that the wallet does not own. Only
insert TxOuts that you trust the values for!
-sourcepub fn calculate_fee(&self, tx: &Transaction) -> Result<u64, CalculateFeeError>
Calculates the fee of a given transaction. Returns 0 if tx is a coinbase transaction.
+sourcepub fn calculate_fee(&self, tx: &Transaction) -> Result<u64, CalculateFeeError>
Calculates the fee of a given transaction. Returns 0 if tx is a coinbase transaction.
To calculate the fee for a [Transaction] with inputs not owned by this wallet you must
manually insert the TxOut(s) into the tx graph using the insert_txout function.
Note tx does not have to be in the graph for this to work.
@@ -89,7 +89,7 @@ manually insert the TxOut(s) into the tx graph using the let tx = &psbt.clone().extract_tx().expect("tx");
let fee = wallet.calculate_fee(tx).expect("fee");
-sourcepub fn calculate_fee_rate(
&self,
tx: &Transaction
) -> Result<FeeRate, CalculateFeeError>
Calculate the [FeeRate] for a given transaction.
+sourcepub fn calculate_fee_rate(
&self,
tx: &Transaction
) -> Result<FeeRate, CalculateFeeError>
Calculate the [FeeRate] for a given transaction.
To calculate the fee rate for a [Transaction] with inputs not owned by this wallet you must
manually insert the TxOut(s) into the tx graph using the insert_txout function.
Note tx does not have to be in the graph for this to work.
@@ -99,7 +99,7 @@ manually insert the TxOut(s) into the tx graph using the let tx = &psbt.clone().extract_tx().expect("tx");
let fee_rate = wallet.calculate_fee_rate(tx).expect("fee rate");
-sourcepub fn sent_and_received(&self, tx: &Transaction) -> (u64, u64)
Compute the txâs sent and received amounts (in satoshis).
+sourcepub fn sent_and_received(&self, tx: &Transaction) -> (u64, u64)
Compute the txâs sent and received amounts (in satoshis).
This method returns a tuple (sent, received). Sent is the sum of the txin amounts
that spend from previous txouts tracked by this wallet. Received is the summation
of this txâs outputs that send to script pubkeys tracked by this wallet.
@@ -109,7 +109,7 @@ of this txâs outputs that send to script pubkeys tracked by this wallet.
let tx = &psbt.clone().extract_tx().expect("tx");
let (sent, received) = wallet.sent_and_received(tx);
-sourcepub fn get_tx(
&self,
txid: Txid
) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>>
Get a single transaction from the wallet as a [CanonicalTx] (if the transaction exists).
+sourcepub fn get_tx(
&self,
txid: Txid
) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>>
Get a single transaction from the wallet as a [CanonicalTx] (if the transaction exists).
CanonicalTx contains the full transaction alongside meta-data such as:
- Blocks that the transaction is
Anchored in. These may or may not be blocks that exist
@@ -147,11 +147,11 @@ the transaction was last seen in the mempool is provided.
last_seen,
),
}
-sourcepub fn insert_checkpoint(
&mut self,
block_id: BlockId
) -> Result<bool, AlterCheckPointError>where
D: PersistBackend<ChangeSet>,
Add a new checkpoint to the walletâs internal view of the chain.
+
sourcepub fn insert_checkpoint(
&mut self,
block_id: BlockId
) -> Result<bool, AlterCheckPointError>
Add a new checkpoint to the walletâs internal view of the chain.
This stages but does not commit the change.
Returns whether anything changed with the insertion (e.g. false if checkpoint was already
there).
-sourcepub fn insert_tx(
&mut self,
tx: Transaction,
position: ConfirmationTime
) -> Result<bool, InsertTxError>where
D: PersistBackend<ChangeSet>,
Add a transaction to the walletâs internal view of the chain. This stages but does not
+
sourcepub fn insert_tx(
&mut self,
tx: Transaction,
position: ConfirmationTime
) -> Result<bool, InsertTxError>
Add a transaction to the walletâs internal view of the chain. This stages but does not
commit the change.
Returns whether anything changed with the transaction insertion (e.g. false if the
transaction was already inserted at the same position).
@@ -161,12 +161,12 @@ inserting new transactions.
WARNING: If position is confirmed, we anchor the tx to a the lowest checkpoint that
is >= the positionâs height. The caller is responsible for ensuring the tx exists in our
local view of the best chainâs history.
-sourcepub fn transactions(
&self
) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>> + '_
Iterate over the transactions in the wallet.
-sourcepub fn get_balance(&self) -> Balance
Return the balance, separated into available, trusted-pending, untrusted-pending and immature
+
sourcepub fn transactions(
&self
) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>> + '_
Iterate over the transactions in the wallet.
+sourcepub fn get_balance(&self) -> Balance
Return the balance, separated into available, trusted-pending, untrusted-pending and immature
values.
-sourcepub fn add_signer(
&mut self,
keychain: KeychainKind,
ordering: SignerOrdering,
signer: Arc<dyn TransactionSigner>
)
Add an external signer
+sourcepub fn add_signer(
&mut self,
keychain: KeychainKind,
ordering: SignerOrdering,
signer: Arc<dyn TransactionSigner>
)
Add an external signer
See the signer module for an example.
-sourcepub fn get_signers(&self, keychain: KeychainKind) -> Arc<SignersContainer>
Get the signers
+sourcepub fn get_signers(&self, keychain: KeychainKind) -> Arc<SignersContainer>
Get the signers
Example
let wallet = Wallet::new_no_persist("wpkh(tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/0'/0'/0/*)", None, Network::Testnet)?;
for secret_key in wallet.get_signers(KeychainKind::External).signers().iter().filter_map(|s| s.descriptor_secret_key()) {
@@ -175,7 +175,7 @@ values.
}
Ok::<(), Box<dyn std::error::Error>>(())
-sourcepub fn build_tx(
&mut self
) -> TxBuilder<'_, D, DefaultCoinSelectionAlgorithm, CreateTx>
Start building a transaction.
+sourcepub fn build_tx(
&mut self
) -> TxBuilder<'_, DefaultCoinSelectionAlgorithm, CreateTx>
sourcepub fn build_fee_bump(
&mut self,
txid: Txid
) -> Result<TxBuilder<'_, D, DefaultCoinSelectionAlgorithm, BumpFee>, BuildFeeBumpError>
Bump the fee of a transaction previously created with this wallet.
+sourcepub fn build_fee_bump(
&mut self,
txid: Txid
) -> Result<TxBuilder<'_, DefaultCoinSelectionAlgorithm, BumpFee>, BuildFeeBumpError>
Bump the fee of a transaction previously created with this wallet.
Returns an error if the transaction is already confirmed or doesnât explicitly signal
replace by fee (RBF). If the transaction can be fee bumped then it returns a TxBuilder
pre-populated with the inputs and outputs of the original transaction.
@@ -211,7 +211,7 @@ pre-populated with the inputs and outputs of the original transaction.
let _ = wallet.sign(&mut psbt, SignOptions::default())?;
let fee_bumped_tx = psbt.extract_tx();
// broadcast fee_bumped_tx to replace original
-sourcepub fn sign(
&self,
psbt: &mut Psbt,
sign_options: SignOptions
) -> Result<bool, SignerError>
Sign a transaction with all the walletâs signers, in the order specified by every signerâs
+
sourcepub fn sign(
&self,
psbt: &mut Psbt,
sign_options: SignOptions
) -> Result<bool, SignerError>
Sign a transaction with all the walletâs signers, in the order specified by every signerâs
SignerOrdering. This function returns the Result type with an encapsulated bool that has the value true if the PSBT was finalized, or false otherwise.
The SignOptions can be used to tweak the behavior of the software signers, and the way
the transaction is finalized at the end. Note that it canât be guaranteed that every
@@ -225,53 +225,53 @@ in this library will.
};
let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
assert!(finalized, "we should have signed all the inputs");
-sourcepub fn policies(
&self,
keychain: KeychainKind
) -> Result<Option<Policy>, DescriptorError>
Return the spending policies for the walletâs descriptor
-sourcepub fn public_descriptor(
&self,
keychain: KeychainKind
) -> Option<&ExtendedDescriptor>
Return the âpublicâ version of the walletâs descriptor, meaning a new descriptor that has
+
sourcepub fn policies(
&self,
keychain: KeychainKind
) -> Result<Option<Policy>, DescriptorError>
Return the spending policies for the walletâs descriptor
+sourcepub fn public_descriptor(
&self,
keychain: KeychainKind
) -> Option<&ExtendedDescriptor>
Return the âpublicâ version of the walletâs descriptor, meaning a new descriptor that has
the same structure but with every secret key removed
This can be used to build a watch-only version of a wallet
-sourcepub fn finalize_psbt(
&self,
psbt: &mut Psbt,
sign_options: SignOptions
) -> Result<bool, SignerError>
Finalize a PSBT, i.e., for each input determine if sufficient data is available to pass
+
sourcepub fn finalize_psbt(
&self,
psbt: &mut Psbt,
sign_options: SignOptions
) -> Result<bool, SignerError>
Finalize a PSBT, i.e., for each input determine if sufficient data is available to pass
validation and construct the respective scriptSig or scriptWitness. Please refer to
BIP174
for further information.
Returns true if the PSBT could be finalized, and false otherwise.
The SignOptions can be used to tweak the behavior of the finalizer.
-sourcepub fn secp_ctx(&self) -> &Secp256k1<All>
Return the secp256k1 context used for all signing operations
-sourcepub fn get_descriptor_for_keychain(
&self,
keychain: KeychainKind
) -> &ExtendedDescriptor
Returns the descriptor used to create addresses for a particular keychain.
-sourcepub fn derivation_index(&self, keychain: KeychainKind) -> Option<u32>
The derivation index of this wallet. It will return None if it has not derived any addresses.
+
sourcepub fn secp_ctx(&self) -> &Secp256k1<All>
Return the secp256k1 context used for all signing operations
+sourcepub fn get_descriptor_for_keychain(
&self,
keychain: KeychainKind
) -> &ExtendedDescriptor
Returns the descriptor used to create addresses for a particular keychain.
+sourcepub fn derivation_index(&self, keychain: KeychainKind) -> Option<u32>
The derivation index of this wallet. It will return None if it has not derived any addresses.
Otherwise, it will return the index of the highest address it has derived.
-sourcepub fn next_derivation_index(&self, keychain: KeychainKind) -> u32
The index of the next address that you would get if you were to ask the wallet for a new address
-sourcepub fn cancel_tx(&mut self, tx: &Transaction)
Informs the wallet that you no longer intend to broadcast a tx that was built from it.
+sourcepub fn next_derivation_index(&self, keychain: KeychainKind) -> u32
The index of the next address that you would get if you were to ask the wallet for a new address
+sourcepub fn cancel_tx(&mut self, tx: &Transaction)
Informs the wallet that you no longer intend to broadcast a tx that was built from it.
This frees up the change address used when creating the tx for use in future transactions.
-sourcepub fn get_psbt_input(
&self,
utxo: LocalOutput,
sighash_type: Option<PsbtSighashType>,
only_witness_utxo: bool
) -> Result<Input, CreateTxError<D::WriteError>>where
D: PersistBackend<ChangeSet>,
get the corresponding PSBT Input for a LocalUtxo
-sourcepub fn descriptor_checksum(&self, keychain: KeychainKind) -> String
Return the checksum of the public descriptor associated to keychain
+sourcepub fn get_psbt_input(
&self,
utxo: LocalOutput,
sighash_type: Option<PsbtSighashType>,
only_witness_utxo: bool
) -> Result<Input, CreateTxError>
get the corresponding PSBT Input for a LocalUtxo
+sourcepub fn descriptor_checksum(&self, keychain: KeychainKind) -> String
Return the checksum of the public descriptor associated to keychain
Internally calls Self::get_descriptor_for_keychain to fetch the right descriptor
-sourcepub fn apply_update(&mut self, update: Update) -> Result<(), CannotConnectError>where
D: PersistBackend<ChangeSet>,
Applies an update to the wallet and stages the changes (but does not commit them).
+sourcepub fn apply_update(&mut self, update: Update) -> Result<(), CannotConnectError>
Applies an update to the wallet and stages the changes (but does not commit them).
Usually you create an update by interacting with some blockchain data source and inserting
transactions related to your wallet into it.
-sourcepub fn commit(&mut self) -> Result<bool, D::WriteError>where
D: PersistBackend<ChangeSet>,
Commits all currently staged changed to the persistence backend returning and error when
+
sourcepub fn commit(&mut self) -> Result<bool>
Commits all currently staged changed to the persistence backend returning and error when
this fails.
This returns whether the update resulted in any changes.
-sourcepub fn staged(&self) -> &ChangeSetwhere
D: PersistBackend<ChangeSet>,
Returns the changes that will be committed with the next call to commit.
-sourcepub fn tx_graph(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>
Get a reference to the inner [TxGraph].
-sourcepub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>
Get a reference to the inner [KeychainTxOutIndex].
-sourcepub fn local_chain(&self) -> &LocalChain
Get a reference to the inner [LocalChain].
-sourcepub fn apply_block(
&mut self,
block: &Block,
height: u32
) -> Result<(), CannotConnectError>where
D: PersistBackend<ChangeSet>,
Introduces a block of height to the wallet, and tries to connect it to the
+
sourcepub fn staged(&self) -> &ChangeSet
Returns the changes that will be committed with the next call to commit.
+sourcepub fn tx_graph(&self) -> &TxGraph<ConfirmationTimeHeightAnchor>
Get a reference to the inner [TxGraph].
+sourcepub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind>
Get a reference to the inner [KeychainTxOutIndex].
+sourcepub fn local_chain(&self) -> &LocalChain
Get a reference to the inner [LocalChain].
+sourcepub fn apply_block(
&mut self,
block: &Block,
height: u32
) -> Result<(), CannotConnectError>
Introduces a block of height to the wallet, and tries to connect it to the
prev_blockhash of the blockâs header.
This is a convenience method that is equivalent to calling apply_block_connected_to
with prev_blockhash and height-1 as the connected_to parameter.
-sourcepub fn apply_block_connected_to(
&mut self,
block: &Block,
height: u32,
connected_to: BlockId
) -> Result<(), ApplyHeaderError>where
D: PersistBackend<ChangeSet>,
Applies relevant transactions from block of height to the wallet, and connects the
+
sourcepub fn apply_block_connected_to(
&mut self,
block: &Block,
height: u32,
connected_to: BlockId
) -> Result<(), ApplyHeaderError>
Applies relevant transactions from block of height to the wallet, and connects the
block to the internal chain.
The connected_to parameter informs the wallet how this block connects to the internal
[LocalChain]. Relevant transactions are filtered from the block and inserted into the
internal [TxGraph].
-sourcepub fn apply_unconfirmed_txs<'t>(
&mut self,
unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>
)where
D: PersistBackend<ChangeSet>,
Apply relevant unconfirmed transactions to the wallet.
+sourcepub fn apply_unconfirmed_txs<'t>(
&mut self,
unconfirmed_txs: impl IntoIterator<Item = (&'t Transaction, u64)>
)
Apply relevant unconfirmed transactions to the wallet.
Transactions that are not relevant are filtered out.
This method takes in an iterator of (tx, last_seen) where last_seen is the timestamp of
when the transaction was last seen in the mempool. This is used for conflict resolution
when there is conflicting unconfirmed transactions. The transaction with the later
last_seen is prioritized.
-Trait Implementations§
Auto Trait Implementations§
§impl<D = ()> !RefUnwindSafe for Wallet<D>
§impl<D> Send for Wallet<D>where
D: Send,
§impl<D> Sync for Wallet<D>where
D: Sync,
§impl<D> Unpin for Wallet<D>where
D: Unpin,
§impl<D = ()> !UnwindSafe for Wallet<D>
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl !RefUnwindSafe for Wallet
§impl Send for Wallet
§impl Sync for Wallet
§impl Unpin for Wallet
§impl !UnwindSafe for Wallet
Blanket Implementations§
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddForeignUtxoError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddForeignUtxoError.html
index 19fbea009d..78aaa35010 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddForeignUtxoError.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddForeignUtxoError.html
@@ -1,5 +1,5 @@
AddForeignUtxoError in bdk::wallet::tx_builder - Rust Enum bdk::wallet::tx_builder::AddForeignUtxoError
source · pub enum AddForeignUtxoError {
+ 
AddForeignUtxoError
Enum bdk::wallet::tx_builder::AddForeignUtxoError
source · pub enum AddForeignUtxoError {
InvalidTxid {
input_txid: Txid,
foreign_utxo: OutPoint,
@@ -12,7 +12,7 @@
Foreign utxo outpoint txid does not match PSBT input txid
§InvalidOutpoint(OutPoint)
Requested outpoint doesnât exist in the tx (vout greater than available outputs)
§MissingUtxo
Foreign utxo missing witness_utxo or non_witness_utxo
-Trait Implementations§
source§impl Debug for AddForeignUtxoError
source§impl Display for AddForeignUtxoError
source§impl Error for AddForeignUtxoError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AddForeignUtxoError
§impl Send for AddForeignUtxoError
§impl Sync for AddForeignUtxoError
§impl Unpin for AddForeignUtxoError
§impl UnwindSafe for AddForeignUtxoError
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl Debug for AddForeignUtxoError
source§impl Display for AddForeignUtxoError
source§impl Error for AddForeignUtxoError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AddForeignUtxoError
§impl Send for AddForeignUtxoError
§impl Sync for AddForeignUtxoError
§impl Unpin for AddForeignUtxoError
§impl UnwindSafe for AddForeignUtxoError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddUtxoError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddUtxoError.html
index 3cb843c57a..0778cb7653 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddUtxoError.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AddUtxoError.html
@@ -1,9 +1,9 @@
AddUtxoError in bdk::wallet::tx_builder - Rust Enum bdk::wallet::tx_builder::AddUtxoError
source · pub enum AddUtxoError {
+ 
AddUtxoError
Enum bdk::wallet::tx_builder::AddUtxoError
source · pub enum AddUtxoError {
UnknownUtxo(OutPoint),
}
Expand description
Error returned from TxBuilder::add_utxo and TxBuilder::add_utxos
Variants§
§UnknownUtxo(OutPoint)
Happens when trying to spend an UTXO that is not in the internal database
-Trait Implementations§
source§impl Debug for AddUtxoError
source§impl Display for AddUtxoError
source§impl Error for AddUtxoError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AddUtxoError
§impl Send for AddUtxoError
§impl Sync for AddUtxoError
§impl Unpin for AddUtxoError
§impl UnwindSafe for AddUtxoError
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl Debug for AddUtxoError
source§impl Display for AddUtxoError
source§impl Error for AddUtxoError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AddUtxoError
§impl Send for AddUtxoError
§impl Sync for AddUtxoError
§impl Unpin for AddUtxoError
§impl UnwindSafe for AddUtxoError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AllowShrinkingError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AllowShrinkingError.html
index 66c60eacb5..1be2155165 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AllowShrinkingError.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.AllowShrinkingError.html
@@ -1,9 +1,9 @@
AllowShrinkingError in bdk::wallet::tx_builder - Rust Enum bdk::wallet::tx_builder::AllowShrinkingError
source · pub enum AllowShrinkingError {
+ 
AllowShrinkingError
Enum bdk::wallet::tx_builder::AllowShrinkingError
source · pub enum AllowShrinkingError {
MissingScriptPubKey(ScriptBuf),
}
Expand description
Error returned from TxBuilder::allow_shrinking
Variants§
§MissingScriptPubKey(ScriptBuf)
Script/PubKey was not in the original transaction
-Trait Implementations§
source§impl Debug for AllowShrinkingError
source§impl Display for AllowShrinkingError
source§impl Error for AllowShrinkingError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AllowShrinkingError
§impl Send for AllowShrinkingError
§impl Sync for AllowShrinkingError
§impl Unpin for AllowShrinkingError
§impl UnwindSafe for AllowShrinkingError
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl Debug for AllowShrinkingError
source§impl Display for AllowShrinkingError
source§impl Error for AllowShrinkingError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl RefUnwindSafe for AllowShrinkingError
§impl Send for AllowShrinkingError
§impl Sync for AllowShrinkingError
§impl Unpin for AllowShrinkingError
§impl UnwindSafe for AllowShrinkingError
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html
index 5e22250c87..c99976c218 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.ChangeSpendPolicy.html
@@ -1,5 +1,5 @@
ChangeSpendPolicy in bdk::wallet::tx_builder - Rust Enum bdk::wallet::tx_builder::ChangeSpendPolicy
source · pub enum ChangeSpendPolicy {
+ 
ChangeSpendPolicy
Enum bdk::wallet::tx_builder::ChangeSpendPolicy
source · pub enum ChangeSpendPolicy {
ChangeAllowed,
OnlyChange,
ChangeForbidden,
@@ -7,11 +7,11 @@
Variants§
§ChangeAllowed
Use both change and non-change outputs (default)
§OnlyChange
Only use change outputs (see TxBuilder::only_spend_change)
§ChangeForbidden
Only use non-change outputs (see TxBuilder::do_not_spend_change)
-Trait Implementations§
source§impl Clone for ChangeSpendPolicy
source§fn clone(&self) -> ChangeSpendPolicy
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for ChangeSpendPolicy
source§impl Default for ChangeSpendPolicy
source§fn default() -> ChangeSpendPolicy
Returns the âdefault valueâ for a type. Read moresource§impl Hash for ChangeSpendPolicy
source§impl Ord for ChangeSpendPolicy
source§fn cmp(&self, other: &ChangeSpendPolicy) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moresource§impl PartialEq<ChangeSpendPolicy> for ChangeSpendPolicy
source§fn eq(&self, other: &ChangeSpendPolicy) -> bool
This method tests for self and other values to be equal, and is used
+Trait Implementations§
source§impl Clone for ChangeSpendPolicy
source§fn clone(&self) -> ChangeSpendPolicy
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for ChangeSpendPolicy
source§impl Default for ChangeSpendPolicy
source§fn default() -> ChangeSpendPolicy
Returns the âdefault valueâ for a type. Read moresource§impl Hash for ChangeSpendPolicy
source§impl Ord for ChangeSpendPolicy
source§fn cmp(&self, other: &ChangeSpendPolicy) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moresource§impl PartialEq<ChangeSpendPolicy> for ChangeSpendPolicy
source§fn eq(&self, other: &ChangeSpendPolicy) -> bool
source§impl PartialOrd<ChangeSpendPolicy> for ChangeSpendPolicy
source§impl PartialOrd<ChangeSpendPolicy> for ChangeSpendPolicy
source§fn partial_cmp(&self, other: &ChangeSpendPolicy) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read moresource§impl Copy for ChangeSpendPolicy
source§impl Eq for ChangeSpendPolicy
source§impl StructuralEq for ChangeSpendPolicy
source§impl StructuralPartialEq for ChangeSpendPolicy
Auto Trait Implementations§
§impl RefUnwindSafe for ChangeSpendPolicy
§impl Send for ChangeSpendPolicy
§impl Sync for ChangeSpendPolicy
§impl Unpin for ChangeSpendPolicy
§impl UnwindSafe for ChangeSpendPolicy
Blanket Implementations§
source§impl Copy for ChangeSpendPolicy
source§impl Eq for ChangeSpendPolicy
source§impl StructuralEq for ChangeSpendPolicy
source§impl StructuralPartialEq for ChangeSpendPolicy
Auto Trait Implementations§
§impl RefUnwindSafe for ChangeSpendPolicy
§impl Send for ChangeSpendPolicy
§impl Sync for ChangeSpendPolicy
§impl Unpin for ChangeSpendPolicy
§impl UnwindSafe for ChangeSpendPolicy
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.TxOrdering.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.TxOrdering.html
index c1ec2e06a8..cca11fdea7 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.TxOrdering.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/enum.TxOrdering.html
@@ -1,5 +1,5 @@
TxOrdering in bdk::wallet::tx_builder - Rust Enum bdk::wallet::tx_builder::TxOrdering
source · pub enum TxOrdering {
+ 
TxOrdering
Enum bdk::wallet::tx_builder::TxOrdering
source · pub enum TxOrdering {
Shuffle,
Untouched,
Bip69Lexicographic,
@@ -7,12 +7,12 @@
Variants§
Implementations§
source§impl TxOrdering
sourcepub fn sort_tx(&self, tx: &mut Transaction)
Sort transaction inputs and outputs by TxOrdering variant
-Trait Implementations§
source§impl Clone for TxOrdering
source§fn clone(&self) -> TxOrdering
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for TxOrdering
source§impl Default for TxOrdering
source§fn default() -> TxOrdering
Returns the âdefault valueâ for a type. Read moresource§impl Hash for TxOrdering
source§impl Ord for TxOrdering
source§fn cmp(&self, other: &TxOrdering) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moresource§impl PartialEq<TxOrdering> for TxOrdering
source§fn eq(&self, other: &TxOrdering) -> bool
This method tests for self and other values to be equal, and is used
+Implementations§
source§impl TxOrdering
sourcepub fn sort_tx(&self, tx: &mut Transaction)
Sort transaction inputs and outputs by TxOrdering variant
+Trait Implementations§
source§impl Clone for TxOrdering
source§fn clone(&self) -> TxOrdering
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for TxOrdering
source§impl Default for TxOrdering
source§fn default() -> TxOrdering
Returns the âdefault valueâ for a type. Read moresource§impl Hash for TxOrdering
source§impl Ord for TxOrdering
source§fn cmp(&self, other: &TxOrdering) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moresource§impl PartialEq<TxOrdering> for TxOrdering
source§fn eq(&self, other: &TxOrdering) -> bool
source§impl PartialOrd<TxOrdering> for TxOrdering
source§impl PartialOrd<TxOrdering> for TxOrdering
source§fn partial_cmp(&self, other: &TxOrdering) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read moresource§impl Copy for TxOrdering
source§impl Eq for TxOrdering
source§impl StructuralEq for TxOrdering
source§impl StructuralPartialEq for TxOrdering
Auto Trait Implementations§
§impl RefUnwindSafe for TxOrdering
§impl Send for TxOrdering
§impl Sync for TxOrdering
§impl Unpin for TxOrdering
§impl UnwindSafe for TxOrdering
Blanket Implementations§
source§impl Copy for TxOrdering
source§impl Eq for TxOrdering
source§impl StructuralEq for TxOrdering
source§impl StructuralPartialEq for TxOrdering
Auto Trait Implementations§
§impl RefUnwindSafe for TxOrdering
§impl Send for TxOrdering
§impl Sync for TxOrdering
§impl Unpin for TxOrdering
§impl UnwindSafe for TxOrdering
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/index.html
index 6533024cfd..1bb72d03f1 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/index.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/index.html
@@ -1,5 +1,5 @@
bdk::wallet::tx_builder - Rust Module bdk::wallet::tx_builder
source · Expand description
Transaction builder
+ 
Module tx_builder
Module bdk::wallet::tx_builder
source · Expand description
Transaction builder
Example
// create a TxBuilder from a wallet
let mut tx_builder = wallet.build_tx();
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.BumpFee.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.BumpFee.html
index 1d4c00b3c3..02683f4913 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.BumpFee.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.BumpFee.html
@@ -1,6 +1,6 @@
BumpFee in bdk::wallet::tx_builder - Rust Struct bdk::wallet::tx_builder::BumpFee
source · pub struct BumpFee;
Expand description
Marker type to indicate the TxBuilder is being used to bump the fee of an existing transaction.
-Trait Implementations§
source§impl TxBuilderContext for BumpFee
Auto Trait Implementations§
§impl RefUnwindSafe for BumpFee
§impl Send for BumpFee
§impl Sync for BumpFee
§impl Unpin for BumpFee
§impl UnwindSafe for BumpFee
Blanket Implementations§
source§impl<T> From<T> for T
const: unstable · source§fn from(t: T) -> T
Returns the argument unchanged.
+ 
BumpFee
Struct bdk::wallet::tx_builder::BumpFee
source · pub struct BumpFee;
Expand description
Marker type to indicate the TxBuilder is being used to bump the fee of an existing transaction.
+Trait Implementations§
source§impl TxBuilderContext for BumpFee
Auto Trait Implementations§
§impl RefUnwindSafe for BumpFee
§impl Send for BumpFee
§impl Sync for BumpFee
§impl Unpin for BumpFee
§impl UnwindSafe for BumpFee
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.CreateTx.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.CreateTx.html
index 90be9cbd14..60da472cf0 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.CreateTx.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.CreateTx.html
@@ -1,7 +1,7 @@
CreateTx in bdk::wallet::tx_builder - Rust Struct bdk::wallet::tx_builder::CreateTx
source · pub struct CreateTx;
Expand description
Marker type to indicate the TxBuilder is being used to create a new transaction (as opposed
+ 
CreateTx
Struct bdk::wallet::tx_builder::CreateTx
source · pub struct CreateTx;
Expand description
Marker type to indicate the TxBuilder is being used to create a new transaction (as opposed
to bumping the fee of an existing one).
-Trait Implementations§
source§impl TxBuilderContext for CreateTx
Auto Trait Implementations§
§impl RefUnwindSafe for CreateTx
§impl Send for CreateTx
§impl Sync for CreateTx
§impl Unpin for CreateTx
§impl UnwindSafe for CreateTx
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl TxBuilderContext for CreateTx
Auto Trait Implementations§
§impl RefUnwindSafe for CreateTx
§impl Send for CreateTx
§impl Sync for CreateTx
§impl Unpin for CreateTx
§impl UnwindSafe for CreateTx
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.TxBuilder.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.TxBuilder.html
index 7b89336676..b7ae791cc2 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.TxBuilder.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.TxBuilder.html
@@ -1,5 +1,5 @@
TxBuilder in bdk::wallet::tx_builder - Rust Struct bdk::wallet::tx_builder::TxBuilder
source · pub struct TxBuilder<'a, D, Cs, Ctx> { /* private fields */ }
Expand description
A transaction builder
+ 
TxBuilder
Struct bdk::wallet::tx_builder::TxBuilder
source · pub struct TxBuilder<'a, Cs, Ctx> { /* private fields */ }
Expand description
A transaction builder
A TxBuilder is created by calling build_tx or build_fee_bump on a wallet. After
assigning it, you set options on it until finally calling finish to consume the builder and
generate the transaction.
@@ -30,7 +30,7 @@ as in the following example:
At the moment coin_selection is an exception to the rule as it consumes self.
This means it is usually best to call coin_selection on the return value of build_tx before assigning it.
For further examples see this moduleâs documentation;
-Implementations§
source§impl<'a, D, Cs, Ctx> TxBuilder<'a, D, Cs, Ctx>
Implementations§
source§impl<'a, Cs, Ctx> TxBuilder<'a, Cs, Ctx>
sourcepub fn fee_rate(&mut self, fee_rate: FeeRate) -> &mut Self
Set a custom fee rate.
This method sets the mining fee paid by the transaction as a rate on its size.
This means that the total fee paid is equal to fee_rate times the size
of the transaction. Default is 1 sat/vB in accordance with Bitcoin Coreâs default
@@ -38,7 +38,7 @@ relay policy.
Note that this is really a minimum feerate â itâs possible to
overshoot it slightly since adding a change output to drain the remaining
excess might not be viable.
-sourcepub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self
Set an absolute fee
+
sourcepub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self
Set an absolute fee
The fee_absolute method refers to the absolute transaction fee in satoshis (sats).
If anyone sets both the fee_absolute method and the fee_rate method,
the FeePolicy enum will be set by whichever method was called last,
@@ -46,7 +46,7 @@ as the FeeRate and FeeAmount are mutually exclusive.
Note that this is really a minimum absolute fee â itâs possible to
overshoot it slightly since adding a change output to drain the remaining
excess might not be viable.
-sourcepub fn policy_path(
&mut self,
policy_path: BTreeMap<String, Vec<usize>>,
keychain: KeychainKind
) -> &mut Self
Set the policy path to use while creating the transaction for a given keychain.
+sourcepub fn policy_path(
&mut self,
policy_path: BTreeMap<String, Vec<usize>>,
keychain: KeychainKind
) -> &mut Self
Set the policy path to use while creating the transaction for a given keychain.
This method accepts a map where the key is the policy node id (see
Policy::id) and the value is the list of the indexes of
the items that are intended to be satisfied from the policy node (see
@@ -93,14 +93,14 @@ path.insert("aabbccdd".to_string(), 50_000)
.policy_path(path, KeychainKind::External);
-sourcepub fn add_utxos(
&mut self,
outpoints: &[OutPoint]
) -> Result<&mut Self, AddUtxoError>
Add the list of outpoints to the internal list of UTXOs that must be spent.
+sourcepub fn add_utxos(
&mut self,
outpoints: &[OutPoint]
) -> Result<&mut Self, AddUtxoError>
Add the list of outpoints to the internal list of UTXOs that must be spent.
If an error occurs while adding any of the UTXOs then none of them are added and the error is returned.
These have priority over the âunspendableâ utxos, meaning that if a utxo is present both in
the âutxosâ and the âunspendableâ list, it will be spent.
-sourcepub fn add_utxo(&mut self, outpoint: OutPoint) -> Result<&mut Self, AddUtxoError>
Add a utxo to the internal list of utxos that must be spent
+sourcepub fn add_utxo(&mut self, outpoint: OutPoint) -> Result<&mut Self, AddUtxoError>
Add a utxo to the internal list of utxos that must be spent
These have priority over the âunspendableâ utxos, meaning that if a utxo is present both in
the âutxosâ and the âunspendableâ list, it will be spent.
-sourcepub fn add_foreign_utxo(
&mut self,
outpoint: OutPoint,
psbt_input: Input,
satisfaction_weight: usize
) -> Result<&mut Self, AddForeignUtxoError>
Add a foreign UTXO i.e. a UTXO not owned by this wallet.
+sourcepub fn add_foreign_utxo(
&mut self,
outpoint: OutPoint,
psbt_input: Input,
satisfaction_weight: usize
) -> Result<&mut Self, AddForeignUtxoError>
Add a foreign UTXO i.e. a UTXO not owned by this wallet.
At a minimum to add a foreign UTXO we need:
outpoint: To add it to the raw transaction.
@@ -135,55 +135,55 @@ graph using the only_witness_utxo any non-taproot psbt_input you pass to this
method must have non_witness_utxo set otherwise you will get an error when finish
is called.
-
sourcepub fn add_foreign_utxo_with_sequence(
&mut self,
outpoint: OutPoint,
psbt_input: Input,
satisfaction_weight: usize,
sequence: Sequence
) -> Result<&mut Self, AddForeignUtxoError>
Same as add_foreign_utxo but allows to set the nSequence value.
-sourcepub fn manually_selected_only(&mut self) -> &mut Self
Only spend utxos added by add_utxo.
+sourcepub fn add_foreign_utxo_with_sequence(
&mut self,
outpoint: OutPoint,
psbt_input: Input,
satisfaction_weight: usize,
sequence: Sequence
) -> Result<&mut Self, AddForeignUtxoError>
Same as add_foreign_utxo but allows to set the nSequence value.
+sourcepub fn manually_selected_only(&mut self) -> &mut Self
Only spend utxos added by add_utxo.
The wallet will not add additional utxos to the transaction even if they are needed to
make the transaction valid.
-sourcepub fn unspendable(&mut self, unspendable: Vec<OutPoint>) -> &mut Self
Replace the internal list of unspendable utxos with a new list
+sourcepub fn unspendable(&mut self, unspendable: Vec<OutPoint>) -> &mut Self
Replace the internal list of unspendable utxos with a new list
Itâs important to note that the âmust-be-spentâ utxos added with TxBuilder::add_utxo
have priority over these. See the docs of the two linked methods for more details.
-sourcepub fn add_unspendable(&mut self, unspendable: OutPoint) -> &mut Self
Add a utxo to the internal list of unspendable utxos
+sourcepub fn add_unspendable(&mut self, unspendable: OutPoint) -> &mut Self
Add a utxo to the internal list of unspendable utxos
Itâs important to note that the âmust-be-spentâ utxos added with TxBuilder::add_utxo
have priority over this. See the docs of the two linked methods for more details.
-sourcepub fn sighash(&mut self, sighash: PsbtSighashType) -> &mut Self
Sign with a specific sig hash
+sourcepub fn sighash(&mut self, sighash: PsbtSighashType) -> &mut Self
Sign with a specific sig hash
Use this option very carefully
-sourcepub fn ordering(&mut self, ordering: TxOrdering) -> &mut Self
Choose the ordering for inputs and outputs of the transaction
-sourcepub fn nlocktime(&mut self, locktime: LockTime) -> &mut Self
Use a specific nLockTime while creating the transaction
+sourcepub fn ordering(&mut self, ordering: TxOrdering) -> &mut Self
Choose the ordering for inputs and outputs of the transaction
+sourcepub fn nlocktime(&mut self, locktime: LockTime) -> &mut Self
Use a specific nLockTime while creating the transaction
This can cause conflicts if the walletâs descriptors contain an âafterâ (OP_CLTV) operator.
-sourcepub fn version(&mut self, version: i32) -> &mut Self
Build a transaction with a specific version
+sourcepub fn version(&mut self, version: i32) -> &mut Self
Build a transaction with a specific version
The version should always be greater than 0 and greater than 1 if the walletâs
descriptors contain an âolderâ (OP_CSV) operator.
-sourcepub fn do_not_spend_change(&mut self) -> &mut Self
Do not spend change outputs
+sourcepub fn do_not_spend_change(&mut self) -> &mut Self
Do not spend change outputs
This effectively adds all the change outputs to the âunspendableâ list. See
TxBuilder::unspendable.
-sourcepub fn only_spend_change(&mut self) -> &mut Self
Only spend change outputs
+sourcepub fn only_spend_change(&mut self) -> &mut Self
Only spend change outputs
This effectively adds all the non-change outputs to the âunspendableâ list. See
TxBuilder::unspendable.
-sourcepub fn change_policy(&mut self, change_policy: ChangeSpendPolicy) -> &mut Self
Set a specific ChangeSpendPolicy. See TxBuilder::do_not_spend_change and
+
sourcepub fn change_policy(&mut self, change_policy: ChangeSpendPolicy) -> &mut Self
Set a specific ChangeSpendPolicy. See TxBuilder::do_not_spend_change and
TxBuilder::only_spend_change for some shortcuts.
-sourcepub fn only_witness_utxo(&mut self) -> &mut Self
Only Fill-in the psbt::Input::witness_utxo field when spending from
+
sourcepub fn only_witness_utxo(&mut self) -> &mut Self
Only Fill-in the psbt::Input::witness_utxo field when spending from
SegWit descriptors.
This reduces the size of the PSBT, but some signers might reject them due to the lack of
the non_witness_utxo.
-sourcepub fn include_output_redeem_witness_script(&mut self) -> &mut Self
Fill-in the psbt::Output::redeem_script and
+
sourcepub fn include_output_redeem_witness_script(&mut self) -> &mut Self
Fill-in the psbt::Output::redeem_script and
psbt::Output::witness_script fields.
This is useful for signers which always require it, like ColdCard hardware wallets.
-sourcepub fn add_global_xpubs(&mut self) -> &mut Self
Fill-in the PSBT_GLOBAL_XPUB field with the extended keys contained in both the external
+
sourcepub fn add_global_xpubs(&mut self) -> &mut Self
Fill-in the PSBT_GLOBAL_XPUB field with the extended keys contained in both the external
and internal descriptors
This is useful for offline signers that take part to a multisig. Some hardware wallets like
BitBox and ColdCard are known to require this.
-sourcepub fn drain_wallet(&mut self) -> &mut Self
Spend all the available inputs. This respects filters like TxBuilder::unspendable and the change policy.
-sourcepub fn coin_selection<P: CoinSelectionAlgorithm>(
self,
coin_selection: P
) -> TxBuilder<'a, D, P, Ctx>
Choose the coin selection algorithm
+sourcepub fn drain_wallet(&mut self) -> &mut Self
Spend all the available inputs. This respects filters like TxBuilder::unspendable and the change policy.
+sourcepub fn coin_selection<P: CoinSelectionAlgorithm>(
self,
coin_selection: P
) -> TxBuilder<'a, P, Ctx>
Choose the coin selection algorithm
Overrides the DefaultCoinSelectionAlgorithm.
Note that this function consumes the builder and returns it so it is usually best to put this as the first call on the builder.
-sourcepub fn enable_rbf(&mut self) -> &mut Self
Enable signaling RBF
+sourcepub fn enable_rbf(&mut self) -> &mut Self
Enable signaling RBF
This will use the default nSequence value of 0xFFFFFFFD.
-sourcepub fn enable_rbf_with_sequence(&mut self, nsequence: Sequence) -> &mut Self
Enable signaling RBF with a specific nSequence value
+sourcepub fn enable_rbf_with_sequence(&mut self, nsequence: Sequence) -> &mut Self
Enable signaling RBF with a specific nSequence value
This can cause conflicts if the walletâs descriptors contain an âolderâ (OP_CSV) operator
and the given nsequence is lower than the CSV value.
If the nsequence is higher than 0xFFFFFFFD an error will be thrown, since it would not
be a valid nSequence to signal RBF.
-sourcepub fn current_height(&mut self, height: u32) -> &mut Self
Set the current blockchain height.
+sourcepub fn current_height(&mut self, height: u32) -> &mut Self
Set the current blockchain height.
This will be used to:
- Set the nLockTime for preventing fee sniping.
@@ -194,14 +194,14 @@ If you want to create a transaction that spends immature coinbase inputs, manual
add them using
TxBuilder::add_utxos.
In both cases, if you donât provide a current height, we use the last sync height.
-sourcepub fn allow_dust(&mut self, allow_dust: bool) -> &mut Self
Set whether or not the dust limit is checked.
+sourcepub fn allow_dust(&mut self, allow_dust: bool) -> &mut Self
Set whether or not the dust limit is checked.
Note: by avoiding a dust limit check you may end up with a transaction that is non-standard.
-source§impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx> TxBuilder<'a, D, Cs, Ctx>
sourcepub fn finish(self) -> Result<Psbt, CreateTxError<D::WriteError>>where
D: PersistBackend<ChangeSet>,
Finish building the transaction.
+source§impl<'a, Cs: CoinSelectionAlgorithm, Ctx> TxBuilder<'a, Cs, Ctx>
sourcepub fn finish(self) -> Result<Psbt, CreateTxError>
Finish building the transaction.
Returns a new [Psbt] per BIP174.
-source§impl<'a, D, Cs: CoinSelectionAlgorithm> TxBuilder<'a, D, Cs, CreateTx>
sourcepub fn set_recipients(&mut self, recipients: Vec<(ScriptBuf, u64)>) -> &mut Self
Replace the recipients already added with a new list
-sourcepub fn add_recipient(
&mut self,
script_pubkey: ScriptBuf,
amount: u64
) -> &mut Self
Add a recipient to the internal list
-source§impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs, CreateTx>
sourcepub fn set_recipients(&mut self, recipients: Vec<(ScriptBuf, u64)>) -> &mut Self
Replace the recipients already added with a new list
+sourcepub fn add_recipient(
&mut self,
script_pubkey: ScriptBuf,
amount: u64
) -> &mut Self
Add a recipient to the internal list
+sourcepub fn add_data<T: AsRef<PushBytes>>(&mut self, data: &T) -> &mut Self
Add data as an output, using OP_RETURN
+sourcepub fn drain_to(&mut self, script_pubkey: ScriptBuf) -> &mut Self
Sets the address to drain excess coins to.
Usually, when there are excess coins they are sent to a change address generated by the
wallet. This option replaces the usual change address with an arbitrary script_pubkey of
your choosing. Just as with a change output, if the drain output is not needed (the excess
@@ -229,7 +229,7 @@ tx_builder
.fee_rate(FeeRate::from_sat_per_vb(5).expect("valid feerate"))
.enable_rbf();
let psbt = tx_builder.finish()?;
-source§impl<'a, D> TxBuilder<'a, D, DefaultCoinSelectionAlgorithm, BumpFee>
sourcepub fn allow_shrinking(
&mut self,
script_pubkey: ScriptBuf
) -> Result<&mut Self, AllowShrinkingError>
Explicitly tells the wallet that it is allowed to reduce the amount of the output matching this
+
source§impl<'a> TxBuilder<'a, DefaultCoinSelectionAlgorithm, BumpFee>
sourcepub fn allow_shrinking(
&mut self,
script_pubkey: ScriptBuf
) -> Result<&mut Self, AllowShrinkingError>
Explicitly tells the wallet that it is allowed to reduce the amount of the output matching this
script_pubkey in order to bump the transaction fee. Without specifying this the wallet
will attempt to find a change output to shrink instead.
Note that the output may shrink to below the dust limit and therefore be removed. If it is
@@ -237,8 +237,8 @@ preserved then it is currently not guaranteed to be in the same position as it w
originally.
Returns an Err if script_pubkey canât be found among the recipients of the
transaction we are bumping.
-Trait Implementations§
Auto Trait Implementations§
§impl<'a, D, Cs, Ctx> !RefUnwindSafe for TxBuilder<'a, D, Cs, Ctx>
§impl<'a, D, Cs, Ctx> !Send for TxBuilder<'a, D, Cs, Ctx>
§impl<'a, D, Cs, Ctx> !Sync for TxBuilder<'a, D, Cs, Ctx>
§impl<'a, D, Cs, Ctx> Unpin for TxBuilder<'a, D, Cs, Ctx>where
Cs: Unpin,
Ctx: Unpin,
§impl<'a, D, Cs, Ctx> !UnwindSafe for TxBuilder<'a, D, Cs, Ctx>
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl<'a, Cs, Ctx> !RefUnwindSafe for TxBuilder<'a, Cs, Ctx>
§impl<'a, Cs, Ctx> !Send for TxBuilder<'a, Cs, Ctx>
§impl<'a, Cs, Ctx> !Sync for TxBuilder<'a, Cs, Ctx>
§impl<'a, Cs, Ctx> Unpin for TxBuilder<'a, Cs, Ctx>where
Cs: Unpin,
Ctx: Unpin,
§impl<'a, Cs, Ctx> !UnwindSafe for TxBuilder<'a, Cs, Ctx>
Blanket Implementations§
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/trait.TxBuilderContext.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/trait.TxBuilderContext.html
index 2c9c12ad74..dd22a0a1a9 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/trait.TxBuilderContext.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/trait.TxBuilderContext.html
@@ -1,3 +1,3 @@
TxBuilderContext in bdk::wallet::tx_builder - Rust Trait bdk::wallet::tx_builder::TxBuilderContext
source · Expand description
Context in which the TxBuilder is valid
-Implementors§
source§impl TxBuilderContext for BumpFee
source§impl TxBuilderContext for CreateTx
\ No newline at end of file
+ 
TxBuilderContext
Trait bdk::wallet::tx_builder::TxBuilderContext
source · Expand description
Context in which the TxBuilder is valid
+Implementors§
source§impl TxBuilderContext for BumpFee
source§impl TxBuilderContext for CreateTx
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/index.html
index f746884dd0..5dcae1e5af 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/index.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/index.html
@@ -16,6 +16,6 @@ cache or how you retrieve it from persistent storage.
Re-exports
pub extern crate serde_crate as serde;pub use bitcoin;pub use indexed_tx_graph::IndexedTxGraph;pub use tx_graph::TxGraph;pub use miniscript;Modules
Contains the IndexedTxGraph and associated types. Refer to the
IndexedTxGraph documentation for more.Module for keychain related structures.The LocalChain is a local implementation of ChainOracle.Module for structures that store and traverse transactions.Structs
A reference to a block in the canonical chain.An Anchor implementation that also records the exact confirmation height of the transaction.An Anchor implementation that also records the exact confirmation time and height of the
-transaction.A TxOut with as much data as we can retrieve about itPersist wraps a PersistBackend (B) to create a convenient staging area for changes (C)
+transaction.A TxOut with as much data as we can retrieve about itPersist wraps a PersistBackend to create a convenient staging area for changes (C)
before they are persisted.An iterator for derived script pubkeys.An index storing TxOuts that have a script pubkey that matches those in a list.Enums
Represents the observed position of some chain data.Block height and timestamp at which a transaction is confirmed.Constants
Maximum BIP32 derivation index.How many confirmations are needed f or a coinbase output to be spent.Traits
Trait that âanchorsâ blockchain data to a specific block of height and hash.An Anchor that can be constructed from a given block, block height and transaction position
within the block.Trait that makes an object appendable.Represents a service that tracks the blockchain.A trait to extend the functionality of a miniscript descriptor.A persistence backend for Persist.
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js
index 90cc5e6694..0bc948d0fb 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["BIP32_MAX_INDEX","Maximum BIP32 derivation index."],["COINBASE_MATURITY","How many confirmations are needed f or a coinbase output to be spent."]],"enum":[["ChainPosition","Represents the observed position of some chain data."],["ConfirmationTime","Block height and timestamp at which a transaction is confirmed."]],"externcrate":[["serde",""]],"mod":[["indexed_tx_graph","Contains the [`IndexedTxGraph`] and associated types. Refer to the [`IndexedTxGraph`] documentation for more."],["keychain","Module for keychain related structures."],["local_chain","The [`LocalChain`] is a local implementation of [`ChainOracle`]."],["tx_graph","Module for structures that store and traverse transactions."]],"struct":[["BlockId","A reference to a block in the canonical chain."],["ConfirmationHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation height of the transaction."],["ConfirmationTimeHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation time and height of the transaction."],["FullTxOut","A `TxOut` with as much data as we can retrieve about it"],["Persist","`Persist` wraps a [`PersistBackend`] (`B`) to create a convenient staging area for changes (`C`) before they are persisted."],["SpkIterator","An iterator for derived script pubkeys."],["SpkTxOutIndex","An index storing `TxOut`s that have a script pubkey that matches those in a list."]],"trait":[["Anchor","Trait that âanchorsâ blockchain data to a specific block of height and hash."],["AnchorFromBlockPosition","An [`Anchor`] that can be constructed from a given block, block height and transaction position within the block."],["Append","Trait that makes an object appendable."],["ChainOracle","Represents a service that tracks the blockchain."],["DescriptorExt","A trait to extend the functionality of a miniscript descriptor."],["PersistBackend","A persistence backend for [`Persist`]."]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":[["BIP32_MAX_INDEX","Maximum BIP32 derivation index."],["COINBASE_MATURITY","How many confirmations are needed f or a coinbase output to be spent."]],"enum":[["ChainPosition","Represents the observed position of some chain data."],["ConfirmationTime","Block height and timestamp at which a transaction is confirmed."]],"externcrate":[["serde",""]],"mod":[["indexed_tx_graph","Contains the [`IndexedTxGraph`] and associated types. Refer to the [`IndexedTxGraph`] documentation for more."],["keychain","Module for keychain related structures."],["local_chain","The [`LocalChain`] is a local implementation of [`ChainOracle`]."],["tx_graph","Module for structures that store and traverse transactions."]],"struct":[["BlockId","A reference to a block in the canonical chain."],["ConfirmationHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation height of the transaction."],["ConfirmationTimeHeightAnchor","An [`Anchor`] implementation that also records the exact confirmation time and height of the transaction."],["FullTxOut","A `TxOut` with as much data as we can retrieve about it"],["Persist","`Persist` wraps a [`PersistBackend`] to create a convenient staging area for changes (`C`) before they are persisted."],["SpkIterator","An iterator for derived script pubkeys."],["SpkTxOutIndex","An index storing `TxOut`s that have a script pubkey that matches those in a list."]],"trait":[["Anchor","Trait that âanchorsâ blockchain data to a specific block of height and hash."],["AnchorFromBlockPosition","An [`Anchor`] that can be constructed from a given block, block height and transaction position within the block."],["Append","Trait that makes an object appendable."],["ChainOracle","Represents a service that tracks the blockchain."],["DescriptorExt","A trait to extend the functionality of a miniscript descriptor."],["PersistBackend","A persistence backend for [`Persist`]."]]};
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/struct.Persist.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/struct.Persist.html
index 2d0000cf36..451d73d262 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/struct.Persist.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/struct.Persist.html
@@ -1,20 +1,20 @@
-Persist in bdk_chain - Rust pub struct Persist<B, C> { /* private fields */ }
Expand description
Persist wraps a PersistBackend (B) to create a convenient staging area for changes (C)
+
Persist in bdk_chain - Rust pub struct Persist<C> { /* private fields */ }
Expand description
Persist wraps a PersistBackend to create a convenient staging area for changes (C)
before they are persisted.
Not all changes to the in-memory representation needs to be written to disk right away, so
Persist::stage can be used to stage changes first and then Persist::commit can be used
to write changes to disk.
-Implementations§
source§impl<B, C> Persist<B, C>where
B: PersistBackend<C>,
C: Default + Append,
sourcepub fn new(backend: B) -> Self
Create a new Persist from PersistBackend.
-sourcepub fn commit(&mut self) -> Result<Option<C>, B::WriteError>
Commit the staged changes to the underlying persistence backend.
+Implementations§
source§impl<C> Persist<C>where
C: Default + Append,
sourcepub fn new(backend: impl PersistBackend<C> + Send + Sync + 'static) -> Self
Create a new Persist from PersistBackend.
+sourcepub fn commit(&mut self) -> Result<Option<C>>
Commit the staged changes to the underlying persistence backend.
Changes that are committed (if any) are returned.
Error
Returns a backend-defined error if this fails.
-sourcepub fn stage_and_commit(
&mut self,
changeset: C
) -> Result<Option<C>, B::WriteError>
Stages a new changeset and commits it (along with any other previously staged changes) to
+
Trait Implementations§
Auto Trait Implementations§
§impl<B, C> RefUnwindSafe for Persist<B, C>where
B: RefUnwindSafe,
C: RefUnwindSafe,
§impl<B, C> Send for Persist<B, C>where
B: Send,
C: Send,
§impl<B, C> Sync for Persist<B, C>where
B: Sync,
C: Sync,
§impl<B, C> Unpin for Persist<B, C>where
B: Unpin,
C: Unpin,
§impl<B, C> UnwindSafe for Persist<B, C>where
B: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl<C> !RefUnwindSafe for Persist<C>
§impl<C> Send for Persist<C>where
C: Send,
§impl<C> Sync for Persist<C>where
C: Sync,
§impl<C> Unpin for Persist<C>where
C: Unpin,
§impl<C> !UnwindSafe for Persist<C>
Blanket Implementations§
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/trait.PersistBackend.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/trait.PersistBackend.html
index de45f13cf6..875ba6e3ea 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/trait.PersistBackend.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/trait.PersistBackend.html
@@ -1,18 +1,13 @@
-PersistBackend in bdk_chain - Rust Trait bdk_chain::PersistBackend
source · pub trait PersistBackend<C> {
- type WriteError: Debug;
- type LoadError: Debug;
-
- fn write_changes(&mut self, changeset: &C) -> Result<(), Self::WriteError>;
- fn load_from_persistence(&mut self) -> Result<Option<C>, Self::LoadError>;
+PersistBackend in bdk_chain - Rust Trait bdk_chain::PersistBackend
source · pub trait PersistBackend<C> {
+ fn write_changes(&mut self, changeset: &C) -> Result<()>;
+ fn load_from_persistence(&mut self) -> Result<Option<C>>;
}
Expand description
A persistence backend for Persist.
C represents the changeset; a datatype that records changes made to in-memory data structures
that are to be persisted, or retrieved from persistence.
-Required Associated Types§
sourcetype WriteError: Debug
The error the backend returns when it fails to write.
-Required Methods§
sourcefn write_changes(&mut self, changeset: &C) -> Result<(), Self::WriteError>
Writes a changeset to the persistence backend.
+Required Methods§
sourcefn write_changes(&mut self, changeset: &C) -> Result<()>
Writes a changeset to the persistence backend.
It is up to the backend what it does with this. It could store every changeset in a list or
it inserts the actual changes into a more structured database. All it needs to guarantee is
that load_from_persistence restores a keychain tracker to what it should be if all
changesets had been applied sequentially.
-sourcefn load_from_persistence(&mut self) -> Result<Option<C>, Self::LoadError>
Return the aggregate changeset C from persistence.
-Implementations on Foreign Types§
source§impl<C> PersistBackend<C> for ()
§type WriteError = Infallible
§type LoadError = Infallible
source§fn write_changes(&mut self, _changeset: &C) -> Result<(), Self::WriteError>
source§fn load_from_persistence(&mut self) -> Result<Option<C>, Self::LoadError>
Implementors§
\ No newline at end of file
+sourcefn load_from_persistence(&mut self) -> Result<Option<C>>
Return the aggregate changeset C from persistence.
+
Implementations on Foreign Types§
source§impl<C> PersistBackend<C> for ()
Implementors§
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.AggregateChangesetsError.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.AggregateChangesetsError.html
index 80499252cd..6702a4839e 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.AggregateChangesetsError.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.AggregateChangesetsError.html
@@ -1,10 +1,10 @@
-AggregateChangesetsError in bdk_file_store - Rust Struct bdk_file_store::AggregateChangesetsError
source · pub struct AggregateChangesetsError<C> {
+AggregateChangesetsError in bdk_file_store - Rust Struct bdk_file_store::AggregateChangesetsError
source · Expand description
Error type for Store::aggregate_changesets.
Fields§
§changeset: Option<C>The partially-aggregated changeset.
§iter_error: IterErrorThe error returned by EntryIter.
-Trait Implementations§
source§impl<C: Debug> Debug for AggregateChangesetsError<C>
source§impl<C> Display for AggregateChangesetsError<C>
source§impl<C: Debug> Error for AggregateChangesetsError<C>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl<C> !RefUnwindSafe for AggregateChangesetsError<C>
§impl<C> Send for AggregateChangesetsError<C>where
C: Send,
§impl<C> Sync for AggregateChangesetsError<C>where
C: Sync,
§impl<C> Unpin for AggregateChangesetsError<C>where
C: Unpin,
§impl<C> !UnwindSafe for AggregateChangesetsError<C>
Blanket Implementations§
source§impl<T> From<T> for T
const: unstable · source§fn from(t: T) -> T
Returns the argument unchanged.
+Trait Implementations§
source§impl<C: Debug> Debug for AggregateChangesetsError<C>
source§impl<C> Display for AggregateChangesetsError<C>
source§impl<C: Debug> Error for AggregateChangesetsError<C>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
ðDeprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl<C> !RefUnwindSafe for AggregateChangesetsError<C>
§impl<C> Send for AggregateChangesetsError<C>where
C: Send,
§impl<C> Sync for AggregateChangesetsError<C>where
C: Sync,
§impl<C> Unpin for AggregateChangesetsError<C>where
C: Unpin,
§impl<C> !UnwindSafe for AggregateChangesetsError<C>
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html
index 74c349ce05..aa85fdd710 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html
@@ -1,23 +1,23 @@
-Store in bdk_file_store - Rust Struct bdk_file_store::Store
source · pub struct Store<C> { /* private fields */ }
Expand description
Persists an append-only list of changesets (C) to a single file.
+Store in bdk_file_store - Rust Struct bdk_file_store::Store
source · Expand description
Persists an append-only list of changesets (C) to a single file.
The changesets are the results of altering a tracker implementation (T).
-Implementations§
source§impl<C> Store<C>where
C: Append + Serialize + DeserializeOwned,
sourcepub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>where
P: AsRef<Path>,
Create a new Store file in write-only mode; error if the file exists.
+Implementations§
source§impl<C> Store<C>where
C: Append + Serialize + DeserializeOwned + Send + Sync,
sourcepub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>where
P: AsRef<Path>,
sourcepub fn open<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>where
P: AsRef<Path>,
Open an existing Store.
+sourcepub fn open<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>where
P: AsRef<Path>,
Open an existing Store.
Use create_new to create a new Store.
Errors
If the prefixed bytes of the opened file does not match the provided magic, the
FileError::InvalidMagicBytes error variant will be returned.
-sourcepub fn open_or_create_new<P>(
magic: &[u8],
file_path: P
) -> Result<Self, FileError>where
P: AsRef<Path>,
Attempt to open existing Store file; create it if the file is non-existent.
+sourcepub fn open_or_create_new<P>(
magic: &[u8],
file_path: P
) -> Result<Self, FileError>where
P: AsRef<Path>,
Attempt to open existing Store file; create it if the file is non-existent.
Internally, this calls either open or create_new.
-sourcepub fn iter_changesets(&mut self) -> EntryIter<'_, C> â
Iterates over the stored changeset from first to last, changing the seek position at each
+
sourcepub fn iter_changesets(&mut self) -> EntryIter<'_, C> â
Iterates over the stored changeset from first to last, changing the seek position at each
iteration.
The iterator may fail to read an entry and therefore return an error. However, the first time
it returns an error will be the last. After doing so, the iterator will always yield None.
WARNING: This method changes the write position in the underlying file. You should
always iterate over all entries until None is returned if you want your next write to go
at the end; otherwise, you will write over existing entries.
-sourcepub fn aggregate_changesets(
&mut self
) -> Result<Option<C>, AggregateChangesetsError<C>>
Loads all the changesets that have been stored as one giant changeset.
+sourcepub fn aggregate_changesets(
&mut self
) -> Result<Option<C>, AggregateChangesetsError<C>>
Loads all the changesets that have been stored as one giant changeset.
This function returns the aggregate changeset, or None if nothing was persisted.
If reading or deserializing any of the entries fails, an error is returned that
consists of all those it was able to read.
@@ -26,11 +26,11 @@ wallet scan with a stop-gap after getting an error, since it is likely that one
changesets it was unable to read changed the derivation indices of the tracker.
WARNING: This method changes the write position of the underlying file. The next
changeset will be written over the erroring entry (or the end of the file if none existed).
-Trait Implementations§
source§impl<C> PersistBackend<C> for Store<C>where
C: Append + Serialize + DeserializeOwned,
§type WriteError = Error
The error the backend returns when it fails to write.source§fn write_changes(&mut self, changeset: &C) -> Result<(), Self::WriteError>
Writes a changeset to the persistence backend. Read moresource§fn load_from_persistence(&mut self) -> Result<Option<C>, Self::LoadError>
Return the aggregate changeset C from persistence.Auto Trait Implementations§
§impl<C> RefUnwindSafe for Store<C>where
C: RefUnwindSafe,
§impl<C> Send for Store<C>where
C: Send,
§impl<C> Sync for Store<C>where
C: Sync,
§impl<C> Unpin for Store<C>where
C: Unpin,
§impl<C> UnwindSafe for Store<C>where
C: UnwindSafe,
Blanket Implementations§
Trait Implementations§
Auto Trait Implementations§
§impl<C> RefUnwindSafe for Store<C>where
C: RefUnwindSafe,
§impl<C> Send for Store<C>
§impl<C> Sync for Store<C>
§impl<C> Unpin for Store<C>where
C: Unpin,
§impl<C> UnwindSafe for Store<C>where
C: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/all.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/all.html
index 794b65b6df..5e5df573c0 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/all.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/all.html
@@ -1 +1 @@
-List of all items in this crate List of all items
Structs
Enums
Functions
Type Definitions
\ No newline at end of file
+List of all items in this crate List of all items
Structs
Enums
Functions
Type Definitions
\ No newline at end of file
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.AddressCmd.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.AddressCmd.html
index e0c51e63f2..305e509cc2 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.AddressCmd.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.AddressCmd.html
@@ -1,4 +1,4 @@
-AddressCmd in example_cli - Rust Enum example_cli::AddressCmd
source · pub enum AddressCmd {
+AddressCmd in example_cli - Rust Enum example_cli::AddressCmd
source · pub enum AddressCmd {
Next,
New,
List {
@@ -10,7 +10,7 @@
§List
List all addresses
§Index
Get last revealed address index for each keychain.
-Trait Implementations§
source§impl Clone for AddressCmd
source§fn clone(&self) -> AddressCmd
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for AddressCmd
source§impl FromArgMatches for AddressCmd
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.source§impl Subcommand for AddressCmd
source§fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn has_subcommand(__clap_name: &str) -> bool
Test whether Self can parse a specific subcommandAuto Trait Implementations§
§impl RefUnwindSafe for AddressCmd
§impl Send for AddressCmd
§impl Sync for AddressCmd
§impl Unpin for AddressCmd
§impl UnwindSafe for AddressCmd
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl Clone for AddressCmd
source§fn clone(&self) -> AddressCmd
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for AddressCmd
source§impl FromArgMatches for AddressCmd
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.source§impl Subcommand for AddressCmd
source§fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn has_subcommand(__clap_name: &str) -> bool
Test whether Self can parse a specific subcommandAuto Trait Implementations§
§impl RefUnwindSafe for AddressCmd
§impl Send for AddressCmd
§impl Sync for AddressCmd
§impl Unpin for AddressCmd
§impl UnwindSafe for AddressCmd
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html
index da0b058fa4..f910abc1f1 100644
--- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html
+++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/enum.CoinSelectionAlgo.html
@@ -1,10 +1,10 @@
-CoinSelectionAlgo in example_cli - Rust Enum example_cli::CoinSelectionAlgo
source · pub enum CoinSelectionAlgo {
+CoinSelectionAlgo in example_cli - Rust Enum example_cli::CoinSelectionAlgo
source · pub enum CoinSelectionAlgo {
LargestFirst,
SmallestFirst,
OldestFirst,
NewestFirst,
BranchAndBound,
-}
Variants§
Trait Implementations§
source§impl Clone for CoinSelectionAlgo
source§fn clone(&self) -> CoinSelectionAlgo
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl Debug for CoinSelectionAlgo
source§impl Default for CoinSelectionAlgo
source§impl Display for CoinSelectionAlgo
Auto Trait Implementations§
§impl RefUnwindSafe for CoinSelectionAlgo
§impl Send for CoinSelectionAlgo
§impl Sync for CoinSelectionAlgo
§impl Unpin for CoinSelectionAlgo
§impl UnwindSafe for CoinSelectionAlgo
Blanket Implementations§