CommercialPaperUtils
Keywords: net.corda.finance.workflows.CommercialPaperUtils class
Date: 2023-09-18

net.corda.finance.workflows

## Class CommercialPaperUtils

- net.corda.finance.workflows.CommercialPaperUtils

-     public class CommercialPaperUtils

- - ### Field Detail

    - #### INSTANCE

          public static CommercialPaperUtils INSTANCE

  - ### Method Detail

    - #### generateIssue

          @JvmStatic
           @NotNull
          public static TransactionBuilder generateIssue(@NotNull
                                                                              PartyAndReference issuance,
                                                                              @NotNull
                                                                              Amount<net.corda.core.contracts.Issued> faceValue,
                                                                              @NotNull
                                                                              java.time.Instant maturityDate,
                                                                              @NotNull
                                                                              Party notary)

      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

          @JvmStatic
          public static void generateMove(@NotNull
                                                     TransactionBuilder tx,
                                                     @NotNull
                                                     StateAndRef<net.corda.finance.contracts.CommercialPaper.State> paper,
                                                     @NotNull
                                                     AbstractParty newOwner)

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

    - #### generateRedeem

          @JvmStatic
           @Suspendable
          public static void generateRedeem(@NotNull
                                                                     TransactionBuilder tx,
                                                                     @NotNull
                                                                     StateAndRef<net.corda.finance.contracts.CommercialPaper.State> paper,
                                                                     @NotNull
                                                                     ServiceHub services,
                                                                     @NotNull
                                                                     PartyAndCertificate ourIdentity)

      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.

      Throws:
        `InsufficientBalanceException` - if the vault doesn't contain enough money to pay the redeemer.