TypeScript SDK
Status: Coming soon. The official TypeScript SDK is under development. Use the REST API + viem directly in the meantime.
Planned
Section titled “Planned”npm install @predix/sdkimport { PrediXClient } from '@predix/sdk';
const client = new PrediXClient({ chain: 'beta', // 'beta' | 'production' rpcUrl: 'https://mainnet.unichain.org',});
// Marketsconst markets = await client.markets.list({ status: 'active' });const market = await client.markets.get(1);
// Tradingconst quote = await client.trade.quote('buyYes', 1, '100');const tx = await client.trade.buyYes(1, '100', { slippage: 50 });
// Portfolioconst positions = await client.portfolio.get('0x...');
// WebSocketclient.ws.subscribe('orderbook', { marketId: 1 });client.ws.on('data', (msg) => console.log(msg));Current alternative
Section titled “Current alternative”Use viem directly with Router contract:
-> API reference - REST endpoints via fetch