Packages

package builder

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. case class FinalizedTxWithSigningInfo(finalizedTx: Transaction, infos: Vector[ScriptSignatureParams[InputInfo]]) extends Product with Serializable

    Contains a finalized tx (output from RawTxFinalizer.buildTx) and the ScriptSignatureParams needed to sign that transaction.

  2. case class NonInteractiveWithChangeFinalizer(inputInfos: Vector[InputInfo], feeRate: FeeUnit, changeSPK: ScriptPubKey) extends RawTxFinalizer with Product with Serializable

    A finalizer which takes as parameters an input info for each input, as well as a fee rate and change scriptpubkey and adds a change output resulting in the expected fee (after fee estimation).

  3. case class RawTxBuilder() extends Product with Serializable

    The mutable transaction builder which collects:

    The mutable transaction builder which collects:

    • Unsigned inputs (script signature will be ignored)
    • Destination outputs (change is dealt with in the finalizer)
    • A version number (default is TransactionConstants.validLockVersion)
    • A lock time (default is TransactionConstants.lockTime)

    At a high level, RawTxBuilder is responsible only for the funding inputs and logical outputs (outputs that are intended by this transaction, and not outputs computed from the logical outputs such as change outputs, which are the responsibility of the RawTxFinalizer) of a transaction.

    RawTxBuilder supports inline calls to += and ++= for adding inputs and outputs. Note that RawTxBuilder respects the order in which inputs and outputs are added when generating a RawTxBuilderResult. If you wish to have some other (computed) order, this is the responsibility of either the calling code (to add in the correct order) or of the RawTxFinalizer which may alter the order of inputs and outputs (and should only do so if it is clearly documented that this will occur, otherwise it is safe to assume that RawTxFinalizers will not alter the order of inputs and outputs).

    Once a transaction is done being built and is ready to be passed to a RawTransactionFinalizer, call the result method to receive a RawTxBuilderResult which can be passed into RawTxFinalizer.buildTx.

    If you have access to a finalizer before you are ready to call result, you may call the setFinalizer method to receive an instance of type RawTxBuilderWithFinalizer which is described below, and where you may continue to build and then call buildTx directly.

    Note: RawTxBuilder is not thread safe.

  4. case class RawTxBuilderResult(version: Int32, inputs: Vector[TransactionInput], outputs: Vector[TransactionOutput], lockTime: UInt32) extends Product with Serializable

    Raw Transaction to be finalized by a RawTxFinalizer

  5. case class RawTxBuilderWithFinalizer(builder: RawTxBuilder, finalizer: RawTxFinalizer) extends Product with Serializable

    Wraps a RawTxBuilder and RawTxFinalizer pair.

    Wraps a RawTxBuilder and RawTxFinalizer pair.

    Provides access to builder methods for continuing to collect inputs and outputs and also offers direct access to the RawTxFinalizer's buildTx method which completes the RawTxBuilder and then finalized the result.

  6. sealed trait RawTxFinalizer extends AnyRef

    This trait is responsible for converting RawTxBuilderResults into finalized (unsigned) transactions.

    This trait is responsible for converting RawTxBuilderResults into finalized (unsigned) transactions. This process usually includes such things as computation on inputs and outputs to generate things like change outputs, or to reorder inputs or outputs.

    Once a transaction is done being finalized, its txid/wtxid should not change as the RawTxSigner's only responsibility is adding signature data not included in the txid/wtxid.

    RawTxFinalizer may (but is not required to) generate witness data other than signatures (i.e. public keys for P2WPKH and redeem scripts for P2WSH). RawTxFinalizer may not otherwise populate any other kind of script signature or witness data.

    RawTxFinalizers are compose-able through the andThen method which will turn the first RawTxFinalizer's finalized transaction into a RawTxBuilderResult by taking that transactions inputs (in order), outputs (in order), locktime and version and this RawTxBuilderResult is then given to the second RawTxFinalizer.

  7. sealed abstract class TxBuilderError extends AnyRef

    Represents an error that can be returned by the TxBuilder if it failed to sign a set of utxos

Value Members

  1. case object FilterDustFinalizer extends RawTxFinalizer with Product with Serializable

    A simple finalizer that only removes outputs beneath the dust threshold and does nothing else

  2. object NonInteractiveWithChangeFinalizer extends Serializable
  3. case object RawFinalizer extends RawTxFinalizer with Product with Serializable

    A trivial finalizer that does no processing

  4. object RawTxBuilderResult extends Serializable
  5. object RawTxSigner extends BitcoinSLogger

    Transactions that have been finalized by a RawTxFinalizer are passed as inputs to a sign function here in order to generate fully signed transactions.

    Transactions that have been finalized by a RawTxFinalizer are passed as inputs to a sign function here in order to generate fully signed transactions.

    In the future sign methods specific to multi-party protocols will be added here to support PSBT and signed transaction construction between multiple parties.

  6. object TxBuilderError

Ungrouped