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.
- Alphabetic
- By Inheritance
- RawTxBuilder
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RawTxBuilder()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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()
- final def +=(output: TransactionOutput): RawTxBuilder.this.type
- Annotations
- @inline()
- final def +=(input: TransactionInput): RawTxBuilder.this.type
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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).
- def addInputs(inputs: Iterable[TransactionInput]): RawTxBuilder.this.type
- 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.
- def addOutputs(outputs: Iterable[TransactionOutput]): RawTxBuilder.this.type
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clear(): Unit
Resets the RawTxBuilder as if it was just constructed.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def result(): RawTxBuilderResult
Returns a RawTxBuilderResult ready for a RawTxFinalizer.
- 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.
- def setLockTime(lockTime: UInt32): RawTxBuilder.this.type
Sets the transaction nLockTime
- def setVersion(version: Int32): RawTxBuilder.this.type
Sets the transaction version
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()