Skip to content

Commit

Permalink
docs: add docstrings for BumpFeeTxBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Nov 25, 2024
1 parent ee80d5d commit 4f702eb
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ dictionary Condition {
LockTime? timelock;
};

/// 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.
/// 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.
interface TxBuilder {
constructor();

Expand Down Expand Up @@ -817,19 +817,54 @@ interface TxBuilder {
Psbt finish([ByRef] Wallet wallet);
};

/// 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.
interface BumpFeeTxBuilder {
constructor(string txid, FeeRate fee_rate);

/// 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.
BumpFeeTxBuilder set_exact_sequence(u32 nsequence);

/// 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.
BumpFeeTxBuilder current_height(u32 height);

/// Use a specific nLockTime while creating the transaction.
///
/// This can cause conflicts if the wallet’s descriptors contain an "after" (`OP_CLTV`) operator.
BumpFeeTxBuilder nlocktime(LockTime locktime);

/// 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.
BumpFeeTxBuilder allow_dust(boolean allow_dust);

/// 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.
BumpFeeTxBuilder version(i32 version);

/// 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`.
[Throws=CreateTxError]
Psbt finish([ByRef] Wallet wallet);
};
Expand Down

0 comments on commit 4f702eb

Please sign in to comment.