@qtsurfer/api-client 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +138 -14
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +148 -12
- package/src/generated/sdk.gen.ts +22 -2
- package/src/generated/types.gen.ts +132 -11
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,65 @@ type ResponseError = {
|
|
|
19
19
|
*/
|
|
20
20
|
type Instrument = string;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* HAL-style response envelope for the instruments listing
|
|
23
|
+
*/
|
|
24
|
+
type InstrumentListResponse = {
|
|
25
|
+
/**
|
|
26
|
+
* The list of instruments for the segment
|
|
27
|
+
*/
|
|
28
|
+
data: Array<InstrumentDetail>;
|
|
29
|
+
meta: InstrumentListMeta;
|
|
30
|
+
_links: InstrumentLinks;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Metadata describing the instruments listing
|
|
34
|
+
*/
|
|
35
|
+
type InstrumentListMeta = {
|
|
36
|
+
/**
|
|
37
|
+
* When this listing was last refreshed
|
|
38
|
+
*/
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
/**
|
|
41
|
+
* The exchange the instruments belong to
|
|
42
|
+
*/
|
|
43
|
+
exchange: string;
|
|
44
|
+
/**
|
|
45
|
+
* The market segment served in `data`
|
|
46
|
+
*/
|
|
47
|
+
segment: 'spot' | 'futures';
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* HAL `_links` — segment discovery for the instruments listing
|
|
51
|
+
*/
|
|
52
|
+
type InstrumentLinks = {
|
|
53
|
+
/**
|
|
54
|
+
* Link to this listing
|
|
55
|
+
*/
|
|
56
|
+
self: HalLink;
|
|
57
|
+
/**
|
|
58
|
+
* Link to the spot instruments listing. Present when the exchange has a spot segment.
|
|
59
|
+
*/
|
|
60
|
+
spot?: HalLink;
|
|
61
|
+
/**
|
|
62
|
+
* Link to the futures instruments listing. Present only when the exchange has a futures segment.
|
|
63
|
+
*/
|
|
64
|
+
futures?: HalLink;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* A HAL link object (Hypertext Application Language)
|
|
68
|
+
*/
|
|
69
|
+
type HalLink = {
|
|
70
|
+
/**
|
|
71
|
+
* The link target as an absolute-path URI reference (resolve against the API base). A URI Template (RFC 6570) when `templated` is true.
|
|
72
|
+
*/
|
|
73
|
+
href: string;
|
|
74
|
+
/**
|
|
75
|
+
* True when `href` is an RFC 6570 URI Template.
|
|
76
|
+
*/
|
|
77
|
+
templated?: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Exchange instrument with per-data-type coverage and market info
|
|
23
81
|
*/
|
|
24
82
|
type InstrumentDetail = {
|
|
25
83
|
/**
|
|
@@ -34,14 +92,7 @@ type InstrumentDetail = {
|
|
|
34
92
|
* Quote currency
|
|
35
93
|
*/
|
|
36
94
|
quote: string;
|
|
37
|
-
|
|
38
|
-
* Earliest timestamp with quality-verified data available for backtesting
|
|
39
|
-
*/
|
|
40
|
-
dataFrom?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Latest timestamp with quality-verified data available for backtesting
|
|
43
|
-
*/
|
|
44
|
-
dataTo?: string;
|
|
95
|
+
coverage?: InstrumentCoverage;
|
|
45
96
|
/**
|
|
46
97
|
* Last traded price
|
|
47
98
|
*/
|
|
@@ -51,6 +102,36 @@ type InstrumentDetail = {
|
|
|
51
102
|
*/
|
|
52
103
|
volume24h?: number;
|
|
53
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Time coverage of available data for this instrument, per data type
|
|
107
|
+
*/
|
|
108
|
+
type InstrumentCoverage = {
|
|
109
|
+
/**
|
|
110
|
+
* Coverage of ticker data
|
|
111
|
+
*/
|
|
112
|
+
tickers?: CoverageWindow;
|
|
113
|
+
/**
|
|
114
|
+
* Coverage of kline (candlestick) data
|
|
115
|
+
*/
|
|
116
|
+
klines?: CoverageWindow;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* The time range of available data for a single data type
|
|
120
|
+
*/
|
|
121
|
+
type CoverageWindow = {
|
|
122
|
+
/**
|
|
123
|
+
* Earliest timestamp with data available
|
|
124
|
+
*/
|
|
125
|
+
from?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Latest timestamp with data available
|
|
128
|
+
*/
|
|
129
|
+
to?: string;
|
|
130
|
+
/**
|
|
131
|
+
* If the instrument stopped producing this data type (delisted/inactive), the timestamp it went inactive. Optional — omitted while the instrument is active.
|
|
132
|
+
*/
|
|
133
|
+
inactiveSince?: string;
|
|
134
|
+
};
|
|
54
135
|
/**
|
|
55
136
|
* Exchange service provider
|
|
56
137
|
*/
|
|
@@ -321,11 +402,40 @@ type GetInstrumentsErrors = {
|
|
|
321
402
|
type GetInstrumentsError = GetInstrumentsErrors[keyof GetInstrumentsErrors];
|
|
322
403
|
type GetInstrumentsResponses = {
|
|
323
404
|
/**
|
|
324
|
-
*
|
|
405
|
+
* The default (spot) segment's instruments in `data`, `meta`, and HAL `_links` (self + spot/futures segment discovery)
|
|
325
406
|
*/
|
|
326
|
-
200:
|
|
407
|
+
200: InstrumentListResponse;
|
|
327
408
|
};
|
|
328
409
|
type GetInstrumentsResponse = GetInstrumentsResponses[keyof GetInstrumentsResponses];
|
|
410
|
+
type GetSegmentInstrumentsData = {
|
|
411
|
+
body?: never;
|
|
412
|
+
path: {
|
|
413
|
+
/**
|
|
414
|
+
* ID of the exchange to retrieve instruments for
|
|
415
|
+
*/
|
|
416
|
+
exchangeId: string;
|
|
417
|
+
/**
|
|
418
|
+
* Market segment to list instruments for
|
|
419
|
+
*/
|
|
420
|
+
segment: 'spot' | 'futures';
|
|
421
|
+
};
|
|
422
|
+
query?: never;
|
|
423
|
+
url: '/exchange/{exchangeId}/{segment}/instruments';
|
|
424
|
+
};
|
|
425
|
+
type GetSegmentInstrumentsErrors = {
|
|
426
|
+
/**
|
|
427
|
+
* Exchange, segment, or instrument catalog not found
|
|
428
|
+
*/
|
|
429
|
+
404: ResponseError;
|
|
430
|
+
};
|
|
431
|
+
type GetSegmentInstrumentsError = GetSegmentInstrumentsErrors[keyof GetSegmentInstrumentsErrors];
|
|
432
|
+
type GetSegmentInstrumentsResponses = {
|
|
433
|
+
/**
|
|
434
|
+
* An object with a `data` array of instrument details (each with per-data-type coverage) and a `meta` block
|
|
435
|
+
*/
|
|
436
|
+
200: InstrumentListResponse;
|
|
437
|
+
};
|
|
438
|
+
type GetSegmentInstrumentsResponse = GetSegmentInstrumentsResponses[keyof GetSegmentInstrumentsResponses];
|
|
329
439
|
type GetExchangeTickersHourData = {
|
|
330
440
|
body?: never;
|
|
331
441
|
path: {
|
|
@@ -775,9 +885,23 @@ declare const auth: <ThrowOnError extends boolean = false>(options?: Options<Aut
|
|
|
775
885
|
*/
|
|
776
886
|
declare const getExchanges: <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Exchange[], unknown, ThrowOnError>;
|
|
777
887
|
/**
|
|
778
|
-
* Get
|
|
888
|
+
* Get an exchange's instruments (default spot segment)
|
|
889
|
+
* "Give me binance instruments" — returns the exchange's DEFAULT segment (`spot`)
|
|
890
|
+
* in `data`, each instrument with per-data-type coverage and market info. `meta`
|
|
891
|
+
* confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the
|
|
892
|
+
* `spot` / `futures` segment-discovery links.
|
|
893
|
+
*
|
|
894
|
+
*/
|
|
895
|
+
declare const getInstruments: <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
|
|
896
|
+
/**
|
|
897
|
+
* Get the instruments for a specific exchange segment
|
|
898
|
+
* Returns the instruments for one market segment of the exchange, each with
|
|
899
|
+
* per-data-type coverage and market info. HAL `_links` carry `self` plus the
|
|
900
|
+
* `spot` / `futures` segment-discovery links; the default-segment shortcut is
|
|
901
|
+
* `GET /exchange/{exchangeId}/instruments` (spot).
|
|
902
|
+
*
|
|
779
903
|
*/
|
|
780
|
-
declare const
|
|
904
|
+
declare const getSegmentInstruments: <ThrowOnError extends boolean = false>(options: Options<GetSegmentInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
|
|
781
905
|
/**
|
|
782
906
|
* Download one hour of tickers for an instrument as a Lastra segment
|
|
783
907
|
* Serves exactly one hour of raw ticker data for the given instrument on the
|
|
@@ -901,4 +1025,4 @@ declare const getExecutionResult: <ThrowOnError extends boolean = false>(options
|
|
|
901
1025
|
|
|
902
1026
|
declare const client: _hey_api_client_fetch.Client;
|
|
903
1027
|
|
|
904
|
-
export { type AcceptedJob, type AuthData, type AuthError, type AuthErrors, type AuthResponse, type AuthResponses, type AuthTokenError, type AuthTokenResponse, type BacktestJobResult, type CancelExecutionData, type CancelExecutionError, type CancelExecutionErrors, type CancelExecutionResponse, type CancelExecutionResponses, type ClientOptions, type DataSourceType, type EquityPoint, type Exchange, type ExecuteBacktestingData, type ExecuteBacktestingError, type ExecuteBacktestingErrors, type ExecuteBacktestingResponse, type ExecuteBacktestingResponses, type GetExchangeKlinesHourData, type GetExchangeKlinesHourError, type GetExchangeKlinesHourErrors, type GetExchangeKlinesHourResponse, type GetExchangeKlinesHourResponses, type GetExchangeTickersHourData, type GetExchangeTickersHourError, type GetExchangeTickersHourErrors, type GetExchangeTickersHourResponse, type GetExchangeTickersHourResponses, type GetExchangesData, type GetExchangesResponse, type GetExchangesResponses, type GetExecutionResultData, type GetExecutionResultError, type GetExecutionResultErrors, type GetExecutionResultResponse, type GetExecutionResultResponses, type GetInstrumentsData, type GetInstrumentsError, type GetInstrumentsErrors, type GetInstrumentsResponse, type GetInstrumentsResponses, type GetPreparationStatusData, type GetPreparationStatusError, type GetPreparationStatusErrors, type GetPreparationStatusResponse, type GetPreparationStatusResponses, type GetStrategyStatusData, type GetStrategyStatusError, type GetStrategyStatusErrors, type GetStrategyStatusResponse, type GetStrategyStatusResponses, type Instrument, type InstrumentDetail, type JobState, type Options, type PostStrategyData, type PostStrategyError, type PostStrategyErrors, type PostStrategyResponse, type PostStrategyResponses, type PrepareBacktestingData, type PrepareBacktestingError, type PrepareBacktestingErrors, type PrepareBacktestingResponse, type PrepareBacktestingResponses, type ResponseError, type ResultMap, type StrategyId, auth, cancelExecution, client, executeBacktesting, getExchangeKlinesHour, getExchangeTickersHour, getExchanges, getExecutionResult, getInstruments, getPreparationStatus, getStrategyStatus, postStrategy, prepareBacktesting };
|
|
1028
|
+
export { type AcceptedJob, type AuthData, type AuthError, type AuthErrors, type AuthResponse, type AuthResponses, type AuthTokenError, type AuthTokenResponse, type BacktestJobResult, type CancelExecutionData, type CancelExecutionError, type CancelExecutionErrors, type CancelExecutionResponse, type CancelExecutionResponses, type ClientOptions, type CoverageWindow, type DataSourceType, type EquityPoint, type Exchange, type ExecuteBacktestingData, type ExecuteBacktestingError, type ExecuteBacktestingErrors, type ExecuteBacktestingResponse, type ExecuteBacktestingResponses, type GetExchangeKlinesHourData, type GetExchangeKlinesHourError, type GetExchangeKlinesHourErrors, type GetExchangeKlinesHourResponse, type GetExchangeKlinesHourResponses, type GetExchangeTickersHourData, type GetExchangeTickersHourError, type GetExchangeTickersHourErrors, type GetExchangeTickersHourResponse, type GetExchangeTickersHourResponses, type GetExchangesData, type GetExchangesResponse, type GetExchangesResponses, type GetExecutionResultData, type GetExecutionResultError, type GetExecutionResultErrors, type GetExecutionResultResponse, type GetExecutionResultResponses, type GetInstrumentsData, type GetInstrumentsError, type GetInstrumentsErrors, type GetInstrumentsResponse, type GetInstrumentsResponses, type GetPreparationStatusData, type GetPreparationStatusError, type GetPreparationStatusErrors, type GetPreparationStatusResponse, type GetPreparationStatusResponses, type GetSegmentInstrumentsData, type GetSegmentInstrumentsError, type GetSegmentInstrumentsErrors, type GetSegmentInstrumentsResponse, type GetSegmentInstrumentsResponses, type GetStrategyStatusData, type GetStrategyStatusError, type GetStrategyStatusErrors, type GetStrategyStatusResponse, type GetStrategyStatusResponses, type HalLink, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type Options, type PostStrategyData, type PostStrategyError, type PostStrategyErrors, type PostStrategyResponse, type PostStrategyResponses, type PrepareBacktestingData, type PrepareBacktestingError, type PrepareBacktestingErrors, type PrepareBacktestingResponse, type PrepareBacktestingResponses, type ResponseError, type ResultMap, type StrategyId, auth, cancelExecution, client, executeBacktesting, getExchangeKlinesHour, getExchangeTickersHour, getExchanges, getExecutionResult, getInstruments, getPreparationStatus, getSegmentInstruments, getStrategyStatus, postStrategy, prepareBacktesting };
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,12 @@ var getInstruments = (options) => {
|
|
|
29
29
|
...options
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
+
var getSegmentInstruments = (options) => {
|
|
33
|
+
return (options.client ?? client).get({
|
|
34
|
+
url: "/exchange/{exchangeId}/{segment}/instruments",
|
|
35
|
+
...options
|
|
36
|
+
});
|
|
37
|
+
};
|
|
32
38
|
var getExchangeTickersHour = (options) => {
|
|
33
39
|
return (options.client ?? client).get({
|
|
34
40
|
url: "/exchange/{exchangeId}/tickers/{base}/{quote}",
|
|
@@ -149,6 +155,7 @@ export {
|
|
|
149
155
|
getExecutionResult,
|
|
150
156
|
getInstruments,
|
|
151
157
|
getPreparationStatus,
|
|
158
|
+
getSegmentInstruments,
|
|
152
159
|
getStrategyStatus,
|
|
153
160
|
postStrategy,
|
|
154
161
|
prepareBacktesting
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ClientOptions } from './types.gen';\nimport { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions>({\n baseUrl: 'https://api.staging.qtsurfer.com/v1'\n}));","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';\nimport type { AuthData, AuthResponse, AuthError, GetExchangesData, GetExchangesResponse, GetInstrumentsData, GetInstrumentsResponse, GetInstrumentsError, GetExchangeTickersHourData, GetExchangeTickersHourResponse, GetExchangeTickersHourError, GetExchangeKlinesHourData, GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, PostStrategyData, PostStrategyResponse, PostStrategyError, GetStrategyStatusData, GetStrategyStatusResponse, GetStrategyStatusError, PrepareBacktestingData, PrepareBacktestingResponse, PrepareBacktestingError, GetPreparationStatusData, GetPreparationStatusResponse, GetPreparationStatusError, ExecuteBacktestingData, ExecuteBacktestingResponse, ExecuteBacktestingError, CancelExecutionData, CancelExecutionResponse, CancelExecutionError, GetExecutionResultData, GetExecutionResultResponse, GetExecutionResultError } from './types.gen';\nimport { client as _heyApiClient } from './client.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Exchange API key for a short-lived JWT\n * Exchanges a long-lived API key for a short-lived JWT used by every other\n * endpoint. This is the only endpoint that accepts an API key directly —\n * callers should obtain a JWT here, then send it as `Authorization: Bearer\n * <token>` to all other operations.\n *\n * The returned JWT carries the caller's subscription `tier` as a claim and\n * expires after `expires_in` seconds. Callers should refresh the token\n * before expiry (or on a `401` response) by calling this endpoint again.\n *\n */\nexport const auth = <ThrowOnError extends boolean = false>(options?: Options<AuthData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).post<AuthResponse, AuthError, ThrowOnError>({\n security: [\n {\n name: 'X-API-Key',\n type: 'apiKey'\n }\n ],\n url: '/auth/token',\n ...options\n });\n};\n\n/**\n * Get a list of available exchanges\n */\nexport const getExchanges = <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).get<GetExchangesResponse, unknown, ThrowOnError>({\n url: '/exchanges',\n ...options\n });\n};\n\n/**\n * Get a list of Instruments from a specific exchange\n */\nexport const getInstruments = <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetInstrumentsResponse, GetInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/instruments',\n ...options\n });\n};\n\n/**\n * Download one hour of tickers for an instrument as a Lastra segment\n * Serves exactly one hour of raw ticker data for the given instrument on the\n * requested exchange. The payload is a native [Lastra](https://github.com/QTSurfer/lastra-java)\n * file — QTSurfer's columnar format for tick-precision timeseries — with\n * no JSON envelope.\n *\n * One segment = one hour, aligned to UTC. The `hour` query parameter selects\n * the segment and must match `YYYY-MM-DDTHH` (no minutes/seconds, no timezone\n * suffix). Example: `hour=2026-01-15T10` returns `h10.lastra` for\n * 2026-01-15, covering `[10:00:00Z, 11:00:00Z)`. Hours not yet available\n * return `404`.\n *\n * A `format=parquet` query parameter switches the response to on-the-fly\n * Parquet conversion via [lastra-convert](https://github.com/QTSurfer/lastra-convert)\n * for clients that don't yet read Lastra. Lastra is the primary format\n * and cheaper when the client can consume it.\n *\n * Clients:\n * - [lastra-java](https://github.com/QTSurfer/lastra-java) — reference\n * Java reader/writer with per-column codecs (ALP, Gorilla, delta-varint,\n * ZSTD) and CRC32 integrity.\n * - [lastra-ts](https://github.com/QTSurfer/lastra-ts) — TypeScript reader\n * (~4 kB bundle, browser + Node.js).\n * - [duckdb-lastra](https://github.com/QTSurfer/duckdb-lastra) — DuckDB\n * extension for ad-hoc SQL over Lastra files.\n * - [lastra-convert](https://github.com/QTSurfer/lastra-convert) — CLI + Java\n * API for converting to/from Parquet, Reef, and CSV.\n * - `curl -OJ` for offline dumps (the `Content-Disposition` header sets a\n * descriptive filename).\n *\n */\nexport const getExchangeTickersHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeTickersHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeTickersHourResponse, GetExchangeTickersHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/tickers/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Download one hour of klines for an instrument as a Lastra segment\n * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,\n * but serves klines (aggregated bars) instead of raw ticks. One\n * [Lastra](https://github.com/QTSurfer/lastra-java) segment = one hour of\n * klines at the exchange's native kline cadence, aligned to UTC.\n *\n * Klines use the same columnar layout as tickers — readers that handle one\n * format read the other with the same code. Use this endpoint when a\n * per-tick payload would be too large for the window of interest.\n *\n */\nexport const getExchangeKlinesHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeKlinesHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/klines/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Compile a strategy from source code\n * Submits raw strategy source for compilation. By default the call is synchronous and returns\n * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue\n * the compile task and return immediately with a `jobId` — poll\n * `GET /strategy/{strategyId}` to check status.\n *\n * The `strategyId` is deterministic: the same source for the same user always produces the\n * same id.\n *\n */\nexport const postStrategy = <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PostStrategyResponse, PostStrategyError, ThrowOnError>({\n bodySerializer: null,\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy',\n ...options,\n headers: {\n 'Content-Type': 'text/plain',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of an async compile task\n * Polls the status of a strategy compilation. Useful when the strategy was submitted with\n * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.\n *\n */\nexport const getStrategyStatus = <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetStrategyStatusResponse, GetStrategyStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy/{strategyId}',\n ...options\n });\n};\n\n/**\n * Prepare backtesting data\n * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;\n * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.\n *\n * The same params always return the same `jobId` (idempotent). Repeated calls with identical\n * params do not enqueue duplicate work — they reuse the existing job.\n *\n */\nexport const prepareBacktesting = <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PrepareBacktestingResponse, PrepareBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of a prepare job\n * Retrieves the current state of the prepare job identified by `jobId`.\n * Poll until `status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getPreparationStatus = <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetPreparationStatusResponse, GetPreparationStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',\n ...options\n });\n};\n\n/**\n * Execute a compiled strategy against a prepared dataset\n * Enqueues an execute task that runs the strategy identified by `strategyId` over the data\n * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are\n * recovered from the prepare job — they do not need to be sent again.\n *\n * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`\n * for the result.\n *\n * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same\n * `jobId` (idempotent).\n *\n */\nexport const executeBacktesting = <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<ExecuteBacktestingResponse, ExecuteBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Cancel a running backtest execution\n * Requests cancellation of the specified execution. The execution\n * status will transition to `Aborted` once the cancellation is\n * processed. Cancellation is asynchronous — poll the GET endpoint\n * to confirm the final status.\n *\n */\nexport const cancelExecution = <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).delete<CancelExecutionResponse, CancelExecutionError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};\n\n/**\n * Get the result of a backtest execution job\n * Retrieves the current state and results of the execute job identified by `jobId`.\n * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getExecutionResult = <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExecutionResultResponse, GetExecutionResultError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ClientOptions } from './types.gen';\nimport { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions>({\n baseUrl: 'https://api.staging.qtsurfer.com/v1'\n}));","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';\nimport type { AuthData, AuthResponse, AuthError, GetExchangesData, GetExchangesResponse, GetInstrumentsData, GetInstrumentsResponse, GetInstrumentsError, GetSegmentInstrumentsData, GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, GetExchangeTickersHourData, GetExchangeTickersHourResponse, GetExchangeTickersHourError, GetExchangeKlinesHourData, GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, PostStrategyData, PostStrategyResponse, PostStrategyError, GetStrategyStatusData, GetStrategyStatusResponse, GetStrategyStatusError, PrepareBacktestingData, PrepareBacktestingResponse, PrepareBacktestingError, GetPreparationStatusData, GetPreparationStatusResponse, GetPreparationStatusError, ExecuteBacktestingData, ExecuteBacktestingResponse, ExecuteBacktestingError, CancelExecutionData, CancelExecutionResponse, CancelExecutionError, GetExecutionResultData, GetExecutionResultResponse, GetExecutionResultError } from './types.gen';\nimport { client as _heyApiClient } from './client.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Exchange API key for a short-lived JWT\n * Exchanges a long-lived API key for a short-lived JWT used by every other\n * endpoint. This is the only endpoint that accepts an API key directly —\n * callers should obtain a JWT here, then send it as `Authorization: Bearer\n * <token>` to all other operations.\n *\n * The returned JWT carries the caller's subscription `tier` as a claim and\n * expires after `expires_in` seconds. Callers should refresh the token\n * before expiry (or on a `401` response) by calling this endpoint again.\n *\n */\nexport const auth = <ThrowOnError extends boolean = false>(options?: Options<AuthData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).post<AuthResponse, AuthError, ThrowOnError>({\n security: [\n {\n name: 'X-API-Key',\n type: 'apiKey'\n }\n ],\n url: '/auth/token',\n ...options\n });\n};\n\n/**\n * Get a list of available exchanges\n */\nexport const getExchanges = <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).get<GetExchangesResponse, unknown, ThrowOnError>({\n url: '/exchanges',\n ...options\n });\n};\n\n/**\n * Get an exchange's instruments (default spot segment)\n * \"Give me binance instruments\" — returns the exchange's DEFAULT segment (`spot`)\n * in `data`, each instrument with per-data-type coverage and market info. `meta`\n * confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links.\n *\n */\nexport const getInstruments = <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetInstrumentsResponse, GetInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/instruments',\n ...options\n });\n};\n\n/**\n * Get the instruments for a specific exchange segment\n * Returns the instruments for one market segment of the exchange, each with\n * per-data-type coverage and market info. HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links; the default-segment shortcut is\n * `GET /exchange/{exchangeId}/instruments` (spot).\n *\n */\nexport const getSegmentInstruments = <ThrowOnError extends boolean = false>(options: Options<GetSegmentInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/{segment}/instruments',\n ...options\n });\n};\n\n/**\n * Download one hour of tickers for an instrument as a Lastra segment\n * Serves exactly one hour of raw ticker data for the given instrument on the\n * requested exchange. The payload is a native [Lastra](https://github.com/QTSurfer/lastra-java)\n * file — QTSurfer's columnar format for tick-precision timeseries — with\n * no JSON envelope.\n *\n * One segment = one hour, aligned to UTC. The `hour` query parameter selects\n * the segment and must match `YYYY-MM-DDTHH` (no minutes/seconds, no timezone\n * suffix). Example: `hour=2026-01-15T10` returns `h10.lastra` for\n * 2026-01-15, covering `[10:00:00Z, 11:00:00Z)`. Hours not yet available\n * return `404`.\n *\n * A `format=parquet` query parameter switches the response to on-the-fly\n * Parquet conversion via [lastra-convert](https://github.com/QTSurfer/lastra-convert)\n * for clients that don't yet read Lastra. Lastra is the primary format\n * and cheaper when the client can consume it.\n *\n * Clients:\n * - [lastra-java](https://github.com/QTSurfer/lastra-java) — reference\n * Java reader/writer with per-column codecs (ALP, Gorilla, delta-varint,\n * ZSTD) and CRC32 integrity.\n * - [lastra-ts](https://github.com/QTSurfer/lastra-ts) — TypeScript reader\n * (~4 kB bundle, browser + Node.js).\n * - [duckdb-lastra](https://github.com/QTSurfer/duckdb-lastra) — DuckDB\n * extension for ad-hoc SQL over Lastra files.\n * - [lastra-convert](https://github.com/QTSurfer/lastra-convert) — CLI + Java\n * API for converting to/from Parquet, Reef, and CSV.\n * - `curl -OJ` for offline dumps (the `Content-Disposition` header sets a\n * descriptive filename).\n *\n */\nexport const getExchangeTickersHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeTickersHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeTickersHourResponse, GetExchangeTickersHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/tickers/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Download one hour of klines for an instrument as a Lastra segment\n * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,\n * but serves klines (aggregated bars) instead of raw ticks. One\n * [Lastra](https://github.com/QTSurfer/lastra-java) segment = one hour of\n * klines at the exchange's native kline cadence, aligned to UTC.\n *\n * Klines use the same columnar layout as tickers — readers that handle one\n * format read the other with the same code. Use this endpoint when a\n * per-tick payload would be too large for the window of interest.\n *\n */\nexport const getExchangeKlinesHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeKlinesHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/klines/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Compile a strategy from source code\n * Submits raw strategy source for compilation. By default the call is synchronous and returns\n * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue\n * the compile task and return immediately with a `jobId` — poll\n * `GET /strategy/{strategyId}` to check status.\n *\n * The `strategyId` is deterministic: the same source for the same user always produces the\n * same id.\n *\n */\nexport const postStrategy = <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PostStrategyResponse, PostStrategyError, ThrowOnError>({\n bodySerializer: null,\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy',\n ...options,\n headers: {\n 'Content-Type': 'text/plain',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of an async compile task\n * Polls the status of a strategy compilation. Useful when the strategy was submitted with\n * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.\n *\n */\nexport const getStrategyStatus = <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetStrategyStatusResponse, GetStrategyStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy/{strategyId}',\n ...options\n });\n};\n\n/**\n * Prepare backtesting data\n * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;\n * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.\n *\n * The same params always return the same `jobId` (idempotent). Repeated calls with identical\n * params do not enqueue duplicate work — they reuse the existing job.\n *\n */\nexport const prepareBacktesting = <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PrepareBacktestingResponse, PrepareBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of a prepare job\n * Retrieves the current state of the prepare job identified by `jobId`.\n * Poll until `status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getPreparationStatus = <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetPreparationStatusResponse, GetPreparationStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',\n ...options\n });\n};\n\n/**\n * Execute a compiled strategy against a prepared dataset\n * Enqueues an execute task that runs the strategy identified by `strategyId` over the data\n * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are\n * recovered from the prepare job — they do not need to be sent again.\n *\n * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`\n * for the result.\n *\n * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same\n * `jobId` (idempotent).\n *\n */\nexport const executeBacktesting = <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<ExecuteBacktestingResponse, ExecuteBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Cancel a running backtest execution\n * Requests cancellation of the specified execution. The execution\n * status will transition to `Aborted` once the cancellation is\n * processed. Cancellation is asynchronous — poll the GET endpoint\n * to confirm the final status.\n *\n */\nexport const cancelExecution = <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).delete<CancelExecutionResponse, CancelExecutionError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};\n\n/**\n * Get the result of a backtest execution job\n * Retrieves the current state and results of the execute job identified by `jobId`.\n * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getExecutionResult = <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExecutionResultResponse, GetExecutionResultError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};"],"mappings":";AAGA,SAAkE,cAAc,oBAAoB;AAY7F,IAAM,SAAS,aAAa,aAA4B;AAAA,EAC3D,SAAS;AACb,CAAC,CAAC;;;ACeK,IAAM,OAAO,CAAuC,YAA8C;AACrG,UAAQ,SAAS,UAAU,QAAe,KAA4C;AAAA,IAClF,UAAU;AAAA,MACN;AAAA,QACI,MAAM;AAAA,QACN,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAKO,IAAM,eAAe,CAAuC,YAAsD;AACrH,UAAQ,SAAS,UAAU,QAAe,IAAiD;AAAA,IACvF,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAUO,IAAM,iBAAiB,CAAuC,YAAuD;AACxH,UAAQ,QAAQ,UAAU,QAAe,IAA+D;AAAA,IACpG,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAUO,IAAM,wBAAwB,CAAuC,YAA8D;AACtI,UAAQ,QAAQ,UAAU,QAAe,IAA6E;AAAA,IAClH,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAkCO,IAAM,yBAAyB,CAAuC,YAA+D;AACxI,UAAQ,QAAQ,UAAU,QAAe,IAA+E;AAAA,IACpH,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAcO,IAAM,wBAAwB,CAAuC,YAA8D;AACtI,UAAQ,QAAQ,UAAU,QAAe,IAA6E;AAAA,IAClH,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAaO,IAAM,eAAe,CAAuC,YAAqD;AACpH,UAAQ,QAAQ,UAAU,QAAe,KAA4D;AAAA,IACjG,gBAAgB;AAAA,IAChB,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IAChB;AAAA,EACJ,CAAC;AACL;AAQO,IAAM,oBAAoB,CAAuC,YAA0D;AAC9H,UAAQ,QAAQ,UAAU,QAAe,IAAqE;AAAA,IAC1G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAWO,IAAM,qBAAqB,CAAuC,YAA2D;AAChI,UAAQ,QAAQ,UAAU,QAAe,KAAwE;AAAA,IAC7G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IAChB;AAAA,EACJ,CAAC;AACL;AAQO,IAAM,uBAAuB,CAAuC,YAA6D;AACpI,UAAQ,QAAQ,UAAU,QAAe,IAA2E;AAAA,IAChH,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAeO,IAAM,qBAAqB,CAAuC,YAA2D;AAChI,UAAQ,QAAQ,UAAU,QAAe,KAAwE;AAAA,IAC7G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IAChB;AAAA,EACJ,CAAC;AACL;AAUO,IAAM,kBAAkB,CAAuC,YAAwD;AAC1H,UAAQ,QAAQ,UAAU,QAAe,OAAoE;AAAA,IACzG,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAQO,IAAM,qBAAqB,CAAuC,YAA2D;AAChI,UAAQ,QAAQ,UAAU,QAAe,IAAuE;AAAA,IAC5G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;","names":[]}
|
package/package.json
CHANGED
|
@@ -24,8 +24,105 @@ export const InstrumentSchema = {
|
|
|
24
24
|
example: 'BTC/USDT'
|
|
25
25
|
} as const;
|
|
26
26
|
|
|
27
|
+
export const InstrumentListResponseSchema = {
|
|
28
|
+
description: 'HAL-style response envelope for the instruments listing',
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: ['data', 'meta', '_links'],
|
|
31
|
+
properties: {
|
|
32
|
+
data: {
|
|
33
|
+
type: 'array',
|
|
34
|
+
description: 'The list of instruments for the segment',
|
|
35
|
+
items: {
|
|
36
|
+
'$ref': '#/components/schemas/InstrumentDetail'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
meta: {
|
|
40
|
+
'$ref': '#/components/schemas/InstrumentListMeta'
|
|
41
|
+
},
|
|
42
|
+
_links: {
|
|
43
|
+
'$ref': '#/components/schemas/InstrumentLinks'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} as const;
|
|
47
|
+
|
|
48
|
+
export const InstrumentListMetaSchema = {
|
|
49
|
+
description: 'Metadata describing the instruments listing',
|
|
50
|
+
type: 'object',
|
|
51
|
+
required: ['updatedAt', 'exchange', 'segment'],
|
|
52
|
+
properties: {
|
|
53
|
+
updatedAt: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
format: 'date-time',
|
|
56
|
+
description: 'When this listing was last refreshed',
|
|
57
|
+
example: '2026-07-09T19:09:07Z'
|
|
58
|
+
},
|
|
59
|
+
exchange: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'The exchange the instruments belong to',
|
|
62
|
+
example: 'binance'
|
|
63
|
+
},
|
|
64
|
+
segment: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
enum: ['spot', 'futures'],
|
|
67
|
+
description: 'The market segment served in `data`',
|
|
68
|
+
example: 'spot'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} as const;
|
|
72
|
+
|
|
73
|
+
export const InstrumentLinksSchema = {
|
|
74
|
+
description: 'HAL `_links` — segment discovery for the instruments listing',
|
|
75
|
+
type: 'object',
|
|
76
|
+
required: ['self'],
|
|
77
|
+
properties: {
|
|
78
|
+
self: {
|
|
79
|
+
allOf: [
|
|
80
|
+
{
|
|
81
|
+
'$ref': '#/components/schemas/HalLink'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
description: 'Link to this listing'
|
|
85
|
+
},
|
|
86
|
+
spot: {
|
|
87
|
+
allOf: [
|
|
88
|
+
{
|
|
89
|
+
'$ref': '#/components/schemas/HalLink'
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
description: 'Link to the spot instruments listing. Present when the exchange has a spot segment.'
|
|
93
|
+
},
|
|
94
|
+
futures: {
|
|
95
|
+
allOf: [
|
|
96
|
+
{
|
|
97
|
+
'$ref': '#/components/schemas/HalLink'
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
description: 'Link to the futures instruments listing. Present only when the exchange has a futures segment.'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
} as const;
|
|
104
|
+
|
|
105
|
+
export const HalLinkSchema = {
|
|
106
|
+
description: 'A HAL link object (Hypertext Application Language)',
|
|
107
|
+
type: 'object',
|
|
108
|
+
required: ['href'],
|
|
109
|
+
properties: {
|
|
110
|
+
href: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
format: 'uri-reference',
|
|
113
|
+
description: 'The link target as an absolute-path URI reference (resolve against the API base). A URI Template (RFC 6570) when `templated` is true.',
|
|
114
|
+
example: '/v1/exchange/binance/spot/instruments'
|
|
115
|
+
},
|
|
116
|
+
templated: {
|
|
117
|
+
type: 'boolean',
|
|
118
|
+
description: 'True when `href` is an RFC 6570 URI Template.',
|
|
119
|
+
example: false
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} as const;
|
|
123
|
+
|
|
27
124
|
export const InstrumentDetailSchema = {
|
|
28
|
-
description: 'Exchange instrument with data
|
|
125
|
+
description: 'Exchange instrument with per-data-type coverage and market info',
|
|
29
126
|
type: 'object',
|
|
30
127
|
required: ['id', 'base', 'quote'],
|
|
31
128
|
properties: {
|
|
@@ -44,17 +141,8 @@ export const InstrumentDetailSchema = {
|
|
|
44
141
|
description: 'Quote currency',
|
|
45
142
|
example: 'USDT'
|
|
46
143
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
format: 'date-time',
|
|
50
|
-
description: 'Earliest timestamp with quality-verified data available for backtesting',
|
|
51
|
-
example: '2026-03-17T00:00:00Z'
|
|
52
|
-
},
|
|
53
|
-
dataTo: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
format: 'date-time',
|
|
56
|
-
description: 'Latest timestamp with quality-verified data available for backtesting',
|
|
57
|
-
example: '2026-03-31T18:00:00Z'
|
|
144
|
+
coverage: {
|
|
145
|
+
'$ref': '#/components/schemas/InstrumentCoverage'
|
|
58
146
|
},
|
|
59
147
|
lastPrice: {
|
|
60
148
|
type: 'number',
|
|
@@ -71,6 +159,54 @@ export const InstrumentDetailSchema = {
|
|
|
71
159
|
}
|
|
72
160
|
} as const;
|
|
73
161
|
|
|
162
|
+
export const InstrumentCoverageSchema = {
|
|
163
|
+
description: 'Time coverage of available data for this instrument, per data type',
|
|
164
|
+
type: 'object',
|
|
165
|
+
properties: {
|
|
166
|
+
tickers: {
|
|
167
|
+
allOf: [
|
|
168
|
+
{
|
|
169
|
+
'$ref': '#/components/schemas/CoverageWindow'
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
description: 'Coverage of ticker data'
|
|
173
|
+
},
|
|
174
|
+
klines: {
|
|
175
|
+
allOf: [
|
|
176
|
+
{
|
|
177
|
+
'$ref': '#/components/schemas/CoverageWindow'
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
description: 'Coverage of kline (candlestick) data'
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
} as const;
|
|
184
|
+
|
|
185
|
+
export const CoverageWindowSchema = {
|
|
186
|
+
description: 'The time range of available data for a single data type',
|
|
187
|
+
type: 'object',
|
|
188
|
+
properties: {
|
|
189
|
+
from: {
|
|
190
|
+
type: 'string',
|
|
191
|
+
format: 'date-time',
|
|
192
|
+
description: 'Earliest timestamp with data available',
|
|
193
|
+
example: '2026-04-10T21:00:00Z'
|
|
194
|
+
},
|
|
195
|
+
to: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
format: 'date-time',
|
|
198
|
+
description: 'Latest timestamp with data available',
|
|
199
|
+
example: '2026-07-09T20:31:08Z'
|
|
200
|
+
},
|
|
201
|
+
inactiveSince: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
format: 'date-time',
|
|
204
|
+
description: 'If the instrument stopped producing this data type (delisted/inactive), the timestamp it went inactive. Optional — omitted while the instrument is active.',
|
|
205
|
+
example: '2026-06-30T12:00:00Z'
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} as const;
|
|
209
|
+
|
|
74
210
|
export const ExchangeSchema = {
|
|
75
211
|
description: 'Exchange service provider',
|
|
76
212
|
type: 'object',
|
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
4
|
-
import type { AuthData, AuthResponse, AuthError, GetExchangesData, GetExchangesResponse, GetInstrumentsData, GetInstrumentsResponse, GetInstrumentsError, GetExchangeTickersHourData, GetExchangeTickersHourResponse, GetExchangeTickersHourError, GetExchangeKlinesHourData, GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, PostStrategyData, PostStrategyResponse, PostStrategyError, GetStrategyStatusData, GetStrategyStatusResponse, GetStrategyStatusError, PrepareBacktestingData, PrepareBacktestingResponse, PrepareBacktestingError, GetPreparationStatusData, GetPreparationStatusResponse, GetPreparationStatusError, ExecuteBacktestingData, ExecuteBacktestingResponse, ExecuteBacktestingError, CancelExecutionData, CancelExecutionResponse, CancelExecutionError, GetExecutionResultData, GetExecutionResultResponse, GetExecutionResultError } from './types.gen';
|
|
4
|
+
import type { AuthData, AuthResponse, AuthError, GetExchangesData, GetExchangesResponse, GetInstrumentsData, GetInstrumentsResponse, GetInstrumentsError, GetSegmentInstrumentsData, GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, GetExchangeTickersHourData, GetExchangeTickersHourResponse, GetExchangeTickersHourError, GetExchangeKlinesHourData, GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, PostStrategyData, PostStrategyResponse, PostStrategyError, GetStrategyStatusData, GetStrategyStatusResponse, GetStrategyStatusError, PrepareBacktestingData, PrepareBacktestingResponse, PrepareBacktestingError, GetPreparationStatusData, GetPreparationStatusResponse, GetPreparationStatusError, ExecuteBacktestingData, ExecuteBacktestingResponse, ExecuteBacktestingError, CancelExecutionData, CancelExecutionResponse, CancelExecutionError, GetExecutionResultData, GetExecutionResultResponse, GetExecutionResultError } from './types.gen';
|
|
5
5
|
import { client as _heyApiClient } from './client.gen';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
@@ -54,7 +54,12 @@ export const getExchanges = <ThrowOnError extends boolean = false>(options?: Opt
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Get
|
|
57
|
+
* Get an exchange's instruments (default spot segment)
|
|
58
|
+
* "Give me binance instruments" — returns the exchange's DEFAULT segment (`spot`)
|
|
59
|
+
* in `data`, each instrument with per-data-type coverage and market info. `meta`
|
|
60
|
+
* confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the
|
|
61
|
+
* `spot` / `futures` segment-discovery links.
|
|
62
|
+
*
|
|
58
63
|
*/
|
|
59
64
|
export const getInstruments = <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => {
|
|
60
65
|
return (options.client ?? _heyApiClient).get<GetInstrumentsResponse, GetInstrumentsError, ThrowOnError>({
|
|
@@ -63,6 +68,21 @@ export const getInstruments = <ThrowOnError extends boolean = false>(options: Op
|
|
|
63
68
|
});
|
|
64
69
|
};
|
|
65
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Get the instruments for a specific exchange segment
|
|
73
|
+
* Returns the instruments for one market segment of the exchange, each with
|
|
74
|
+
* per-data-type coverage and market info. HAL `_links` carry `self` plus the
|
|
75
|
+
* `spot` / `futures` segment-discovery links; the default-segment shortcut is
|
|
76
|
+
* `GET /exchange/{exchangeId}/instruments` (spot).
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
export const getSegmentInstruments = <ThrowOnError extends boolean = false>(options: Options<GetSegmentInstrumentsData, ThrowOnError>) => {
|
|
80
|
+
return (options.client ?? _heyApiClient).get<GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, ThrowOnError>({
|
|
81
|
+
url: '/exchange/{exchangeId}/{segment}/instruments',
|
|
82
|
+
...options
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
66
86
|
/**
|
|
67
87
|
* Download one hour of tickers for an instrument as a Lastra segment
|
|
68
88
|
* Serves exactly one hour of raw ticker data for the given instrument on the
|
|
@@ -20,7 +20,69 @@ export type ResponseError = {
|
|
|
20
20
|
export type Instrument = string;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* HAL-style response envelope for the instruments listing
|
|
24
|
+
*/
|
|
25
|
+
export type InstrumentListResponse = {
|
|
26
|
+
/**
|
|
27
|
+
* The list of instruments for the segment
|
|
28
|
+
*/
|
|
29
|
+
data: Array<InstrumentDetail>;
|
|
30
|
+
meta: InstrumentListMeta;
|
|
31
|
+
_links: InstrumentLinks;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Metadata describing the instruments listing
|
|
36
|
+
*/
|
|
37
|
+
export type InstrumentListMeta = {
|
|
38
|
+
/**
|
|
39
|
+
* When this listing was last refreshed
|
|
40
|
+
*/
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
/**
|
|
43
|
+
* The exchange the instruments belong to
|
|
44
|
+
*/
|
|
45
|
+
exchange: string;
|
|
46
|
+
/**
|
|
47
|
+
* The market segment served in `data`
|
|
48
|
+
*/
|
|
49
|
+
segment: 'spot' | 'futures';
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* HAL `_links` — segment discovery for the instruments listing
|
|
54
|
+
*/
|
|
55
|
+
export type InstrumentLinks = {
|
|
56
|
+
/**
|
|
57
|
+
* Link to this listing
|
|
58
|
+
*/
|
|
59
|
+
self: HalLink;
|
|
60
|
+
/**
|
|
61
|
+
* Link to the spot instruments listing. Present when the exchange has a spot segment.
|
|
62
|
+
*/
|
|
63
|
+
spot?: HalLink;
|
|
64
|
+
/**
|
|
65
|
+
* Link to the futures instruments listing. Present only when the exchange has a futures segment.
|
|
66
|
+
*/
|
|
67
|
+
futures?: HalLink;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A HAL link object (Hypertext Application Language)
|
|
72
|
+
*/
|
|
73
|
+
export type HalLink = {
|
|
74
|
+
/**
|
|
75
|
+
* The link target as an absolute-path URI reference (resolve against the API base). A URI Template (RFC 6570) when `templated` is true.
|
|
76
|
+
*/
|
|
77
|
+
href: string;
|
|
78
|
+
/**
|
|
79
|
+
* True when `href` is an RFC 6570 URI Template.
|
|
80
|
+
*/
|
|
81
|
+
templated?: boolean;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Exchange instrument with per-data-type coverage and market info
|
|
24
86
|
*/
|
|
25
87
|
export type InstrumentDetail = {
|
|
26
88
|
/**
|
|
@@ -35,14 +97,7 @@ export type InstrumentDetail = {
|
|
|
35
97
|
* Quote currency
|
|
36
98
|
*/
|
|
37
99
|
quote: string;
|
|
38
|
-
|
|
39
|
-
* Earliest timestamp with quality-verified data available for backtesting
|
|
40
|
-
*/
|
|
41
|
-
dataFrom?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Latest timestamp with quality-verified data available for backtesting
|
|
44
|
-
*/
|
|
45
|
-
dataTo?: string;
|
|
100
|
+
coverage?: InstrumentCoverage;
|
|
46
101
|
/**
|
|
47
102
|
* Last traded price
|
|
48
103
|
*/
|
|
@@ -53,6 +108,38 @@ export type InstrumentDetail = {
|
|
|
53
108
|
volume24h?: number;
|
|
54
109
|
};
|
|
55
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Time coverage of available data for this instrument, per data type
|
|
113
|
+
*/
|
|
114
|
+
export type InstrumentCoverage = {
|
|
115
|
+
/**
|
|
116
|
+
* Coverage of ticker data
|
|
117
|
+
*/
|
|
118
|
+
tickers?: CoverageWindow;
|
|
119
|
+
/**
|
|
120
|
+
* Coverage of kline (candlestick) data
|
|
121
|
+
*/
|
|
122
|
+
klines?: CoverageWindow;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The time range of available data for a single data type
|
|
127
|
+
*/
|
|
128
|
+
export type CoverageWindow = {
|
|
129
|
+
/**
|
|
130
|
+
* Earliest timestamp with data available
|
|
131
|
+
*/
|
|
132
|
+
from?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Latest timestamp with data available
|
|
135
|
+
*/
|
|
136
|
+
to?: string;
|
|
137
|
+
/**
|
|
138
|
+
* If the instrument stopped producing this data type (delisted/inactive), the timestamp it went inactive. Optional — omitted while the instrument is active.
|
|
139
|
+
*/
|
|
140
|
+
inactiveSince?: string;
|
|
141
|
+
};
|
|
142
|
+
|
|
56
143
|
/**
|
|
57
144
|
* Exchange service provider
|
|
58
145
|
*/
|
|
@@ -344,13 +431,47 @@ export type GetInstrumentsError = GetInstrumentsErrors[keyof GetInstrumentsError
|
|
|
344
431
|
|
|
345
432
|
export type GetInstrumentsResponses = {
|
|
346
433
|
/**
|
|
347
|
-
*
|
|
434
|
+
* The default (spot) segment's instruments in `data`, `meta`, and HAL `_links` (self + spot/futures segment discovery)
|
|
348
435
|
*/
|
|
349
|
-
200:
|
|
436
|
+
200: InstrumentListResponse;
|
|
350
437
|
};
|
|
351
438
|
|
|
352
439
|
export type GetInstrumentsResponse = GetInstrumentsResponses[keyof GetInstrumentsResponses];
|
|
353
440
|
|
|
441
|
+
export type GetSegmentInstrumentsData = {
|
|
442
|
+
body?: never;
|
|
443
|
+
path: {
|
|
444
|
+
/**
|
|
445
|
+
* ID of the exchange to retrieve instruments for
|
|
446
|
+
*/
|
|
447
|
+
exchangeId: string;
|
|
448
|
+
/**
|
|
449
|
+
* Market segment to list instruments for
|
|
450
|
+
*/
|
|
451
|
+
segment: 'spot' | 'futures';
|
|
452
|
+
};
|
|
453
|
+
query?: never;
|
|
454
|
+
url: '/exchange/{exchangeId}/{segment}/instruments';
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export type GetSegmentInstrumentsErrors = {
|
|
458
|
+
/**
|
|
459
|
+
* Exchange, segment, or instrument catalog not found
|
|
460
|
+
*/
|
|
461
|
+
404: ResponseError;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export type GetSegmentInstrumentsError = GetSegmentInstrumentsErrors[keyof GetSegmentInstrumentsErrors];
|
|
465
|
+
|
|
466
|
+
export type GetSegmentInstrumentsResponses = {
|
|
467
|
+
/**
|
|
468
|
+
* An object with a `data` array of instrument details (each with per-data-type coverage) and a `meta` block
|
|
469
|
+
*/
|
|
470
|
+
200: InstrumentListResponse;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export type GetSegmentInstrumentsResponse = GetSegmentInstrumentsResponses[keyof GetSegmentInstrumentsResponses];
|
|
474
|
+
|
|
354
475
|
export type GetExchangeTickersHourData = {
|
|
355
476
|
body?: never;
|
|
356
477
|
path: {
|