Interface UtxoTransactionBuilder
-
- All Implemented Interfaces:
@DoNotImplement() public interface UtxoTransactionBuilder
Defines a builder for UTXO transactions.
-
-
Method Summary
Modifier and Type Method Description abstract UtxoTransactionBuilder
addCommand(@NotNull() Command command)
Adds the specified command to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addSignatories(@NotNull() Iterable<PublicKey> signatories)
Adds the specified signatories to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addSignatories(@NotNull() Array<PublicKey> signatories)
Adds the specified signatories to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addInputState(@NotNull() StateRef stateRef)
Adds the specified input state to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addInputStates(@NotNull() Iterable<StateRef> stateRefs)
Adds the specified input states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addInputStates(@NotNull() Array<StateRef> stateRefs)
Adds the specified input states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addReferenceState(@NotNull() StateRef stateRef)
Adds the specified reference state to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addReferenceStates(@NotNull() Iterable<StateRef> stateRefs)
Adds the specified reference states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addReferenceStates(@NotNull() Array<StateRef> stateRefs)
Adds the specified reference states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addOutputState(@NotNull() ContractState contractState)
Adds the specified output state to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addOutputStates(@NotNull() Iterable<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addOutputStates(@NotNull() Array<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
addEncumberedOutputStates(@NotNull() String tag, @NotNull() Iterable<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder as a tagged encumbrance group. abstract UtxoTransactionBuilder
addEncumberedOutputStates(@NotNull() String tag, @NotNull() Array<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder as a tagged encumbrance group. abstract List<ContractState>
getEncumbranceGroup(@NotNull() String tag)
Gets a list of encumbered ContractState instances from the specified encumbrance group tag. abstract Map<String, List<ContractState>>
getEncumbranceGroups()
Gets a map of encumbrance group tags and the associated encumbered ContractState instances. abstract MemberX500Name
getNotaryName()
Gets the notary service name assigned to the current transaction, or null if the notary has not been set. abstract PublicKey
getNotaryKey()
Gets the notary service key assigned to the current transaction, or null if the notary has not been set. abstract UtxoTransactionBuilder
setNotary(@NotNull() MemberX500Name notary)
Sets the specified MemberX500Name as a notary to the current UtxoTransactionBuilder. abstract UtxoTransactionBuilder
setTimeWindowUntil(@NotNull() Instant until)
Sets the transaction time window to be valid until the specified Instant, tending towards negative infinity. abstract UtxoTransactionBuilder
setTimeWindowBetween(@NotNull() Instant from, @NotNull() Instant until)
Sets the transaction time window to be valid between the specified Instant values. abstract UtxoSignedTransaction
toSignedTransaction()
Verifies the content of the UtxoTransactionBuilder and signs the transaction with any required signatories that belong to the current node. -
-
Method Detail
-
addCommand
@NotNull() abstract UtxoTransactionBuilder addCommand(@NotNull() Command command)
Adds the specified command to the current UtxoTransactionBuilder.
- Parameters:
command
- The command to add to the current UtxoTransactionBuilder.
-
addSignatories
@NotNull() abstract UtxoTransactionBuilder addSignatories(@NotNull() Iterable<PublicKey> signatories)
Adds the specified signatories to the current UtxoTransactionBuilder.
- Parameters:
signatories
- The signatories to add to the current UtxoTransactionBuilder.
-
addSignatories
@NotNull() abstract UtxoTransactionBuilder addSignatories(@NotNull() Array<PublicKey> signatories)
Adds the specified signatories to the current UtxoTransactionBuilder.
- Parameters:
signatories
- The signatories to add to the current UtxoTransactionBuilder.
-
addInputState
@NotNull() abstract UtxoTransactionBuilder addInputState(@NotNull() StateRef stateRef)
Adds the specified input state to the current UtxoTransactionBuilder.
- Parameters:
stateRef
- The StateRef instance of the input state to add to the current UtxoTransactionBuilder.
-
addInputStates
@NotNull() abstract UtxoTransactionBuilder addInputStates(@NotNull() Iterable<StateRef> stateRefs)
Adds the specified input states to the current UtxoTransactionBuilder.
- Parameters:
stateRefs
- The StateRef instances of the input state to add to the current UtxoTransactionBuilder.
-
addInputStates
@NotNull() abstract UtxoTransactionBuilder addInputStates(@NotNull() Array<StateRef> stateRefs)
Adds the specified input states to the current UtxoTransactionBuilder.
- Parameters:
stateRefs
- The StateRef instances of the input state to add to the current UtxoTransactionBuilder.
-
addReferenceState
@NotNull() abstract UtxoTransactionBuilder addReferenceState(@NotNull() StateRef stateRef)
Adds the specified reference state to the current UtxoTransactionBuilder.
- Parameters:
stateRef
- The StateRef instance of the reference state to add to the current UtxoTransactionBuilder.
-
addReferenceStates
@NotNull() abstract UtxoTransactionBuilder addReferenceStates(@NotNull() Iterable<StateRef> stateRefs)
Adds the specified reference states to the current UtxoTransactionBuilder.
- Parameters:
stateRefs
- The StateRef instances of the reference state to add to the current UtxoTransactionBuilder.
-
addReferenceStates
@NotNull() abstract UtxoTransactionBuilder addReferenceStates(@NotNull() Array<StateRef> stateRefs)
Adds the specified reference states to the current UtxoTransactionBuilder.
- Parameters:
stateRefs
- The StateRef instances of the reference state to add to the current UtxoTransactionBuilder.
-
addOutputState
@NotNull() abstract UtxoTransactionBuilder addOutputState(@NotNull() ContractState contractState)
Adds the specified output state to the current UtxoTransactionBuilder.
- Parameters:
contractState
- The ContractState instance to add to the current UtxoTransactionBuilder.
-
addOutputStates
@NotNull() abstract UtxoTransactionBuilder addOutputStates(@NotNull() Iterable<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder.
- Parameters:
contractStates
- The ContractState instances to add to the current UtxoTransactionBuilder.
-
addOutputStates
@NotNull() abstract UtxoTransactionBuilder addOutputStates(@NotNull() Array<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder.
- Parameters:
contractStates
- The ContractState instances to add to the current UtxoTransactionBuilder.
-
addEncumberedOutputStates
@NotNull() abstract UtxoTransactionBuilder addEncumberedOutputStates(@NotNull() String tag, @NotNull() Iterable<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder as a tagged encumbrance group.
- Parameters:
tag
- The tag of the encumbrance group which the specified ContractState instances will belong to.contractStates
- The ContractState instances to add to the current UtxoTransactionBuilder.
-
addEncumberedOutputStates
@NotNull() abstract UtxoTransactionBuilder addEncumberedOutputStates(@NotNull() String tag, @NotNull() Array<ContractState> contractStates)
Adds the specified output states to the current UtxoTransactionBuilder as a tagged encumbrance group.
- Parameters:
tag
- The tag of the encumbrance group which the specified ContractState instances will belong to.contractStates
- The ContractState instances to add to the current UtxoTransactionBuilder.
-
getEncumbranceGroup
@NotNull() abstract List<ContractState> getEncumbranceGroup(@NotNull() String tag)
Gets a list of encumbered ContractState instances from the specified encumbrance group tag.
- Parameters:
tag
- The encumbrance group tag for which to obtain the associated list of ContractState instances.
-
getEncumbranceGroups
@NotNull() abstract Map<String, List<ContractState>> getEncumbranceGroups()
Gets a map of encumbrance group tags and the associated encumbered ContractState instances.
-
getNotaryName
@Nullable() abstract MemberX500Name getNotaryName()
Gets the notary service name assigned to the current transaction, or null if the notary has not been set.
-
getNotaryKey
@Nullable() abstract PublicKey getNotaryKey()
Gets the notary service key assigned to the current transaction, or null if the notary has not been set.
-
setNotary
@NotNull() abstract UtxoTransactionBuilder setNotary(@NotNull() MemberX500Name notary)
Sets the specified MemberX500Name as a notary to the current UtxoTransactionBuilder.
- Parameters:
notary
- The MemberX500Name to set as a notary to the current UtxoTransactionBuilder.
-
setTimeWindowUntil
@NotNull() abstract UtxoTransactionBuilder setTimeWindowUntil(@NotNull() Instant until)
Sets the transaction time window to be valid until the specified Instant, tending towards negative infinity.
- Parameters:
until
- The Instant until which the transaction time window is valid.
-
setTimeWindowBetween
@NotNull() abstract UtxoTransactionBuilder setTimeWindowBetween(@NotNull() Instant from, @NotNull() Instant until)
Sets the transaction time window to be valid between the specified Instant values.
-
toSignedTransaction
@NotNull()@Suspendable() abstract UtxoSignedTransaction toSignedTransaction()
Verifies the content of the UtxoTransactionBuilder and signs the transaction with any required signatories that belong to the current node.
Calling this function once consumes the UtxoTransactionBuilder, so it cannot be used again. Therefore, if you want to build two transactions, you need two builders.
-
-
-
-