net.corda.core.transactions

## Class WireTransaction

- BaseTransaction
- - net.corda.core.transactions.WireTransaction

- All Implemented Interfaces:
    NamedByHash, TraversableTransaction

      public class WireTransaction
      extends BaseTransaction
      implements TraversableTransaction

  A transaction ready for serialisation, without any signatures attached. A WireTransaction is usually wrapped by a `class 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 `class SignedTransaction`s with different sets of signatures to have the same identity hash.

  See Also:
    `class SignedTransaction`, `class SignedTransaction`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `WireTransaction.Companion`

    - ### Nested classes/interfaces inherited from interface net.corda.core.transactions.TraversableTransaction

      `TraversableTransaction.DefaultImpls`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static WireTransaction.Companion` | `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WireTransaction(java.util.List<net.corda.core.contracts.StateRef> inputs, java.util.List<? extends net.corda.core.crypto.SecureHash> attachments, java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs, java.util.List<net.corda.core.contracts.Command> commands, Party notary, java.util.List<? extends net.corda.core.crypto.CompositeKey> signers, TransactionType type, Timestamp timestamp)` A transaction ready for serialisation, without any signatures attached. A WireTransaction is usually wrapped by a `class 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 `class SignedTransaction`s with different sets of signatures to have the same identity hash.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FilteredTransaction` | `buildFilteredTransaction(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> filtering)` Build filtered transaction using provided filtering functions.
    `boolean` | `equals(java.lang.Object other)`
    `FilteredLeaves` | `filterWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> filtering)` Construction of partial transaction from WireTransaction based on filtering.
    `java.util.List<net.corda.core.crypto.SecureHash>` | `getAttachments()` Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.
    `java.util.List<net.corda.core.crypto.SecureHash>` | `getAvailableComponentHashes()` 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.
    `java.util.List<java.lang.Object>` | `getAvailableComponents()` Returns a flattened list of all the components that are present in the transaction, in the following order:
    `java.util.List<net.corda.core.contracts.Command>` | `getCommands()` Ordered list of
    `SecureHash` | `getId()`
    `java.util.List<net.corda.core.contracts.StateRef>` | `getInputs()` Pointers to the input states on the ledger,
    `MerkleTree` | `getMerkleTree()` Builds whole Merkle tree for a transaction.
    `SerializedBytes<net.corda.core.transactions.WireTransaction>` | `getSerialized()`
    `int` | `hashCode()`
    `<T extends ContractState> StateAndRef<T>` | `outRef(int index)` Returns a `class StateAndRef` for the given output index.
    `<T extends ContractState> StateAndRef<T>` | `outRef(ContractState state)` Returns a `class StateAndRef` for the requested output state, or throws IllegalArgumentException if not found.
    `LedgerTransaction` | `toLedgerTransaction(ServicesForResolution services)` Looks up identities and attachments from storage to generate a `class LedgerTransaction`. A transaction is expected to have been fully resolved using the resolution flow by this point.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class net.corda.core.transactions.BaseTransaction

      `checkInvariants, equals, getInputs, getMustSign, getNotary, getOutputs, getTimestamp, getType, hashCode, toString`

    - ### Methods inherited from interface net.corda.core.transactions.TraversableTransaction

      `getAttachments, getAvailableComponentHashes, getAvailableComponents, getCommands, getInputs, getMustSign, getNotary, getOutputs, getTimestamp, getType`

    - ### Methods inherited from interface net.corda.core.contracts.NamedByHash

      `getId`

- - ### Field Detail

    - #### Companion

          public static WireTransaction.Companion Companion

  - ### Constructor Detail

    - #### WireTransaction

          public WireTransaction(java.util.List<net.corda.core.contracts.StateRef> inputs,
                                 java.util.List<? extends net.corda.core.crypto.SecureHash> attachments,
                                 java.util.List<? extends net.corda.core.contracts.TransactionState<? extends net.corda.core.contracts.ContractState>> outputs,
                                 java.util.List<net.corda.core.contracts.Command> commands,
                                 Party notary,
                                 java.util.List<? extends net.corda.core.crypto.CompositeKey> signers,
                                 TransactionType type,
                                 Timestamp timestamp)

      A transaction ready for serialisation, without any signatures attached. A WireTransaction is usually wrapped by a `class 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 `class SignedTransaction`s with different sets of signatures to have the same identity hash.

      Parameters:
        `inputs` - Pointers to the input states on the ledger,identified by(tx identity hash,output index).
        `attachments` - Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.
        `commands` - Ordered list of(`interface CommandData`,PublicKey)pairs that instruct the contracts what to do.
      See Also:
        `class SignedTransaction`, `class SignedTransaction`

  - ### Method Detail

    - #### getSerialized

          public SerializedBytes<net.corda.core.transactions.WireTransaction> getSerialized()

    - #### getId

          public SecureHash getId()

    - #### outRef

          public <T extends ContractState> StateAndRef<T> outRef(int index)

      Returns a `class StateAndRef` for the given output index.

      See Also:
        `class StateAndRef`

    - #### outRef

          public <T extends ContractState> StateAndRef<T> outRef(ContractState state)

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

      See Also:
        `class StateAndRef`, IllegalArgumentException

    - #### toLedgerTransaction

          public LedgerTransaction toLedgerTransaction(ServicesForResolution services)

      Looks up identities and attachments from storage to generate a `class LedgerTransaction`. A transaction is expected to have been fully resolved using the resolution flow by this point.

      Throws:
        - if a required attachment was not found in storage.
        - if an input points to a transaction not found in storage.
      See Also:
        `class LedgerTransaction`

    - #### buildFilteredTransaction

          public FilteredTransaction buildFilteredTransaction(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> filtering)

      Build filtered transaction using provided filtering functions.

    - #### getMerkleTree

          public MerkleTree getMerkleTree()

      Builds whole Merkle tree for a transaction.

    - #### filterWithFun

          public FilteredLeaves filterWithFun(kotlin.jvm.functions.Function1<java.lang.Object,java.lang.Boolean> filtering)

      Construction of partial transaction from WireTransaction based on filtering.

      Parameters:
        `filtering` - filtering over the whole WireTransaction

    - #### toString

          public java.lang.String toString()

    - #### equals

          public boolean equals(java.lang.Object other)

    - #### hashCode

          public int hashCode()

    - #### getInputs

          public java.util.List<net.corda.core.contracts.StateRef> getInputs()

      Pointers to the input states on the ledger,

      identified by(tx identity hash,output index).

    - #### getAttachments

          public java.util.List<net.corda.core.crypto.SecureHash> getAttachments()

      Hashes of the ZIP/JAR files that are needed to interpret the contents of this wire transaction.

    - #### getCommands

          public java.util.List<net.corda.core.contracts.Command> getCommands()

      Ordered list of

      (`interface CommandData`,PublicKey)pairs that instruct the contracts what to do.

      See Also:
        `interface CommandData`, PublicKey

    - #### getAvailableComponents

          public java.util.List<java.lang.Object> getAvailableComponents()

      Returns a flattened list of all the components that are present in the transaction, in the following order:

      - Each input that is present

      - Each attachment that is present

      - Each output that is present

      - Each command that is present

      - The notary `class Party`, if present

      - Each required signer (mustSign) that is present

      - The type of the transaction, if present

      - The timestamp of the transaction, if present

      See Also:
        `class Party`

    - #### getAvailableComponentHashes

          public java.util.List<net.corda.core.crypto.SecureHash> getAvailableComponentHashes()

      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.