]> Untitled Git - bdk/commitdiff
docs(wallet): reword the `next_unused_address` doc
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Wed, 4 Dec 2024 18:33:45 +0000 (15:33 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Fri, 13 Dec 2024 12:43:09 +0000 (09:43 -0300)
docs(wallet): reword the `next_unused_address` doc

Adds an example on what `used` stands for, and make it explicit that it
has the same behavior as `Wallet::reveal_next_address` in the scenario
where all previously revealed addresses have been used.

docs(wallet): fix typo in doc comment

crates/wallet/src/wallet/mod.rs

index 4adfb633f207ea40b044a844be54ca7f72d2e721..3af424d37c9734e33bc51e10a4d70b0bd2dd80ae 100644 (file)
@@ -732,10 +732,10 @@ impl Wallet {
     }
 
     /// Get the next unused address for the given `keychain`, i.e. the address with the lowest
-    /// derivation index that hasn't been used.
+    /// derivation index that hasn't been used in a transaction.
     ///
-    /// This will attempt to derive and reveal a new address if no newly revealed addresses
-    /// are available. See also [`reveal_next_address`](Self::reveal_next_address).
+    /// This will attempt to reveal a new address if all previously revealed addresses have
+    /// been used, in which case the returned address will be the same as calling [`Wallet::reveal_next_address`].
     ///
     /// **WARNING**: To avoid address reuse you must persist the changes resulting from one or more
     /// calls to this method before closing the wallet. See [`Wallet::reveal_next_address`].