Package-level declarations

Types

Link copied to clipboard
data class BilateralNetState<P : Any>(val partyKeys: Set<AbstractParty>, val template: Obligation.Terms<P>) : NetState<P>

Subset of state, containing the elements which must match for two obligation transactions to be nettable. If two obligation state objects produce equal bilateral net states, they are considered safe to net directly. Bilateral states are used in close-out netting.

Link copied to clipboard

A cash transaction may split and merge money represented by a set of (issuer, depositRef) pairs, across multiple input and output states. Imagine a Bitcoin transaction but in which all UTXOs had a colour (a blend of issuer+depositRef) and you couldn't merge outputs of two colours together, but you COULD put them in the same transaction.

Link copied to clipboard
data class MultilateralNetState<P : Any>(val template: Obligation.Terms<P>) : NetState<P>

Subset of state, containing the elements which must match for two or more obligation transactions to be candidates for netting (this does not include the checks to enforce that everyone's amounts received are the same at the end, which is handled under the verify() function). In comparison to BilateralNetState, this doesn't include the parties' keys, as ensuring balances match on input and output is handled elsewhere. Used in cases where all parties (or their proxies) are signing, such as central clearing.

Link copied to clipboard
interface NetState<P : Any>

Common interface for the state subsets used when determining nettability of two or more states. Exposes the underlying issued thing.

Link copied to clipboard

An obligation contract commits the obligor to delivering a specified amount of a fungible asset (for example the Cash contract) at a specified future point in time. Settlement transactions may split and merge contracts across multiple input and output states. The goal of this design is to handle amounts owed, and these contracts are expected to be netted/merged, with settlement only for any remainder amount.

Link copied to clipboard
abstract class OnLedgerAsset<T : Any, out C : CommandData, S : FungibleAsset<T>> : Contract

An asset transaction may split and merge assets represented by a set of (issuer, depositRef) pairs, across multiple input and output states. Imagine a Bitcoin transaction but in which all UTXOs had a colour (a blend of issuer+depositRef) and you couldn't merge outputs of two colours together, but you COULD put them in the same transaction.

Link copied to clipboard
data class PartyAndAmount<T : Any>(val party: AbstractParty, val amount: Amount<T>)

A simple holder for a (possibly anonymous) AbstractParty and a quantity of tokens

Properties

Link copied to clipboard

An extension property that lets you write 100.DOLLARS.CASH

Link copied to clipboard

An extension property that lets you get a cash state from an issued token, under the NULL_PARTY

Functions

Link copied to clipboard
infix fun <T : Any> Obligation.State<T>.at(dueBefore: Instant): Obligation.State<T>
Link copied to clipboard
infix fun <T : Any> Obligation.State<T>.between(parties: <Error class: unknown class><AbstractParty, AbstractParty>): Obligation.State<T>
Link copied to clipboard
fun <P : Any> extractAmountsDue(product: Obligation.Terms<P>, states: Iterable<Obligation.State<P>>): Map<<Error class: unknown class><AbstractParty, AbstractParty>, Amount<Obligation.Terms<P>>>

Convert a list of settlement states into total from each obligor to a beneficiary.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <P : AbstractParty, T : Any> netAmountsDue(balances: Map<<Error class: unknown class><P, P>, Amount<T>>): Map<<Error class: unknown class><P, P>, Amount<T>>

Net off the amounts due between parties.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <P : AbstractParty, T : Any> sumAmountsDue(balances: Map<<Error class: unknown class><P, P>, Amount<T>>): Map<P, Long>

Calculate the total balance movement for each party in the transaction, based off a summary of balances between each obligor and beneficiary.