@qtsurfer/api-client 0.8.0 → 0.10.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/README.md +24 -11
- package/dist/index.d.ts +172 -6
- package/dist/index.js +46 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/client.gen.ts +1 -1
- package/src/generated/schemas.gen.ts +67 -0
- package/src/generated/sdk.gen.ts +106 -0
- package/src/generated/types.gen.ts +145 -5
package/README.md
CHANGED
|
@@ -68,20 +68,33 @@ pluggable token stores so callers don't reinvent that plumbing.
|
|
|
68
68
|
|
|
69
69
|
All operations are exported as standalone functions; every operation accepts an `Options` object and returns `{ data, error, response }`.
|
|
70
70
|
|
|
71
|
+
The table is exhaustive: `src/generated/` is produced from the OpenAPI spec, so **all 21 operations**
|
|
72
|
+
the spec declares are exported. The rows below describe **spec version 0.109.2**, which is versioned
|
|
73
|
+
independently of this package.
|
|
74
|
+
|
|
71
75
|
| Function | Method | Path | Purpose |
|
|
72
76
|
| -------- | ------ | ---- | ------- |
|
|
73
77
|
| `authenticate` | POST | `/auth/token` | Exchange an API key for a short-lived JWT |
|
|
74
|
-
| `listExchanges` | GET | `/exchanges` | List available exchanges |
|
|
75
|
-
| `listInstruments` | GET | `/exchange/{exchangeId}/instruments` | List instruments
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
78
|
+
| `listExchanges` | GET | `/exchanges` | List the available exchanges |
|
|
79
|
+
| `listInstruments` | GET | `/exchange/{exchangeId}/instruments` | List an exchange's instruments (default spot segment) |
|
|
80
|
+
| `listSegmentInstruments` | GET | `/exchange/{exchangeId}/{segment}/instruments` | List an exchange segment's instruments |
|
|
81
|
+
| `downloadTickers` | GET | `/exchange/{exchangeId}/tickers/{base}/{quote}` | Download one hour of tickers as a Lastra segment |
|
|
82
|
+
| `downloadKlines` | GET | `/exchange/{exchangeId}/klines/{base}/{quote}` | Download one hour of klines as a Lastra segment |
|
|
83
|
+
| `listStrategies` | GET | `/strategies` | List your registered strategies, most recently compiled first |
|
|
84
|
+
| `compileStrategy` | POST | `/strategy` | Compile and register a strategy |
|
|
85
|
+
| `validateStrategy` | POST | `/strategy/{strategyId}/validate` | Check that a registered strategy can actually run |
|
|
86
|
+
| `getStrategy` | GET | `/strategy/{strategyId}` | Get a strategy by id, including its validation state |
|
|
87
|
+
| `deleteStrategy` | DELETE | `/strategy/{strategyId}` | Release a registered strategy |
|
|
88
|
+
| `getStrategyCode` | GET | `/strategy/{strategyId}/code` | Get a registered strategy's source, if you still have one to read |
|
|
89
|
+
| `prepareBacktest` | POST | `/backtest/{exchangeId}/{type}/prepare` | Prepare backtest data |
|
|
90
|
+
| `getPrepareStatus` | GET | `/backtest/{exchangeId}/{type}/prepare/{jobId}` | Get the status of a prepare job |
|
|
91
|
+
| `executeSweep` | POST | `/backtest/{exchangeId}/{type}/executeSweep/{requestId}` | Execute a parameter sweep over prepared data |
|
|
92
|
+
| `getSweepResult` | GET | `/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}` | Get sweep progress and results |
|
|
93
|
+
| `cancelSweep` | DELETE | `/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}` | Cancel a running parameter sweep |
|
|
94
|
+
| `getSweepSensitivity` | GET | `/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/sensitivity` | Get sweep sensitivity surfaces |
|
|
95
|
+
| `executeBacktest` | POST | `/backtest/{exchangeId}/{type}/execute` | Execute a compiled strategy against a prepared dataset |
|
|
96
|
+
| `cancelBacktest` | DELETE | `/backtest/{exchangeId}/{type}/execute/{jobId}` | Cancel a running backtest execution |
|
|
97
|
+
| `getBacktestResult` | GET | `/backtest/{exchangeId}/{type}/execute/{jobId}` | Get the result of a backtest execution job |
|
|
85
98
|
|
|
86
99
|
All generated types (`Exchange`, `InstrumentDetail`, `BacktestJobResult`, `PrepareJobState`, `ResultMap`, etc.) are re-exported from the root.
|
|
87
100
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,22 @@ type InstrumentLinks = {
|
|
|
63
63
|
*/
|
|
64
64
|
futures?: HalLink;
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* HAL `_links` for a strategy — present on a full `StrategyState` body (`GET
|
|
68
|
+
* /strategy/{strategyId}`, and `POST /strategy/{strategyId}/validate`'s already-validated
|
|
69
|
+
* `200`), absent from that same endpoint's `202` — a deliberately partial stub carrying only
|
|
70
|
+
* what is known before a check has even started. Following `code` can still `404` once
|
|
71
|
+
* present: it documents its own honest "nothing to return" for a strategy with no source of
|
|
72
|
+
* its own (a `REFERENCE` marketplace copy, or one resolved only through the platform's shared
|
|
73
|
+
* pool). This link says where to look, not that something is there.
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
type StrategyLinks = {
|
|
77
|
+
/**
|
|
78
|
+
* Link to this strategy's registered source, `GET /strategy/{strategyId}/code`.
|
|
79
|
+
*/
|
|
80
|
+
code: HalLink;
|
|
81
|
+
};
|
|
66
82
|
/**
|
|
67
83
|
* A HAL link object (Hypertext Application Language)
|
|
68
84
|
*/
|
|
@@ -512,6 +528,11 @@ type ExecuteSweepResult = {
|
|
|
512
528
|
* How many train/test splits the `pbo` figure was averaged over.
|
|
513
529
|
*/
|
|
514
530
|
pboSplits?: number;
|
|
531
|
+
/**
|
|
532
|
+
* Why the sweep produced less than it should have — the cause reported by the **first** shard to fail, not a list. It is what turns an inscrutable empty leaderboard into an answer: a sweep can come back `PARTIAL` with `done: 0` because the strategy could not be loaded at all, and without this the response says only that nothing finished.
|
|
533
|
+
* First failure wins and later ones are not recorded, so on a sweep where several shards failed for different reasons this names one of them rather than all. Absent when no shard reported a cause, which is the normal case for a healthy sweep — read it together with `progress.failedShards` rather than as a count of anything.
|
|
534
|
+
*/
|
|
535
|
+
failReason?: string;
|
|
515
536
|
progress: SweepProgress;
|
|
516
537
|
/**
|
|
517
538
|
* Total result rows currently available.
|
|
@@ -757,6 +778,26 @@ type Notice = {
|
|
|
757
778
|
*/
|
|
758
779
|
provenance?: "execute" | "compile-dry-run";
|
|
759
780
|
};
|
|
781
|
+
/**
|
|
782
|
+
* One entry from `GET /strategies` — the same provenance a full `StrategyState` carries
|
|
783
|
+
* (`compiledAt`, `requiredSources`), without its validation state, so listing stays cheap
|
|
784
|
+
* regardless of how many strategies you have registered. Check a specific strategy's
|
|
785
|
+
* validation with `GET /strategy/{strategyId}`.
|
|
786
|
+
*
|
|
787
|
+
*/
|
|
788
|
+
type StrategySummary = {
|
|
789
|
+
strategyId: StrategyId;
|
|
790
|
+
/**
|
|
791
|
+
* When the live compilation was produced.
|
|
792
|
+
*/
|
|
793
|
+
compiledAt?: string;
|
|
794
|
+
/**
|
|
795
|
+
* The market data this strategy needs. Absent, not empty, when it could
|
|
796
|
+
* not be established without constructing the strategy.
|
|
797
|
+
*
|
|
798
|
+
*/
|
|
799
|
+
requiredSources?: Array<string>;
|
|
800
|
+
};
|
|
760
801
|
/**
|
|
761
802
|
* What is known about a registered strategy: that it compiled, and what validating it found.
|
|
762
803
|
*
|
|
@@ -828,6 +869,7 @@ type StrategyState = {
|
|
|
828
869
|
*
|
|
829
870
|
*/
|
|
830
871
|
validationStalled?: boolean;
|
|
872
|
+
_links?: StrategyLinks;
|
|
831
873
|
};
|
|
832
874
|
type AuthTokenResponse = {
|
|
833
875
|
/**
|
|
@@ -1071,6 +1113,22 @@ type DownloadKlinesResponses = {
|
|
|
1071
1113
|
200: Blob | File;
|
|
1072
1114
|
};
|
|
1073
1115
|
type DownloadKlinesResponse = DownloadKlinesResponses[keyof DownloadKlinesResponses];
|
|
1116
|
+
type ListStrategiesData = {
|
|
1117
|
+
body?: never;
|
|
1118
|
+
path?: never;
|
|
1119
|
+
query?: never;
|
|
1120
|
+
url: "/strategies";
|
|
1121
|
+
};
|
|
1122
|
+
type ListStrategiesResponses = {
|
|
1123
|
+
/**
|
|
1124
|
+
* Your registered strategies. An empty array if you have none — this is never a `404`.
|
|
1125
|
+
*
|
|
1126
|
+
*/
|
|
1127
|
+
200: {
|
|
1128
|
+
strategies: Array<StrategySummary>;
|
|
1129
|
+
};
|
|
1130
|
+
};
|
|
1131
|
+
type ListStrategiesResponse = ListStrategiesResponses[keyof ListStrategiesResponses];
|
|
1074
1132
|
type CompileStrategyData = {
|
|
1075
1133
|
/**
|
|
1076
1134
|
* Raw strategy Java source code
|
|
@@ -1129,13 +1187,44 @@ type ValidateStrategyResponses = {
|
|
|
1129
1187
|
* Validation queued. Not a terminal outcome — poll `GET /strategy/{strategyId}` until
|
|
1130
1188
|
* `validation` leaves `pending`.
|
|
1131
1189
|
*
|
|
1190
|
+
* The body is a `StrategyState` carrying only what is known at this point: the id and
|
|
1191
|
+
* `validation: pending`. **The status code, not the body, is what tells the two responses
|
|
1192
|
+
* apart** — a `200` can also carry `validation: pending`, left by a check an earlier call
|
|
1193
|
+
* queued. So `202` means *this call started a check*, while `pending` means only *a check
|
|
1194
|
+
* is outstanding*.
|
|
1195
|
+
*
|
|
1132
1196
|
*/
|
|
1133
|
-
202:
|
|
1197
|
+
202: StrategyState;
|
|
1198
|
+
};
|
|
1199
|
+
type ValidateStrategyResponse = ValidateStrategyResponses[keyof ValidateStrategyResponses];
|
|
1200
|
+
type DeleteStrategyData = {
|
|
1201
|
+
body?: never;
|
|
1202
|
+
path: {
|
|
1203
|
+
/**
|
|
1204
|
+
* The id returned by `POST /strategy`
|
|
1205
|
+
*/
|
|
1134
1206
|
strategyId: StrategyId;
|
|
1135
|
-
validation: "pending";
|
|
1136
1207
|
};
|
|
1208
|
+
query?: never;
|
|
1209
|
+
url: "/strategy/{strategyId}";
|
|
1137
1210
|
};
|
|
1138
|
-
type
|
|
1211
|
+
type DeleteStrategyErrors = {
|
|
1212
|
+
/**
|
|
1213
|
+
* No such registered strategy for this user
|
|
1214
|
+
*/
|
|
1215
|
+
404: ResponseError;
|
|
1216
|
+
};
|
|
1217
|
+
type DeleteStrategyError = DeleteStrategyErrors[keyof DeleteStrategyErrors];
|
|
1218
|
+
type DeleteStrategyResponses = {
|
|
1219
|
+
/**
|
|
1220
|
+
* Deleted
|
|
1221
|
+
*/
|
|
1222
|
+
200: {
|
|
1223
|
+
strategyId: StrategyId;
|
|
1224
|
+
deleted: true;
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
type DeleteStrategyResponse = DeleteStrategyResponses[keyof DeleteStrategyResponses];
|
|
1139
1228
|
type GetStrategyData = {
|
|
1140
1229
|
body?: never;
|
|
1141
1230
|
path: {
|
|
@@ -1161,6 +1250,37 @@ type GetStrategyResponses = {
|
|
|
1161
1250
|
200: StrategyState;
|
|
1162
1251
|
};
|
|
1163
1252
|
type GetStrategyResponse = GetStrategyResponses[keyof GetStrategyResponses];
|
|
1253
|
+
type GetStrategyCodeData = {
|
|
1254
|
+
body?: never;
|
|
1255
|
+
path: {
|
|
1256
|
+
/**
|
|
1257
|
+
* The id returned by `POST /strategy`
|
|
1258
|
+
*/
|
|
1259
|
+
strategyId: StrategyId;
|
|
1260
|
+
};
|
|
1261
|
+
query?: never;
|
|
1262
|
+
url: "/strategy/{strategyId}/code";
|
|
1263
|
+
};
|
|
1264
|
+
type GetStrategyCodeErrors = {
|
|
1265
|
+
/**
|
|
1266
|
+
* No such registered strategy for this user, or nothing to read for this id
|
|
1267
|
+
*/
|
|
1268
|
+
404: ResponseError;
|
|
1269
|
+
};
|
|
1270
|
+
type GetStrategyCodeError = GetStrategyCodeErrors[keyof GetStrategyCodeErrors];
|
|
1271
|
+
type GetStrategyCodeResponses = {
|
|
1272
|
+
/**
|
|
1273
|
+
* The registered source
|
|
1274
|
+
*/
|
|
1275
|
+
200: {
|
|
1276
|
+
strategyId: StrategyId;
|
|
1277
|
+
/**
|
|
1278
|
+
* Raw strategy Java source code, exactly as registered.
|
|
1279
|
+
*/
|
|
1280
|
+
code: string;
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
type GetStrategyCodeResponse = GetStrategyCodeResponses[keyof GetStrategyCodeResponses];
|
|
1164
1284
|
type PrepareBacktestData = {
|
|
1165
1285
|
/**
|
|
1166
1286
|
* The required data to prepare a backtesting
|
|
@@ -1505,7 +1625,7 @@ type GetBacktestResultResponses = {
|
|
|
1505
1625
|
};
|
|
1506
1626
|
type GetBacktestResultResponse = GetBacktestResultResponses[keyof GetBacktestResultResponses];
|
|
1507
1627
|
type ClientOptions = {
|
|
1508
|
-
baseUrl: "https://api.
|
|
1628
|
+
baseUrl: "https://api.qtsurfer.net/v1" | "https://api.qtsurfer.com/v1" | (string & {});
|
|
1509
1629
|
};
|
|
1510
1630
|
|
|
1511
1631
|
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
@@ -1602,6 +1722,19 @@ declare const downloadTickers: <ThrowOnError extends boolean = false>(options: O
|
|
|
1602
1722
|
*
|
|
1603
1723
|
*/
|
|
1604
1724
|
declare const downloadKlines: <ThrowOnError extends boolean = false>(options: Options<DownloadKlinesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
|
|
1725
|
+
/**
|
|
1726
|
+
* List your registered strategies
|
|
1727
|
+
* Every strategy you have registered and not deleted, most recently compiled first.
|
|
1728
|
+
*
|
|
1729
|
+
* Each entry carries the same provenance `GET /strategy/{strategyId}` does — `compiledAt`,
|
|
1730
|
+
* `requiredSources` — but not its validation state, so listing stays cheap regardless of how
|
|
1731
|
+
* many strategies you have. Check a specific strategy's validation with `GET
|
|
1732
|
+
* /strategy/{strategyId}`.
|
|
1733
|
+
*
|
|
1734
|
+
*/
|
|
1735
|
+
declare const listStrategies: <ThrowOnError extends boolean = false>(options?: Options<ListStrategiesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
1736
|
+
strategies: Array<StrategySummary>;
|
|
1737
|
+
}, unknown, ThrowOnError>;
|
|
1605
1738
|
/**
|
|
1606
1739
|
* Compile and register a strategy
|
|
1607
1740
|
* Compiles raw strategy source and registers it, returning its `strategyId`.
|
|
@@ -1644,7 +1777,25 @@ declare const compileStrategy: <ThrowOnError extends boolean = false>(options: O
|
|
|
1644
1777
|
* bytecode that is no longer what would run.
|
|
1645
1778
|
*
|
|
1646
1779
|
*/
|
|
1647
|
-
declare const validateStrategy: <ThrowOnError extends boolean = false>(options: Options<ValidateStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<
|
|
1780
|
+
declare const validateStrategy: <ThrowOnError extends boolean = false>(options: Options<ValidateStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<StrategyState, ResponseError, ThrowOnError>;
|
|
1781
|
+
/**
|
|
1782
|
+
* Release a registered strategy
|
|
1783
|
+
* Removes a strategy from `GET /strategy/{strategyId}` and `GET /strategies`. This is not
|
|
1784
|
+
* undone by re-submitting the same source to `POST /strategy` — that registers a new
|
|
1785
|
+
* strategy, with a new id.
|
|
1786
|
+
*
|
|
1787
|
+
* **Backtests you already ran against this strategy are unaffected.** Deleting it stops it
|
|
1788
|
+
* from counting against your account and stops you from validating or re-running it under
|
|
1789
|
+
* this id — it does not erase what already happened.
|
|
1790
|
+
*
|
|
1791
|
+
* Only removes a strategy you registered yourself. If you copied someone else's strategy
|
|
1792
|
+
* (a shared/marketplace listing), deleting your copy never affects theirs, or anyone else's.
|
|
1793
|
+
*
|
|
1794
|
+
*/
|
|
1795
|
+
declare const deleteStrategy: <ThrowOnError extends boolean = false>(options: Options<DeleteStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
1796
|
+
strategyId: StrategyId;
|
|
1797
|
+
deleted: true;
|
|
1798
|
+
}, ResponseError, ThrowOnError>;
|
|
1648
1799
|
/**
|
|
1649
1800
|
* Get a strategy by id, including its validation state
|
|
1650
1801
|
* Reports that the strategy is registered — implied by a `200` at all — and what validating it
|
|
@@ -1655,6 +1806,21 @@ declare const validateStrategy: <ThrowOnError extends boolean = false>(options:
|
|
|
1655
1806
|
*
|
|
1656
1807
|
*/
|
|
1657
1808
|
declare const getStrategy: <ThrowOnError extends boolean = false>(options: Options<GetStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<StrategyState, ResponseError, ThrowOnError>;
|
|
1809
|
+
/**
|
|
1810
|
+
* Get a registered strategy's source, if you still have one to read
|
|
1811
|
+
* The exact source you last submitted for this id — the same text `POST /strategy` derives
|
|
1812
|
+
* `strategyId` from, whitespace and comments included.
|
|
1813
|
+
*
|
|
1814
|
+
* **"If available", not "always".** A strategy you resolve only through a shared/marketplace
|
|
1815
|
+
* listing you copied by reference carries no source of its own, and reads as a `404` here the
|
|
1816
|
+
* same as a `strategyId` you never registered — that is the honest answer either way, since
|
|
1817
|
+
* from this endpoint's point of view nothing is there to return.
|
|
1818
|
+
*
|
|
1819
|
+
*/
|
|
1820
|
+
declare const getStrategyCode: <ThrowOnError extends boolean = false>(options: Options<GetStrategyCodeData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
1821
|
+
strategyId: StrategyId;
|
|
1822
|
+
code: string;
|
|
1823
|
+
}, ResponseError, ThrowOnError>;
|
|
1658
1824
|
/**
|
|
1659
1825
|
* Prepare backtest data
|
|
1660
1826
|
* Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
|
|
@@ -1798,4 +1964,4 @@ declare const getBacktestResult: <ThrowOnError extends boolean = false>(options:
|
|
|
1798
1964
|
|
|
1799
1965
|
declare const client: _hey_api_client_fetch.Client;
|
|
1800
1966
|
|
|
1801
|
-
export { type AcceptedJob, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type DataSourceType, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type Notice, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type StrategyId, type StrategyState, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, getBacktestResult, getPrepareStatus, getStrategy, getSweepResult, getSweepSensitivity, listExchanges, listInstruments, listSegmentInstruments, prepareBacktest, validateStrategy };
|
|
1967
|
+
export { type AcceptedJob, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type DataSourceType, type DeleteStrategyData, type DeleteStrategyError, type DeleteStrategyErrors, type DeleteStrategyResponse, type DeleteStrategyResponses, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyCodeData, type GetStrategyCodeError, type GetStrategyCodeErrors, type GetStrategyCodeResponse, type GetStrategyCodeResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type Notice, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type StrategyId, type StrategyLinks, type StrategyState, type StrategySummary, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, getBacktestResult, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepSensitivity, listExchanges, listInstruments, listSegmentInstruments, listStrategies, prepareBacktest, validateStrategy };
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "@hey-api/client-fetch";
|
|
6
6
|
var client = createClient(
|
|
7
7
|
createConfig({
|
|
8
|
-
baseUrl: "https://api.
|
|
8
|
+
baseUrl: "https://api.qtsurfer.net/v1"
|
|
9
9
|
})
|
|
10
10
|
);
|
|
11
11
|
|
|
@@ -52,6 +52,18 @@ var downloadKlines = (options) => {
|
|
|
52
52
|
...options
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
+
var listStrategies = (options) => {
|
|
56
|
+
return (options?.client ?? client).get({
|
|
57
|
+
security: [
|
|
58
|
+
{
|
|
59
|
+
scheme: "bearer",
|
|
60
|
+
type: "http"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
url: "/strategies",
|
|
64
|
+
...options
|
|
65
|
+
});
|
|
66
|
+
};
|
|
55
67
|
var compileStrategy = (options) => {
|
|
56
68
|
return (options.client ?? client).post({
|
|
57
69
|
bodySerializer: null,
|
|
@@ -81,6 +93,18 @@ var validateStrategy = (options) => {
|
|
|
81
93
|
...options
|
|
82
94
|
});
|
|
83
95
|
};
|
|
96
|
+
var deleteStrategy = (options) => {
|
|
97
|
+
return (options.client ?? client).delete({
|
|
98
|
+
security: [
|
|
99
|
+
{
|
|
100
|
+
scheme: "bearer",
|
|
101
|
+
type: "http"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
url: "/strategy/{strategyId}",
|
|
105
|
+
...options
|
|
106
|
+
});
|
|
107
|
+
};
|
|
84
108
|
var getStrategy = (options) => {
|
|
85
109
|
return (options.client ?? client).get({
|
|
86
110
|
security: [
|
|
@@ -93,6 +117,18 @@ var getStrategy = (options) => {
|
|
|
93
117
|
...options
|
|
94
118
|
});
|
|
95
119
|
};
|
|
120
|
+
var getStrategyCode = (options) => {
|
|
121
|
+
return (options.client ?? client).get({
|
|
122
|
+
security: [
|
|
123
|
+
{
|
|
124
|
+
scheme: "bearer",
|
|
125
|
+
type: "http"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
url: "/strategy/{strategyId}/code",
|
|
129
|
+
...options
|
|
130
|
+
});
|
|
131
|
+
};
|
|
96
132
|
var prepareBacktest = (options) => {
|
|
97
133
|
return (options.client ?? client).post({
|
|
98
134
|
security: [
|
|
@@ -163,6 +199,12 @@ var getSweepResult = (options) => {
|
|
|
163
199
|
};
|
|
164
200
|
var getSweepSensitivity = (options) => {
|
|
165
201
|
return (options.client ?? client).get({
|
|
202
|
+
security: [
|
|
203
|
+
{
|
|
204
|
+
scheme: "bearer",
|
|
205
|
+
type: "http"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
166
208
|
url: "/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/sensitivity",
|
|
167
209
|
...options
|
|
168
210
|
});
|
|
@@ -213,6 +255,7 @@ export {
|
|
|
213
255
|
cancelSweep,
|
|
214
256
|
client,
|
|
215
257
|
compileStrategy,
|
|
258
|
+
deleteStrategy,
|
|
216
259
|
downloadKlines,
|
|
217
260
|
downloadTickers,
|
|
218
261
|
executeBacktest,
|
|
@@ -220,11 +263,13 @@ export {
|
|
|
220
263
|
getBacktestResult,
|
|
221
264
|
getPrepareStatus,
|
|
222
265
|
getStrategy,
|
|
266
|
+
getStrategyCode,
|
|
223
267
|
getSweepResult,
|
|
224
268
|
getSweepSensitivity,
|
|
225
269
|
listExchanges,
|
|
226
270
|
listInstruments,
|
|
227
271
|
listSegmentInstruments,
|
|
272
|
+
listStrategies,
|
|
228
273
|
prepareBacktest,
|
|
229
274
|
validateStrategy
|
|
230
275
|
};
|
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 {\n type Config,\n type ClientOptions as DefaultClientOptions,\n createClient,\n createConfig,\n} 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> =\n (\n override?: Config<DefaultClientOptions & T>\n ) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(\n createConfig<ClientOptions>({\n baseUrl: \"https://api.staging.qtsurfer.com/v1\",\n })\n);\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type {\n Options as ClientOptions,\n TDataShape,\n Client,\n} from \"@hey-api/client-fetch\";\nimport type {\n AuthenticateData,\n AuthenticateResponse,\n AuthenticateError,\n ListExchangesData,\n ListExchangesResponse,\n ListInstrumentsData,\n ListInstrumentsResponse,\n ListInstrumentsError,\n ListSegmentInstrumentsData,\n ListSegmentInstrumentsResponse,\n ListSegmentInstrumentsError,\n DownloadTickersData,\n DownloadTickersResponse,\n DownloadTickersError,\n DownloadKlinesData,\n DownloadKlinesResponse,\n DownloadKlinesError,\n CompileStrategyData,\n CompileStrategyResponse,\n CompileStrategyError,\n ValidateStrategyData,\n ValidateStrategyResponse,\n ValidateStrategyError,\n GetStrategyData,\n GetStrategyResponse,\n GetStrategyError,\n PrepareBacktestData,\n PrepareBacktestResponse,\n PrepareBacktestError,\n GetPrepareStatusData,\n GetPrepareStatusResponse,\n GetPrepareStatusError,\n ExecuteSweepData,\n ExecuteSweepResponse,\n ExecuteSweepError,\n CancelSweepData,\n CancelSweepResponse,\n CancelSweepError,\n GetSweepResultData,\n GetSweepResultResponse,\n GetSweepResultError,\n GetSweepSensitivityData,\n GetSweepSensitivityResponse,\n GetSweepSensitivityError,\n ExecuteBacktestData,\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n CancelBacktestData,\n CancelBacktestResponse,\n CancelBacktestError,\n GetBacktestResultData,\n GetBacktestResultResponse,\n GetBacktestResultError,\n} from \"./types.gen\";\nimport { client as _heyApiClient } from \"./client.gen\";\n\nexport type Options<\n TData extends TDataShape = TDataShape,\n ThrowOnError extends boolean = boolean\n> = 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 authenticate = <ThrowOnError extends boolean = false>(\n options?: Options<AuthenticateData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).post<\n AuthenticateResponse,\n AuthenticateError,\n ThrowOnError\n >({\n security: [\n {\n name: \"X-API-Key\",\n type: \"apiKey\",\n },\n ],\n url: \"/auth/token\",\n ...options,\n });\n};\n\n/**\n * List the available exchanges\n */\nexport const listExchanges = <ThrowOnError extends boolean = false>(\n options?: Options<ListExchangesData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListExchangesResponse,\n unknown,\n ThrowOnError\n >({\n url: \"/exchanges\",\n ...options,\n });\n};\n\n/**\n * List 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 listInstruments = <ThrowOnError extends boolean = false>(\n options: Options<ListInstrumentsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n ListInstrumentsResponse,\n ListInstrumentsError,\n ThrowOnError\n >({\n url: \"/exchange/{exchangeId}/instruments\",\n ...options,\n });\n};\n\n/**\n * List an exchange segment's instruments\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 listSegmentInstruments = <ThrowOnError extends boolean = false>(\n options: Options<ListSegmentInstrumentsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n ListSegmentInstrumentsResponse,\n ListSegmentInstrumentsError,\n ThrowOnError\n >({\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 downloadTickers = <ThrowOnError extends boolean = false>(\n options: Options<DownloadTickersData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n DownloadTickersResponse,\n DownloadTickersError,\n ThrowOnError\n >({\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 downloadKlines = <ThrowOnError extends boolean = false>(\n options: Options<DownloadKlinesData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n DownloadKlinesResponse,\n DownloadKlinesError,\n ThrowOnError\n >({\n url: \"/exchange/{exchangeId}/klines/{base}/{quote}\",\n ...options,\n });\n};\n\n/**\n * Compile and register a strategy\n * Compiles raw strategy source and registers it, returning its `strategyId`.\n *\n * **This answers one question: is the source valid Java.** It compiles, registers, and hands\n * back the id — nothing more. Whether the class can actually run is\n * `POST /strategy/{strategyId}/validate`, and everything known about a strategy, validation\n * included, is read from `GET /strategy/{strategyId}`. One place to ask, so there is no second\n * answer to keep in step.\n *\n * The `strategyId` is derived from what the code *means*, not from how it is written. Adding a\n * comment, inserting a blank line, re-indenting, reordering imports, or moving a method around\n * all return the **same** id — you have not created a second strategy. Renaming a variable,\n * changing an identifier's case, reordering fields, or reordering statements inside a method\n * return a **different** one.\n *\n * Two rules follow, and they are worth designing around:\n *\n * - re-submitting a strategy you have only reformatted is free, and gives you back the id you\n * already had, along with any validation already recorded against it;\n * - the id says nothing about *behaviour*. Two sources that compute the same thing by\n * different means are two strategies, because deciding otherwise would mean deciding program\n * equivalence.\n *\n */\nexport const compileStrategy = <ThrowOnError extends boolean = false>(\n options: Options<CompileStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n CompileStrategyResponse,\n CompileStrategyError,\n ThrowOnError\n >({\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 * Check that a registered strategy can actually run\n * Instantiates the compiled class and drives it through a bounded synthetic series, so a wiring\n * fault surfaces here instead of at your first backtest. The verdict — pass or fail, plus any\n * engine notices — is recorded and served from `GET /strategy/{strategyId}`.\n *\n * **Idempotent.** If a verdict already exists for the current compilation it comes straight\n * back with `200` and nothing is queued. Otherwise the check is queued and this returns `202`;\n * poll `GET /strategy/{strategyId}` until `validation` is `passed` or `failed`.\n *\n * Recompiling supersedes a verdict, which makes this callable again — the old answer described\n * bytecode that is no longer what would run.\n *\n */\nexport const validateStrategy = <ThrowOnError extends boolean = false>(\n options: Options<ValidateStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ValidateStrategyResponse,\n ValidateStrategyError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/validate\",\n ...options,\n });\n};\n\n/**\n * Get a strategy by id, including its validation state\n * Reports that the strategy is registered — implied by a `200` at all — and what validating it\n * found.\n *\n * A `404` means one thing: no such registered strategy for this user. It is never a stale or\n * expired answer; registration and verdict are stored durably, not cached.\n *\n */\nexport const getStrategy = <ThrowOnError extends boolean = false>(\n options: Options<GetStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetStrategyResponse,\n GetStrategyError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}\",\n ...options,\n });\n};\n\n/**\n * Prepare backtest 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 prepareBacktest = <ThrowOnError extends boolean = false>(\n options: Options<PrepareBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n PrepareBacktestResponse,\n PrepareBacktestError,\n ThrowOnError\n >({\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 getPrepareStatus = <ThrowOnError extends boolean = false>(\n options: Options<GetPrepareStatusData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetPrepareStatusResponse,\n GetPrepareStatusError,\n ThrowOnError\n >({\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 parameter sweep over prepared data\n * Runs a parameter matrix over the single immutable dataset identified by `requestId`.\n * The backend expands and executes the matrix internally; clients poll the returned\n * `sweepId` for incremental results.\n *\n * Supplying `walkForward` runs the sweep in a different mode entirely. Instead of scoring\n * every parameter vector once over the whole range, the data is split into F sequential\n * folds; each fold optimizes the full grid on its own window and then scores only its winner\n * on the window immediately after — data that winner was not chosen on. It answers a harder\n * question than a leaderboard: not \"which parameters won\", but \"does re-optimizing this\n * periodically actually work\". Omit the block and nothing changes, including the response.\n *\n * The cost is the reason it is opt-in rather than always on: F folds × N vectors, so a\n * 4-fold run over a 500-point grid is 2004 backtests where the plain sweep is 500. The\n * request is rejected when `folds × totalRuns` exceeds the server's sweep budget.\n *\n */\nexport const executeSweep = <ThrowOnError extends boolean = false>(\n options: Options<ExecuteSweepData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ExecuteSweepResponse,\n ExecuteSweepError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Cancel a running parameter sweep\n * Requests cancellation between parameter vectors. Completed rows remain readable.\n */\nexport const cancelSweep = <ThrowOnError extends boolean = false>(\n options: Options<CancelSweepData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n CancelSweepResponse,\n CancelSweepError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}\",\n ...options,\n });\n};\n\n/**\n * Get sweep progress and results\n * Returns incremental sweep progress. The default `ranked` view sorts and may truncate the\n * display leaderboard. `order=natural` returns every available row, untruncated, ordered by\n * deterministic `runIx`; use that view when materialising durable trial rows.\n *\n * The `ranked` view is ordered by **plateau score** by default, not by the raw objective. A\n * plateau score is the objective of the worst run in a parameter point's immediate\n * neighbourhood, so a point scores well only if the region around it also does — the highest\n * raw score is frequently a spike that does not survive the parameters moving slightly. Pass\n * `ranking=raw` for the unadjusted objective order.\n *\n * Rows in the `ranked` view carry `plateauScore` and `neighbourCount` when plateau ranking\n * applied. Read them together: `neighbourCount: 0` means the point had no neighbours to\n * compare against, so its plateau score is unevidenced rather than confirmed. Sweeps\n * submitted before plateau ranking existed have no stored parameter grid to rebuild a\n * neighbourhood from and are always ranked raw; the response's `ranking` field says which\n * ordering was actually used.\n *\n * A sweep submitted with `walkForward` answers in a different shape, and the `walkForward`\n * field on the response is what tells the two apart — it appears as soon as the sweep is\n * accepted, before any fold has finished, so it is safe to branch on while polling. There\n * the leaderboard is one row per completed fold: that fold's winner as it scored\n * **out-of-sample**, with `runIx` carrying the fold index rather than a grid position. The\n * in-sample runs behind those winners are not retained — they are an optimization's working\n * set, and only the winner survives its fold. `ranking` is always `raw` and no plateau, DSR\n * or PBO figure is reported: the out-of-sample scores are already the honest number, and\n * layering a certification computed over F observations on top of them would overstate what\n * was measured.\n *\n */\nexport const getSweepResult = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepResultData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepResultResponse,\n GetSweepResultError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}\",\n ...options,\n });\n};\n\n/**\n * Get sweep sensitivity surfaces\n * How the objective moves as each parameter moves — the question a leaderboard cannot answer.\n * A leaderboard says which point won; a sweep can spend its entire budget on an axis that\n * never moved the objective at all, and showing only the top rows hides that completely.\n *\n * A **marginal** takes one axis and collapses every other one: for each value of that axis,\n * it aggregates every run that used it, whatever the rest of the parameters were. A flat\n * marginal means the axis is irrelevant over the range swept. `best`, `mean` and `worst` are\n * all reported because them disagreeing is itself the signal — a value with a high `best` and\n * a poor `mean` works only in specific company, which is an interaction between parameters\n * and would be invisible behind a single number.\n *\n * A **heatmap** does the same over a pair of axes, where that interaction becomes visible\n * directly.\n *\n * Served from the sweep's stored rows: no re-run, no engine call, and it works on a sweep\n * still in flight — the aggregates then describe the runs finished so far. Aborted runs are\n * excluded throughout, since a run that threw measured nothing and counting it as a bad\n * outcome would invent evidence against a parameter value that was never really tested.\n *\n * This is a separate endpoint rather than extra fields on the result view because the\n * two-dimensional half is quadratic in the axis count (N axes give N(N-1)/2 surfaces, each\n * the product of two axes' value counts) and is not wanted on the poll that drives progress.\n *\n */\nexport const getSweepSensitivity = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepSensitivityData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepSensitivityResponse,\n GetSweepSensitivityError,\n ThrowOnError\n >({\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/sensitivity\",\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 executeBacktest = <ThrowOnError extends boolean = false>(\n options: Options<ExecuteBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n ThrowOnError\n >({\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 cancelBacktest = <ThrowOnError extends boolean = false>(\n options: Options<CancelBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n CancelBacktestResponse,\n CancelBacktestError,\n ThrowOnError\n >({\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 * A `202` means the result is not readable yet — keep polling. It is never a terminal\n * outcome, and it carries no `state`, so a poll loop that stops on a terminal status will\n * not stop on it.\n *\n */\nexport const getBacktestResult = <ThrowOnError extends boolean = false>(\n options: Options<GetBacktestResultData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetBacktestResultResponse,\n GetBacktestResultError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/execute/{jobId}\",\n ...options,\n });\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 {\n type Config,\n type ClientOptions as DefaultClientOptions,\n createClient,\n createConfig,\n} 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> =\n (\n override?: Config<DefaultClientOptions & T>\n ) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(\n createConfig<ClientOptions>({\n baseUrl: \"https://api.qtsurfer.net/v1\",\n })\n);\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type {\n Options as ClientOptions,\n TDataShape,\n Client,\n} from \"@hey-api/client-fetch\";\nimport type {\n AuthenticateData,\n AuthenticateResponse,\n AuthenticateError,\n ListExchangesData,\n ListExchangesResponse,\n ListInstrumentsData,\n ListInstrumentsResponse,\n ListInstrumentsError,\n ListSegmentInstrumentsData,\n ListSegmentInstrumentsResponse,\n ListSegmentInstrumentsError,\n DownloadTickersData,\n DownloadTickersResponse,\n DownloadTickersError,\n DownloadKlinesData,\n DownloadKlinesResponse,\n DownloadKlinesError,\n ListStrategiesData,\n ListStrategiesResponse,\n CompileStrategyData,\n CompileStrategyResponse,\n CompileStrategyError,\n ValidateStrategyData,\n ValidateStrategyResponse,\n ValidateStrategyError,\n DeleteStrategyData,\n DeleteStrategyResponse,\n DeleteStrategyError,\n GetStrategyData,\n GetStrategyResponse,\n GetStrategyError,\n GetStrategyCodeData,\n GetStrategyCodeResponse,\n GetStrategyCodeError,\n PrepareBacktestData,\n PrepareBacktestResponse,\n PrepareBacktestError,\n GetPrepareStatusData,\n GetPrepareStatusResponse,\n GetPrepareStatusError,\n ExecuteSweepData,\n ExecuteSweepResponse,\n ExecuteSweepError,\n CancelSweepData,\n CancelSweepResponse,\n CancelSweepError,\n GetSweepResultData,\n GetSweepResultResponse,\n GetSweepResultError,\n GetSweepSensitivityData,\n GetSweepSensitivityResponse,\n GetSweepSensitivityError,\n ExecuteBacktestData,\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n CancelBacktestData,\n CancelBacktestResponse,\n CancelBacktestError,\n GetBacktestResultData,\n GetBacktestResultResponse,\n GetBacktestResultError,\n} from \"./types.gen\";\nimport { client as _heyApiClient } from \"./client.gen\";\n\nexport type Options<\n TData extends TDataShape = TDataShape,\n ThrowOnError extends boolean = boolean\n> = 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 authenticate = <ThrowOnError extends boolean = false>(\n options?: Options<AuthenticateData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).post<\n AuthenticateResponse,\n AuthenticateError,\n ThrowOnError\n >({\n security: [\n {\n name: \"X-API-Key\",\n type: \"apiKey\",\n },\n ],\n url: \"/auth/token\",\n ...options,\n });\n};\n\n/**\n * List the available exchanges\n */\nexport const listExchanges = <ThrowOnError extends boolean = false>(\n options?: Options<ListExchangesData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListExchangesResponse,\n unknown,\n ThrowOnError\n >({\n url: \"/exchanges\",\n ...options,\n });\n};\n\n/**\n * List 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 listInstruments = <ThrowOnError extends boolean = false>(\n options: Options<ListInstrumentsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n ListInstrumentsResponse,\n ListInstrumentsError,\n ThrowOnError\n >({\n url: \"/exchange/{exchangeId}/instruments\",\n ...options,\n });\n};\n\n/**\n * List an exchange segment's instruments\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 listSegmentInstruments = <ThrowOnError extends boolean = false>(\n options: Options<ListSegmentInstrumentsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n ListSegmentInstrumentsResponse,\n ListSegmentInstrumentsError,\n ThrowOnError\n >({\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 downloadTickers = <ThrowOnError extends boolean = false>(\n options: Options<DownloadTickersData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n DownloadTickersResponse,\n DownloadTickersError,\n ThrowOnError\n >({\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 downloadKlines = <ThrowOnError extends boolean = false>(\n options: Options<DownloadKlinesData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n DownloadKlinesResponse,\n DownloadKlinesError,\n ThrowOnError\n >({\n url: \"/exchange/{exchangeId}/klines/{base}/{quote}\",\n ...options,\n });\n};\n\n/**\n * List your registered strategies\n * Every strategy you have registered and not deleted, most recently compiled first.\n *\n * Each entry carries the same provenance `GET /strategy/{strategyId}` does — `compiledAt`,\n * `requiredSources` — but not its validation state, so listing stays cheap regardless of how\n * many strategies you have. Check a specific strategy's validation with `GET\n * /strategy/{strategyId}`.\n *\n */\nexport const listStrategies = <ThrowOnError extends boolean = false>(\n options?: Options<ListStrategiesData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListStrategiesResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategies\",\n ...options,\n });\n};\n\n/**\n * Compile and register a strategy\n * Compiles raw strategy source and registers it, returning its `strategyId`.\n *\n * **This answers one question: is the source valid Java.** It compiles, registers, and hands\n * back the id — nothing more. Whether the class can actually run is\n * `POST /strategy/{strategyId}/validate`, and everything known about a strategy, validation\n * included, is read from `GET /strategy/{strategyId}`. One place to ask, so there is no second\n * answer to keep in step.\n *\n * The `strategyId` is derived from what the code *means*, not from how it is written. Adding a\n * comment, inserting a blank line, re-indenting, reordering imports, or moving a method around\n * all return the **same** id — you have not created a second strategy. Renaming a variable,\n * changing an identifier's case, reordering fields, or reordering statements inside a method\n * return a **different** one.\n *\n * Two rules follow, and they are worth designing around:\n *\n * - re-submitting a strategy you have only reformatted is free, and gives you back the id you\n * already had, along with any validation already recorded against it;\n * - the id says nothing about *behaviour*. Two sources that compute the same thing by\n * different means are two strategies, because deciding otherwise would mean deciding program\n * equivalence.\n *\n */\nexport const compileStrategy = <ThrowOnError extends boolean = false>(\n options: Options<CompileStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n CompileStrategyResponse,\n CompileStrategyError,\n ThrowOnError\n >({\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 * Check that a registered strategy can actually run\n * Instantiates the compiled class and drives it through a bounded synthetic series, so a wiring\n * fault surfaces here instead of at your first backtest. The verdict — pass or fail, plus any\n * engine notices — is recorded and served from `GET /strategy/{strategyId}`.\n *\n * **Idempotent.** If a verdict already exists for the current compilation it comes straight\n * back with `200` and nothing is queued. Otherwise the check is queued and this returns `202`;\n * poll `GET /strategy/{strategyId}` until `validation` is `passed` or `failed`.\n *\n * Recompiling supersedes a verdict, which makes this callable again — the old answer described\n * bytecode that is no longer what would run.\n *\n */\nexport const validateStrategy = <ThrowOnError extends boolean = false>(\n options: Options<ValidateStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ValidateStrategyResponse,\n ValidateStrategyError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/validate\",\n ...options,\n });\n};\n\n/**\n * Release a registered strategy\n * Removes a strategy from `GET /strategy/{strategyId}` and `GET /strategies`. This is not\n * undone by re-submitting the same source to `POST /strategy` — that registers a new\n * strategy, with a new id.\n *\n * **Backtests you already ran against this strategy are unaffected.** Deleting it stops it\n * from counting against your account and stops you from validating or re-running it under\n * this id — it does not erase what already happened.\n *\n * Only removes a strategy you registered yourself. If you copied someone else's strategy\n * (a shared/marketplace listing), deleting your copy never affects theirs, or anyone else's.\n *\n */\nexport const deleteStrategy = <ThrowOnError extends boolean = false>(\n options: Options<DeleteStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n DeleteStrategyResponse,\n DeleteStrategyError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}\",\n ...options,\n });\n};\n\n/**\n * Get a strategy by id, including its validation state\n * Reports that the strategy is registered — implied by a `200` at all — and what validating it\n * found.\n *\n * A `404` means one thing: no such registered strategy for this user. It is never a stale or\n * expired answer; registration and verdict are stored durably, not cached.\n *\n */\nexport const getStrategy = <ThrowOnError extends boolean = false>(\n options: Options<GetStrategyData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetStrategyResponse,\n GetStrategyError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}\",\n ...options,\n });\n};\n\n/**\n * Get a registered strategy's source, if you still have one to read\n * The exact source you last submitted for this id — the same text `POST /strategy` derives\n * `strategyId` from, whitespace and comments included.\n *\n * **\"If available\", not \"always\".** A strategy you resolve only through a shared/marketplace\n * listing you copied by reference carries no source of its own, and reads as a `404` here the\n * same as a `strategyId` you never registered — that is the honest answer either way, since\n * from this endpoint's point of view nothing is there to return.\n *\n */\nexport const getStrategyCode = <ThrowOnError extends boolean = false>(\n options: Options<GetStrategyCodeData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetStrategyCodeResponse,\n GetStrategyCodeError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/code\",\n ...options,\n });\n};\n\n/**\n * Prepare backtest 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 prepareBacktest = <ThrowOnError extends boolean = false>(\n options: Options<PrepareBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n PrepareBacktestResponse,\n PrepareBacktestError,\n ThrowOnError\n >({\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 getPrepareStatus = <ThrowOnError extends boolean = false>(\n options: Options<GetPrepareStatusData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetPrepareStatusResponse,\n GetPrepareStatusError,\n ThrowOnError\n >({\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 parameter sweep over prepared data\n * Runs a parameter matrix over the single immutable dataset identified by `requestId`.\n * The backend expands and executes the matrix internally; clients poll the returned\n * `sweepId` for incremental results.\n *\n * Supplying `walkForward` runs the sweep in a different mode entirely. Instead of scoring\n * every parameter vector once over the whole range, the data is split into F sequential\n * folds; each fold optimizes the full grid on its own window and then scores only its winner\n * on the window immediately after — data that winner was not chosen on. It answers a harder\n * question than a leaderboard: not \"which parameters won\", but \"does re-optimizing this\n * periodically actually work\". Omit the block and nothing changes, including the response.\n *\n * The cost is the reason it is opt-in rather than always on: F folds × N vectors, so a\n * 4-fold run over a 500-point grid is 2004 backtests where the plain sweep is 500. The\n * request is rejected when `folds × totalRuns` exceeds the server's sweep budget.\n *\n */\nexport const executeSweep = <ThrowOnError extends boolean = false>(\n options: Options<ExecuteSweepData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ExecuteSweepResponse,\n ExecuteSweepError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Cancel a running parameter sweep\n * Requests cancellation between parameter vectors. Completed rows remain readable.\n */\nexport const cancelSweep = <ThrowOnError extends boolean = false>(\n options: Options<CancelSweepData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n CancelSweepResponse,\n CancelSweepError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}\",\n ...options,\n });\n};\n\n/**\n * Get sweep progress and results\n * Returns incremental sweep progress. The default `ranked` view sorts and may truncate the\n * display leaderboard. `order=natural` returns every available row, untruncated, ordered by\n * deterministic `runIx`; use that view when materialising durable trial rows.\n *\n * The `ranked` view is ordered by **plateau score** by default, not by the raw objective. A\n * plateau score is the objective of the worst run in a parameter point's immediate\n * neighbourhood, so a point scores well only if the region around it also does — the highest\n * raw score is frequently a spike that does not survive the parameters moving slightly. Pass\n * `ranking=raw` for the unadjusted objective order.\n *\n * Rows in the `ranked` view carry `plateauScore` and `neighbourCount` when plateau ranking\n * applied. Read them together: `neighbourCount: 0` means the point had no neighbours to\n * compare against, so its plateau score is unevidenced rather than confirmed. Sweeps\n * submitted before plateau ranking existed have no stored parameter grid to rebuild a\n * neighbourhood from and are always ranked raw; the response's `ranking` field says which\n * ordering was actually used.\n *\n * A sweep submitted with `walkForward` answers in a different shape, and the `walkForward`\n * field on the response is what tells the two apart — it appears as soon as the sweep is\n * accepted, before any fold has finished, so it is safe to branch on while polling. There\n * the leaderboard is one row per completed fold: that fold's winner as it scored\n * **out-of-sample**, with `runIx` carrying the fold index rather than a grid position. The\n * in-sample runs behind those winners are not retained — they are an optimization's working\n * set, and only the winner survives its fold. `ranking` is always `raw` and no plateau, DSR\n * or PBO figure is reported: the out-of-sample scores are already the honest number, and\n * layering a certification computed over F observations on top of them would overstate what\n * was measured.\n *\n */\nexport const getSweepResult = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepResultData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepResultResponse,\n GetSweepResultError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}\",\n ...options,\n });\n};\n\n/**\n * Get sweep sensitivity surfaces\n * How the objective moves as each parameter moves — the question a leaderboard cannot answer.\n * A leaderboard says which point won; a sweep can spend its entire budget on an axis that\n * never moved the objective at all, and showing only the top rows hides that completely.\n *\n * A **marginal** takes one axis and collapses every other one: for each value of that axis,\n * it aggregates every run that used it, whatever the rest of the parameters were. A flat\n * marginal means the axis is irrelevant over the range swept. `best`, `mean` and `worst` are\n * all reported because them disagreeing is itself the signal — a value with a high `best` and\n * a poor `mean` works only in specific company, which is an interaction between parameters\n * and would be invisible behind a single number.\n *\n * A **heatmap** does the same over a pair of axes, where that interaction becomes visible\n * directly.\n *\n * Served from the sweep's stored rows: no re-run, no engine call, and it works on a sweep\n * still in flight — the aggregates then describe the runs finished so far. Aborted runs are\n * excluded throughout, since a run that threw measured nothing and counting it as a bad\n * outcome would invent evidence against a parameter value that was never really tested.\n *\n * This is a separate endpoint rather than extra fields on the result view because the\n * two-dimensional half is quadratic in the axis count (N axes give N(N-1)/2 surfaces, each\n * the product of two axes' value counts) and is not wanted on the poll that drives progress.\n *\n */\nexport const getSweepSensitivity = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepSensitivityData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepSensitivityResponse,\n GetSweepSensitivityError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/sensitivity\",\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 executeBacktest = <ThrowOnError extends boolean = false>(\n options: Options<ExecuteBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n ThrowOnError\n >({\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 cancelBacktest = <ThrowOnError extends boolean = false>(\n options: Options<CancelBacktestData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n CancelBacktestResponse,\n CancelBacktestError,\n ThrowOnError\n >({\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 * A `202` means the result is not readable yet — keep polling. It is never a terminal\n * outcome, and it carries no `state`, so a poll loop that stops on a terminal status will\n * not stop on it.\n *\n */\nexport const getBacktestResult = <ThrowOnError extends boolean = false>(\n options: Options<GetBacktestResultData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetBacktestResultResponse,\n GetBacktestResultError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/execute/{jobId}\",\n ...options,\n });\n};\n"],"mappings":"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","names":[]}
|
package/package.json
CHANGED
|
@@ -104,6 +104,30 @@ export const InstrumentLinksSchema = {
|
|
|
104
104
|
},
|
|
105
105
|
} as const;
|
|
106
106
|
|
|
107
|
+
export const StrategyLinksSchema = {
|
|
108
|
+
description: `HAL \`_links\` for a strategy — present on a full \`StrategyState\` body (\`GET
|
|
109
|
+
/strategy/{strategyId}\`, and \`POST /strategy/{strategyId}/validate\`'s already-validated
|
|
110
|
+
\`200\`), absent from that same endpoint's \`202\` — a deliberately partial stub carrying only
|
|
111
|
+
what is known before a check has even started. Following \`code\` can still \`404\` once
|
|
112
|
+
present: it documents its own honest "nothing to return" for a strategy with no source of
|
|
113
|
+
its own (a \`REFERENCE\` marketplace copy, or one resolved only through the platform's shared
|
|
114
|
+
pool). This link says where to look, not that something is there.
|
|
115
|
+
`,
|
|
116
|
+
type: "object",
|
|
117
|
+
required: ["code"],
|
|
118
|
+
properties: {
|
|
119
|
+
code: {
|
|
120
|
+
allOf: [
|
|
121
|
+
{
|
|
122
|
+
$ref: "#/components/schemas/HalLink",
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
description:
|
|
126
|
+
"Link to this strategy's registered source, `GET /strategy/{strategyId}/code`.",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
} as const;
|
|
130
|
+
|
|
107
131
|
export const HalLinkSchema = {
|
|
108
132
|
description: "A HAL link object (Hypertext Application Language)",
|
|
109
133
|
type: "object",
|
|
@@ -1020,6 +1044,12 @@ export const ExecuteSweepResultSchema = {
|
|
|
1020
1044
|
description:
|
|
1021
1045
|
"How many train/test splits the `pbo` figure was averaged over.",
|
|
1022
1046
|
},
|
|
1047
|
+
failReason: {
|
|
1048
|
+
type: "string",
|
|
1049
|
+
description: `Why the sweep produced less than it should have — the cause reported by the **first** shard to fail, not a list. It is what turns an inscrutable empty leaderboard into an answer: a sweep can come back \`PARTIAL\` with \`done: 0\` because the strategy could not be loaded at all, and without this the response says only that nothing finished.
|
|
1050
|
+
First failure wins and later ones are not recorded, so on a sweep where several shards failed for different reasons this names one of them rather than all. Absent when no shard reported a cause, which is the normal case for a healthy sweep — read it together with \`progress.failedShards\` rather than as a count of anything.`,
|
|
1051
|
+
example: "Failed to load/configure strategy",
|
|
1052
|
+
},
|
|
1023
1053
|
progress: {
|
|
1024
1054
|
$ref: "#/components/schemas/SweepProgress",
|
|
1025
1055
|
},
|
|
@@ -1411,6 +1441,35 @@ real run (\`execute\`) is a clean bill of health, while an empty list from
|
|
|
1411
1441
|
},
|
|
1412
1442
|
} as const;
|
|
1413
1443
|
|
|
1444
|
+
export const StrategySummarySchema = {
|
|
1445
|
+
type: "object",
|
|
1446
|
+
description: `One entry from \`GET /strategies\` — the same provenance a full \`StrategyState\` carries
|
|
1447
|
+
(\`compiledAt\`, \`requiredSources\`), without its validation state, so listing stays cheap
|
|
1448
|
+
regardless of how many strategies you have registered. Check a specific strategy's
|
|
1449
|
+
validation with \`GET /strategy/{strategyId}\`.
|
|
1450
|
+
`,
|
|
1451
|
+
required: ["strategyId"],
|
|
1452
|
+
properties: {
|
|
1453
|
+
strategyId: {
|
|
1454
|
+
$ref: "#/components/schemas/strategyId",
|
|
1455
|
+
},
|
|
1456
|
+
compiledAt: {
|
|
1457
|
+
type: "string",
|
|
1458
|
+
format: "date-time",
|
|
1459
|
+
description: "When the live compilation was produced.",
|
|
1460
|
+
},
|
|
1461
|
+
requiredSources: {
|
|
1462
|
+
type: "array",
|
|
1463
|
+
description: `The market data this strategy needs. Absent, not empty, when it could
|
|
1464
|
+
not be established without constructing the strategy.
|
|
1465
|
+
`,
|
|
1466
|
+
items: {
|
|
1467
|
+
type: "string",
|
|
1468
|
+
},
|
|
1469
|
+
},
|
|
1470
|
+
},
|
|
1471
|
+
} as const;
|
|
1472
|
+
|
|
1414
1473
|
export const StrategyStateSchema = {
|
|
1415
1474
|
type: "object",
|
|
1416
1475
|
description: `What is known about a registered strategy: that it compiled, and what validating it found.
|
|
@@ -1499,6 +1558,9 @@ went; it simply reached less than a full run would.
|
|
|
1499
1558
|
the strategy — the check has not run. Stop waiting and re-request it later.
|
|
1500
1559
|
`,
|
|
1501
1560
|
},
|
|
1561
|
+
_links: {
|
|
1562
|
+
$ref: "#/components/schemas/StrategyLinks",
|
|
1563
|
+
},
|
|
1502
1564
|
},
|
|
1503
1565
|
example: {
|
|
1504
1566
|
strategyId: "6bsh31ikwkuivhtgcoa6s4",
|
|
@@ -1514,6 +1576,11 @@ the strategy — the check has not run. Stop waiting and re-request it later.
|
|
|
1514
1576
|
provenance: "compile-dry-run",
|
|
1515
1577
|
},
|
|
1516
1578
|
],
|
|
1579
|
+
_links: {
|
|
1580
|
+
code: {
|
|
1581
|
+
href: "/v1/strategy/6bsh31ikwkuivhtgcoa6s4/code",
|
|
1582
|
+
},
|
|
1583
|
+
},
|
|
1517
1584
|
},
|
|
1518
1585
|
} as const;
|
|
1519
1586
|
|
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -23,15 +23,23 @@ import type {
|
|
|
23
23
|
DownloadKlinesData,
|
|
24
24
|
DownloadKlinesResponse,
|
|
25
25
|
DownloadKlinesError,
|
|
26
|
+
ListStrategiesData,
|
|
27
|
+
ListStrategiesResponse,
|
|
26
28
|
CompileStrategyData,
|
|
27
29
|
CompileStrategyResponse,
|
|
28
30
|
CompileStrategyError,
|
|
29
31
|
ValidateStrategyData,
|
|
30
32
|
ValidateStrategyResponse,
|
|
31
33
|
ValidateStrategyError,
|
|
34
|
+
DeleteStrategyData,
|
|
35
|
+
DeleteStrategyResponse,
|
|
36
|
+
DeleteStrategyError,
|
|
32
37
|
GetStrategyData,
|
|
33
38
|
GetStrategyResponse,
|
|
34
39
|
GetStrategyError,
|
|
40
|
+
GetStrategyCodeData,
|
|
41
|
+
GetStrategyCodeResponse,
|
|
42
|
+
GetStrategyCodeError,
|
|
35
43
|
PrepareBacktestData,
|
|
36
44
|
PrepareBacktestResponse,
|
|
37
45
|
PrepareBacktestError,
|
|
@@ -238,6 +246,35 @@ export const downloadKlines = <ThrowOnError extends boolean = false>(
|
|
|
238
246
|
});
|
|
239
247
|
};
|
|
240
248
|
|
|
249
|
+
/**
|
|
250
|
+
* List your registered strategies
|
|
251
|
+
* Every strategy you have registered and not deleted, most recently compiled first.
|
|
252
|
+
*
|
|
253
|
+
* Each entry carries the same provenance `GET /strategy/{strategyId}` does — `compiledAt`,
|
|
254
|
+
* `requiredSources` — but not its validation state, so listing stays cheap regardless of how
|
|
255
|
+
* many strategies you have. Check a specific strategy's validation with `GET
|
|
256
|
+
* /strategy/{strategyId}`.
|
|
257
|
+
*
|
|
258
|
+
*/
|
|
259
|
+
export const listStrategies = <ThrowOnError extends boolean = false>(
|
|
260
|
+
options?: Options<ListStrategiesData, ThrowOnError>
|
|
261
|
+
) => {
|
|
262
|
+
return (options?.client ?? _heyApiClient).get<
|
|
263
|
+
ListStrategiesResponse,
|
|
264
|
+
unknown,
|
|
265
|
+
ThrowOnError
|
|
266
|
+
>({
|
|
267
|
+
security: [
|
|
268
|
+
{
|
|
269
|
+
scheme: "bearer",
|
|
270
|
+
type: "http",
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
url: "/strategies",
|
|
274
|
+
...options,
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
|
|
241
278
|
/**
|
|
242
279
|
* Compile and register a strategy
|
|
243
280
|
* Compiles raw strategy source and registers it, returning its `strategyId`.
|
|
@@ -320,6 +357,39 @@ export const validateStrategy = <ThrowOnError extends boolean = false>(
|
|
|
320
357
|
});
|
|
321
358
|
};
|
|
322
359
|
|
|
360
|
+
/**
|
|
361
|
+
* Release a registered strategy
|
|
362
|
+
* Removes a strategy from `GET /strategy/{strategyId}` and `GET /strategies`. This is not
|
|
363
|
+
* undone by re-submitting the same source to `POST /strategy` — that registers a new
|
|
364
|
+
* strategy, with a new id.
|
|
365
|
+
*
|
|
366
|
+
* **Backtests you already ran against this strategy are unaffected.** Deleting it stops it
|
|
367
|
+
* from counting against your account and stops you from validating or re-running it under
|
|
368
|
+
* this id — it does not erase what already happened.
|
|
369
|
+
*
|
|
370
|
+
* Only removes a strategy you registered yourself. If you copied someone else's strategy
|
|
371
|
+
* (a shared/marketplace listing), deleting your copy never affects theirs, or anyone else's.
|
|
372
|
+
*
|
|
373
|
+
*/
|
|
374
|
+
export const deleteStrategy = <ThrowOnError extends boolean = false>(
|
|
375
|
+
options: Options<DeleteStrategyData, ThrowOnError>
|
|
376
|
+
) => {
|
|
377
|
+
return (options.client ?? _heyApiClient).delete<
|
|
378
|
+
DeleteStrategyResponse,
|
|
379
|
+
DeleteStrategyError,
|
|
380
|
+
ThrowOnError
|
|
381
|
+
>({
|
|
382
|
+
security: [
|
|
383
|
+
{
|
|
384
|
+
scheme: "bearer",
|
|
385
|
+
type: "http",
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
url: "/strategy/{strategyId}",
|
|
389
|
+
...options,
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
|
|
323
393
|
/**
|
|
324
394
|
* Get a strategy by id, including its validation state
|
|
325
395
|
* Reports that the strategy is registered — implied by a `200` at all — and what validating it
|
|
@@ -348,6 +418,36 @@ export const getStrategy = <ThrowOnError extends boolean = false>(
|
|
|
348
418
|
});
|
|
349
419
|
};
|
|
350
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Get a registered strategy's source, if you still have one to read
|
|
423
|
+
* The exact source you last submitted for this id — the same text `POST /strategy` derives
|
|
424
|
+
* `strategyId` from, whitespace and comments included.
|
|
425
|
+
*
|
|
426
|
+
* **"If available", not "always".** A strategy you resolve only through a shared/marketplace
|
|
427
|
+
* listing you copied by reference carries no source of its own, and reads as a `404` here the
|
|
428
|
+
* same as a `strategyId` you never registered — that is the honest answer either way, since
|
|
429
|
+
* from this endpoint's point of view nothing is there to return.
|
|
430
|
+
*
|
|
431
|
+
*/
|
|
432
|
+
export const getStrategyCode = <ThrowOnError extends boolean = false>(
|
|
433
|
+
options: Options<GetStrategyCodeData, ThrowOnError>
|
|
434
|
+
) => {
|
|
435
|
+
return (options.client ?? _heyApiClient).get<
|
|
436
|
+
GetStrategyCodeResponse,
|
|
437
|
+
GetStrategyCodeError,
|
|
438
|
+
ThrowOnError
|
|
439
|
+
>({
|
|
440
|
+
security: [
|
|
441
|
+
{
|
|
442
|
+
scheme: "bearer",
|
|
443
|
+
type: "http",
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
url: "/strategy/{strategyId}/code",
|
|
447
|
+
...options,
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
|
|
351
451
|
/**
|
|
352
452
|
* Prepare backtest data
|
|
353
453
|
* Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
|
|
@@ -553,6 +653,12 @@ export const getSweepSensitivity = <ThrowOnError extends boolean = false>(
|
|
|
553
653
|
GetSweepSensitivityError,
|
|
554
654
|
ThrowOnError
|
|
555
655
|
>({
|
|
656
|
+
security: [
|
|
657
|
+
{
|
|
658
|
+
scheme: "bearer",
|
|
659
|
+
type: "http",
|
|
660
|
+
},
|
|
661
|
+
],
|
|
556
662
|
url: "/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/sensitivity",
|
|
557
663
|
...options,
|
|
558
664
|
});
|
|
@@ -67,6 +67,23 @@ export type InstrumentLinks = {
|
|
|
67
67
|
futures?: HalLink;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* HAL `_links` for a strategy — present on a full `StrategyState` body (`GET
|
|
72
|
+
* /strategy/{strategyId}`, and `POST /strategy/{strategyId}/validate`'s already-validated
|
|
73
|
+
* `200`), absent from that same endpoint's `202` — a deliberately partial stub carrying only
|
|
74
|
+
* what is known before a check has even started. Following `code` can still `404` once
|
|
75
|
+
* present: it documents its own honest "nothing to return" for a strategy with no source of
|
|
76
|
+
* its own (a `REFERENCE` marketplace copy, or one resolved only through the platform's shared
|
|
77
|
+
* pool). This link says where to look, not that something is there.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
export type StrategyLinks = {
|
|
81
|
+
/**
|
|
82
|
+
* Link to this strategy's registered source, `GET /strategy/{strategyId}/code`.
|
|
83
|
+
*/
|
|
84
|
+
code: HalLink;
|
|
85
|
+
};
|
|
86
|
+
|
|
70
87
|
/**
|
|
71
88
|
* A HAL link object (Hypertext Application Language)
|
|
72
89
|
*/
|
|
@@ -541,6 +558,11 @@ export type ExecuteSweepResult = {
|
|
|
541
558
|
* How many train/test splits the `pbo` figure was averaged over.
|
|
542
559
|
*/
|
|
543
560
|
pboSplits?: number;
|
|
561
|
+
/**
|
|
562
|
+
* Why the sweep produced less than it should have — the cause reported by the **first** shard to fail, not a list. It is what turns an inscrutable empty leaderboard into an answer: a sweep can come back `PARTIAL` with `done: 0` because the strategy could not be loaded at all, and without this the response says only that nothing finished.
|
|
563
|
+
* First failure wins and later ones are not recorded, so on a sweep where several shards failed for different reasons this names one of them rather than all. Absent when no shard reported a cause, which is the normal case for a healthy sweep — read it together with `progress.failedShards` rather than as a count of anything.
|
|
564
|
+
*/
|
|
565
|
+
failReason?: string;
|
|
544
566
|
progress: SweepProgress;
|
|
545
567
|
/**
|
|
546
568
|
* Total result rows currently available.
|
|
@@ -795,6 +817,27 @@ export type Notice = {
|
|
|
795
817
|
provenance?: "execute" | "compile-dry-run";
|
|
796
818
|
};
|
|
797
819
|
|
|
820
|
+
/**
|
|
821
|
+
* One entry from `GET /strategies` — the same provenance a full `StrategyState` carries
|
|
822
|
+
* (`compiledAt`, `requiredSources`), without its validation state, so listing stays cheap
|
|
823
|
+
* regardless of how many strategies you have registered. Check a specific strategy's
|
|
824
|
+
* validation with `GET /strategy/{strategyId}`.
|
|
825
|
+
*
|
|
826
|
+
*/
|
|
827
|
+
export type StrategySummary = {
|
|
828
|
+
strategyId: StrategyId;
|
|
829
|
+
/**
|
|
830
|
+
* When the live compilation was produced.
|
|
831
|
+
*/
|
|
832
|
+
compiledAt?: string;
|
|
833
|
+
/**
|
|
834
|
+
* The market data this strategy needs. Absent, not empty, when it could
|
|
835
|
+
* not be established without constructing the strategy.
|
|
836
|
+
*
|
|
837
|
+
*/
|
|
838
|
+
requiredSources?: Array<string>;
|
|
839
|
+
};
|
|
840
|
+
|
|
798
841
|
/**
|
|
799
842
|
* What is known about a registered strategy: that it compiled, and what validating it found.
|
|
800
843
|
*
|
|
@@ -866,6 +909,7 @@ export type StrategyState = {
|
|
|
866
909
|
*
|
|
867
910
|
*/
|
|
868
911
|
validationStalled?: boolean;
|
|
912
|
+
_links?: StrategyLinks;
|
|
869
913
|
};
|
|
870
914
|
|
|
871
915
|
export type AuthTokenResponse = {
|
|
@@ -1150,6 +1194,26 @@ export type DownloadKlinesResponses = {
|
|
|
1150
1194
|
export type DownloadKlinesResponse =
|
|
1151
1195
|
DownloadKlinesResponses[keyof DownloadKlinesResponses];
|
|
1152
1196
|
|
|
1197
|
+
export type ListStrategiesData = {
|
|
1198
|
+
body?: never;
|
|
1199
|
+
path?: never;
|
|
1200
|
+
query?: never;
|
|
1201
|
+
url: "/strategies";
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
export type ListStrategiesResponses = {
|
|
1205
|
+
/**
|
|
1206
|
+
* Your registered strategies. An empty array if you have none — this is never a `404`.
|
|
1207
|
+
*
|
|
1208
|
+
*/
|
|
1209
|
+
200: {
|
|
1210
|
+
strategies: Array<StrategySummary>;
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
export type ListStrategiesResponse =
|
|
1215
|
+
ListStrategiesResponses[keyof ListStrategiesResponses];
|
|
1216
|
+
|
|
1153
1217
|
export type CompileStrategyData = {
|
|
1154
1218
|
/**
|
|
1155
1219
|
* Raw strategy Java source code
|
|
@@ -1219,16 +1283,54 @@ export type ValidateStrategyResponses = {
|
|
|
1219
1283
|
* Validation queued. Not a terminal outcome — poll `GET /strategy/{strategyId}` until
|
|
1220
1284
|
* `validation` leaves `pending`.
|
|
1221
1285
|
*
|
|
1286
|
+
* The body is a `StrategyState` carrying only what is known at this point: the id and
|
|
1287
|
+
* `validation: pending`. **The status code, not the body, is what tells the two responses
|
|
1288
|
+
* apart** — a `200` can also carry `validation: pending`, left by a check an earlier call
|
|
1289
|
+
* queued. So `202` means *this call started a check*, while `pending` means only *a check
|
|
1290
|
+
* is outstanding*.
|
|
1291
|
+
*
|
|
1222
1292
|
*/
|
|
1223
|
-
202:
|
|
1224
|
-
strategyId: StrategyId;
|
|
1225
|
-
validation: "pending";
|
|
1226
|
-
};
|
|
1293
|
+
202: StrategyState;
|
|
1227
1294
|
};
|
|
1228
1295
|
|
|
1229
1296
|
export type ValidateStrategyResponse =
|
|
1230
1297
|
ValidateStrategyResponses[keyof ValidateStrategyResponses];
|
|
1231
1298
|
|
|
1299
|
+
export type DeleteStrategyData = {
|
|
1300
|
+
body?: never;
|
|
1301
|
+
path: {
|
|
1302
|
+
/**
|
|
1303
|
+
* The id returned by `POST /strategy`
|
|
1304
|
+
*/
|
|
1305
|
+
strategyId: StrategyId;
|
|
1306
|
+
};
|
|
1307
|
+
query?: never;
|
|
1308
|
+
url: "/strategy/{strategyId}";
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1311
|
+
export type DeleteStrategyErrors = {
|
|
1312
|
+
/**
|
|
1313
|
+
* No such registered strategy for this user
|
|
1314
|
+
*/
|
|
1315
|
+
404: ResponseError;
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
export type DeleteStrategyError =
|
|
1319
|
+
DeleteStrategyErrors[keyof DeleteStrategyErrors];
|
|
1320
|
+
|
|
1321
|
+
export type DeleteStrategyResponses = {
|
|
1322
|
+
/**
|
|
1323
|
+
* Deleted
|
|
1324
|
+
*/
|
|
1325
|
+
200: {
|
|
1326
|
+
strategyId: StrategyId;
|
|
1327
|
+
deleted: true;
|
|
1328
|
+
};
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
export type DeleteStrategyResponse =
|
|
1332
|
+
DeleteStrategyResponses[keyof DeleteStrategyResponses];
|
|
1333
|
+
|
|
1232
1334
|
export type GetStrategyData = {
|
|
1233
1335
|
body?: never;
|
|
1234
1336
|
path: {
|
|
@@ -1260,6 +1362,44 @@ export type GetStrategyResponses = {
|
|
|
1260
1362
|
export type GetStrategyResponse =
|
|
1261
1363
|
GetStrategyResponses[keyof GetStrategyResponses];
|
|
1262
1364
|
|
|
1365
|
+
export type GetStrategyCodeData = {
|
|
1366
|
+
body?: never;
|
|
1367
|
+
path: {
|
|
1368
|
+
/**
|
|
1369
|
+
* The id returned by `POST /strategy`
|
|
1370
|
+
*/
|
|
1371
|
+
strategyId: StrategyId;
|
|
1372
|
+
};
|
|
1373
|
+
query?: never;
|
|
1374
|
+
url: "/strategy/{strategyId}/code";
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
export type GetStrategyCodeErrors = {
|
|
1378
|
+
/**
|
|
1379
|
+
* No such registered strategy for this user, or nothing to read for this id
|
|
1380
|
+
*/
|
|
1381
|
+
404: ResponseError;
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
export type GetStrategyCodeError =
|
|
1385
|
+
GetStrategyCodeErrors[keyof GetStrategyCodeErrors];
|
|
1386
|
+
|
|
1387
|
+
export type GetStrategyCodeResponses = {
|
|
1388
|
+
/**
|
|
1389
|
+
* The registered source
|
|
1390
|
+
*/
|
|
1391
|
+
200: {
|
|
1392
|
+
strategyId: StrategyId;
|
|
1393
|
+
/**
|
|
1394
|
+
* Raw strategy Java source code, exactly as registered.
|
|
1395
|
+
*/
|
|
1396
|
+
code: string;
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
export type GetStrategyCodeResponse =
|
|
1401
|
+
GetStrategyCodeResponses[keyof GetStrategyCodeResponses];
|
|
1402
|
+
|
|
1263
1403
|
export type PrepareBacktestData = {
|
|
1264
1404
|
/**
|
|
1265
1405
|
* The required data to prepare a backtesting
|
|
@@ -1666,7 +1806,7 @@ export type GetBacktestResultResponse =
|
|
|
1666
1806
|
|
|
1667
1807
|
export type ClientOptions = {
|
|
1668
1808
|
baseUrl:
|
|
1669
|
-
| "https://api.
|
|
1809
|
+
| "https://api.qtsurfer.net/v1"
|
|
1670
1810
|
| "https://api.qtsurfer.com/v1"
|
|
1671
1811
|
| (string & {});
|
|
1672
1812
|
};
|