Hope Wallet SDK
Docs
Session API
Four HTTP routes the SDK polls so phone-camera connect can POST proof to your origin.
Implement on the same HTTPS origin as the page. Serverless hosts (Vercel) need a shared store — Redis/KV or Explorer’s hope_wallet_link_* RPCs — not an in-memory Map.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/hope-wallet/sessions | Create { session_id, status: pending } |
| GET | /api/hope-wallet/sessions/:id | Row for the SDK poll |
| DELETE | /api/hope-wallet/sessions/:id | cancelled |
| POST | /api/hope-wallet/sessions/:id/confirm | Wallet posts { session_id, address, pubkey_base64? } |
Poll every 1.5s until status === "connected" or 5 minutes.
This portal implements the four routes. On production they persist through Explorer pairing RPCs so create, phone confirm, and GET can hit different instances.
Copy-paste: package docs/hosted/sessions.ts.
