From: github-actions Date: Thu, 10 Dec 2020 10:31:07 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandStringError.html?a=commitdiff_plain;h=fa5f4bb66ea41bde60d544c54030732f2fb3794b;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/index.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/index.html index bcc39cd764..13e1f395d1 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/index.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/index.html @@ -1,7 +1,7 @@ bdk::descriptor - Rust

[][src]Module bdk::descriptor

Descriptors

+ Change settings

[][src]Module bdk::descriptor

Descriptors

This module contains generic utilities to work with descriptors, plus some re-exported types from [miniscript].

Re-exports

diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ExtractPolicy.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ExtractPolicy.html index 9c47f27507..c9c22d867d 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ExtractPolicy.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ExtractPolicy.html @@ -1,7 +1,7 @@ bdk::descriptor::ExtractPolicy - Rust

[][src]Trait bdk::descriptor::ExtractPolicy

pub trait ExtractPolicy {
+                Change settings

[][src]Trait bdk::descriptor::ExtractPolicy

pub trait ExtractPolicy {
     pub fn extract_policy(
        &self,
        signers: &SignersContainer,
        secp: &Secp256k1<All>
    ) -> Result<Option<Policy>, Error>; }

Trait implemented on Descriptors to add a method to extract the spending policy

-

Required methods

pub fn extract_policy(
    &self,
    signers: &SignersContainer,
    secp: &Secp256k1<All>
) -> Result<Option<Policy>, Error>
[src]

Loading content...

Implementors

impl ExtractPolicy for Descriptor<DescriptorPublicKey>[src]

impl<Ctx: ScriptContext> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>[src]

Loading content...
\ No newline at end of file +

Required methods

pub fn extract_policy(
    &self,
    signers: &SignersContainer,
    secp: &Secp256k1<All>
) -> Result<Option<Policy>, Error>
[src]

Loading content...

Implementors

impl ExtractPolicy for Descriptor<DescriptorPublicKey>[src]

impl<Ctx: ScriptContext> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>[src]

Loading content...
\ No newline at end of file diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.MiniscriptKey.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.MiniscriptKey.html index ab38103c4a..6906d5e676 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.MiniscriptKey.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.MiniscriptKey.html @@ -11,6 +11,6 @@ Loading content...

Required methods

pub fn to_pubkeyhash(&self) -> Self::Hash

Converts an object to PublicHash

Loading content...

Provided methods

pub fn is_uncompressed(&self) -> bool

Check if the publicKey is uncompressed. The default implementation returns false

-
Loading content...

Implementations on Foreign Types

impl MiniscriptKey for String

type Hash = String

impl MiniscriptKey for DummyKey

type Hash = DummyKeyHash

impl MiniscriptKey for PublicKey

pub fn is_uncompressed(&self) -> bool

is_uncompressed returns true only for +

Loading content...

Implementations on Foreign Types

impl MiniscriptKey for String

type Hash = String

impl MiniscriptKey for PublicKey

pub fn is_uncompressed(&self) -> bool

is_uncompressed returns true only for bitcoin::Publickey type if the underlying key is uncompressed.

-

type Hash = Hash

Loading content...

Implementors

Loading content...
\ No newline at end of file +

type Hash = Hash

impl MiniscriptKey for DummyKey

type Hash = DummyKeyHash

Loading content...

Implementors

Loading content...
\ No newline at end of file diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ToWalletDescriptor.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ToWalletDescriptor.html index c9d25e139e..4a92ec6bfa 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ToWalletDescriptor.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/trait.ToWalletDescriptor.html @@ -1,9 +1,9 @@ bdk::descriptor::ToWalletDescriptor - Rust

[][src]Trait bdk::descriptor::ToWalletDescriptor

pub trait ToWalletDescriptor {
+                Change settings

[][src]Trait bdk::descriptor::ToWalletDescriptor

pub trait ToWalletDescriptor {
     pub fn to_wallet_descriptor(
        self,
        network: Network
    ) -> Result<(ExtendedDescriptor, KeyMap), KeyError>; }

Trait for types which can be converted into an ExtendedDescriptor and a KeyMap usable by a wallet in a specific [Network]

-

Required methods

pub fn to_wallet_descriptor(
    self,
    network: Network
) -> Result<(ExtendedDescriptor, KeyMap), KeyError>
[src]

Loading content...

Implementations on Foreign Types

impl<'_> ToWalletDescriptor for &'_ str[src]

impl<'_> ToWalletDescriptor for &'_ String[src]

impl ToWalletDescriptor for (ExtendedDescriptor, KeyMap)[src]

impl ToWalletDescriptor for (ExtendedDescriptor, KeyMap, ValidNetworks)[src]

Loading content...

Implementors

impl ToWalletDescriptor for ExtendedDescriptor[src]

impl<T: DescriptorTemplate> ToWalletDescriptor for T[src]

Turns a DescriptorTemplate into a valid wallet descriptor by calling its +

Required methods

pub fn to_wallet_descriptor(
    self,
    network: Network
) -> Result<(ExtendedDescriptor, KeyMap), KeyError>
[src]

Loading content...

Implementations on Foreign Types

impl<'_> ToWalletDescriptor for &'_ str[src]

impl<'_> ToWalletDescriptor for &'_ String[src]

impl ToWalletDescriptor for (ExtendedDescriptor, KeyMap)[src]

impl ToWalletDescriptor for (ExtendedDescriptor, KeyMap, ValidNetworks)[src]

Loading content...

Implementors

impl ToWalletDescriptor for ExtendedDescriptor[src]

impl<T: DescriptorTemplate> ToWalletDescriptor for T[src]

Turns a DescriptorTemplate into a valid wallet descriptor by calling its build method

Loading content...
\ No newline at end of file diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.ExtendedDescriptor.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.ExtendedDescriptor.html index 6da04ee385..174a4617ac 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.ExtendedDescriptor.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.ExtendedDescriptor.html @@ -1,5 +1,5 @@ bdk::descriptor::ExtendedDescriptor - Rust

[][src]Type Definition bdk::descriptor::ExtendedDescriptor

type ExtendedDescriptor = Descriptor<DescriptorPublicKey>;

Alias for a Descriptor that can contain extended keys using DescriptorPublicKey

-

Trait Implementations

\ No newline at end of file + Change settings

[][src]Type Definition bdk::descriptor::ExtendedDescriptor

type ExtendedDescriptor = Descriptor<DescriptorPublicKey>;

Alias for a Descriptor that can contain extended keys using DescriptorPublicKey

+

Trait Implementations

\ No newline at end of file diff --git a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.HDKeyPaths.html b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.HDKeyPaths.html index 4b9a9024c1..75bfeeeb28 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.HDKeyPaths.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/descriptor/type.HDKeyPaths.html @@ -1,6 +1,6 @@ bdk::descriptor::HDKeyPaths - Rust

[][src]Type Definition bdk::descriptor::HDKeyPaths

type HDKeyPaths = BTreeMap<PublicKey, (Fingerprint, DerivationPath)>;

Alias for the type of maps that represent derivation paths in a psbt::Input or + Change settings

[][src]Type Definition bdk::descriptor::HDKeyPaths

type HDKeyPaths = BTreeMap<PublicKey, (Fingerprint, DerivationPath)>;

Alias for the type of maps that represent derivation paths in a psbt::Input or psbt::Output

\ No newline at end of file diff --git a/static/docs-rs/bdk/nightly/latest/bdk/enum.Error.html b/static/docs-rs/bdk/nightly/latest/bdk/enum.Error.html index 72c0522ac5..074ba8a33d 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/enum.Error.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/enum.Error.html @@ -74,8 +74,8 @@ the desired outputs plus fee, if there is not such combination this error is thr key in the descriptor must either be a master key itself (having depth = 0) or have an explicit origin provided

ChecksumMismatch

Descriptor checksum mismatch

-
SpendingPolicyRequired(ScriptType)

Spending policy is not compatible with this [ScriptType]

-
InvalidPolicyPathError(PolicyError)
Signer(SignerError)
OfflineClient

Thrown when trying to call a method that requires a network connection, [Wallet::sync] and [Wallet::broadcast] +

SpendingPolicyRequired(ScriptType)

Spending policy is not compatible with this ScriptType

+
InvalidPolicyPathError(PolicyError)
Signer(SignerError)
OfflineClient

Thrown when trying to call a method that requires a network connection, Wallet::sync and Wallet::broadcast This error is thrown when creating the Client for the first time, while recovery attempts are tried during the sync

InvalidProgressValue(f32)

Progress value must be between 0.0 (included) and 100.0 (included)

diff --git a/static/docs-rs/bdk/nightly/latest/bdk/index.html b/static/docs-rs/bdk/nightly/latest/bdk/index.html index da655a915b..800a7f2d26 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/index.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/index.html @@ -1,7 +1,153 @@ bdk - Rust

[][src]Crate bdk

Re-exports

+ Change settings

[][src]Crate bdk

A modern, lightweight, descriptor-based wallet library written in Rust.

+

About

+

The BDK library aims to be the core building block for Bitcoin wallets of any kind.

+
    +
  • It uses Miniscript to support descriptors with generalized conditions. This exact same library can be used to build +single-sig wallets, multisigs, timelocked contracts and more.
  • +
  • It supports multiple blockchain backends and databases, allowing developers to choose exactly what's right for their projects.
  • +
  • It is built to be cross-platform: the core logic works on desktop, mobile, and even WebAssembly.
  • +
  • It is very easy to extend: developers can implement customized logic for blockchain backends, databases, signers, coin selection, and more, without having to fork and modify this library.
  • +
+

A Tour of BDK

+

BDK consists of a number of modules that provide a range of functionality +essential for implementing descriptor based Bitcoin wallet applications in Rust. In this +section, we will take a brief tour of BDK, summarizing the major APIs and +their uses.

+

The easiest way to get started is to add bdk to your dependencies with the default features. +The default features include a simple key-value database (sled) to cache +blockchain data and an electrum blockchain client to +interact with the bitcoin P2P network.

+
bdk = "0.2.0"
+
+

Sync the balance of a descriptor

Example

+
ⓘThis example is not tested
+use bdk::Wallet;
+use bdk::database::MemoryDatabase;
+use bdk::blockchain::{noop_progress, ElectrumBlockchain};
+
+use bdk::electrum_client::Client;
+
+fn main() -> Result<(), bdk::Error> {
+    let client = Client::new("ssl://electrum.blockstream.info:60002")?;
+    let wallet = Wallet::new(
+        "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",
+        Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),
+        bitcoin::Network::Testnet,
+        MemoryDatabase::default(),
+        ElectrumBlockchain::from(client)
+    )?;
+
+    wallet.sync(noop_progress(), None)?;
+
+    println!("Descriptor balance: {} SAT", wallet.get_balance()?);
+
+    Ok(())
+}
+

Generate a few addresses

Example

+
+use bdk::{Wallet, OfflineWallet};
+use bdk::database::MemoryDatabase;
+
+fn main() -> Result<(), bdk::Error> {
+    let wallet: OfflineWallet<_> = Wallet::new_offline(
+        "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",
+        Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),
+        bitcoin::Network::Testnet,
+        MemoryDatabase::default(),
+    )?;
+
+    println!("Address #0: {}", wallet.get_new_address()?);
+    println!("Address #1: {}", wallet.get_new_address()?);
+    println!("Address #2: {}", wallet.get_new_address()?);
+
+    Ok(())
+}
+

Create a transaction

Example

+
ⓘThis example is not tested
+use base64::decode;
+use bdk::{FeeRate, TxBuilder, Wallet};
+use bdk::database::MemoryDatabase;
+use bdk::blockchain::{noop_progress, ElectrumBlockchain};
+
+use bdk::electrum_client::Client;
+
+use bitcoin::consensus::serialize;
+
+fn main() -> Result<(), bdk::Error> {
+    let client = Client::new("ssl://electrum.blockstream.info:60002")?;
+    let wallet = Wallet::new(
+        "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)",
+        Some("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)"),
+        bitcoin::Network::Testnet,
+        MemoryDatabase::default(),
+        ElectrumBlockchain::from(client)
+    )?;
+
+    wallet.sync(noop_progress(), None)?;
+
+    let send_to = wallet.get_new_address()?;
+    let (psbt, details) = wallet.create_tx(
+        TxBuilder::with_recipients(vec![(send_to.script_pubkey(), 50_000)])
+            .enable_rbf()
+            .do_not_spend_change()
+            .fee_rate(FeeRate::from_sat_per_vb(5.0))
+    )?;
+
+    println!("Transaction details: {:#?}", details);
+    println!("Unsigned PSBT: {}", base64::encode(&serialize(&psbt)));
+
+    Ok(())
+}
+

Sign a transaction

Example

+
ⓘThis example is not tested
+use base64::decode;
+use bdk::{Wallet, OfflineWallet};
+use bdk::database::MemoryDatabase;
+
+use bitcoin::consensus::deserialize;
+
+fn main() -> Result<(), bdk::Error> {
+    let wallet: OfflineWallet<_> = Wallet::new_offline(
+        "wpkh([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/0/*)",
+        Some("wpkh([c258d2e4/84h/1h/0h]tprv8griRPhA7342zfRyB6CqeKF8CJDXYu5pgnj1cjL1u2ngKcJha5jjTRimG82ABzJQ4MQe71CV54xfn25BbhCNfEGGJZnxvCDQCd6JkbvxW6h/1/*)"),
+        bitcoin::Network::Testnet,
+        MemoryDatabase::default(),
+    )?;
+
+    let psbt = "...";
+    let psbt = deserialize(&base64::decode(psbt).unwrap())?;
+
+    let (signed_psbt, finalized) = wallet.sign(psbt, None)?;
+
+    Ok(())
+}
+

Feature flags

+

BDK uses a set of feature flags +to reduce the amount of compiled code by allowing projects to only enable the features they need. +By default, BDK enables two internal features, key-value-db and electrum.

+

If you are new to BDK we recommended that you use the default features which will enable +basic descriptor wallet functionality. More advanced users can disable the default features +(--no-default-features) and build the BDK library with only the features you need. +Below is a list of the available feature flags and the additional functionality they provide.

+
    +
  • all-keys: all features for working with bitcoin keys
  • +
  • async-interface: async functions in bdk traits
  • +
  • cli-utils: utilities for creating a command line interface wallet
  • +
  • keys-bip39: BIP-39 mnemonic codes for generating deterministic keys
  • +
+

Internal features

+

These features do not expose any new API, but influence internal implementation aspects of +BDK.

+
    +
  • compact_filters: compact_filters client protocol for interacting with the bitcoin P2P network
  • +
  • electrum: electrum client protocol for interacting with electrum servers
  • +
  • esplora: esplora client protocol for interacting with blockstream electrs servers
  • +
  • key-value-db: key value database based on sled for caching blockchain data
  • +
+

Re-exports

pub extern crate bitcoin;
pub extern crate miniscript;
pub extern crate electrum_client;
pub extern crate reqwest;
pub extern crate sled;
pub use descriptor::template;
pub use descriptor::HDKeyPaths;
pub use wallet::address_validator;
pub use wallet::signer;
pub use wallet::tx_builder::TxBuilder;
pub use wallet::OfflineWallet;
pub use wallet::Wallet;

Modules

blockchain

Blockchain backends

database

Database types

diff --git a/static/docs-rs/bdk/nightly/latest/bdk/wallet/index.html b/static/docs-rs/bdk/nightly/latest/bdk/wallet/index.html index 4b87d61a67..0b56e706f8 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/wallet/index.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/wallet/index.html @@ -1,7 +1,7 @@ bdk::wallet - Rust

[][src]Module bdk::wallet

Wallet

+ Change settings

[][src]Module bdk::wallet

Wallet

This module defines the Wallet structure.

Modules

address_validator

Address validation callbacks

diff --git a/static/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html b/static/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html index 53eb13cccd..70fac232ec 100644 --- a/static/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html +++ b/static/docs-rs/bdk/nightly/latest/bdk/wallet/struct.Wallet.html @@ -1,7 +1,7 @@ bdk::wallet::Wallet - Rust

[][src]Struct bdk::wallet::Wallet

pub struct Wallet<B, D> { /* fields omitted */ }

A Bitcoin wallet

+ Change settings

[][src]Struct bdk::wallet::Wallet

pub struct Wallet<B, D> { /* fields omitted */ }

A Bitcoin wallet

A wallet takes descriptors, a database and a blockchain and implements the basic functions that a Bitcoin wallets needs to operate, like generating addresses, returning the balance, @@ -9,32 +9,32 @@ needs to operate, like blockchain type provided implements Blockchain, or "offline" OfflineBlockchain is used. Offline wallets only expose methods that don't need any interaction with the blockchain to work.

-

Implementations

impl<B, D> Wallet<B, D> where
    B: BlockchainMarker,
    D: BatchDatabase
[src]

pub fn new_offline<E: ToWalletDescriptor>(
    descriptor: E,
    change_descriptor: Option<E>,
    network: Network,
    database: D
) -> Result<Self, Error>
[src]

Create a new "offline" wallet

-

pub fn get_new_address(&self) -> Result<Address, Error>[src]

Return a newly generated address using the external descriptor

-

pub fn is_mine(&self, script: &Script) -> Result<bool, Error>[src]

Return whether or not a script is part of this wallet (either internal or external)

-

pub fn list_unspent(&self) -> Result<Vec<UTXO>, Error>[src]

Return the list of unspent outputs of this wallet

+

Implementations

impl<B, D> Wallet<B, D> where
    B: BlockchainMarker,
    D: BatchDatabase
[src]

pub fn new_offline<E: ToWalletDescriptor>(
    descriptor: E,
    change_descriptor: Option<E>,
    network: Network,
    database: D
) -> Result<Self, Error>
[src]

Create a new "offline" wallet

+

pub fn get_new_address(&self) -> Result<Address, Error>[src]

Return a newly generated address using the external descriptor

+

pub fn is_mine(&self, script: &Script) -> Result<bool, Error>[src]

Return whether or not a script is part of this wallet (either internal or external)

+

pub fn list_unspent(&self) -> Result<Vec<UTXO>, Error>[src]

Return the list of unspent outputs of this wallet

Note that this methods only operate on the internal database, which first needs to be Wallet::sync manually.

-

pub fn list_transactions(
    &self,
    include_raw: bool
) -> Result<Vec<TransactionDetails>, Error>
[src]

Return the list of transactions made and received by the wallet

+

pub fn list_transactions(
    &self,
    include_raw: bool
) -> Result<Vec<TransactionDetails>, Error>
[src]

Return the list of transactions made and received by the wallet

Optionally fill the TransactionDetails::transaction field with the raw transaction if include_raw is true.

Note that this methods only operate on the internal database, which first needs to be Wallet::sync manually.

-

pub fn get_balance(&self) -> Result<u64, Error>[src]

Return the balance, meaning the sum of this wallet's unspent outputs' values

+

pub fn get_balance(&self) -> Result<u64, Error>[src]

Return the balance, meaning the sum of this wallet's unspent outputs' values

Note that this methods only operate on the internal database, which first needs to be Wallet::sync manually.

-

pub fn add_signer(
    &mut self,
    script_type: ScriptType,
    id: SignerId,
    ordering: SignerOrdering,
    signer: Arc<dyn Signer>
)
[src]

Add an external signer

+

pub fn add_signer(
    &mut self,
    script_type: ScriptType,
    id: SignerId,
    ordering: SignerOrdering,
    signer: Arc<dyn Signer>
)
[src]

Add an external signer

See the signer module for an example.

-

pub fn add_address_validator(&mut self, validator: Arc<dyn AddressValidator>)[src]

Add an address validator

+

pub fn add_address_validator(&mut self, validator: Arc<dyn AddressValidator>)[src]

Add an address validator

See the address_validator module for an example.

-

pub fn create_tx<Cs: CoinSelectionAlgorithm<D>>(
    &self,
    builder: TxBuilder<D, Cs, CreateTx>
) -> Result<(PSBT, TransactionDetails), Error>
[src]

Create a new transaction following the options specified in the builder

+

pub fn create_tx<Cs: CoinSelectionAlgorithm<D>>(
    &self,
    builder: TxBuilder<D, Cs, CreateTx>
) -> Result<(PSBT, TransactionDetails), Error>
[src]

Create a new transaction following the options specified in the builder

Example

 let (psbt, details) = wallet.create_tx(
     TxBuilder::with_recipients(vec![(to_address.script_pubkey(), 50_000)])
 )?;
 // sign and broadcast ...
-

pub fn bump_fee<Cs: CoinSelectionAlgorithm<D>>(
    &self,
    txid: &Txid,
    builder: TxBuilder<D, Cs, BumpFee>
) -> Result<(PSBT, TransactionDetails), Error>
[src]

Bump the fee of a transaction following the options specified in the builder

+

pub fn bump_fee<Cs: CoinSelectionAlgorithm<D>>(
    &self,
    txid: &Txid,
    builder: TxBuilder<D, Cs, BumpFee>
) -> Result<(PSBT, TransactionDetails), Error>
[src]

Bump the fee of a transaction following the options specified in the builder

Return an error if the transaction is already confirmed or doesn't explicitly signal RBF.

NOTE: if the original transaction was made with TxBuilder::set_single_recipient, the TxBuilder::maintain_single_recipient flag should be enabled to correctly reduce the @@ -49,21 +49,21 @@ transaction regardless of whether they are necessary or not to cover additional TxBuilder::new().fee_rate(FeeRate::from_sat_per_vb(5.0)), )?; // sign and broadcast ...

-

pub fn sign(
    &self,
    psbt: PSBT,
    assume_height: Option<u32>
) -> Result<(PSBT, bool), Error>
[src]

Sign a transaction with all the wallet's signers, in the order specified by every signer's +

pub fn sign(
    &self,
    psbt: PSBT,
    assume_height: Option<u32>
) -> Result<(PSBT, bool), Error>
[src]

Sign a transaction with all the wallet's signers, in the order specified by every signer's SignerOrdering

Example

 let (signed_psbt, finalized) = wallet.sign(psbt, None)?;
-

pub fn policies(&self, script_type: ScriptType) -> Result<Option<Policy>, Error>[src]

Return the spending policies for the wallet's descriptor

-

pub fn public_descriptor(
    &self,
    script_type: ScriptType
) -> Result<Option<ExtendedDescriptor>, Error>
[src]

Return the "public" version of the wallet's descriptor, meaning a new descriptor that has +

pub fn policies(&self, script_type: ScriptType) -> Result<Option<Policy>, Error>[src]

Return the spending policies for the wallet's descriptor

+

pub fn public_descriptor(
    &self,
    script_type: ScriptType
) -> Result<Option<ExtendedDescriptor>, Error>
[src]

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

-

pub fn finalize_psbt(
    &self,
    psbt: PSBT,
    assume_height: Option<u32>
) -> Result<(PSBT, bool), Error>
[src]

Try to finalize a PSBT

-

pub fn secp_ctx(&self) -> &Secp256k1<All>[src]

impl<B, D> Wallet<B, D> where
    B: Blockchain,
    D: BatchDatabase
[src]

pub fn new<E: ToWalletDescriptor>(
    descriptor: E,
    change_descriptor: Option<E>,
    network: Network,
    database: D,
    client: B
) -> Result<Self, Error>
[src]

Create a new "online" wallet

-

pub fn sync<P: 'static + Progress>(
    &self,
    progress_update: P,
    max_address_param: Option<u32>
) -> Result<(), Error>
[src]

Sync the internal database with the blockchain

-

pub fn client(&self) -> Option<&B>[src]

Return a reference to the internal blockchain client

-

pub fn network(&self) -> Network[src]

Get the Bitcoin network the wallet is using.

-

pub fn broadcast(&self, tx: Transaction) -> Result<Txid, Error>[src]

Broadcast a transaction to the network

+

pub fn finalize_psbt(
    &self,
    psbt: PSBT,
    assume_height: Option<u32>
) -> Result<(PSBT, bool), Error>
[src]

Try to finalize a PSBT

+

pub fn secp_ctx(&self) -> &Secp256k1<All>[src]

impl<B, D> Wallet<B, D> where
    B: Blockchain,
    D: BatchDatabase
[src]

pub fn new<E: ToWalletDescriptor>(
    descriptor: E,
    change_descriptor: Option<E>,
    network: Network,
    database: D,
    client: B
) -> Result<Self, Error>
[src]

Create a new "online" wallet

+

pub fn sync<P: 'static + Progress>(
    &self,
    progress_update: P,
    max_address_param: Option<u32>
) -> Result<(), Error>
[src]

Sync the internal database with the blockchain

+

pub fn client(&self) -> Option<&B>[src]

Return a reference to the internal blockchain client

+

pub fn network(&self) -> Network[src]

Get the Bitcoin network the wallet is using.

+

pub fn broadcast(&self, tx: Transaction) -> Result<Txid, Error>[src]

Broadcast a transaction to the network

Auto Trait Implementations

impl<B, D> !RefUnwindSafe for Wallet<B, D>

impl<B, D> Send for Wallet<B, D> where
    B: Send,
    D: Send

impl<B, D> !Sync for Wallet<B, D>

impl<B, D> Unpin for Wallet<B, D> where
    B: Unpin,
    D: Unpin

impl<B, D> !UnwindSafe for Wallet<B, D>

Blanket Implementations

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

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

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