Client SDKs
Official Time Seventeen clients for TypeScript, Python and Rust — market data, signed orders, account reads and streaming, with the same methods in each language.
Three small clients wrap the signed order frames, REST and the WebSocket. Each one is tested byte for byte against the official test vectors, so an order it signs is exactly what the exchange verifies.
| Language | Package | Needs |
|---|---|---|
| TypeScript | @t17/sdk | Nothing: fetch, WebCrypto Ed25519 and WebSocket (Node 22+, Deno, Bun, browsers) |
| Python | t17-sdk | cryptography; websockets for streaming (t17-sdk[stream]) |
| Rust | t17-sdk | ed25519-dalek, reqwest (rustls); feature stream for the WebSocket |
Availability
During the testnet the packages are shared by your Time Seventeen contact; they are published to npm, PyPI and crates.io at launch. The wire format they implement is fully documented, so any language works without them.
Connect
The SDKs default to the testnet (https://api-testnet.timeseventeen.com). Pass the account number and the 32-byte private key seed as 64 hex characters — an API key is the usual choice for programs.
import { Client } from "@t17/sdk";
const c = new Client({ account: 1001, privateKey: process.env.T17_KEY, apiKeySlot: 1 });from t17 import Client
c = Client(account=1001, private_key=os.environ["T17_KEY"], api_key_slot=1)let c = t17_sdk::Client::builder().account(1001).private_key(&key)?.api_key_slot(1).build();apiKeySlot puts every nonce on that key’s lanes. Several programs can share one key by each taking its own lane (0–15 within the key’s range). Without an API key the SDK signs with the account key on lane 2.
Trade
const [m] = await c.markets();
const book = await c.book(m.market, 10);
const r = await c.buy(m.market, "Yes", 650_000, 10, { tif: "Ioc" }); // price in ticks: 650,000 = $0.65
const stop = await c.sell(m.market, "Yes", 1, 10, { kind: { Stop: { trigger: 600_000 } }, reduceOnly: true });
await c.cancel(stop.id);
await c.cancelAll(m.market);
const me = await c.getAccount(); // cash, positions, open ordersm = c.markets()[0]
r = c.buy(m["market"], "Yes", 650_000, 10, tif="Ioc")
stop = c.sell(m["market"], "Yes", 1, 10, kind=Stop(600_000), reduce_only=True)
c.cancel(stop["id"])
fills = events(r, "Fill")Every command returns the engine’s answer: {"Applied": {"seq", "events"}} or {"Refused": code}. Events include Accepted, Fill, Done (with a reason such as Filled, Cancelled, IocRemainder) and Rejected (see Errors). submit([...]) sends several commands in one request.
Methods
| Operation | TypeScript | Python | Rust |
|---|---|---|---|
| Markets | markets(), market(id) | markets(), market(id) | markets() |
| Order book | book(id, depth) | book(id, depth) | book(id, depth) |
| Account | getAccount(), openOrders() | get_account(), open_orders() | account() |
| Place | placeOrder, buy, sell | place_order, buy, sell | place_order, buy, sell |
| Order options | tif, postOnly, reduceOnly, kind, oco | tif, post_only, reduce_only, kind, oco | OrderOptions { .. } |
| Cancel, cancel all, amend | cancel, cancelAll, amend | cancel, cancel_all, amend | cancel, cancel_all, amend |
| Several at once | submit([...]) | submit([...]) | submit(&[...]) |
| Stream | stream({ markets, onMessage }) | async for m in c.stream() | stream(markets, channels) |
| New key pair | generateKey() | generate_key() | generate_key() |
The stream subscribes to trades, l2 and bbo for the markets you name (all by default) and, when a key is set, authenticates for your account’s private events — the messages are those of the WebSocket.