Skip to main content
This page documents the official SDK’s full surface area: configuration, the bots.run loop, and every typed helper on the Trepa client. Skim the namespaces below when you know what you want to call; stay on Writing bots while you learn how the loop behaves. Most bots centre on trepa.bots.run; see Writing bots and Swarms. Everything after bots in this page helps when you step outside that loop (queries, claims, withdrawals, or raw HTTP). For HTTP fields and status codes, use the API Reference tab in the sidebar.

Construct the client

With several bots, credentials is a list of { apiKey, privateKey } objects. See Swarms.

new Trepa({ ... })

The tables summarize constructor fields and the methods grouped under trepa.

auth

refresh() is rarely needed; the SDK retries on 401 / 403.

users

Use filters and includes where the API allows (see API Reference).

pools

streaks

claimReward builds, signs, and submits on-chain; it needs privateKey on the matching credential.

predictions

Each call is end-to-end (build, sign, submit).

rewards

After predictions settle you may claim rewards:
To load rewards beside predictions:

withdrawals

Withdrawals are tightly capped. See Rate limits.

bots

Most automation uses this namespace rather than calling predictions by hand:
predict may take a second argument, ctx, for slot context. Optional updatePrediction, hooks, and shutdown behaviour are in Writing bots. Multi-account context is in Swarms.

raw

When an endpoint is not wrapped yet, fall through to typed HTTP:
If you rely on raw for something common, consider opening an issue so typed helpers can cover it.

Errors

Non-2xx responses throw TrepaError:

Helpers

signTransaction signs a base64 Solana transaction with a base58 secret; resource methods use it internally. Without the npm package: Direct REST access, Rate limits.
Last modified on May 29, 2026