npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qtsurfer/api-client

v0.1.2

Published

Auto-generated TypeScript API client for the QTSurfer API (from OpenAPI 3.1 spec)

Downloads

200

Readme

@qtsurfer/api-client

Auto-generated TypeScript API client for the QTSurfer API, produced from the OpenAPI 3.1 spec with @hey-api/openapi-ts.

This package is intentionally thin: one function per operation, 1:1 with the spec. For workflow orchestration (polling, retries, domain objects, unified errors), use @qtsurfer/sdk.

  • Tree-shakeable standalone functions.
  • Full type safety for requests, responses, and error shapes.
  • Native fetch based client via @hey-api/client-fetch.
  • Works in Node.js >=20, modern browsers, Deno, and Bun.

Installation

pnpm add @qtsurfer/api-client
# or
npm install @qtsurfer/api-client

Quick start

import { client, getExchanges, prepareBacktesting } from '@qtsurfer/api-client';

client.setConfig({
  baseUrl: 'https://api.qtsurfer.com/v1',
  headers: {
    Authorization: `Bearer ${process.env.QTSURFER_TOKEN}`,
  },
});

const { data: exchanges, error } = await getExchanges();
if (error) throw error;

console.log(exchanges);

API surface

All operations are exported as standalone functions; every operation accepts an Options object and returns { data, error, response }.

| Function | Method | Path | Purpose | | -------- | ------ | ---- | ------- | | getExchanges | GET | /exchanges | List available exchanges | | getInstruments | GET | /exchange/{exchangeId}/instruments | List instruments for an exchange | | getExchangeTickersHour | GET | /exchange/{exchangeId}/tickers/{base}/{quote} | Download one hour of tickers as Lastra/Parquet | | getExchangeKlinesHour | GET | /exchange/{exchangeId}/klines/{base}/{quote} | Download one hour of klines as Lastra/Parquet | | postStrategy | POST | /strategy | Compile a strategy | | getStrategyStatus | GET | /strategy/{strategyId} | Poll strategy compilation status | | prepareBacktesting | POST | /backtesting/prepare | Start a data preparation job | | getPreparationStatus | GET | /backtesting/prepare/{jobId} | Poll preparation status | | executeBacktesting | POST | /backtesting/execute | Start a backtest execution | | cancelExecution | POST | /backtesting/execute/{jobId}/cancel | Cancel a running execution | | getExecutionResult | GET | /backtesting/execute/{jobId} | Poll or fetch execution results |

All generated types (Exchange, InstrumentDetail, BacktestJobResult, ResultMap, etc.) are re-exported from the root.

Configuring the client

The default client points to the staging server. Override via setConfig or by passing options inline:

import { client, getExchanges } from '@qtsurfer/api-client';

// Global
client.setConfig({
  baseUrl: 'https://api.qtsurfer.com/v1',
});

// Per-call
await getExchanges({
  baseUrl: 'https://api.qtsurfer.com/v1',
  headers: { 'X-Request-Id': '...' },
});

To build your own isolated client (e.g. per-tenant), use createClient from @hey-api/client-fetch.

Error handling

Each function returns a discriminated union. Narrow via error before using data:

const { data, error } = await prepareBacktesting({
  body: {
    /* PrepareBacktestingRequest */
  },
});

if (error) {
  console.error(error.code, error.message);
  return;
}

console.log(data.jobId);

Regenerating the client

The src/generated/ directory is a committed artifact produced from the OpenAPI spec hosted at QTSurfer/qtsurfer-api.

pnpm install
pnpm generate   # runs @hey-api/openapi-ts against the remote spec
pnpm lint       # tsc --noEmit
pnpm build      # emits dist/ with .js + .d.ts

Configuration lives in openapi-ts.config.ts. To generate against a local checkout instead, change input to a relative path (e.g. ../qtsurfer-api/openapi.yaml).

Development

| Script | Description | | ------ | ----------- | | pnpm generate | Regenerate the client from the OpenAPI spec | | pnpm lint | Type-check without emitting | | pnpm build | Compile to dist/ |

License

Apache-2.0 — see LICENSE.