Hope
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.

MethodPathPurpose
POST/api/hope-wallet/sessionsCreate { session_id, status: pending }
GET/api/hope-wallet/sessions/:idRow for the SDK poll
DELETE/api/hope-wallet/sessions/:idcancelled
POST/api/hope-wallet/sessions/:id/confirmWallet 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.