corda / net.corda.core.transactions / WireTransaction

# WireTransaction

`class WireTransaction : BaseTransaction, TraversableTransaction`

A transaction ready for serialisation, without any signatures attached. A WireTransaction is usually wrapped by a SignedTransaction that carries the signatures over this payload. The hash of the wire transaction is the identity of the transaction, that is, it's possible for two SignedTransactions with different sets of signatures to have the same identity hash.

### Constructors

<init> | `WireTransaction(inputs: List<StateRef>, attachments: List<SecureHash>, outputs: List<TransactionState<ContractState>>, commands: List<Command>, notary: Party?, signers: List<CompositeKey>, type: TransactionType, timestamp: Timestamp?)` A transaction ready for serialisation, without any signatures attached. A WireTransaction is usually wrapped by a SignedTransaction that carries the signatures over this payload. The hash of the wire transaction is the identity of the transaction, that is, it's possible for two SignedTransactions with different sets of signatures to have the same identity hash.

### Properties

attachments | `val attachments: List<SecureHash>` Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.
commands | `val commands: List<Command>` Ordered list of (CommandData, PublicKey) pairs that instruct the contracts what to do.
id | `val id: SecureHash`
inputs | `val inputs: List<StateRef>` Pointers to the input states on the ledger, identified by (tx identity hash, output index).
merkleTree | `val merkleTree: MerkleTree` Builds whole Merkle tree for a transaction.
serialized | `val serialized: SerializedBytes<WireTransaction>`

### Inherited Properties

availableComponentHashes | `open val availableComponentHashes: List<SecureHash>` Calculate the hashes of the sub-components of the transaction, that are used to build its Merkle tree. The root of the tree is the transaction identifier. The tree structure is helpful for privacy, please see the user-guide section "Transaction tear-offs" to learn more about this topic.
availableComponents | `open val availableComponents: List<Any>` Returns a flattened list of all the components that are present in the transaction, in the following order:
mustSign | `val mustSign: List<CompositeKey>` Composite keys that need to be fulfilled by signatures in order for the transaction to be valid. In a SignedTransaction this list is used to check whether there are any missing signatures. Note that 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.
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 don't consume any other states and thus can't 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 ledger's perspective.
type | `val type: TransactionType` Pointer to a class that defines the behaviour of this transaction: either normal, or "notary changing".

### Functions

buildFilteredTransaction | `fun buildFilteredTransaction(filtering: (Any) -> Boolean): FilteredTransaction` Build filtered transaction using provided filtering functions.
equals | `fun equals(other: Any?): Boolean`
filterWithFun | `fun filterWithFun(filtering: (Any) -> Boolean): FilteredLeaves` Construction of partial transaction from WireTransaction based on filtering.
hashCode | `fun hashCode(): Int`
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.
toLedgerTransaction | `fun toLedgerTransaction(services: ServicesForResolution): LedgerTransaction` Looks up identities and attachments from storage to generate a LedgerTransaction. A transaction is expected to have been fully resolved using the resolution flow by this point.
toString | `fun toString(): String`

### Inherited Functions

checkInvariants | `fun checkInvariants(): Unit`

### Companion Object Functions

deserialize | `fun deserialize(data: SerializedBytes<WireTransaction>, kryo: Kryo = threadLocalP2PKryo()): WireTransaction`