@qtsurfer/api-client 0.1.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.
@@ -0,0 +1,287 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export const ResponseErrorSchema = {
3
+ description: 'General response error',
4
+ type: 'object',
5
+ required: ['code', 'message'],
6
+ properties: {
7
+ code: {
8
+ description: 'Status code',
9
+ type: 'integer',
10
+ example: 400
11
+ },
12
+ message: {
13
+ description: 'Error description',
14
+ type: 'string',
15
+ example: 'Invalid request'
16
+ }
17
+ }
18
+ };
19
+ export const InstrumentSchema = {
20
+ description: 'Exchange instrument identifier (e.g. a currency pair)',
21
+ type: 'string',
22
+ example: 'BTC/USDT'
23
+ };
24
+ export const InstrumentDetailSchema = {
25
+ description: 'Exchange instrument with data availability and market info',
26
+ type: 'object',
27
+ required: ['id', 'base', 'quote'],
28
+ properties: {
29
+ id: {
30
+ type: 'string',
31
+ description: 'Instrument identifier (e.g. currency pair)',
32
+ example: 'BTC/USDT'
33
+ },
34
+ base: {
35
+ type: 'string',
36
+ description: 'Base currency',
37
+ example: 'BTC'
38
+ },
39
+ quote: {
40
+ type: 'string',
41
+ description: 'Quote currency',
42
+ example: 'USDT'
43
+ },
44
+ dataFrom: {
45
+ type: 'string',
46
+ format: 'date-time',
47
+ description: 'Earliest timestamp with quality-verified data available for backtesting',
48
+ example: '2026-03-17T00:00:00Z'
49
+ },
50
+ dataTo: {
51
+ type: 'string',
52
+ format: 'date-time',
53
+ description: 'Latest timestamp with quality-verified data available for backtesting',
54
+ example: '2026-03-31T18:00:00Z'
55
+ },
56
+ lastPrice: {
57
+ type: 'number',
58
+ format: 'double',
59
+ description: 'Last traded price',
60
+ example: 84250.5
61
+ },
62
+ volume24h: {
63
+ type: 'number',
64
+ format: 'double',
65
+ description: 'Trading volume in the last 24 hours (in quote currency)',
66
+ example: 1234567.89
67
+ }
68
+ }
69
+ };
70
+ export const ExchangeSchema = {
71
+ description: 'Exchange service provider',
72
+ type: 'object',
73
+ required: ['id', 'name'],
74
+ properties: {
75
+ id: {
76
+ description: 'Unique identifier for the exchange',
77
+ type: 'string',
78
+ example: 'binance'
79
+ },
80
+ name: {
81
+ description: 'Name of the exchange',
82
+ type: 'string',
83
+ example: 'Binance'
84
+ },
85
+ description: {
86
+ description: 'Description of the exchange',
87
+ type: 'string',
88
+ example: 'Binance cryptocurrency exchange'
89
+ }
90
+ }
91
+ };
92
+ export const DataSourceTypeSchema = {
93
+ type: 'string',
94
+ description: 'Managed exchange data sources available for backtesting. Currently only ticker is supported; kline and funding rate support is planned.',
95
+ enum: ['ticker'],
96
+ example: 'ticker'
97
+ };
98
+ export const JobStateSchema = {
99
+ type: 'object',
100
+ description: 'Information about a single job',
101
+ required: ['contextId', 'status', 'size', 'completed'],
102
+ properties: {
103
+ contextId: {
104
+ type: 'string',
105
+ description: 'Unique context ID for the job',
106
+ example: 'jctx:ticker:4a627755-7f5a-4297-b647-8dddd8aee416:binance:1rabbrpk5r4kkegs83w6qr:btc/usdt:2o8heaioicr0edvx5ybcap'
107
+ },
108
+ status: {
109
+ type: 'string',
110
+ description: 'Current status of the job',
111
+ enum: ['New', 'Started', 'Completed', 'Aborted', 'Failed'],
112
+ example: 'Completed'
113
+ },
114
+ statusDetail: {
115
+ type: ['string', 'null'],
116
+ description: 'Detailed status information, if available',
117
+ example: 'Job completed with error code 5001'
118
+ },
119
+ size: {
120
+ type: 'integer',
121
+ description: 'Total size of the data being prepared',
122
+ example: 100
123
+ },
124
+ completed: {
125
+ type: 'integer',
126
+ description: 'The amount of data processed so far',
127
+ example: 50
128
+ },
129
+ startTime: {
130
+ type: ['string', 'null'],
131
+ format: 'date-time',
132
+ description: 'Timestamp for when the preparation started',
133
+ example: '2025-01-04T14:00:00Z'
134
+ },
135
+ endTime: {
136
+ type: ['string', 'null'],
137
+ format: 'date-time',
138
+ description: 'Timestamp for when the preparation finished',
139
+ example: '2025-01-04T14:00:20Z'
140
+ }
141
+ }
142
+ };
143
+ export const AcceptedJobSchema = {
144
+ type: 'object',
145
+ description: `Response returned by async endpoints (\`202 Accepted\`). The \`jobId\` is deterministic for the
146
+ same input parameters — repeated calls with identical params return the same id.
147
+ `,
148
+ required: ['jobId'],
149
+ properties: {
150
+ jobId: {
151
+ type: 'string',
152
+ description: 'Unique job identifier; use this to poll for completion.',
153
+ example: '13RBLGQlPnfDjO6wyKSX8i'
154
+ }
155
+ },
156
+ example: {
157
+ jobId: '13RBLGQlPnfDjO6wyKSX8i'
158
+ }
159
+ };
160
+ export const BacktestJobResultSchema = {
161
+ type: 'object',
162
+ description: 'Backtest job result.',
163
+ required: ['results', 'state'],
164
+ properties: {
165
+ results: {
166
+ '$ref': '#/components/schemas/ResultMap'
167
+ },
168
+ state: {
169
+ '$ref': '#/components/schemas/JobState'
170
+ }
171
+ }
172
+ };
173
+ export const ResultMapSchema = {
174
+ type: 'object',
175
+ description: 'Execution result map. Always includes core fields (hostName, iops, strategyId, instrument). Yield metrics (pnlTotal, totalTrades, winRate, etc.) are present when the strategy emitted at least one trade. When signal storage is enabled, includes signal fields described below.',
176
+ required: ['strategyId', 'instrument'],
177
+ properties: {
178
+ hostName: {
179
+ type: 'string',
180
+ description: 'Hostname of the worker node that executed the strategy',
181
+ example: 'backtesting-job-worker-84b569dff9-dr4lb'
182
+ },
183
+ iops: {
184
+ type: 'number',
185
+ format: 'double',
186
+ description: 'Instrument operations per second throughput during execution',
187
+ example: 123956.53
188
+ },
189
+ strategyId: {
190
+ type: 'string',
191
+ description: 'Redis key of the compiled strategy used for execution. Format: strategy:{userId}:ticker:{compilationId}',
192
+ example: 'strategy:4a627755-7f5a-4297-b647-8dddd8aee416:ticker:2iyvtenlzh9dabqtxn7nbv'
193
+ },
194
+ instrument: {
195
+ type: 'string',
196
+ description: 'The instrument (currency pair) that was backtested',
197
+ example: 'BTC/USDT'
198
+ },
199
+ pnlTotal: {
200
+ type: 'number',
201
+ format: 'double',
202
+ description: 'Total profit and loss in the output currency',
203
+ example: 42.75
204
+ },
205
+ totalTrades: {
206
+ type: 'integer',
207
+ format: 'int64',
208
+ description: 'Total number of trades executed by the strategy',
209
+ example: 156
210
+ },
211
+ winRate: {
212
+ type: 'number',
213
+ format: 'double',
214
+ description: 'Percentage of profitable trades (0-100)',
215
+ example: 58.33
216
+ },
217
+ sharpeRatio: {
218
+ type: 'number',
219
+ format: 'double',
220
+ description: 'Risk-adjusted return ratio (mean return / standard deviation of returns)',
221
+ example: 1.245
222
+ },
223
+ sortinoRatio: {
224
+ type: 'number',
225
+ format: 'double',
226
+ description: 'Downside risk-adjusted return ratio (mean return / downside deviation)',
227
+ example: 1.872
228
+ },
229
+ cagr: {
230
+ type: 'number',
231
+ format: 'double',
232
+ description: 'Compound Annual Growth Rate',
233
+ example: 0.1534
234
+ },
235
+ maxDrawdown: {
236
+ type: 'number',
237
+ format: 'double',
238
+ description: 'Maximum absolute drawdown in the output currency',
239
+ example: 12.5
240
+ },
241
+ maxDrawdownPercent: {
242
+ type: 'number',
243
+ format: 'double',
244
+ description: 'Maximum percentage drawdown from peak equity',
245
+ example: 8.75
246
+ },
247
+ signalCount: {
248
+ type: 'integer',
249
+ description: 'Number of signals emitted during strategy execution',
250
+ example: 100000
251
+ },
252
+ signalsId: {
253
+ type: 'string',
254
+ description: 'Storage key for the signal Parquet file. Format: {userId}/exec/{exchange}/{jobId}',
255
+ example: '4a627755-7f5a-4297-b647-8dddd8aee416/exec/binance/3vsndwikcuaatjmb83fjtl'
256
+ },
257
+ signalsUrl: {
258
+ type: 'string',
259
+ format: 'uri',
260
+ description: 'Public HTTPS URL to the Parquet file. Computed at setup time from publicBaseUrl + signalsId + .parquet. Available even before upload completes.',
261
+ example: 'https://storage.qtsurfer.com/4a627755-7f5a-4297-b647-8dddd8aee416/exec/binance/3vsndwikcuaatjmb83fjtl.parquet'
262
+ },
263
+ signalsUpload: {
264
+ type: 'string',
265
+ enum: ['Done', 'Failed', 'Skipped'],
266
+ description: 'Upload status. Done = file uploaded to R2. Failed = upload error (see signalsUploadReason). Skipped = no signals emitted or storage not configured.',
267
+ example: 'Done'
268
+ },
269
+ signalsUploadedAt: {
270
+ type: 'string',
271
+ format: 'date-time',
272
+ description: 'ISO 8601 timestamp of when the upload completed. Only present when signalsUpload is Done.',
273
+ example: '2026-03-18T13:21:48.170Z'
274
+ },
275
+ signalsUploadReason: {
276
+ type: 'string',
277
+ description: 'Human-readable reason when signalsUpload is Failed or Skipped.',
278
+ example: 'parquet file empty or missing after close'
279
+ }
280
+ }
281
+ };
282
+ export const strategyIdSchema = {
283
+ description: 'Unique identifier for a compiled strategy',
284
+ type: 'string',
285
+ example: '6bsh31ikwkuivhtgcoa6s4'
286
+ };
287
+ //# sourceMappingURL=schemas.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.gen.js","sourceRoot":"","sources":["../../src/generated/schemas.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;IAC7B,UAAU,EAAE;QACR,IAAI,EAAE;YACF,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,GAAG;SACf;QACD,OAAO,EAAE;YACL,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,iBAAiB;SAC7B;KACJ;CACK,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,UAAU;CACb,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC;IACjC,U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,EAAE,iJAAiJ;YAC9J,OAAO,EAAE,+GAA+G;SAC3H;QACD,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;YACnC,WAAW,EAAE,qJAAqJ;YAClK,OAAO,EAAE,MAAM;SAClB;QACD,iBAAiB,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,2FAA2F;YACxG,OAAO,EAAE,0BAA0B;SACtC;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gEAAgE;YAC7E,OAAO,EAAE,2CAA2C;SACvD;KACJ;CACK,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,WAAW,EAAE,2CAA2C;IACxD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,wBAAwB;CAC3B,CAAC"}
@@ -0,0 +1,98 @@
1
+ import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
2
+ import type { GetExchangesData, GetInstrumentsData, PostStrategyData, PostStrategyResponse, GetStrategyStatusData, PrepareBacktestingData, GetPreparationStatusData, ExecuteBacktestingData, CancelExecutionData, GetExecutionResultData } from './types.gen';
3
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
+ /**
5
+ * You can provide a client instance returned by `createClient()` instead of
6
+ * individual options. This might be also useful if you want to implement a
7
+ * custom client.
8
+ */
9
+ client?: Client;
10
+ /**
11
+ * You can pass arbitrary values through the `meta` object. This can be
12
+ * used to access values that aren't defined as part of the SDK function.
13
+ */
14
+ meta?: Record<string, unknown>;
15
+ };
16
+ /**
17
+ * Get a list of available exchanges
18
+ */
19
+ export declare const getExchanges: <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Exchange[], unknown, ThrowOnError>;
20
+ /**
21
+ * Get a list of Instruments from a specific exchange
22
+ */
23
+ export declare const getInstruments: <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").InstrumentDetail[], import("./types.gen").ResponseError, ThrowOnError>;
24
+ /**
25
+ * Compile a strategy from source code
26
+ * Submits raw strategy source for compilation. By default the call is synchronous and returns
27
+ * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue
28
+ * the compile task and return immediately with a `jobId` — poll
29
+ * `GET /strategy/{strategyId}` to check status.
30
+ *
31
+ * The `strategyId` is deterministic: the same source for the same user always produces the
32
+ * same id.
33
+ *
34
+ */
35
+ export declare const postStrategy: <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<PostStrategyResponse, import("./types.gen").ResponseError, ThrowOnError>;
36
+ /**
37
+ * Get the status of an async compile task
38
+ * Polls the status of a strategy compilation. Useful when the strategy was submitted with
39
+ * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
40
+ *
41
+ */
42
+ export declare const getStrategyStatus: <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
43
+ jobId?: string;
44
+ status: "New" | "Started" | "Completed" | "Aborted" | "Failed";
45
+ strategyId?: import("./types.gen").StrategyId;
46
+ statusDetail?: string | null;
47
+ }, import("./types.gen").ResponseError, ThrowOnError>;
48
+ /**
49
+ * Prepare backtesting data
50
+ * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
51
+ * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
52
+ *
53
+ * The same params always return the same `jobId` (idempotent). Repeated calls with identical
54
+ * params do not enqueue duplicate work — they reuse the existing job.
55
+ *
56
+ */
57
+ export declare const prepareBacktesting: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").AcceptedJob, import("./types.gen").ResponseError, ThrowOnError>;
58
+ /**
59
+ * Get the status of a prepare job
60
+ * Retrieves the current state of the prepare job identified by `jobId`.
61
+ * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
62
+ *
63
+ */
64
+ export declare const getPreparationStatus: <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").JobState, import("./types.gen").ResponseError, ThrowOnError>;
65
+ /**
66
+ * Execute a compiled strategy against a prepared dataset
67
+ * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
68
+ * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are
69
+ * recovered from the prepare job — they do not need to be sent again.
70
+ *
71
+ * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
72
+ * for the result.
73
+ *
74
+ * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
75
+ * `jobId` (idempotent).
76
+ *
77
+ */
78
+ export declare const executeBacktesting: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").AcceptedJob, import("./types.gen").ResponseError, ThrowOnError>;
79
+ /**
80
+ * Cancel a running backtest execution
81
+ * Requests cancellation of the specified execution. The execution
82
+ * status will transition to `Aborted` once the cancellation is
83
+ * processed. Cancellation is asynchronous — poll the GET endpoint
84
+ * to confirm the final status.
85
+ *
86
+ */
87
+ export declare const cancelExecution: <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
88
+ status?: "cancelling";
89
+ jobId?: string;
90
+ }, import("./types.gen").ResponseError, ThrowOnError>;
91
+ /**
92
+ * Get the result of a backtest execution job
93
+ * Retrieves the current state and results of the execute job identified by `jobId`.
94
+ * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
95
+ *
96
+ */
97
+ export declare const getExecutionResult: <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").BacktestJobResult, import("./types.gen").ResponseError, ThrowOnError>;
98
+ //# sourceMappingURL=sdk.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAwB,kBAAkB,EAA+C,gBAAgB,EAAE,oBAAoB,EAAqB,qBAAqB,EAAqD,sBAAsB,EAAuD,wBAAwB,EAA2D,sBAAsB,EAAuD,mBAAmB,EAAiD,sBAAsB,EAAuD,MAAM,aAAa,CAAC;AAG9oB,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAAE,YAAY,SAAS,OAAO,GAAG,OAAO,IAAI,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG;IACtI;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,UAAU,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,2GAKnH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,kBAAkB,EAAE,YAAY,CAAC,+IAKtH,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,2HAgBlH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC;;;;;qDAW5H,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,sBAAsB,EAAE,YAAY,CAAC,wIAe9H,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,wBAAwB,EAAE,YAAY,CAAC,qIAWlI,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,sBAAsB,EAAE,YAAY,CAAC,wIAe9H,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,mBAAmB,EAAE,YAAY,CAAC;;;qDAWxH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,sBAAsB,EAAE,YAAY,CAAC,8IAW9H,CAAC"}
@@ -0,0 +1,177 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client as _heyApiClient } from './client.gen';
3
+ /**
4
+ * Get a list of available exchanges
5
+ */
6
+ export const getExchanges = (options) => {
7
+ return (options?.client ?? _heyApiClient).get({
8
+ url: '/exchanges',
9
+ ...options
10
+ });
11
+ };
12
+ /**
13
+ * Get a list of Instruments from a specific exchange
14
+ */
15
+ export const getInstruments = (options) => {
16
+ return (options.client ?? _heyApiClient).get({
17
+ url: '/exchange/{exchangeId}/instruments',
18
+ ...options
19
+ });
20
+ };
21
+ /**
22
+ * Compile a strategy from source code
23
+ * Submits raw strategy source for compilation. By default the call is synchronous and returns
24
+ * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue
25
+ * the compile task and return immediately with a `jobId` — poll
26
+ * `GET /strategy/{strategyId}` to check status.
27
+ *
28
+ * The `strategyId` is deterministic: the same source for the same user always produces the
29
+ * same id.
30
+ *
31
+ */
32
+ export const postStrategy = (options) => {
33
+ return (options.client ?? _heyApiClient).post({
34
+ bodySerializer: null,
35
+ security: [
36
+ {
37
+ scheme: 'bearer',
38
+ type: 'http'
39
+ }
40
+ ],
41
+ url: '/strategy',
42
+ ...options,
43
+ headers: {
44
+ 'Content-Type': 'text/plain',
45
+ ...options?.headers
46
+ }
47
+ });
48
+ };
49
+ /**
50
+ * Get the status of an async compile task
51
+ * Polls the status of a strategy compilation. Useful when the strategy was submitted with
52
+ * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
53
+ *
54
+ */
55
+ export const getStrategyStatus = (options) => {
56
+ return (options.client ?? _heyApiClient).get({
57
+ security: [
58
+ {
59
+ scheme: 'bearer',
60
+ type: 'http'
61
+ }
62
+ ],
63
+ url: '/strategy/{strategyId}',
64
+ ...options
65
+ });
66
+ };
67
+ /**
68
+ * Prepare backtesting data
69
+ * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
70
+ * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
71
+ *
72
+ * The same params always return the same `jobId` (idempotent). Repeated calls with identical
73
+ * params do not enqueue duplicate work — they reuse the existing job.
74
+ *
75
+ */
76
+ export const prepareBacktesting = (options) => {
77
+ return (options.client ?? _heyApiClient).post({
78
+ security: [
79
+ {
80
+ scheme: 'bearer',
81
+ type: 'http'
82
+ }
83
+ ],
84
+ url: '/backtest/{exchangeId}/{type}/prepare',
85
+ ...options,
86
+ headers: {
87
+ 'Content-Type': 'application/json',
88
+ ...options?.headers
89
+ }
90
+ });
91
+ };
92
+ /**
93
+ * Get the status of a prepare job
94
+ * Retrieves the current state of the prepare job identified by `jobId`.
95
+ * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
96
+ *
97
+ */
98
+ export const getPreparationStatus = (options) => {
99
+ return (options.client ?? _heyApiClient).get({
100
+ security: [
101
+ {
102
+ scheme: 'bearer',
103
+ type: 'http'
104
+ }
105
+ ],
106
+ url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',
107
+ ...options
108
+ });
109
+ };
110
+ /**
111
+ * Execute a compiled strategy against a prepared dataset
112
+ * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
113
+ * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are
114
+ * recovered from the prepare job — they do not need to be sent again.
115
+ *
116
+ * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
117
+ * for the result.
118
+ *
119
+ * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
120
+ * `jobId` (idempotent).
121
+ *
122
+ */
123
+ export const executeBacktesting = (options) => {
124
+ return (options.client ?? _heyApiClient).post({
125
+ security: [
126
+ {
127
+ scheme: 'bearer',
128
+ type: 'http'
129
+ }
130
+ ],
131
+ url: '/backtest/{exchangeId}/{type}/execute',
132
+ ...options,
133
+ headers: {
134
+ 'Content-Type': 'application/json',
135
+ ...options?.headers
136
+ }
137
+ });
138
+ };
139
+ /**
140
+ * Cancel a running backtest execution
141
+ * Requests cancellation of the specified execution. The execution
142
+ * status will transition to `Aborted` once the cancellation is
143
+ * processed. Cancellation is asynchronous — poll the GET endpoint
144
+ * to confirm the final status.
145
+ *
146
+ */
147
+ export const cancelExecution = (options) => {
148
+ return (options.client ?? _heyApiClient).delete({
149
+ security: [
150
+ {
151
+ scheme: 'bearer',
152
+ type: 'http'
153
+ }
154
+ ],
155
+ url: '/backtest/{exchangeId}/{type}/execute/{jobId}',
156
+ ...options
157
+ });
158
+ };
159
+ /**
160
+ * Get the result of a backtest execution job
161
+ * Retrieves the current state and results of the execute job identified by `jobId`.
162
+ * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
163
+ *
164
+ */
165
+ export const getExecutionResult = (options) => {
166
+ return (options.client ?? _heyApiClient).get({
167
+ security: [
168
+ {
169
+ scheme: 'bearer',
170
+ type: 'http'
171
+ }
172
+ ],
173
+ url: '/backtest/{exchangeId}/{type}/execute/{jobId}',
174
+ ...options
175
+ });
176
+ };
177
+ //# sourceMappingURL=sdk.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.gen.js","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAIrD,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAgBvD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAuC,OAAiD,EAAE,EAAE;IACpH,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,aAAa,CAAC,CAAC,GAAG,CAA8C;QACvF,GAAG,EAAE,YAAY;QACjB,GAAG,OAAO;KACb,CAAC,CAAC;AACP,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAuC,OAAkD,EAAE,EAAE;IACvH,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,CAAC,GAAG,CAA4D;QACpG,GAAG,EAAE,oCAAoC;QACzC,GAAG,OAAO;KACb,CAAC,CAAC;AACP,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAuC,OAAgD,EAAE,EAAE;IACnH,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,CAAC,IAAI,CAAwD;QACjG,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN;gBACI,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,MAAM;aACf;SACJ;QACD,GAAG,EAAE,WAAW;QACh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