unconsumedCashStatesForSpending

fun unconsumedCashStatesForSpending(services: <Error class: unknown class>, amount: <Error class: unknown class><Currency>, onlyFromIssuerParties: Set<<Error class: unknown class>> = emptySet(), notary: <Error class: unknown class>? = null, lockId: UUID, withIssuerRefs: Set<<Error class: unknown class>> = emptySet()): List<<Error class: unknown class><<Error class: unknown class>>>

Query to gather Cash states that are available and retry if they are temporarily unavailable.

Return

The matching states that were found. If sufficient funds were found these will be locked, otherwise what is available is returned unlocked for informational purposes.

Parameters

services

The service hub to allow access to the database session

amount

The amount of currency desired (ignoring issues, but specifying the currency)

onlyFromIssuerParties

If empty the operation ignores the specifics of the issuer, otherwise the set of eligible states wil be filtered to only include those from these issuers.

notary

If null the notary source is ignored, if specified then only states marked with this notary are included.

lockId

The FlowLogic.runId.uuid of the flow, which is used to soft reserve the states. Also, previous outputs of the flow will be eligible as they are implicitly locked with this id until the flow completes.

withIssuerRefs

If not empty the specific set of issuer references to match against.