@trepa/sdk package for TypeScript and Node. This guide is for integrations that call the HTTP API directly: another language, curl, or your own client.
You use the same API key and wallet private key as SDK-based bots.
Two ideas drive every integration:
- Session cookies after you exchange the API key for a session.
- Create, sign, submit for each on-chain action (predictions, claims, withdrawals).
Session cookies
Authentication always starts by trading your API key for cookies:POST /auth/session with header trepa-api-key returns Set-Cookie headers (no JSON body):
403 or 401 on /auth/*. Call /auth/refresh, refresh your cookie jar, retry.
Create, sign, submit
Authenticated writes always follow the same three steps:- Create:
POSTthe/transactions/...route. Body includes{ transaction, proof }wheretransactionis an unsigned base64VersionedTransaction. - Sign: Deserialize, sign with your wallet key, serialize, base64-encode again.
- Submit:
POSTthe paired/transactions/.../submitroute withsigned_transactionand the originalproof.
Here is one full prediction round-trip in Node:
Node example (prediction)
solders), Rust (solana-sdk), or other stacks you already use.
Next: Rate limits.