majjha.developers
Open beta

Public beta: activity uses test Dots with no monetary value. There is no money in or out, and interfaces may change before launch.

SDKs

Clients for the hosted majjha beta. TypeScript and Python are pre-release; the Rust SDK is the systems client used by our own services.

Use the pre-release SDKs

Repository checkout
pnpm install --frozen-lockfile
pnpm build:sdk:ts
Python editable install
uv pip install -e ./sdks/python
Rust path dependency
[dependencies]
predictmax = { path = "../predictmax/sdks/rust" }

Not publicly published yet

The reserved package names are @predictmax/sdk, predictmax-client, and predictmax, but registry installs are not available yet. Use a source checkout until this page announces a published release.

Quickstart

TypeScript
import { PredictMaxClient } from "@predictmax/sdk";

const client = new PredictMaxClient({ baseUrl: "https://api.majjha.fun" });
const { markets } = await client.markets.list({ status: "ACTIVE", limit: 5 });
const book = await client.markets.orderbook(markets[0].ticker ?? markets[0].id);
Python
from predictmax import PredictMaxClient

client = PredictMaxClient("https://api.majjha.fun")
markets = client.markets.list(status="ACTIVE", limit=5)["markets"]
book = client.markets.orderbook(markets[0].get("ticker") or markets[0]["id"])
Python async
import asyncio

from predictmax import AsyncPredictMaxClient

async def main() -> None:
    async with AsyncPredictMaxClient("https://api.majjha.fun") as client:
        markets = (await client.markets.list(status="ACTIVE", limit=5))["markets"]
        await client.markets.orderbook(markets[0].get("ticker") or markets[0]["id"])

asyncio.run(main())

Authenticated Calls

Authenticated calls use the same Bearer token as REST. The app obtains it through Dynamic, and local compatibility clients may use password login. Pass the resulting session token into the SDK client.

TypeScript
const authed = new PredictMaxClient({
  baseUrl: "https://api.majjha.fun",
  token,
});

await authed.orders.cancelAll();
Python
authed = PredictMaxClient("https://api.majjha.fun", token=token)
authed.orders.cancel_all()

Approved order-write access

Automated order entry is an approved beta surface. Use the client and onboarding details supplied for your account; public read and order-management helpers remain available from the standard SDK clients.

Generated Clients

The maintained SDKs are the preferred path for REST and WebSocket integrations. For internal tools or languages without a first-party package, generate a client from the live /openapi.json contract.

Fetch the contract
curl https://docs.majjha.fun/openapi.json -o predictmax-openapi.json
TypeScript fetch
npx @openapitools/openapi-generator-cli generate \
  -i predictmax-openapi.json \
  -g typescript-fetch \
  -o ./generated/predictmax-typescript \
  --additional-properties=supportsES6=true,npmName=@your-scope/predictmax-openapi
Python
npx @openapitools/openapi-generator-cli generate \
  -i predictmax-openapi.json \
  -g python \
  -o ./generated/predictmax-python \
  --additional-properties=packageName=predictmax_openapi

Generated-client scope

Generated clients cover the REST contract, standard error responses, auth security schemes, and export media types. Use the first-party SDKs when you need typed decimal handling, higher-level account helpers, or WebSocket frame builders.

Coverage

  • Service status and environment discovery.
  • Search, sports, series, events, markets, order books, trades, holders, and price history.
  • Orders, portfolio, profiles, comments, and account activity.
  • Sync and async Python clients, a TypeScript client, a Rust client, and WebSocket helpers for public market data and sports snapshots.