com.r3corda.contracts

## Package com.r3corda.contracts

### Types

CommercialPaper | `class CommercialPaper : ClauseVerifier`
CommercialPaperLegacy | `class CommercialPaperLegacy : Contract`
Event | `open class Event` Event superclass - everything happens on a date.
FixedRate | `class FixedRate : Rate` A very basic subclass to represent a fixed rate.
FixedRatePaymentEvent | `class FixedRatePaymentEvent : RatePaymentEvent` Basic class for the Fixed Rate Payments on the fixed leg - see RatePaymentEvent. Assumes that the rate is valid.
FloatingRate | `open class FloatingRate : Rate` The parent class of the Floating rate classes.
FloatingRatePaymentEvent | `class FloatingRatePaymentEvent : RatePaymentEvent` Basic class for the Floating Rate Payments on the floating leg - see RatePaymentEvent. If the rate is null returns a zero payment. // TODO: Is this the desired behaviour?
InterestRateSwap | `class InterestRateSwap : ClauseVerifier` The Interest Rate Swap class. For a quick overview of what an IRS is, see here - http://www.pimco.co.uk/EN/Education/Pages/InterestRateSwapsBasics1-08.aspx (no endorsement). This contract has 4 significant data classes within it, the "Common", "Calculation", "FixedLeg" and "FloatingLeg". It also has 4 commands, "Agree", "Fix", "Pay" and "Mature". Currently, we are not interested (excuse pun) in valuing the swap, calculating the PVs, DFs and all that good stuff (soon though). This is just a representation of a vanilla Fixed vs Floating (same currency) IRS in the R3 prototype model.
PaymentEvent | `abstract class PaymentEvent : Event` Top level PaymentEvent class - represents an obligation to pay an amount on a given date, which may be either in the past or the future.
PercentageRatioUnit | `open class PercentageRatioUnit : RatioUnit` A class to reprecent a percentage in an unambiguous way.
Rate | `open class Rate` Parent of the Rate family. Used to denote fixed rates, floating rates, reference rates etc.
RatePaymentEvent | `abstract class RatePaymentEvent : PaymentEvent` A RatePaymentEvent represents a dated obligation of payment. It is a specialisation / modification of a basic cash flow event (to be written) that has some additional assistance functions for interest rate swap legs of the fixed and floating nature. For the fixed leg, the rate is already known at creation and therefore the flows can be pre-determined. For the floating leg, the rate refers to a reference rate which is to be "fixed" at a point in the future.
RatioUnit | `open class RatioUnit` A utility class to prevent the various mixups between percentages, decimals, bips etc.
ReferenceRate | `class ReferenceRate : FloatingRate` So a reference rate is a rate that takes its value from a source at a given date e.g. LIBOR 6M as of 17 March 2016. Hence it requires a source (name) and a value date in the getAsOf(..) method.
UnknownType | `open class UnknownType`

### Extensions for External Classes

kotlin.Int |
kotlin.String |

### Properties

CP_LEGACY_PROGRAM_ID | `val CP_LEGACY_PROGRAM_ID: CommercialPaperLegacy` Legacy version of CommercialPaper that includes the full verification logic itself, rather than breaking it into clauses. This is here just as an example for the contract tutorial.
CP_PROGRAM_ID | `val CP_PROGRAM_ID: CommercialPaper` This is an ultra-trivial implementation of commercial paper, which is essentially a simpler version of a corporate bond. It can be seen as a company-specific currency. A company issues CP with a particular face value, say $100, but sells it for less, say $90. The paper can be redeemed for cash at a given date in the future. Thus this example would have a 10% interest rate with a single repayment. Commercial paper is often rolled over (the maturity date is adjusted as if the paper was redeemed and immediately repurchased, but without having to front the cash).
IRS_PROGRAM_ID | `val IRS_PROGRAM_ID: InterestRateSwap`

### Functions

exportIRSToCSV | `fun State.exportIRSToCSV(): String`
owned by | `infix fun State.owned by(owner: PublicKey): State` `infix fun <ERROR CLASS>.owned by(newOwner: PublicKey): <ERROR CLASS>`
times | `operator fun Amount<Currency>.times(other: RatioUnit): Amount<Currency>`
with notary | `infix fun State.with notary(notary: Party): TransactionState<State>`