Time SeventeenDocs

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.

LanguagePackageNeeds
TypeScript@t17/sdkNothing: fetch, WebCrypto Ed25519 and WebSocket (Node 22+, Deno, Bun, browsers)
Pythont17-sdkcryptography; websockets for streaming (t17-sdk[stream])
Rustt17-sdked25519-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 orders
m = 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

OperationTypeScriptPythonRust
Marketsmarkets(), market(id)markets(), market(id)markets()
Order bookbook(id, depth)book(id, depth)book(id, depth)
AccountgetAccount(), openOrders()get_account(), open_orders()account()
PlaceplaceOrder, buy, sellplace_order, buy, sellplace_order, buy, sell
Order optionstif, postOnly, reduceOnly, kind, ocotif, post_only, reduce_only, kind, ocoOrderOptions { .. }
Cancel, cancel all, amendcancel, cancelAll, amendcancel, cancel_all, amendcancel, cancel_all, amend
Several at oncesubmit([...])submit([...])submit(&[...])
Streamstream({ markets, onMessage })async for m in c.stream()stream(markets, channels)
New key pairgenerateKey()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.