Repository navigation
Phase 4: API routes - #112
Merged
Merged
Conversation
- Sign-in: challenge nonce in a signed cookie, NEP-413 verification (full-access key), HMAC-signed HTTP-only session; page middleware - Routes: onboard (keeper creates the vault once), vault, tokens, funding quote (dry preview or stored attempt), submit-tx, status refreshed from 1Click on read, plan cost preview, buys, CSV export - getServices() seam so tests and demo mode inject their own adapters; clear 503 when real mode isn't configured; rate limits - 16 route tests on the real handlers (84 TS tests total)
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Stack API (ARCHITECTURE §4.1, §6) on top of Phases 2–3.
What changed
GET /api/sessionissues a 32-byte nonce in a signed 5-minute cookie;POSTverifies the NEP-413 signature (must be a full-access key; nonce, message and recipient must match) and sets an HMAC-signed HTTP-only session cookie;DELETEsigns out. Middleware sends signed-out page visits to the landing page.get_vaultfirst), rate-limited.getServices(); tests (and demo mode in Phase 7) inject their own. Missing real-mode config → 503 telling you what to set.Closes #43
Closes #44
Closes #45
Closes #46
Closes #47
Closes #48
Closes #49
Roadmap
Checks
pnpm typecheck,pnpm lint,pnpm buildNEAR HACKATHON rules
SESSION_SECRETrequired in production only