@qtsurfer/api-client 0.1.0 → 0.1.2

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 CHANGED
@@ -1,3 +1,811 @@
1
- export * from './generated';
2
- export { client } from './generated/client.gen';
3
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _hey_api_client_fetch from '@hey-api/client-fetch';
2
+ import { TDataShape, Options as Options$1, Client } from '@hey-api/client-fetch';
3
+
4
+ /**
5
+ * General response error
6
+ */
7
+ type ResponseError = {
8
+ /**
9
+ * Status code
10
+ */
11
+ code: number;
12
+ /**
13
+ * Error description
14
+ */
15
+ message: string;
16
+ };
17
+ /**
18
+ * Exchange instrument identifier (e.g. a currency pair)
19
+ */
20
+ type Instrument = string;
21
+ /**
22
+ * Exchange instrument with data availability and market info
23
+ */
24
+ type InstrumentDetail = {
25
+ /**
26
+ * Instrument identifier (e.g. currency pair)
27
+ */
28
+ id: string;
29
+ /**
30
+ * Base currency
31
+ */
32
+ base: string;
33
+ /**
34
+ * Quote currency
35
+ */
36
+ 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;
45
+ /**
46
+ * Last traded price
47
+ */
48
+ lastPrice?: number;
49
+ /**
50
+ * Trading volume in the last 24 hours (in quote currency)
51
+ */
52
+ volume24h?: number;
53
+ };
54
+ /**
55
+ * Exchange service provider
56
+ */
57
+ type Exchange = {
58
+ /**
59
+ * Unique identifier for the exchange
60
+ */
61
+ id: string;
62
+ /**
63
+ * Name of the exchange
64
+ */
65
+ name: string;
66
+ /**
67
+ * Description of the exchange
68
+ */
69
+ description?: string;
70
+ };
71
+ /**
72
+ * Managed exchange data sources available for backtesting.
73
+ */
74
+ type DataSourceType = 'ticker';
75
+ /**
76
+ * Information about a single job
77
+ */
78
+ type JobState = {
79
+ /**
80
+ * Opaque context identifier for the job
81
+ */
82
+ contextId: string;
83
+ /**
84
+ * Current status of the job. `Partial` (prepare only) means some
85
+ * hours are still being produced asynchronously — keep polling.
86
+ * Treat `Completed | Aborted | Failed` as terminal; anything else
87
+ * means keep polling.
88
+ *
89
+ */
90
+ status: 'New' | 'Started' | 'Partial' | 'Completed' | 'Aborted' | 'Failed';
91
+ /**
92
+ * Detailed status information, if available
93
+ */
94
+ statusDetail?: string | null;
95
+ /**
96
+ * Total size of the data being prepared
97
+ */
98
+ size: number;
99
+ /**
100
+ * The amount of data processed so far
101
+ */
102
+ completed: number;
103
+ /**
104
+ * Timestamp for when the preparation started
105
+ */
106
+ startTime?: string | null;
107
+ /**
108
+ * Timestamp for when the preparation finished
109
+ */
110
+ endTime?: string | null;
111
+ };
112
+ /**
113
+ * Response returned by async endpoints (`202 Accepted`). The `jobId` is deterministic for the
114
+ * same input parameters — repeated calls with identical params return the same id.
115
+ *
116
+ */
117
+ type AcceptedJob = {
118
+ /**
119
+ * Unique job identifier; use this to poll for completion.
120
+ */
121
+ jobId: string;
122
+ };
123
+ /**
124
+ * Backtest job result.
125
+ */
126
+ type BacktestJobResult = {
127
+ results: ResultMap;
128
+ state: JobState;
129
+ };
130
+ /**
131
+ * 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.
132
+ */
133
+ type ResultMap = {
134
+ /**
135
+ * Identifier of the worker that executed the strategy. Useful when reporting issues so support can correlate with logs.
136
+ */
137
+ hostName?: string;
138
+ /**
139
+ * Instrument operations per second throughput during execution
140
+ */
141
+ iops?: number;
142
+ /**
143
+ * Identifier of the compiled strategy that produced this result
144
+ */
145
+ strategyId: string;
146
+ /**
147
+ * The instrument (currency pair) that was backtested
148
+ */
149
+ instrument: string;
150
+ /**
151
+ * Total profit and loss in the output currency
152
+ */
153
+ pnlTotal?: number;
154
+ /**
155
+ * Total number of trades executed by the strategy
156
+ */
157
+ totalTrades?: number;
158
+ /**
159
+ * Percentage of profitable trades (0-100)
160
+ */
161
+ winRate?: number;
162
+ /**
163
+ * Risk-adjusted return ratio (mean return / standard deviation of returns)
164
+ */
165
+ sharpeRatio?: number;
166
+ /**
167
+ * Downside risk-adjusted return ratio (mean return / downside deviation)
168
+ */
169
+ sortinoRatio?: number;
170
+ /**
171
+ * Compound Annual Growth Rate
172
+ */
173
+ cagr?: number;
174
+ /**
175
+ * Maximum absolute drawdown in the output currency
176
+ */
177
+ maxDrawdown?: number;
178
+ /**
179
+ * Maximum percentage drawdown from peak equity
180
+ */
181
+ maxDrawdownPercent?: number;
182
+ /**
183
+ * Number of signals emitted during strategy execution
184
+ */
185
+ signalCount?: number;
186
+ /**
187
+ * Storage key for the signals file. Treat as opaque; use signalsUrl to download.
188
+ */
189
+ signalsId?: string;
190
+ /**
191
+ * HTTPS URL to download the signals Parquet file. Use signalsUpload to know when it's ready.
192
+ */
193
+ signalsUrl?: string;
194
+ /**
195
+ * Upload status. Done = signal file is available at signalsUrl. Failed = upload error (see signalsUploadReason). Skipped = no signals emitted.
196
+ */
197
+ signalsUpload?: 'Done' | 'Failed' | 'Skipped';
198
+ /**
199
+ * ISO 8601 timestamp of when the upload completed. Only present when signalsUpload is Done.
200
+ */
201
+ signalsUploadedAt?: string;
202
+ /**
203
+ * Human-readable reason when signalsUpload is Failed or Skipped.
204
+ */
205
+ signalsUploadReason?: string;
206
+ };
207
+ /**
208
+ * Unique identifier for a compiled strategy
209
+ */
210
+ type StrategyId = string;
211
+ type GetExchangesData = {
212
+ body?: never;
213
+ path?: never;
214
+ query?: never;
215
+ url: '/exchanges';
216
+ };
217
+ type GetExchangesResponses = {
218
+ /**
219
+ * A JSON array of Exchanges
220
+ */
221
+ 200: Array<Exchange>;
222
+ };
223
+ type GetExchangesResponse = GetExchangesResponses[keyof GetExchangesResponses];
224
+ type GetInstrumentsData = {
225
+ body?: never;
226
+ path: {
227
+ /**
228
+ * ID of the exchange to retrieve instruments for
229
+ */
230
+ exchangeId: string;
231
+ };
232
+ query?: never;
233
+ url: '/exchange/{exchangeId}/instruments';
234
+ };
235
+ type GetInstrumentsErrors = {
236
+ /**
237
+ * Exchange not found or instrument catalog not available
238
+ */
239
+ 404: ResponseError;
240
+ };
241
+ type GetInstrumentsError = GetInstrumentsErrors[keyof GetInstrumentsErrors];
242
+ type GetInstrumentsResponses = {
243
+ /**
244
+ * A JSON array of Instrument details with data availability
245
+ */
246
+ 200: Array<InstrumentDetail>;
247
+ };
248
+ type GetInstrumentsResponse = GetInstrumentsResponses[keyof GetInstrumentsResponses];
249
+ type GetExchangeTickersHourData = {
250
+ body?: never;
251
+ path: {
252
+ /**
253
+ * ID of the exchange (e.g. `binance`).
254
+ */
255
+ exchangeId: string;
256
+ /**
257
+ * Base asset symbol (first leg of the pair).
258
+ */
259
+ base: string;
260
+ /**
261
+ * Quote asset symbol (second leg of the pair).
262
+ */
263
+ quote: string;
264
+ };
265
+ query: {
266
+ /**
267
+ * Hour selector in `YYYY-MM-DDTHH` (UTC). The returned segment covers
268
+ * `[HH:00:00Z, HH+1:00:00Z)`.
269
+ *
270
+ */
271
+ hour: string;
272
+ /**
273
+ * Response wire format. `lastra` (default) returns raw Lastra bytes.
274
+ * `parquet` returns Parquet via on-the-fly conversion using
275
+ * [lastra-convert](https://github.com/QTSurfer/lastra-convert).
276
+ *
277
+ */
278
+ format?: 'lastra' | 'parquet';
279
+ };
280
+ url: '/exchange/{exchangeId}/tickers/{base}/{quote}';
281
+ };
282
+ type GetExchangeTickersHourErrors = {
283
+ /**
284
+ * Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
285
+ */
286
+ 400: ResponseError;
287
+ /**
288
+ * No Lastra segment exists for the requested instrument/hour.
289
+ */
290
+ 404: ResponseError;
291
+ /**
292
+ * Unexpected I/O error serving the file.
293
+ */
294
+ 500: ResponseError;
295
+ };
296
+ type GetExchangeTickersHourError = GetExchangeTickersHourErrors[keyof GetExchangeTickersHourErrors];
297
+ type GetExchangeTickersHourResponses = {
298
+ /**
299
+ * One hour of tickers for the instrument. `Content-Type` is
300
+ * `application/vnd.lastra` by default or
301
+ * `application/vnd.apache.parquet` when `format=parquet` was
302
+ * requested.
303
+ *
304
+ */
305
+ 200: Blob | File;
306
+ };
307
+ type GetExchangeTickersHourResponse = GetExchangeTickersHourResponses[keyof GetExchangeTickersHourResponses];
308
+ type GetExchangeKlinesHourData = {
309
+ body?: never;
310
+ path: {
311
+ /**
312
+ * ID of the exchange (e.g. `binance`).
313
+ */
314
+ exchangeId: string;
315
+ /**
316
+ * Base asset symbol.
317
+ */
318
+ base: string;
319
+ /**
320
+ * Quote asset symbol.
321
+ */
322
+ quote: string;
323
+ };
324
+ query: {
325
+ /**
326
+ * Hour selector in `YYYY-MM-DDTHH` (UTC). The returned segment covers
327
+ * `[HH:00:00Z, HH+1:00:00Z)`.
328
+ *
329
+ */
330
+ hour: string;
331
+ /**
332
+ * Response wire format. `lastra` (default) returns raw Lastra bytes.
333
+ * `parquet` returns Parquet via on-the-fly conversion.
334
+ *
335
+ */
336
+ format?: 'lastra' | 'parquet';
337
+ };
338
+ url: '/exchange/{exchangeId}/klines/{base}/{quote}';
339
+ };
340
+ type GetExchangeKlinesHourErrors = {
341
+ /**
342
+ * Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
343
+ */
344
+ 400: ResponseError;
345
+ /**
346
+ * No Lastra segment exists for the requested instrument/hour.
347
+ */
348
+ 404: ResponseError;
349
+ /**
350
+ * Unexpected I/O error serving the file.
351
+ */
352
+ 500: ResponseError;
353
+ };
354
+ type GetExchangeKlinesHourError = GetExchangeKlinesHourErrors[keyof GetExchangeKlinesHourErrors];
355
+ type GetExchangeKlinesHourResponses = {
356
+ /**
357
+ * One hour of klines for the instrument. `Content-Type` is
358
+ * `application/vnd.lastra` by default or
359
+ * `application/vnd.apache.parquet` when `format=parquet`.
360
+ *
361
+ */
362
+ 200: Blob | File;
363
+ };
364
+ type GetExchangeKlinesHourResponse = GetExchangeKlinesHourResponses[keyof GetExchangeKlinesHourResponses];
365
+ type PostStrategyData = {
366
+ /**
367
+ * Raw strategy Java source code
368
+ */
369
+ body: string;
370
+ headers?: {
371
+ /**
372
+ * When `true`, compile asynchronously and return `202` with a `jobId`.
373
+ */
374
+ 'X-Compile-Async'?: boolean;
375
+ };
376
+ path?: never;
377
+ query?: never;
378
+ url: '/strategy';
379
+ };
380
+ type PostStrategyErrors = {
381
+ /**
382
+ * Invalid strategy (compilation error)
383
+ */
384
+ 400: ResponseError;
385
+ };
386
+ type PostStrategyError = PostStrategyErrors[keyof PostStrategyErrors];
387
+ type PostStrategyResponses = {
388
+ /**
389
+ * Strategy compiled successfully (sync mode)
390
+ */
391
+ 200: {
392
+ strategyId: StrategyId;
393
+ };
394
+ /**
395
+ * Compile task accepted (async mode — set `X-Compile-Async: true`)
396
+ */
397
+ 202: AcceptedJob;
398
+ };
399
+ type PostStrategyResponse = PostStrategyResponses[keyof PostStrategyResponses];
400
+ type GetStrategyStatusData = {
401
+ body?: never;
402
+ path: {
403
+ /**
404
+ * The id returned by `POST /strategy` (sync) or the `jobId` returned in async mode
405
+ */
406
+ strategyId: string;
407
+ };
408
+ query?: never;
409
+ url: '/strategy/{strategyId}';
410
+ };
411
+ type GetStrategyStatusErrors = {
412
+ /**
413
+ * Strategy compile job not found
414
+ */
415
+ 404: ResponseError;
416
+ };
417
+ type GetStrategyStatusError = GetStrategyStatusErrors[keyof GetStrategyStatusErrors];
418
+ type GetStrategyStatusResponses = {
419
+ /**
420
+ * Strategy compile state
421
+ */
422
+ 200: {
423
+ /**
424
+ * Compile job id (only set in async mode)
425
+ */
426
+ jobId?: string;
427
+ status: 'New' | 'Started' | 'Completed' | 'Aborted' | 'Failed';
428
+ strategyId?: StrategyId;
429
+ /**
430
+ * Compilation error messages when `status` is `Failed`
431
+ */
432
+ statusDetail?: string | null;
433
+ };
434
+ };
435
+ type GetStrategyStatusResponse = GetStrategyStatusResponses[keyof GetStrategyStatusResponses];
436
+ type PrepareBacktestingData = {
437
+ /**
438
+ * The required data to prepare a backtesting
439
+ */
440
+ body: {
441
+ instrument: Instrument;
442
+ /**
443
+ * Start date for the preparation process. Supports the following formats:
444
+ * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
445
+ * - ISO DATE (e.g. 2024-12-14)
446
+ * - BASIC ISO DATE (e.g., 20241214)
447
+ *
448
+ */
449
+ from: string;
450
+ /**
451
+ * End date for the preparation process. Supports the following formats:
452
+ * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
453
+ * - ISO DATE (e.g. 2024-12-14)
454
+ * - BASIC ISO DATE (e.g., 20241214)
455
+ *
456
+ */
457
+ to: string;
458
+ /**
459
+ * Output bar cadence for the prepared range. Defaults to the publisher's
460
+ * native cadence (`1s`); coarser cadences are produced on demand via
461
+ * resampling and stored alongside the native blob in cache. Coarser-than-
462
+ * source values must be exact multiples of the source cadence — invalid
463
+ * labels return `400`.
464
+ *
465
+ */
466
+ cadence?: '1s' | '5s' | '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
467
+ };
468
+ path: {
469
+ /**
470
+ * ID of the exchange to prepare the backtesting for
471
+ */
472
+ exchangeId: string;
473
+ /**
474
+ * The type of data source to prepare from
475
+ */
476
+ type: DataSourceType;
477
+ };
478
+ query?: never;
479
+ url: '/backtest/{exchangeId}/{type}/prepare';
480
+ };
481
+ type PrepareBacktestingErrors = {
482
+ /**
483
+ * Invalid request or parameters. Also returned when `from` is older than the configured
484
+ * lookback window or `to` is in the future.
485
+ *
486
+ */
487
+ 400: ResponseError;
488
+ /**
489
+ * Exchange or data source type not found
490
+ */
491
+ 404: ResponseError;
492
+ /**
493
+ * Rate limited. Returned when the global queue exceeds capacity or the user has too many
494
+ * active backtests.
495
+ *
496
+ */
497
+ 429: ResponseError;
498
+ };
499
+ type PrepareBacktestingError = PrepareBacktestingErrors[keyof PrepareBacktestingErrors];
500
+ type PrepareBacktestingResponses = {
501
+ /**
502
+ * Prepare task accepted (queued for processing)
503
+ */
504
+ 202: AcceptedJob;
505
+ };
506
+ type PrepareBacktestingResponse = PrepareBacktestingResponses[keyof PrepareBacktestingResponses];
507
+ type GetPreparationStatusData = {
508
+ body?: never;
509
+ path: {
510
+ /**
511
+ * ID of the exchange for the backtesting process
512
+ */
513
+ exchangeId: string;
514
+ /**
515
+ * The type of data source to prepare from
516
+ */
517
+ type: DataSourceType;
518
+ /**
519
+ * Job ID returned by `POST /prepare`
520
+ */
521
+ jobId: string;
522
+ };
523
+ query?: never;
524
+ url: '/backtest/{exchangeId}/{type}/prepare/{jobId}';
525
+ };
526
+ type GetPreparationStatusErrors = {
527
+ /**
528
+ * Invalid request or parameters
529
+ */
530
+ 400: ResponseError;
531
+ /**
532
+ * Prepare job not found or expired
533
+ */
534
+ 404: ResponseError;
535
+ };
536
+ type GetPreparationStatusError = GetPreparationStatusErrors[keyof GetPreparationStatusErrors];
537
+ type GetPreparationStatusResponses = {
538
+ /**
539
+ * Current prepare job state
540
+ */
541
+ 200: JobState;
542
+ };
543
+ type GetPreparationStatusResponse = GetPreparationStatusResponses[keyof GetPreparationStatusResponses];
544
+ type ExecuteBacktestingData = {
545
+ /**
546
+ * Execute task parameters
547
+ */
548
+ body: {
549
+ /**
550
+ * Job ID returned by `POST /prepare` (must be in `Completed` state)
551
+ */
552
+ prepareJobId: string;
553
+ strategyId: StrategyId;
554
+ /**
555
+ * When true, the worker uploads emitted signals to object storage and the
556
+ * response includes `signalsUrl` / `signalsId` fields. Defaults to false.
557
+ *
558
+ */
559
+ storeSignals?: boolean;
560
+ };
561
+ path: {
562
+ /**
563
+ * ID of the exchange for the backtesting process
564
+ */
565
+ exchangeId: string;
566
+ /**
567
+ * The type of data source to execute from
568
+ */
569
+ type: DataSourceType;
570
+ };
571
+ query?: never;
572
+ url: '/backtest/{exchangeId}/{type}/execute';
573
+ };
574
+ type ExecuteBacktestingErrors = {
575
+ /**
576
+ * Invalid request or parameters
577
+ */
578
+ 400: ResponseError;
579
+ /**
580
+ * Prepare job not found or expired
581
+ */
582
+ 404: ResponseError;
583
+ /**
584
+ * Rate limited (global queue at capacity or per-user limit reached)
585
+ */
586
+ 429: ResponseError;
587
+ };
588
+ type ExecuteBacktestingError = ExecuteBacktestingErrors[keyof ExecuteBacktestingErrors];
589
+ type ExecuteBacktestingResponses = {
590
+ /**
591
+ * Execute task accepted (queued for processing)
592
+ */
593
+ 202: AcceptedJob;
594
+ };
595
+ type ExecuteBacktestingResponse = ExecuteBacktestingResponses[keyof ExecuteBacktestingResponses];
596
+ type CancelExecutionData = {
597
+ body?: never;
598
+ path: {
599
+ exchangeId: string;
600
+ type: DataSourceType;
601
+ /**
602
+ * Job ID returned by `POST /execute`
603
+ */
604
+ jobId: string;
605
+ };
606
+ query?: never;
607
+ url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
608
+ };
609
+ type CancelExecutionErrors = {
610
+ /**
611
+ * Execution not found
612
+ */
613
+ 404: ResponseError;
614
+ };
615
+ type CancelExecutionError = CancelExecutionErrors[keyof CancelExecutionErrors];
616
+ type CancelExecutionResponses = {
617
+ /**
618
+ * Cancellation request accepted
619
+ */
620
+ 200: {
621
+ status?: 'cancelling';
622
+ jobId?: string;
623
+ };
624
+ };
625
+ type CancelExecutionResponse = CancelExecutionResponses[keyof CancelExecutionResponses];
626
+ type GetExecutionResultData = {
627
+ body?: never;
628
+ path: {
629
+ /**
630
+ * ID of the exchange for the backtesting process
631
+ */
632
+ exchangeId: string;
633
+ /**
634
+ * The type of data source to execute from
635
+ */
636
+ type: DataSourceType;
637
+ /**
638
+ * Job ID returned by `POST /execute`
639
+ */
640
+ jobId: string;
641
+ };
642
+ query?: never;
643
+ url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
644
+ };
645
+ type GetExecutionResultErrors = {
646
+ /**
647
+ * Invalid request or parameters
648
+ */
649
+ 400: ResponseError;
650
+ /**
651
+ * Execution job not found
652
+ */
653
+ 404: ResponseError;
654
+ };
655
+ type GetExecutionResultError = GetExecutionResultErrors[keyof GetExecutionResultErrors];
656
+ type GetExecutionResultResponses = {
657
+ /**
658
+ * Backtesting execution result
659
+ */
660
+ 200: BacktestJobResult;
661
+ };
662
+ type GetExecutionResultResponse = GetExecutionResultResponses[keyof GetExecutionResultResponses];
663
+ type ClientOptions = {
664
+ baseUrl: 'https://api.staging.qtsurfer.com/v1' | 'https://api.qtsurfer.com/v1' | (string & {});
665
+ };
666
+
667
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
668
+ /**
669
+ * You can provide a client instance returned by `createClient()` instead of
670
+ * individual options. This might be also useful if you want to implement a
671
+ * custom client.
672
+ */
673
+ client?: Client;
674
+ /**
675
+ * You can pass arbitrary values through the `meta` object. This can be
676
+ * used to access values that aren't defined as part of the SDK function.
677
+ */
678
+ meta?: Record<string, unknown>;
679
+ };
680
+ /**
681
+ * Get a list of available exchanges
682
+ */
683
+ declare const getExchanges: <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Exchange[], unknown, ThrowOnError>;
684
+ /**
685
+ * Get a list of Instruments from a specific exchange
686
+ */
687
+ declare const getInstruments: <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentDetail[], ResponseError, ThrowOnError>;
688
+ /**
689
+ * Download one hour of tickers for an instrument as a Lastra segment
690
+ * Serves exactly one hour of raw ticker data for the given instrument on the
691
+ * requested exchange. The payload is a native [Lastra](https://github.com/QTSurfer/lastra-java)
692
+ * file — QTSurfer's columnar format for tick-precision timeseries — with
693
+ * no JSON envelope.
694
+ *
695
+ * One segment = one hour, aligned to UTC. The `hour` query parameter selects
696
+ * the segment and must match `YYYY-MM-DDTHH` (no minutes/seconds, no timezone
697
+ * suffix). Example: `hour=2026-01-15T10` returns `h10.lastra` for
698
+ * 2026-01-15, covering `[10:00:00Z, 11:00:00Z)`. Hours not yet available
699
+ * return `404`.
700
+ *
701
+ * A `format=parquet` query parameter switches the response to on-the-fly
702
+ * Parquet conversion via [lastra-convert](https://github.com/QTSurfer/lastra-convert)
703
+ * for clients that don't yet read Lastra. Lastra is the primary format
704
+ * and cheaper when the client can consume it.
705
+ *
706
+ * Clients:
707
+ * - [lastra-java](https://github.com/QTSurfer/lastra-java) — reference
708
+ * Java reader/writer with per-column codecs (ALP, Gorilla, delta-varint,
709
+ * ZSTD) and CRC32 integrity.
710
+ * - [lastra-ts](https://github.com/QTSurfer/lastra-ts) — TypeScript reader
711
+ * (~4 kB bundle, browser + Node.js).
712
+ * - [duckdb-lastra](https://github.com/QTSurfer/duckdb-lastra) — DuckDB
713
+ * extension for ad-hoc SQL over Lastra files.
714
+ * - [lastra-convert](https://github.com/QTSurfer/lastra-convert) — CLI + Java
715
+ * API for converting to/from Parquet, Reef, and CSV.
716
+ * - `curl -OJ` for offline dumps (the `Content-Disposition` header sets a
717
+ * descriptive filename).
718
+ *
719
+ */
720
+ declare const getExchangeTickersHour: <ThrowOnError extends boolean = false>(options: Options<GetExchangeTickersHourData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
721
+ /**
722
+ * Download one hour of klines for an instrument as a Lastra segment
723
+ * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,
724
+ * but serves klines (aggregated bars) instead of raw ticks. One
725
+ * [Lastra](https://github.com/QTSurfer/lastra-java) segment = one hour of
726
+ * klines at the exchange's native kline cadence, aligned to UTC.
727
+ *
728
+ * Klines use the same columnar layout as tickers — readers that handle one
729
+ * format read the other with the same code. Use this endpoint when a
730
+ * per-tick payload would be too large for the window of interest.
731
+ *
732
+ */
733
+ declare const getExchangeKlinesHour: <ThrowOnError extends boolean = false>(options: Options<GetExchangeKlinesHourData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
734
+ /**
735
+ * Compile a strategy from source code
736
+ * Submits raw strategy source for compilation. By default the call is synchronous and returns
737
+ * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue
738
+ * the compile task and return immediately with a `jobId` — poll
739
+ * `GET /strategy/{strategyId}` to check status.
740
+ *
741
+ * The `strategyId` is deterministic: the same source for the same user always produces the
742
+ * same id.
743
+ *
744
+ */
745
+ declare const postStrategy: <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostStrategyResponse, ResponseError, ThrowOnError>;
746
+ /**
747
+ * Get the status of an async compile task
748
+ * Polls the status of a strategy compilation. Useful when the strategy was submitted with
749
+ * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
750
+ *
751
+ */
752
+ declare const getStrategyStatus: <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
753
+ jobId?: string;
754
+ status: "New" | "Started" | "Completed" | "Aborted" | "Failed";
755
+ strategyId?: StrategyId;
756
+ statusDetail?: string | null;
757
+ }, ResponseError, ThrowOnError>;
758
+ /**
759
+ * Prepare backtesting data
760
+ * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
761
+ * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
762
+ *
763
+ * The same params always return the same `jobId` (idempotent). Repeated calls with identical
764
+ * params do not enqueue duplicate work — they reuse the existing job.
765
+ *
766
+ */
767
+ declare const prepareBacktesting: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
768
+ /**
769
+ * Get the status of a prepare job
770
+ * Retrieves the current state of the prepare job identified by `jobId`.
771
+ * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
772
+ *
773
+ */
774
+ declare const getPreparationStatus: <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<JobState, ResponseError, ThrowOnError>;
775
+ /**
776
+ * Execute a compiled strategy against a prepared dataset
777
+ * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
778
+ * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are
779
+ * recovered from the prepare job — they do not need to be sent again.
780
+ *
781
+ * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
782
+ * for the result.
783
+ *
784
+ * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
785
+ * `jobId` (idempotent).
786
+ *
787
+ */
788
+ declare const executeBacktesting: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
789
+ /**
790
+ * Cancel a running backtest execution
791
+ * Requests cancellation of the specified execution. The execution
792
+ * status will transition to `Aborted` once the cancellation is
793
+ * processed. Cancellation is asynchronous — poll the GET endpoint
794
+ * to confirm the final status.
795
+ *
796
+ */
797
+ declare const cancelExecution: <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
798
+ status?: "cancelling";
799
+ jobId?: string;
800
+ }, ResponseError, ThrowOnError>;
801
+ /**
802
+ * Get the result of a backtest execution job
803
+ * Retrieves the current state and results of the execute job identified by `jobId`.
804
+ * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
805
+ *
806
+ */
807
+ declare const getExecutionResult: <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BacktestJobResult, ResponseError, ThrowOnError>;
808
+
809
+ declare const client: _hey_api_client_fetch.Client;
810
+
811
+ export { type AcceptedJob, type BacktestJobResult, type CancelExecutionData, type CancelExecutionError, type CancelExecutionErrors, type CancelExecutionResponse, type CancelExecutionResponses, type ClientOptions, type DataSourceType, 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, cancelExecution, client, executeBacktesting, getExchangeKlinesHour, getExchangeTickersHour, getExchanges, getExecutionResult, getInstruments, getPreparationStatus, getStrategyStatus, postStrategy, prepareBacktesting };