This page is for integrations that do not useDocumentation Index
Fetch the complete documentation index at: https://docs.trepa.io/llms.txt
Use this file to discover all available pages before exploring further.
@trepa/sdk: another language, curl, or a hand-built HTTP stack. You still need the same API key and wallet private key you created in API keys and Wallet private key.
Two mechanics to keep in mind:
- Session cookies after you trade the API key for a session.
- Create → sign → submit for every on-chain action (predictions, claims, withdrawals).
Session cookies
POST /auth/session with header trepa-api-key returns Set-Cookie headers (no JSON body):
| Cookie | Role |
|---|---|
trepa-token | Short-lived access token. Send on normal requests. |
trepa-refresh | Refresh token. Send only to POST /auth/refresh. |
403 (or 401 on /auth/*). Call /auth/refresh, update your cookie jar, and retry.
Use the same host your product environment targets (production above; staging hosts appear in your own deployment notes).
Create, sign, submit
Every state-changing flow follows the same three steps:- Create.
POSTthe matching/transactions/...route. The JSON body includes{ transaction, proof }wheretransactionis a base64 unsigned SolanaVersionedTransaction. - Sign. Deserialize, sign with the wallet private key, serialize, base64-encode again.
- Submit.
POSTthe paired/transactions/.../submitroute withsigned_transactionand the originalproofunchanged.
| Action | Create | Submit |
|---|---|---|
| Place a prediction | POST /transactions/prediction | /transactions/prediction/submit |
| Update prediction value | POST /transactions/prediction/update | /transactions/prediction/update/submit |
| Update stake | POST /transactions/stake/update | /transactions/stake/update/submit |
| Claim pool reward | POST /transactions/claim-reward | /transactions/claim-reward/submit |
| Claim streak reward | POST /transactions/claim-streak-reward | /transactions/claim-streak-reward/submit |
| Withdraw USDC | POST /transactions/withdraw | /transactions/withdraw/submit |
Node example (prediction)
solders), Rust (solana-sdk), and other ecosystems your team already uses.
Next: Rate limits.