From: github-actions Date: Fri, 22 Mar 2024 07:13:09 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/struct.EncoderStringWriter.html?a=commitdiff_plain;h=461cee346a6fde303961d284081f046331ebf82f;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/index.html index eef93a60b2..760e0a45c6 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/index.html @@ -21,51 +21,52 @@

bdk

-

The bdk crate provides the Wallet type which is a simple, high-level +

The bdk crate provides the Wallet type which is a simple, high-level interface built from the low-level components of bdk_chain. Wallet is a good starting point for many simple applications as well as a good demonstration of how to use the other mechanisms to construct a wallet. It has two keychains (external and internal) which are defined by miniscript descriptors and uses them to generate addresses. When you give it chain data it also uses the descriptors to find transaction outputs owned by them. From there, you can create and sign transactions.

-

For more information, see the Wallet’s documentation.

+

For details about the API of Wallet see the module-level documentation.

Blockchain data

-

In order to get blockchain data for Wallet to consume, you have to put it into particular form. -Right now this is KeychainScan which is defined in bdk_chain.

-

This can be created manually or from blockchain-scanning crates.

+

In order to get blockchain data for Wallet to consume, you should configure a client from +an available chain source. Typically you make a request to the chain source and get a response +that the Wallet can use to update its view of the chain.

Blockchain Data Sources

Examples

Persistence

-

To persist the Wallet on disk, Wallet needs to be constructed with a -Persist implementation.

+

To persist the Wallet on disk, it must be constructed with a PersistBackend implementation.

Implementations

Example

+ -
use bdk::{bitcoin::Network, wallet::{AddressIndex, Wallet}};
+
ⓘ
use bdk::{bitcoin::Network, wallet::{ChangeSet, Wallet}};
 
 fn main() {
-    // a type that implements `Persist`
-    let db = ();
+    // Create a new file `Store`.
+    let db = bdk_file_store::Store::<ChangeSet>::open_or_create_new(b"magic_bytes", "path/to/my_wallet.db").expect("create store");
 
-    let descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/0/*)";
-    let mut wallet = Wallet::new(descriptor, None, db, Network::Testnet).expect("should create");
+    let descriptor = "wpkh(tprv8ZgxMBicQKsPdcAqYBpzAFwU5yxBUo88ggoBqu1qPcHUfSbKK1sKMLmC7EAk438btHQrSdu3jGGQa6PA71nvH5nkDexhLteJqkM4dQmWF9g/84'/1'/0'/0/*)";
+    let mut wallet = Wallet::new_or_load(descriptor, None, db, Network::Testnet).expect("create or load wallet");
 
-    // get a new address (this increments revealed derivation index)
-    println!("revealed address: {}", wallet.get_address(AddressIndex::New));
-    println!("staged changes: {:?}", wallet.staged());
-    // persist changes
-    wallet.commit().expect("must save");
+    // Insert a single `TxOut` at `OutPoint` into the wallet.
+    let _ = wallet.insert_txout(outpoint, txout);
+    wallet.commit().expect("must write to database");
 }
diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/index.html index bf794089f3..64bc21d5b8 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/index.html @@ -1,2 +1,2 @@ -example_cli - Rust

Crate example_cli

source ·

Re-exports

pub use anyhow;
pub use clap;

Structs

The initial state returned by init.

Enums

Functions

Parses command line arguments and initializes all components, creating +example_cli - Rust

Crate example_cli

source ·

Re-exports

pub use anyhow;
pub use bdk_file_store;
pub use clap;

Structs

The initial state returned by init.

Enums

Functions

Parses command line arguments and initializes all components, creating a file store with the given parameters, or loading one if it exists.

Type Definitions

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.Database.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.Database.html index ce168eedcd..a45eaff166 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.Database.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/type.Database.html @@ -1 +1 @@ -Database in example_cli - Rust

Type Definition example_cli::Database

source ·
pub type Database<C> = Persist<Store<C>, C>;
\ No newline at end of file +Database in example_cli - Rust

Type Definition example_cli::Database

source ·
pub type Database<C> = Persist<Store<C>, C>;
\ No newline at end of file