com.r3corda.core.contracts / LedgerTransaction

# LedgerTransaction

`data class LedgerTransaction : NamedByHash`

A LedgerTransaction wraps the data needed to calculate one or more successor states from a set of input states. It is the first step after extraction from a WireTransaction. The signatures at this point have been lined up with the commands from the wire, and verified/looked up.

### Constructors

<init> | `LedgerTransaction(inputs: List<StateAndRef<*>>, outputs: List<TransactionState<*>>, commands: List<AuthenticatedObject<CommandData>>, attachments: List<Attachment>, id: SecureHash, notary: Party?, signers: List<PublicKey>, timestamp: Timestamp?, type: TransactionType)` A LedgerTransaction wraps the data needed to calculate one or more successor states from a set of input states. It is the first step after extraction from a WireTransaction. The signatures at this point have been lined up with the commands from the wire, and verified/looked up.

### Properties

attachments | `val attachments: List<Attachment>` A list of Attachment objects identified by the transaction that are needed for this transaction to verify.
commands | `val commands: List<AuthenticatedObject<CommandData>>` Arbitrary data passed to the program of each input state.
id | `val id: SecureHash` The hash of the original serialised WireTransaction.
inputs | `val inputs: List<StateAndRef<*>>` The input states which will be consumed/invalidated by the execution of this transaction.
notary | `val notary: Party?` The notary for this party, may be null for transactions with no notary.
outputs | `val outputs: List<TransactionState<*>>` The states that will be generated by the execution of this transaction.
signers | `val signers: List<PublicKey>` The notary key and the command keys together: a signed transaction must provide signatures for all of these.
timestamp | `val timestamp: Timestamp?`
type | `val type: TransactionType`

### Functions

outRef | `fun <T : ContractState> outRef(index: Int): StateAndRef<T>`
toTransactionForContract | `fun toTransactionForContract(): TransactionForContract` Strips the transaction down to a form that is usable by the contract verify functions
verify | `fun verify(): Unit` Verifies this transaction and throws an exception if not valid, depending on the type. For general transactions: