com.r3corda.demos.api / InterestRateSwapAPI / <init>

# <init>

`InterestRateSwapAPI(services: ServiceHub)`

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).