diff --git a/bdk-python/docs/_build/html/.doctrees/api.doctree b/bdk-python/docs/_build/html/.doctrees/api.doctree index 440d7703..86a3ce5a 100644 Binary files a/bdk-python/docs/_build/html/.doctrees/api.doctree and b/bdk-python/docs/_build/html/.doctrees/api.doctree differ diff --git a/bdk-python/docs/_build/html/.doctrees/environment.pickle b/bdk-python/docs/_build/html/.doctrees/environment.pickle index 679650fe..a1be6a90 100644 Binary files a/bdk-python/docs/_build/html/.doctrees/environment.pickle and b/bdk-python/docs/_build/html/.doctrees/environment.pickle differ diff --git a/bdk-python/docs/_build/html/_sources/api.rst.txt b/bdk-python/docs/_build/html/_sources/api.rst.txt index 2389b668..d154c06d 100644 --- a/bdk-python/docs/_build/html/_sources/api.rst.txt +++ b/bdk-python/docs/_build/html/_sources/api.rst.txt @@ -1,99 +1,8 @@ BDK Python API Reference -========================== +===================== This document describes the Python API for the Bitcoin Development Kit (BDK). -API Reference -============== - -.. currentmodule:: bdkpython - -Core Types ------------- - -Addresses and Scripts -~~~~~~~~~~~~~~~~~~~~~~ -.. autoclass:: Address - :members: - :undoc-members: - :show-inheritance: - - -Descriptors -~~~~~~~~~~~~ -.. autoclass:: Descriptor - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: DescriptorPublicKey - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: DescriptorSecretKey - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: DerivationPath - :members: - :undoc-members: - :show-inheritance: - -Wallet Operations ------------------- - -Transaction Building -~~~~~~~~~~~~~~~~~~~~~ -.. autoclass:: TxBuilder - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: BumpFeeTxBuilder - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: Psbt - :members: - :undoc-members: - :show-inheritance: - -Blockchain Clients -~~~~~~~~~~~~~~~~~~~ -.. autoclass:: ElectrumClient - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: EsploraClient - :members: - :undoc-members: - :show-inheritance: - -Wallet -~~~~~~ -.. autoclass:: Wallet - :members: - :undoc-members: - :show-inheritance: - -Utilities ----------- -.. autoclass:: Mnemonic - :members: - :undoc-members: - :show-inheritance: - -Exceptions ------------ -.. autoexception:: InternalError - :members: - :show-inheritance: - - Bdk Module ========== Bitcoin Module @@ -103,7 +12,7 @@ Examples -------- Basic Wallet Usage -~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~ .. code-block:: python diff --git a/bdk-python/docs/_build/html/api.html b/bdk-python/docs/_build/html/api.html index b9513665..2c803690 100644 --- a/bdk-python/docs/_build/html/api.html +++ b/bdk-python/docs/_build/html/api.html @@ -44,53 +44,6 @@
Wallet
This document describes the Python API for the Bitcoin Development Kit (BDK).
-Bases: object
Get as many descriptors as different paths in this descriptor.
-For multipath descriptors it will return as many descriptors as there is -“parallel” paths. For regular descriptors it will just return itself.
-Bases: object
Bases: object
Bases: object
A TxBuilder is created by calling build_tx on a wallet. After assigning it, you set options on it until finally -calling finish to consume the builder and generate the transaction.
- - -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.
-Add a recipient to the internal list of recipients.
-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.
-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.
-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.
-Set a specific ChangeSpendPolicy. See TxBuilder::do_not_spend_change and TxBuilder::only_spend_change for -some shortcuts. This method assumes the presence of an internal keychain, otherwise it has no effect.
-Set the current blockchain height.
-This will be used to:
-1. Set the nLockTime for preventing fee sniping. Note: This will be ignored if you manually specify a -nlocktime using TxBuilder::nlocktime.
-2. Decide whether coinbase outputs are mature or not. If the coinbase outputs are not mature at current_height, -we ignore them in the coin selection. If you want to create a transaction that spends immature coinbase inputs, -manually add them using TxBuilder::add_utxos. -In both cases, if you don’t provide a current height, we use the last sync height.
-Do not spend change outputs.
-This effectively adds all the change outputs to the “unspendable” list. See TxBuilder::unspendable. This method -assumes the presence of an internal keychain, otherwise it has no effect.
-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 coins are too small) it will not be included in the resulting -transaction. The only difference is that it is valid to use drain_to without setting any ordinary recipients -with add_recipient (but it is perfectly fine to add recipients as well).
-If you choose not to set any recipients, you should provide the utxos that the transaction should spend via -add_utxos. drain_to is very useful for draining all the coins in a wallet with drain_wallet to a single -address.
-Spend all the available inputs. This respects filters like TxBuilder::unspendable and the change policy.
-Set an absolute fee The fee_absolute method refers to the absolute transaction fee in Amount. 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, 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.
-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 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.
-Finish building the transaction.
-Uses the thread-local random number generator (rng).
-Returns a new Psbt per BIP174.
-WARNING: To avoid change 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.
-Only spend utxos added by TxBuilder::add_utxo.
-The wallet will not add additional utxos to the transaction even if they are needed to make the transaction valid.
-Use a specific nLockTime while creating the transaction.
-This can cause conflicts if the wallet’s descriptors contain an “after” (OP_CLTV) operator.
-Only spend change outputs.
-This effectively adds all the non-change outputs to the “unspendable” list. See TxBuilder::unspendable. This -method assumes the presence of an internal keychain, otherwise it has no effect.
-The TxBuilder::policy_path is a complex API. See the Rust docs for complete information: https://docs.rs/bdk_wallet/latest/bdk_wallet/struct.TxBuilder.html#method.policy_path
-Set an exact 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.
-Replace the recipients already added with a new list of recipients.
-Bases: object
A BumpFeeTxBuilder is created by calling 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.
-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.
-Set the current blockchain height.
-This will be used to:
-1. Set the nLockTime for preventing fee sniping. Note: This will be ignored if you manually specify a -nlocktime using TxBuilder::nlocktime.
-2. Decide whether coinbase outputs are mature or not. If the coinbase outputs are not mature at current_height, -we ignore them in the coin selection. If you want to create a transaction that spends immature coinbase inputs, -manually add them using TxBuilder::add_utxos. -In both cases, if you don’t provide a current height, we use the last sync height.
-Finish building the transaction.
-Uses the thread-local random number generator (rng).
-Returns a new Psbt per BIP174.
-WARNING: To avoid change 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.
-Use a specific nLockTime while creating the transaction.
-This can cause conflicts if the wallet’s descriptors contain an “after” (OP_CLTV) operator.
-Set an exact 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.
-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.
-Bases: object
Bases: object
Applies an update to the wallet and stages the changes (but does not persist them).
-Usually you create an update by interacting with some blockchain data source and inserting -transactions related to your wallet into it.
-After applying updates you should persist the staged wallet changes. For an example of how -to persist staged wallet changes see [Wallet::reveal_next_address].
-Return the balance, separated into available, trusted-pending, untrusted-pending and immature -values.
-Calculates the fee of a given transaction. Returns [Amount::ZERO] 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.
-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.
-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.
-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.
-Finds how the wallet derived the script pubkey spk.
-Will only return Some(_) if the wallet has given out the spk.
-Return the checksum of the public descriptor associated to keychain
-Internally calls [Self::public_descriptor] to fetch the right descriptor
-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](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#Input_Finalizer), -and [BIP371](https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki) -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.
-Get a single transaction from the wallet as a [WalletTx] (if the transaction exists).
-WalletTx contains the full transaction alongside meta-data such as: -* Blocks that the transaction is [Anchor]ed in. These may or may not be blocks that exist
---in the best chain.
-
The [ChainPosition] of the transaction in the best chain - whether the transaction is -confirmed or unconfirmed. If the transaction is confirmed, the anchor which proves the -confirmation is provided. If the transaction is unconfirmed, the unix timestamp of when -the transaction was last seen in the mempool is provided.
Returns the utxo owned by this wallet corresponding to outpoint if it exists in the -wallet’s database.
-Return whether or not a script is part of this wallet (either internal or external)
-List all relevant outputs (includes both spent and unspent, confirmed and unconfirmed).
-To list only unspent outputs (UTXOs), use [Wallet::list_unspent] instead.
-List addresses that are revealed but unused.
-Note if the returned iterator is empty you can reveal more addresses -by using [reveal_next_address](Self::reveal_next_address) or -[reveal_addresses_to](Self::reveal_addresses_to).
-Marks an address used of the given keychain at index.
-Returns whether the given index was present and then removed from the unused set.
-The index of the next address that you would get if you were to ask the wallet for a new address
-Get the next unused address for the given keychain, i.e. the address with the lowest -derivation index that hasn’t been used.
-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).
-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].
-Peek an address of the given keychain at index without revealing it.
-For non-wildcard descriptors this returns the same address at every provided index.
-# Panics
-This panics when the caller requests for an address of derivation index greater than the -[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) max index.
-Reveal addresses up to and including the target index and return an iterator -of newly revealed addresses.
-If the target index is unreachable, we make a best effort to reveal up to the last -possible index. If all addresses up to the given index are already revealed, then -no new addresses are returned.
-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].
-Attempt to reveal the next address of the given keychain.
-This will increment the keychain’s derivation index. If the keychain’s descriptor doesn’t -contain a wildcard or every address is already revealed up to the maximum derivation -index defined in [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki), -then the last revealed address will be returned.
-Compute the tx’s sent and received [Amount]s.
-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.
-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 -signers will follow the options, but the “software signers” (WIF keys and xprv) defined -in this library will.
-Create a [`FullScanRequest] for this wallet.
-This is the first step when performing a spk-based wallet full scan, the returned -[`FullScanRequest] collects iterators for the wallet’s keychain script pub keys needed to -start a blockchain full scan with a spk based blockchain client.
-This operation is generally only used when importing or restoring a previously used wallet -in which the list of used scripts is not known.
-Create a partial [SyncRequest] for this wallet for all revealed spks.
-This is the first step when performing a spk-based wallet partial sync, the returned -[SyncRequest] collects all revealed script pubkeys from the wallet keychain needed to -start a blockchain sync with a spk based blockchain client.
-- | - |
- | - |
- | - |
- | - |
- | - |
- | - |
- | - |
- | - |
- |
- | - |
- | - |
- |
- | - |
- | - |
- | - |
- | - |
- |
- |
- |