corda / net.corda.core.transactions / CoreTransaction

CoreTransaction

abstract class CoreTransaction : BaseTransaction

A transaction with the minimal amount of information required to compute the unique transaction id, and resolve a FullTransaction. This type of transaction, wrapped in SignedTransaction, gets transferred across the wire and recorded to storage.

Constructors

<init>

CoreTransaction()

A transaction with the minimal amount of information required to compute the unique transaction id, and resolve a FullTransaction. This type of transaction, wrapped in SignedTransaction, gets transferred across the wire and recorded to storage.

Properties

inputs

abstract val inputs: List<StateRef>

The inputs of this transaction, containing state references only.

networkParametersHash

abstract val networkParametersHash: SecureHash?

Hash of the network parameters that were in force when the transaction was notarised. Null means, that the transaction was created on older version of Corda (before 4), resolution will default to initial parameters.

references

abstract val references: List<StateRef>

The reference inputs of this transaction, containing the state references only.

Inherited Properties

notary

abstract val notary: Party?

If present, the notary for this transaction. If absent then the transaction is not notarised at all. This is intended for issuance/genesis transactions that don't consume any other states and thus can't double spend anything.

outputStates

val outputStates: List<ContractState>

Helper property to return a list of ContractState objects, rather than the often less convenient TransactionState

outputs

abstract val outputs: List<TransactionState<ContractState>>

Ordered list of states defined by this transaction, along with the associated notaries.

Inherited Functions

checkBaseInvariants

open fun checkBaseInvariants(): Unit

filterOutRefs

fun <T : ContractState> filterOutRefs(clazz: Class<T>, predicate: Predicate<T>): List<StateAndRef<T>>

Helper to simplify filtering output StateAndRef items according to a Predicate.

fun <T : ContractState> filterOutRefs(predicate: (T) -> Boolean): List<StateAndRef<T>>

filterOutputs

fun <T : ContractState> filterOutputs(clazz: Class<T>, predicate: Predicate<T>): List<T>

Helper to simplify filtering outputs according to a Predicate.

fun <T : ContractState> filterOutputs(predicate: (T) -> Boolean): List<T>

findOutRef

fun <T : ContractState> findOutRef(clazz: Class<T>, predicate: Predicate<T>): StateAndRef<T>

Helper to simplify finding a single output StateAndRef matching a Predicate.

fun <T : ContractState> findOutRef(predicate: (T) -> Boolean): StateAndRef<T>

findOutput

fun <T : ContractState> findOutput(clazz: Class<T>, predicate: Predicate<T>): T

Helper to simplify finding a single output matching a Predicate.

fun <T : ContractState> findOutput(predicate: (T) -> Boolean): T

getOutput

fun getOutput(index: Int): ContractState

Helper to simplify getting an indexed output.

outRef

fun <T : ContractState> outRef(index: Int): StateAndRef<T>

Returns a StateAndRef for the given output index.

fun <T : ContractState> outRef(state: ContractState): StateAndRef<T>

Returns a StateAndRef for the requested output state, or throws IllegalArgumentException if not found.

outRefsOfType

fun <T : ContractState> outRefsOfType(clazz: Class<T>): List<StateAndRef<T>>

Helper to simplify getting all output StateAndRef items of a particular state class, interface, or base class.

fun <T : ContractState> outRefsOfType(): List<StateAndRef<T>>

outputsOfType

fun <T : ContractState> outputsOfType(clazz: Class<T>): List<T>

Helper to simplify getting all output states of a particular class, interface, or base class.

fun <T : ContractState> outputsOfType(): List<T>

toString

open fun toString(): String

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.

Inheritors

ContractUpgradeFilteredTransaction

data class ContractUpgradeFilteredTransaction : CoreTransaction

A filtered version of the ContractUpgradeWireTransaction. In comparison with a regular FilteredTransaction, there is no flexibility on what parts of the transaction to reveal – the inputs, notary and network parameters hash fields are always visible and the rest of the transaction is always hidden. Its only purpose is to hide transaction data when using a non-validating notary.

ContractUpgradeWireTransaction

data class ContractUpgradeWireTransaction : CoreTransaction

A special transaction for upgrading the contract of a state.

NotaryChangeWireTransaction

data class NotaryChangeWireTransaction : CoreTransaction

A special transaction for changing the notary of a state. It only needs specifying the state(s) as input(s), old and new notaries. Output states can be computed by applying the notary modification to corresponding inputs on the fly.

TraversableTransaction

abstract class TraversableTransaction : CoreTransaction

Implemented by WireTransaction and FilteredTransaction. A TraversableTransaction allows you to iterate over the flattened components of the underlying transaction structure, taking into account that some may be missing in the case of this representing a "torn" transaction. Please see the user guide section "Transaction tear-offs" to learn more about this feature.