com.r3corda.demos.api / InterestRateSwapAPI

# InterestRateSwapAPI

`class InterestRateSwapAPI`

This provides a simplified API, currently for demonstration use only.

It provides several JSON REST calls as follows:

GET /api/irs/deals - returns an array of all deals tracked by the wallet of this node. GET /api/irs/deals/{ref} - return the deal referenced by the externally provided refence that was previously uploaded. POST /api/irs/deals - Payload is a JSON formatted InterestRateSwap.State create a new deal (includes an externally provided reference for use above).

TODO: where we currently refer to singular external deal reference, of course this could easily be multiple identifiers e.g. CUSIP, ISIN.

GET /api/irs/demodate - return the current date as viewed by the system in YYYY-MM-DD format. PUT /api/irs/demodate - put date in format YYYY-MM-DD to advance the current date as viewed by the system and simulate any associated business processing (currently fixing).

TODO: replace simulated date advancement with business event based implementation

PUT /api/irs/restart - (empty payload) cause the node to restart for API user emergency use in case any servers become unresponsive, or if the demodate or population of deals should be reset (will only work while persistence is disabled).

### Constructors

<init> | `InterestRateSwapAPI(api: APIServer)` This provides a simplified API, currently for demonstration use only.

### Properties

api | `val api: APIServer`

### Functions

exitServer | `fun exitServer(): <ERROR CLASS>`
fetchDeal | `fun fetchDeal(ref: String): <ERROR CLASS>`
fetchDeals | `fun fetchDeals(): Array<State>`
fetchDemoDate | `fun fetchDemoDate(): LocalDate`
storeDeal | `fun storeDeal(newDeal: State): <ERROR CLASS>`
storeDemoDate | `fun storeDemoDate(newDemoDate: LocalDate): <ERROR CLASS>`