com.r3corda.core.contracts / SignedTransaction

SignedTransaction

data class SignedTransaction : NamedByHash

Container for a WireTransaction and attached signatures.



Constructors

<init> SignedTransaction(txBits: SerializedBytes<WireTransaction>, sigs: List<WithKey>)

Container for a WireTransaction and attached signatures.

Properties

id val id: SecureHash

A transaction ID is the hash of the WireTransaction. Thus adding or removing a signature does not change it.

sigs val sigs: List<WithKey>
tx val tx: WireTransaction

Lazily calculated access to the deserialised/hashed transaction data.

txBits val txBits: SerializedBytes<WireTransaction>

Functions

plus operator fun plus(sig: WithKey): SignedTransaction

Alias for withAdditionalSignature to let you use Kotlin operator overloading.

operator fun plus(sigList: Collection<WithKey>): SignedTransaction
verifySignatures fun verifySignatures(throwIfSignaturesAreMissing: Boolean = true): Set<PublicKey>

Verify the signatures, deserialise the wire transaction and then check that the set of signatures found contains the set of pubkeys in the signers list. If any signatures are missing, either throws an exception (by default) or returns the list of keys that have missing signatures, depending on the parameter.

withAdditionalSignature fun withAdditionalSignature(sig: WithKey): SignedTransaction

Returns the same transaction but with an additional (unchecked) signature

withAdditionalSignatures fun withAdditionalSignatures(sigList: Iterable<WithKey>): SignedTransaction

Extension Functions

toLedgerTransaction fun SignedTransaction.toLedgerTransaction(services: ServiceHub): LedgerTransaction

Calls verify to check all required signatures are present, and then calls WireTransaction.toLedgerTransaction with the passed in ServiceHub to resolve the dependencies, returning an unverified LedgerTransaction.