Skip to content

feat: add chat x402 template#754

Open
PurdueDM wants to merge 2 commits intoMerit-Systems:masterfrom
PurdueDM:feat/chat-x402-template
Open

feat: add chat x402 template#754
PurdueDM wants to merge 2 commits intoMerit-Systems:masterfrom
PurdueDM:feat/chat-x402-template

Conversation

@PurdueDM
Copy link
Copy Markdown

@PurdueDM PurdueDM commented Apr 3, 2026

Adds next-chat-x402 template with auth switcher (Echo credits OR USDC via x402). Reuses chat UI from next-chat, adds wallet components (RainbowKit + wagmi), dual-mode chat, and x402 payment routing in the API. Fixes #610

Adds a new next-chat-x402 template to /templates with:

- Auth switcher: users choose Echo credits or USDC via x402
- Wallet integration via RainbowKit + wagmi for x402 payments
- Dual-mode chat: detects payment method and routes accordingly
- AuthGuard component supporting both Echo sign-in and wallet connect
- x402 payment types and helpers in src/lib/x402.ts
- API route with x402 payment header detection
- Reuses chat UI components from existing next-chat template

Fixes Merit-Systems#610
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 3, 2026

@PurdueDM is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

- Catches malformed JSON with SyntaxError (returns 400)
- Catches streamText failures (returns 500)
- Prevents unhandled exceptions from crashing the route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat x402 template

1 participant