Transaction Builder
A TransactionBuilder is a transaction class that's mutable (unlike the others which are all immutable). It is intended to be passed around contracts that may edit it by adding new states/commands. Then once the states and commands are right, this class can be used as a holding bucket to gather signatures from multiple parties.
The builder can be customised for specific transaction types, e.g. where additional processing is needed before adding a state/command.
Parameters
Notary used for the transaction. If null, this indicates the transaction DOES NOT have a notary. When this is set to a non-null value, an output state can be added by just passing in a ContractState – a TransactionState with this notary specified will be generated automatically.
Constructors
Properties
Functions
Adds an attachment with the specified hash to the TransactionBuilder.
Adds a Command to the transaction.
Adds a Command to the transaction, specified by the encapsulated CommandData object and required list of signing PublicKeys.
Adds an input StateRef to the transaction.
Adds an output state to the transaction.
Adds an output state with the specified constraint.
Adds an output state. A default notary must be specified during builder construction to use this method
Adds an output state, with associated contract code (and constraints), and notary, to the transaction.
Adds a reference input StateRef to the transaction.
Returns an immutable list of attachment hashes.
Creates a copy of the builder.
Returns an immutable list of input StateRefs.
Returns an immutable list of output TransactionStates.
Returns an immutable list of reference input StateRefs.
Sets the TimeWindow for this transaction, replacing the existing TimeWindow if there is one. To be valid, the transaction must then be signed by the notary service within this window of time. In this way, the notary acts as the Timestamp Authority.
The TimeWindow for the transaction can also be defined as time +/- timeTolerance. The tolerance should be chosen such that your code can finish building the transaction and sending it to the Timestamp Authority within that window of time, taking into account factors such as network latency. Transactions being built by a group of collaborating parties may therefore require a higher time tolerance than a transaction being built by a single node.
Sign the built transaction and return it. This is an internal function for use by the service hub, please use ServiceHub.signInitialTransaction instead.
Generates a WireTransaction from this builder, resolves any AutomaticPlaceholderConstraint, and selects the attachments to use for this transaction.