case class RawTxBuilder() extends Product with Serializable

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RawTxBuilder
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RawTxBuilder()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ++=[T >: TransactionInput with TransactionOutput](inputsOrOutputs: Iterable[T]): RawTxBuilder.this.type

    Adds a collection of inputs and/or outputs to the input and/or output lists

    Adds a collection of inputs and/or outputs to the input and/or output lists

    Annotations
    @inline()
  4. final def +=(output: TransactionOutput): RawTxBuilder.this.type
    Annotations
    @inline()
  5. final def +=(input: TransactionInput): RawTxBuilder.this.type
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def addInput(input: TransactionInput): RawTxBuilder.this.type

    Adds a TransactionInput to be the next input.

    Adds a TransactionInput to be the next input. No ScriptSignature is required and any given ScriptSignature will be ignored (we recommend EmptyScriptSignature).

  8. def addInputs(inputs: Iterable[TransactionInput]): RawTxBuilder.this.type
  9. def addOutput(output: TransactionOutput): RawTxBuilder.this.type

    Adds a TransactionOuput to be the next output.

    Adds a TransactionOuput to be the next output.

    Note that outputs like a change output which are computed from other inputs and outputs should not be added here and are instead the responsibility of the RawTxFinalizer.

  10. def addOutputs(outputs: Iterable[TransactionOutput]): RawTxBuilder.this.type
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def clear(): Unit

    Resets the RawTxBuilder as if it was just constructed.

  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def productElementNames: Iterator[String]
    Definition Classes
    Product
  22. def result(): RawTxBuilderResult

    Returns a RawTxBuilderResult ready for a RawTxFinalizer.

  23. def setFinalizer[F <: RawTxFinalizer](finalizer: F): RawTxBuilderWithFinalizer[F]

    Returns a RawTxBuilderWithFinalizer where building can continue and where buildTx can be called once building is completed.

  24. def setLockTime(lockTime: UInt32): RawTxBuilder.this.type

    Sets the transaction nLockTime

  25. def setVersion(version: Int32): RawTxBuilder.this.type

    Sets the transaction version

  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped