@arkane_absolute/sdk
v1.0.7
Published
Arkane SDK for interacting with Arkane API
Readme
Arkane SDK
TypeScript client for the Arkane prediction, trade-decision, and runtime bot APIs.
What it provides
ArkaneClientwith:predict→/predicttradeDecision→/trade-decision?include_intent=1|0botnamespace (status,start,stop,tick,applyLatest,positions,clearPositions,tradeDecision,health)
- Fully typed request/response models (see
src/types/*). - Structured
ArkaneApiErrorwhen the backend returns an error envelope.
How to run
cd sdk
npm install
npm run build- Build output lands in
dist/and is used for publishing.
Usage
import { ArkaneClient, type PredictRequest } from "@arkane_absolute/sdk";
const client = new ArkaneClient({
apiKey: process.env.ARKANE_API_KEY!,
baseUrl: "http://localhost:8080",
});
const payload: PredictRequest = {
pair: {/* PairData */},
timeframe: "1h",
bars: [...],
};
const prediction = await client.predict(payload);
const decision = await client.tradeDecision(payload, true); // include intent
const status = await client.bot.status();Errors
- All methods throw
ArkaneApiErrorwithmessage, optionalcode,status, anddatafrom the server’s{ error: { code, message } }envelope. - Network/unknown errors are wrapped into
ArkaneApiErroras well.
Gotchas
axiosis a peer dependency; install it in the consuming app.- Keep API keys out of source; load from env/secret manager.
- Endpoints are relative to
baseUrlyou pass to the client.
