An open API service indexing awesome lists of open source software.

https://github.com/trepaorg/trepa-sdk

Trepa SDK is the official TypeScript SDK for Trepa.
https://github.com/trepaorg/trepa-sdk

openapi sdk solana trepa typescript

Last synced: 4 days ago
JSON representation

Trepa SDK is the official TypeScript SDK for Trepa.

Awesome Lists containing this project

README

          


Trepa

@trepa/sdk


TypeScript SDK for the Trepa precision-prediction protocol


npm
Node.js
pnpm
TypeScript
Solana mainnet
MIT License


📚 Read the docs →

---

> [!WARNING]
> **Experimental.** The SDK is under active development and has not yet hit a stable release.

## Install

```bash
npm install @trepa/sdk
```

## Quickstart

Put your credentials in a `.env` file (and add it to `.gitignore`):

```sh
TREPA_API_KEY=trp_your_api_key
TREPA_PRIVATE_KEY=your_base58_wallet_private_key
```

Write the bot:

```ts
import { credentialsFromEnv, Trepa } from '@trepa/sdk';

const trepa = new Trepa({
credentials: credentialsFromEnv(),
});

await trepa.bots.run({
predict: (pool) => ({ value: 65_000, stake: pool.min_stake }),
});
```

### Run the bot

```bash
node bot.ts
```

> [!TIP]
> Node.js 22.12 or newer can execute `.ts` entrypoints directly. On older Node versions, compile with `tsc` and run the emitted JavaScript, or use a runner such as `tsx` instead.

Full guides at **[docs.trepa.io/developers](https://docs.trepa.io/developers/introduction)**:

- [Quickstart](https://docs.trepa.io/developers/quickstart)
- [Writing bots](https://docs.trepa.io/developers/writing-bots)
- [SDK reference](https://docs.trepa.io/developers/sdk-reference)

## Examples

- [`examples/workshop`](./examples/workshop)

## License

[MIT](./LICENSE)