Vault

class Vault<out T : ContractState>(val states: Iterable<StateAndRef<T>>)

A vault (name may be temporary) wraps a set of states that are useful for us to keep track of, for instance, because we own them. This class represents an immutable, stable state of a vault: it is guaranteed not to change out from underneath you, even though the canonical currently-best-known vault may change as we learn about new transactions from our peers and generate new transactions that consume states ourselves.

This abstract class has no references to Cash contracts.

states Holds a VaultService queried subset of states that are active and relevant. Active means they haven't been consumed yet (or we don't know about it). Relevant means they contain at least one of our pubkeys.

Constructors

Link copied to clipboard
constructor(states: Iterable<StateAndRef<T>>)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class ConstraintInfo(val constraint: AttachmentConstraint)

Contract constraint information associated with a ContractState. See AttachmentConstraint

Link copied to clipboard
data class Page<T : ContractState> constructor(val states: List<StateAndRef<T>>, val statesMetadata: List<Vault.StateMetadata>, val totalStatesAvailable: Long, val stateTypes: Vault.StateStatus, val otherResults: List<Any>, val previousPageAnchor: StateRef? = null)

Returned in queries VaultService.queryBy and VaultService.trackBy. A Page contains:

Link copied to clipboard

If the querying node is a participant in a state then it is classed as RELEVANT.

Link copied to clipboard
data class StateMetadata constructor(val ref: StateRef, val contractStateClassName: String, val recordedTime: Instant, val consumedTime: Instant?, val status: Vault.StateStatus, val notary: AbstractParty?, val lockId: String?, val lockUpdateTime: Instant?, val relevancyStatus: Vault.RelevancyStatus? = null, val constraintInfo: Vault.ConstraintInfo? = null)
Link copied to clipboard
Link copied to clipboard
data class Update<U : ContractState>(val consumed: Set<StateAndRef<U>>, val produced: Set<StateAndRef<U>>, val flowId: UUID? = null, val type: Vault.UpdateType = UpdateType.GENERAL, val references: Set<StateAndRef<U>> = emptySet(), val consumingTxIds: Map<StateRef, SecureHash> = emptyMap())

Represents an update observed by the vault that will be notified to observers. Include the StateRefs of transaction outputs that were consumed (inputs) and the ContractStates produced (outputs) to/by the transaction or transactions observed and the vault.

Link copied to clipboard

Properties

Link copied to clipboard