public class ObligationUtils
Modifier and Type | Field and Description |
---|---|
static ObligationUtils |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
generateCashIssue(TransactionBuilder tx,
AbstractParty obligor,
SecureHash acceptableContract,
Amount<net.corda.core.contracts.Issued> amount,
java.time.Instant dueBefore,
AbstractParty beneficiary,
Party notary)
Puts together an issuance transaction for the specified currency obligation amount that starts out being owned by
the given pubkey.
|
<P> void |
generateCloseOutNetting(TransactionBuilder tx,
AbstractParty signer,
net.corda.core.contracts.StateAndRef inputs)
Generate a transaction performing close-out netting of two or more states.
|
<P> java.util.Set<java.security.PublicKey> |
generateExit(TransactionBuilder tx,
Amount<net.corda.core.contracts.Issued> amountIssued,
java.util.List<net.corda.core.contracts.StateAndRef> assetStates)
Generate an transaction exiting an obligation from the ledger.
|
<P> java.util.Set<java.security.PublicKey> |
generateIssue(TransactionBuilder tx,
AbstractParty obligor,
Obligation.Terms<P> issuanceDef,
long pennies,
AbstractParty beneficiary,
Party notary)
Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.
|
<P> void |
generatePaymentNetting(TransactionBuilder tx,
Issued<net.corda.finance.contracts.asset.Obligation.Terms> issued,
Party notary,
net.corda.core.contracts.StateAndRef inputs) |
<P> void |
generateSetLifecycle(TransactionBuilder tx,
java.util.List<net.corda.core.contracts.StateAndRef> statesAndRefs,
Obligation.Lifecycle lifecycle,
Party notary)
Generate a transaction changing the lifecycle of one or more state objects.
|
<P> void |
generateSettle(TransactionBuilder tx,
java.lang.Iterable<net.corda.core.contracts.StateAndRef> statesAndRefs,
java.lang.Iterable<? extends net.corda.core.contracts.StateAndRef<? extends net.corda.core.contracts.FungibleAsset<P>>> assetStatesAndRefs,
MoveCommand moveCommand,
Party notary) |
public static ObligationUtils INSTANCE
public void generateCashIssue(TransactionBuilder tx, AbstractParty obligor, SecureHash acceptableContract, Amount<net.corda.core.contracts.Issued> amount, java.time.Instant dueBefore, AbstractParty beneficiary, Party notary)
Puts together an issuance transaction for the specified currency obligation amount that starts out being owned by the given pubkey.
tx
- transaction builder to add states and commands to.obligor
- the party who is expected to pay some currency amount to fulfil the obligation (also the owner of
the obligation).amount
- currency amount the obligor is expected to pay.dueBefore
- the date on which the obligation is due. The default time tolerance is used (currently this is
30 seconds).beneficiary
- the party the obligor is expected to pay.notary
- the notary for this transaction's outputs.public <P> java.util.Set<java.security.PublicKey> generateIssue(TransactionBuilder tx, AbstractParty obligor, Obligation.Terms<P> issuanceDef, long pennies, AbstractParty beneficiary, Party notary)
Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.
tx
- transaction builder to add states and commands to.obligor
- the party who is expected to pay some amount to fulfil the obligation.issuanceDef
- the terms of the obligation, including which contracts and underlying assets are acceptable
forms of payment.pennies
- the quantity of the asset (in the smallest normal unit of measurement) owed.beneficiary
- the party the obligor is expected to pay.notary
- the notary for this transaction's outputs.public <P> void generateCloseOutNetting(TransactionBuilder tx, AbstractParty signer, net.corda.core.contracts.StateAndRef inputs)
Generate a transaction performing close-out netting of two or more states.
signer
- the party which will sign the transaction. Must be one of the obligor or beneficiary.inputs
- two or more states, which must be compatible for bilateral netting (same issuance definitions,
and same parties involved).public <P> void generatePaymentNetting(TransactionBuilder tx, Issued<net.corda.finance.contracts.asset.Obligation.Terms> issued, Party notary, net.corda.core.contracts.StateAndRef inputs)
public <P> void generateSetLifecycle(TransactionBuilder tx, java.util.List<net.corda.core.contracts.StateAndRef> statesAndRefs, Obligation.Lifecycle lifecycle, Party notary)
Generate a transaction changing the lifecycle of one or more state objects.
statesAndRefs
- a list of state objects, which MUST all have the same issuance definition. This avoids
potential complications arising from different deadlines applying to different states.public <P> void generateSettle(TransactionBuilder tx, java.lang.Iterable<net.corda.core.contracts.StateAndRef> statesAndRefs, java.lang.Iterable<? extends net.corda.core.contracts.StateAndRef<? extends net.corda.core.contracts.FungibleAsset<P>>> assetStatesAndRefs, MoveCommand moveCommand, Party notary)
statesAndRefs
- a list of state objects, which MUST all have the same aggregate state. This is done as
only a single settlement command can be present in a transaction, to avoid potential problems with allocating
assets to different obligation issuances.assetStatesAndRefs
- a list of fungible asset state objects, which MUST all be of the same issued product.
It is strongly encouraged that these all have the same beneficiary.moveCommand
- the command used to move the asset state objects to their new owner.public <P> java.util.Set<java.security.PublicKey> generateExit(TransactionBuilder tx, Amount<net.corda.core.contracts.Issued> amountIssued, java.util.List<net.corda.core.contracts.StateAndRef> assetStates)
Generate an transaction exiting an obligation from the ledger.
tx
- transaction builder to add states and commands to.amountIssued
- the amount to be exited, represented as a quantity of issued currency.assetStates
- the asset states to take funds from. No checks are done about ownership of these states, it is
the responsibility of the caller to check that they do not exit funds held by others.