TorqClient
Create the isomorphic TypeScript client for canonical Torq APIs.
| Package | @torq-finance/sdk |
|---|---|
| Signature | new TorqClient(config: TorqClientConfig) |
Behavior
Configures the API origin, one API-key type, an optional wallet session, fetch, and WebSocket factories. Secret and publishable keys are mutually exclusive.
Example
import { TorqClient } from '@torq-finance/sdk';
const torq = new TorqClient({
baseUrl: 'https://api.torq.finance',
publishableKey: process.env.NEXT_PUBLIC_TORQ_PUBLISHABLE_KEY,
});Security boundary
Keep secret keys server-side. A publishable key is origin-bound and does not replace wallet-session or approved-role checks.
See the API Reference for the governed endpoint contract and the workflow guide for canonical completion semantics.