com.r3corda.core.transactions / LedgerTransaction

# LedgerTransaction

`class LedgerTransaction : BaseTransaction`

A LedgerTransaction is derived from a WireTransaction. It is the result of doing the following operations:

- Downloading and locally storing all the dependencies of the transaction.

- Resolving the input states and loading them into memory.

- Doing some basic key lookups on the Commands to see if any keys are from a recognised party, thus converting the Command objects into AuthenticatedObject.

- Deserialising the output states.

All the above refer to inputs using a (txhash, output index) pair.

### Constructors

<init> | `LedgerTransaction(inputs: List<StateAndRef<*>>, outputs: List<TransactionState<ContractState>>, commands: List<AuthenticatedObject<CommandData>>, attachments: List<Attachment>, id: SecureHash, notary: Party?, signers: List<PublicKey>, timestamp: Timestamp?, type: TransactionType)` A LedgerTransaction is derived from a WireTransaction. It is the result of doing the following operations:

### 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 resolved input states which will be consumed/invalidated by the execution of this transaction.

### Inherited Properties

mustSign | `val mustSign: List<PublicKey>` Keys that are required to have signed the wrapping SignedTransaction, ordered to match the list of signatures. There is nothing that forces the list to be the correct list of signers for this transaction until the transaction is verified by using LedgerTransaction.verify. It includes the notary key, if the notary field is set.
notary | `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 dont consume any other states and thus cant double spend anything.
outputs | `val outputs: List<TransactionState<ContractState>>` Ordered list of states defined by this transaction, along with the associated notaries.
timestamp | `val timestamp: Timestamp?` If specified, a time window in which this transaction may have been notarised. Contracts can check this time window to find out when a transaction is deemed to have occurred, from the ledgers perspective.
type | `val type: TransactionType` Pointer to a class that defines the behaviour of this transaction: either normal, or "notary changing".

### Functions

equals | `fun equals(other: Any?): Boolean`
hashCode | `fun hashCode(): Int`
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:

### Inherited Functions

checkInvariants | `fun checkInvariants(): Unit`