Marketplace →
SDK Reference

TypeScript SDK (@ttx/sdk)

The official strongly-typed TypeScript SDK for TTX Charts, Script Studio, and Marketplace.


Installation

npm install @ttx/sdk

Client Initialization

import { TtxDeveloperClient } from '@ttx/sdk'; const client = new TtxDeveloperClient({ apiKey: process.env.TTX_API_KEY, baseUrl: 'https://api.ttx.trade/api/v1', timeoutMs: 10000, maxRetries: 3 });

Marketplace Integration Methods

// Browse published products

const products = await client.listMarketplaceProducts({ category: 'order-flow' });

// Get single product

const product = await client.getMarketplaceProduct('ttx-orderflow-footprint');

// Install product into personal library

const install = await client.installMarketplaceProduct(product.id);

Error Handling

import { TtxDeveloperError } from '@ttx/sdk'; try { await client.getProfile(); } catch (err) { if (err instanceof TtxDeveloperError) { console.error(`TTX Error (${err.code}): ${err.message}`); } }