corda / net.corda.finance.workflows / CommercialPaperUtils

CommercialPaperUtils

object CommercialPaperUtils

Functions

generateIssue

fun generateIssue(issuance: PartyAndReference, faceValue: Amount<Issued<Currency>>, maturityDate: Instant, notary: Party): TransactionBuilder

Returns a transaction that issues commercial paper, owned by the issuing parties key. Does not update an existing transaction because you aren't able to issue multiple pieces of CP in a single transaction at the moment: this restriction is not fundamental and may be lifted later.

generateMove

fun generateMove(tx: TransactionBuilder, paper: StateAndRef<State>, newOwner: AbstractParty): Unit

Updates the given partial transaction with an input/output/command to reassign ownership of the paper.

generateRedeem

fun generateRedeem(tx: TransactionBuilder, paper: StateAndRef<State>, services: ServiceHub, ourIdentity: PartyAndCertificate): Unit

Intended to be called by the issuer of some commercial paper, when an owner has notified us that they wish to redeem the paper. We must therefore send enough money to the key that owns the paper to satisfy the face value, and then ensure the paper is removed from the ledger.

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.