@trepaorg/trepa-client
v0.3.0
Published
Client for Trepa bot integration
Readme
@trepaorg/client
Node.js client for the Trepa API.
Installation
pnpm add @trepaorg/clientnpm and yarn are also supported. No .npmrc or registry config required.
Usage
import { createClient } from "@trepaorg/client";
const client = await createClient(process.env.TREPA_API_URL, process.env.TREPA_API_KEY);
const pools = await client.getPools();
const pool = await client.getPool(pools[0].id);
// Create and submit a prediction (sign with your wallet, then submit)
const { transaction, proof } = await client.createPrediction({
pool_id: pool.id,
stake: 1.0,
value: 50_000,
});
// ... sign transaction with @solana/web3.js, then:
await client.submitPrediction({
pool_id: pool.id,
signed_transaction: serializedTx,
proof,
});