The Proof Trading SDK is available for TypeScript/Node.js, Python, and Rust. All three language bindings share the same wire protocol and devnet defaults, so you can freely mix them in a multi-service architecture. This page covers everything you need to get a working installation verified against the public devnet.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Proof-labs/trading-sdk/llms.txt
Use this file to discover all available pages before exploring further.
TypeScript / Node.js
Install the package
@proof/trading-sdk. It ships as a pre-built ESM bundle (dist/index.js) with bundled TypeScript declarations (dist/index.d.ts).
Runtime requirements
| Requirement | Minimum version | Notes |
|---|---|---|
| Node.js | 18 | Required for native fetch, crypto.getRandomValues, and WebSocket. |
| TypeScript | 6.0 | tsconfig devDependency in the SDK’s own package.json. |
| Module system | ESM | Set "type": "module" in your package.json. |
"type": "module", your project must also be an ESM module. Add the following to your package.json if it is not already present:
CommonJS (
require()) is not supported. If you are working in a CJS codebase, use a dynamic import() at the call site, or migrate to ESM top-level imports.Verify your installation
ImportExchangeClient, connect to the devnet, and call queryHealth(). This makes a single HTTP request to https://api.dev.proof.trade/health and confirms that your environment can reach the gateway:
tsx (no build step required):
{ status: "ok", height: <number> } confirms end-to-end connectivity.
Python
Install the Python package from PyPI:python/pyproject.toml in the SDK repository.
If a pre-compiled wheel is not available for your platform,
pip will attempt to build from source. In that case you need a Rust toolchain (rustup toolchain install stable) and the maturin build backend installed.Rust
Add the crate to yourCargo.toml:
crates/proof-trading-sdk in the SDK monorepo and is published to crates.io. It is the canonical implementation that both the TypeScript and Python bindings are built on top of.
Devnet configuration
The SDK ships with the following devnet defaults. No configuration is required to connect to the public devnet:| Parameter | Default value | Environment variable |
|---|---|---|
| Gateway URL | https://api.dev.proof.trade | PROOF_GATEWAY_URL |
| Chain ID | exchange-devnet-1 | PROOF_CHAIN_ID |
| Faucet URL | https://faucet.dev.proof.trade | PROOF_FAUCET_URL |
chainId:
Local stack configuration
When running a local development stack (CometBFT node + exchange API + gateway), point each URL at your local services:ExchangeClientOptions:
Always pin
chainId explicitly in production and CI environments. When chainId is omitted, the SDK auto-resolves it from the CometBFT /status endpoint at startup. Pinning it ensures signatures are deterministic across builds and prevents subtle cross-chain replay issues if the auto-resolved value changes.ExchangeClientOptions reference
| Option | Type | Default | Description |
|---|---|---|---|
rpcUrl | string | https://api.dev.proof.trade | CometBFT RPC endpoint for block queries. |
apiUrl | string | https://api.dev.proof.trade | Exchange query API for orderbooks, accounts, tickers. |
gatewayUrl | string | https://api.dev.proof.trade | Gateway endpoint for POST /exchange tx submission. |
chainId | string | "exchange-devnet-1" | Chain ID embedded in every transaction signature. |
useGateway | boolean | true | Route transactions through gateway rather than direct CometBFT broadcast. |
apiKey | string | — | Bearer token for gateway endpoints that require auth. |