You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Add a utxo to the internal list of utxos that must be spent.
841
-
///
842
-
/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in the "utxos" and the
843
-
/// "unspendable" list, it will be spent.
844
-
TxBuilder add_utxo(OutPoint outpoint);
845
-
846
-
/// 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
/// This effectively adds all the change outputs to the "unspendable" list. See `TxBuilder::unspendable`. This method
856
-
/// assumes the presence of an internal keychain, otherwise it has no effect.
857
-
TxBuilder do_not_spend_change();
858
-
859
-
/// Only spend change outputs.
860
-
///
861
-
/// This effectively adds all the non-change outputs to the "unspendable" list. See `TxBuilder::unspendable`. This
862
-
/// method assumes the presence of an internal keychain, otherwise it has no effect.
863
-
TxBuilder only_spend_change();
864
-
865
-
/// Only spend utxos added by `TxBuilder::add_utxo`.
866
-
///
867
-
/// The wallet will not add additional utxos to the transaction even if they are needed to make the transaction valid.
868
-
TxBuilder manually_selected_only();
869
-
870
-
/// Set a custom fee rate.
871
-
///
872
-
/// This method sets the mining fee paid by the transaction as a rate on its size. This means that the total fee paid
873
-
/// is equal to fee_rate times the size of the transaction. Default is 1 sat/vB in accordance with Bitcoin Core’s
874
-
/// default relay policy.
875
-
///
876
-
/// Note that this is really a minimum feerate – it’s possible to overshoot it slightly since adding a change output
877
-
/// to drain the remaining excess might not be viable.
878
-
TxBuilder fee_rate([ByRef] FeeRate fee_rate);
879
-
880
-
/// Set an absolute fee The `fee_absolute` method refers to the absolute transaction fee in `Amount`. If anyone sets
881
-
/// both the `fee_absolute` method and the `fee_rate` method, the `FeePolicy` enum will be set by whichever method was
882
-
/// called last, as the `FeeRate` and `FeeAmount` are mutually exclusive.
883
-
///
884
-
/// 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.
885
-
TxBuilder fee_absolute(Amount fee);
886
-
887
-
/// Spend all the available inputs. This respects filters like `TxBuilder::unspendable` and the change policy.
888
-
TxBuilder drain_wallet();
889
-
890
-
/// Sets the address to drain excess coins to.
891
-
///
892
-
/// Usually, when there are excess coins they are sent to a change address generated by the wallet. This option
893
-
/// replaces the usual change address with an arbitrary script_pubkey of your choosing. Just as with a change output,
894
-
/// if the drain output is not needed (the excess coins are too small) it will not be included in the resulting
895
-
/// transaction. The only difference is that it is valid to use `drain_to` without setting any ordinary recipients
896
-
/// with `add_recipient` (but it is perfectly fine to add recipients as well).
897
-
///
898
-
/// If you choose not to set any recipients, you should provide the utxos that the transaction should spend via
899
-
/// `add_utxos`. `drain_to` is very useful for draining all the coins in a wallet with `drain_wallet` to a single
900
-
/// address.
901
-
TxBuilder drain_to([ByRef] Script script);
902
-
903
-
/// Set an exact `nSequence` value.
904
-
///
905
-
/// This can cause conflicts if the wallet’s descriptors contain an "older" (`OP_CSV`) operator and the given
906
-
/// `nsequence` is lower than the CSV value.
907
-
TxBuilder set_exact_sequence(u32 nsequence);
908
-
909
-
/// Add data as an output using `OP_RETURN`.
910
-
TxBuilder add_data(sequence<u8> data);
911
-
912
-
/// Set the current blockchain height.
913
-
///
914
-
/// This will be used to:
915
-
///
916
-
/// 1. Set the `nLockTime` for preventing fee sniping. Note: This will be ignored if you manually specify a
917
-
/// `nlocktime` using `TxBuilder::nlocktime`.
918
-
///
919
-
/// 2. Decide whether coinbase outputs are mature or not. If the coinbase outputs are not mature at `current_height`,
920
-
/// we ignore them in the coin selection. If you want to create a transaction that spends immature coinbase inputs,
921
-
/// manually add them using `TxBuilder::add_utxos`.
922
-
/// In both cases, if you don’t provide a current height, we use the last sync height.
923
-
TxBuilder current_height(u32 height);
924
-
925
-
/// Use a specific nLockTime while creating the transaction.
926
-
///
927
-
/// This can cause conflicts if the wallet’s descriptors contain an "after" (`OP_CLTV`) operator.
928
-
TxBuilder nlocktime(LockTime locktime);
929
-
930
-
/// Set whether or not the dust limit is checked.
931
-
///
932
-
/// Note: by avoiding a dust limit check you may end up with a transaction that is non-standard.
933
-
TxBuilder allow_dust(boolean allow_dust);
934
-
935
-
/// Build a transaction with a specific version.
936
-
///
937
-
/// The version should always be greater than 0 and greater than 1 if the wallet’s descriptors contain an "older"
938
-
/// (`OP_CSV`) operator.
939
-
TxBuilder version(i32 version);
940
-
941
-
/// Finish building the transaction.
942
-
///
943
-
/// Uses the thread-local random number generator (rng).
944
-
///
945
-
/// Returns a new `Psbt` per BIP174.
946
-
///
947
-
/// WARNING: To avoid change address reuse you must persist the changes resulting from one or more calls to this
948
-
/// method before closing the wallet. See `Wallet::reveal_next_address`.
949
-
[Throws=CreateTxError]
950
-
Psbt finish([ByRef] Wallet wallet);
951
-
};
952
-
953
812
/// A `BumpFeeTxBuilder` is created by calling `build_fee_bump` on a wallet. After assigning it, you set options on it
954
813
/// until finally calling `finish` to consume the builder and generate the transaction.
0 commit comments