net.corda.core.node.services / VaultService / generateSpend

# generateSpend

`abstract fun generateSpend(tx: TransactionBuilder, amount: Amount<Currency>, to: PublicKeyTree, onlyFromParties: Set<Party>? = null): <ERROR CLASS><TransactionBuilder, List<PublicKeyTree>>`

InsufficientBalanceException is thrown when a Cash Spending transaction fails because there is insufficient quantity for a given currency (and optionally set of Issuer Parties). Note: an Amount of Currency is only fungible for a given Issuer Party within a FungibleAsset