Architecture
The relayer
One server route that can submit a fixed list of contract calls.
Allowed calls
POST /api/relay accepts only these functions on the Setlo contract, converts the arguments to the ABI types, rate-limits per IP and per package, and submits. claimFor is not accepted from the browser; payouts are pushed by the server.
fundWithPermit · acceptWithSig · declineWithSig · clientActionWithSig · expirePackage · releaseBalances · claimForDeadlines without a scheduler
Vercel Hobby has no frequent cron, so an open booking page polls /api/deadlines. The server reads the package and the chain clock, and submits expirePackage or the automatic releaseBalances when the contract would allow it.
Reliability
- The relayer tracks its own transaction counter and retries once on a "nonce too low" error, because the RPC can return a stale counter when several transactions go out in a row.
- After a credit, automatic payouts wait until the RPC has reached the crediting block and retry a zero read up to four times before logging that they gave up.