Most automation stays onDocumentation 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.bots.run. The tables below are for everything else: manual prediction calls, rewards, withdrawals, raw HTTP, and configuration you rarely touch on day one.
Multiple bots in one process (see Swarms) mean several { apiKey, privateKey } entries inside credentials. For full HTTP field lists, open the API Reference tab in the sidebar.
The client
Trepa configuration
new Trepa({ ... }) accepts:
| Field | Purpose |
|---|---|
credentials | List of { apiKey, privateKey }. One bot per entry when using bots.run. |
baseUrl | Trepa API origin (defaults to production). |
solanaRpcUrl | Solana HTTPS RPC URL for on-chain helpers. Defaults to https://api.mainnet-beta.solana.com. |
solanaRpcSubscriptionsUrl | Solana WebSocket RPC URL. Defaults to wss://api.mainnet-beta.solana.com. |
| Namespace | Purpose |
|---|---|
trepa.bots | Primary: prediction loop with predict and optional hooks. |
trepa.auth | Current user, refresh, logout. |
trepa.users | Profiles, predictions, statistics, portfolios. |
trepa.pools | List and fetch pools. |
trepa.streaks | Bitcoin streak helpers, pool details, streak rewards. |
trepa.predictions | Create, update value, update stake (outside bots.run if you build your own flow). |
trepa.rewards | Claim pool payouts. |
trepa.withdrawals | Send USDC to an external wallet. |
trepa.raw | Typed HTTP escape hatch with the same auth jar. |
auth
refresh() is rarely needed. The SDK refreshes on 401 / 403 automatically.
users
includes in the second argument where the API supports them (see API Reference).
pools
streaks
claimReward builds, signs, and submits on-chain work. It needs privateKey on the matching credential.
predictions
privateKey on the credential.
rewards
includes on the predictions query:
withdrawals
bots
predict can take (pool, ctx). Hooks onStart, onPredicted, onPoolSkipped, onError are documented in Writing bots. Multi-account ctx details are in Swarms.
raw
raw for something common is a good reason to open an issue so the typed helpers can grow.
Errors
Non-2xx responses throwTrepaError:
Helpers
signTransaction signs a base64 Solana transaction with a base58 secret key. Resource methods call it internally.
Next: Direct REST access.