Skip to main content

API Endpoints

Frontend proxy routes

The frontend lives in app/src/app/api/. All browser → backend traffic goes through these routes (Canton has no CORS).

RouteProxies toPurpose
/api/ledger/*Canton JSON API at <org.ledgerUrl>All ledger reads/writes; forwards Authorization: Bearer <jwt>
/api/oracle/[...path]oracle.url (default http://localhost:3001)Curve fetch, pricing inputs, health
/api/configlocal irsforge.yaml resolutionBootstrap config for the frontend

/api/ledger

Mirrors Canton's JSON API. Common shapes:

In network topology the browser client sends X-Irsforge-Org: <orgId> so the proxy can select the matching orgs[].ledgerUrl. Omitting that header is only allowed in sandbox topology, where the proxy falls back to orgs[0].ledgerUrl for pre-login/bootstrap calls.

Canton endpointUse
POST /v1/queryRead ACS — Map k v returns as [[k,v],...], not a Record
POST /v1/exerciseRun a choice — response is {result: {exerciseResult, events}, status}
POST /v1/createCreate a contract
WS /v1/stream/queryLive updates

Daml tuples come back as {_1, _2} records in JSON, not arrays — destructure accordingly.

/api/oracle/[...path]

GET-only pass-through to oracle.url (app/src/app/api/oracle/[...path]/route.ts). The proxy prepends /api/ to the forwarded path, so browser requests to /api/oracle/health hit the oracle's /api/health. For the actual route list see Oracle HTTP API below.

/api/config

Returns the resolved config the frontend needs (party list, observables, currencies, indices, csa params). Sourced from shared-config — never directly from irsforge.yaml to avoid leaking server-side paths.

Oracle HTTP API

Default port 3001 (configurable via oracle.url). Routes live in oracle/src/api/server.ts.

EndpointPurpose
GET /api/healthLiveness + mode. Proxied to the browser as /api/oracle/health
POST /api/publish-curvePublish a curve to the ledger (pillars + metadata)
POST /api/publish-ratePublish a single floating-rate observation
POST /api/fetch-sofrPull SOFR from the configured provider (NY Fed in demo)

Pricing, fixings and curve reads happen on-ledger — the frontend queries the Canton JSON API directly via /api/ledger rather than a dedicated oracle HTTP endpoint. See Canton oracle model.

Auth service

Default port 3002 (configurable via auth.builtin.port; browser-facing origin is platform.authPublicUrl). Routes live in auth/src/index.ts. Only runs when auth.provider is builtin or oidc — it exits on startup when provider: demo.

EndpointMethodPurpose
GET /.well-known/jwks.jsonGETJWKS — Canton sandbox is started with --auth=rs-256-jwks=<this>
GET /auth/healthGETLiveness + active provider
POST /auth/loginPOSTExchange party credentials for a JWT (builtin mode)
GET /auth/authorizeGETOIDC authorization redirect (oidc mode)
GET /auth/callbackGETOIDC callback → stores token + redirects to frontend
POST /auth/handoffPOSTBridge token from /auth/callback (server) to the SPA
POST /auth/refreshPOSTRefresh an access token
POST /auth/oauth/tokenPOSTOAuth2 client-credentials token endpoint for configured service accounts
POST /auth/logoutPOSTRevoke the active session

There is no generic POST /token endpoint and no locally-served /.well-known/openid-configuration. Human OIDC discovery comes from the upstream IdP; service accounts use IRSForge's explicit /auth/oauth/token endpoint.