feat: Next.js SIWX multichain own-server example (EVM + Bitcoin + Tron)#207
feat: Next.js SIWX multichain own-server example (EVM + Bitcoin + Tron)#207rtomas wants to merge 1 commit into
Conversation
… Tron)
Adds nextjs/next-siwx-multichain-own-server: a Next.js example that
implements the SIWXConfig interface directly (not DefaultSIWX), so signature
verification and session storage live entirely in this app's API routes.
- /api/siwx/{nonce,verify,sessions,revoke} with HMAC-signed stateless nonces
and a jose JWT in an httpOnly cookie.
- Per-chain server verifiers: viem for eip155, bip322-js for bip122,
tronweb verifyMessageV2 for tron.
- Custom ServerSIWX.signMessage() bypasses the AppKit Tron adapter's stub
(returns '') by calling window.tronWeb.trx.signMessageV2 directly; other
chains delegate to ConnectionController as in DefaultSigner.
- Reuses InformalMessenger from @reown/appkit-siwx for SIWE-style messages.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @rtomas's task in 2m 45s —— View job PR Review
License compliance: ✅ All MIT/Apache-2.0 — no issues Found 6 issue(s)Issue 1: Hardcoded real projectId makes the
|
Summary
Adds
nextjs/next-siwx-multichain-own-server: a Next.js example that implements the SIWXSIWXConfiginterface directly (notDefaultSIWX), so nonce issuance, signature verification, and session storage all live in this app's own API routes — no client-side verifiers run./api/siwx/{nonce,verify,sessions,revoke}with HMAC-signed stateless nonces and ajoseJWT in an httpOnly cookie.viem(eip155),bip322-js(bip122),tronwebverifyMessageV2(tron).ServerSIWX.signMessage()works around AppKit 1.8.20'sTronAdapter.signMessage()stub by callingwindow.tronWeb.trx.signMessageV2directly for Tron; other chains delegate toConnectionControllerlikeDefaultSigner.Test plan