TxBuilder class
A transaction builder
A TxBuilder is created by calling TxBuilder or BumpFeeTxBuilder on a wallet. After assigning it, you set options on it until finally calling finish to consume the builder and generate the transaction.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addData(
{required List< int> data}) → TxBuilder - Add data as an output, using OP_RETURN
-
addForeignUtxo(
Input psbtInput, OutPoint outPoint, int satisfactionWeight) → TxBuilder - Add a foreign UTXO i.e. a UTXO not owned by this wallet. At a minimum to add a foreign UTXO we need:
-
addRecipient(
Script script, int amount) → TxBuilder - Add a recipient to the internal list
-
addUnSpendable(
OutPoint unSpendable) → TxBuilder - Add a utxo to the internal list of unspendable utxos
-
addUtxo(
OutPoint outpoint) → TxBuilder - Add a utxo to the internal list of utxos that must be spent
-
addUtxos(
List< OutPoint> outpoints) → TxBuilder - Add the list of outpoints to the internal list of UTXOs that must be spent.
-
doNotSpendChange(
) → TxBuilder - Do not spend change outputs
-
drainTo(
Script script) → TxBuilder - Sets the address to drain excess coins to.
-
drainWallet(
) → TxBuilder - Spend all the available inputs. This respects filters like TxBuilder().unSpendable and the change policy.
-
enableRbf(
) → TxBuilder - Enable signaling RBF
-
enableRbfWithSequence(
int nSequence) → TxBuilder - Enable signaling RBF with a specific nSequence value
-
feeAbsolute(
int feeAmount) → TxBuilder - Set an absolute fee
-
feeRate(
double satPerVbyte) → TxBuilder - Set a custom fee rate
-
finish(
Wallet wallet) → Future< TxBuilderResult> - Finish building the transaction.
-
manuallySelectedOnly(
) → TxBuilder - Only spend utxos added by add_utxo.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onlySpendChange(
) → TxBuilder - Only spend change outputs
-
setRecipients(
List< ScriptAmount> recipients) → TxBuilder - Replace the recipients already added with a new list
-
toString(
) → String -
A string representation of this object.
inherited
-
unSpendable(
List< OutPoint> outpoints) → TxBuilder - Add a utxo to the internal list of unspendable utxos
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited