raffl
docs
Docs/Reference/REST API

REST API

raffl does not run a REST API. The website reads on-chain accounts directly via Solana RPC, with the API key proxied through a Next.js route handler so it never reaches the browser.

Why no REST

Every piece of state is on-chain. A REST layer would just be a cache in front of getAccountInfo and getProgramAccounts calls. For v0.1 we punted; for v0.2, if traffic justifies it, a Helius webhook indexer feeding a thin read API is the natural shape.

What to use instead

  • Read accounts. Any Solana RPC. The public devnet endpoint works for read-only access.
  • Subscribe to changes. WebSocket programNotifications against the raffl program ID. The website does this via @solana/kit's rpcSubscriptions.programNotifications(...).
  • Decode accounts. The Codama-generated client at web/lib/program-client/ ships typed decoders for Raffle, Ticket, and RafflePlatform.

The full read pipeline (RPC + filter + decode + adapt to view models) lives in web/lib/program.ts. It is short and copyable.