@qtsurfer/api-client 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +492 -20
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +331 -15
- package/src/generated/sdk.gen.ts +197 -0
- package/src/generated/types.gen.ts +471 -19
package/dist/index.d.ts
CHANGED
|
@@ -169,8 +169,32 @@ type Exchange = {
|
|
|
169
169
|
* Managed exchange data sources available for backtesting.
|
|
170
170
|
*/
|
|
171
171
|
type DataSourceType = "ticker";
|
|
172
|
+
/**
|
|
173
|
+
* Two shapes, chosen by the `exchangeId` path segment. Against a managed exchange,
|
|
174
|
+
* `instrument` is required and `datasetId`/`datasetVersionId` are ignored. Against the
|
|
175
|
+
* reserved `exchangeId: user`, send `datasetId` instead of `instrument` — `instrument` is
|
|
176
|
+
* ignored there, since it comes from the dataset itself.
|
|
177
|
+
*
|
|
178
|
+
*/
|
|
172
179
|
type PrepareRequest = {
|
|
173
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Required unless `exchangeId` is the reserved value `user`, in which case send
|
|
182
|
+
* `datasetId` instead.
|
|
183
|
+
*
|
|
184
|
+
*/
|
|
185
|
+
instrument?: Instrument;
|
|
186
|
+
/**
|
|
187
|
+
* Only for `exchangeId: user`: the id of a dataset created via `POST /datasets`, in place
|
|
188
|
+
* of `instrument`. Ignored against a managed exchange.
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
datasetId?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Only for `exchangeId: user`, and optional even then: pins a specific past version of
|
|
194
|
+
* the dataset instead of its current one. Defaults to the dataset's current version.
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
197
|
+
datasetVersionId?: string;
|
|
174
198
|
/**
|
|
175
199
|
* Start date for the preparation process. Supports the following formats:
|
|
176
200
|
* - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
@@ -195,7 +219,7 @@ type PrepareRequest = {
|
|
|
195
219
|
* labels return `400`.
|
|
196
220
|
*
|
|
197
221
|
*/
|
|
198
|
-
cadence?: "1s" | "5s" | "1m" | "5m" | "15m" | "1h" | "4h" | "1d";
|
|
222
|
+
cadence?: "1s" | "5s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "8h" | "12h" | "1d" | "1w" | "1q";
|
|
199
223
|
};
|
|
200
224
|
/**
|
|
201
225
|
* Information about a single job
|
|
@@ -235,12 +259,19 @@ type JobState = {
|
|
|
235
259
|
endTime?: string | null;
|
|
236
260
|
};
|
|
237
261
|
/**
|
|
238
|
-
* State of a single-instrument prepare job — the `JobState` shape plus a
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
262
|
+
* State of a single-instrument prepare job — the `JobState` shape plus a coverage summary.
|
|
263
|
+
* A single-instrument prepare is always terminal (`status: Completed`): the client decides
|
|
264
|
+
* what to do from `coverageRatio` (e.g. execute if it is at or above a chosen threshold)
|
|
265
|
+
* rather than polling for missing hours that may never arrive — a missing hour for one
|
|
266
|
+
* instrument usually means low activity, not missing data.
|
|
267
|
+
*
|
|
268
|
+
* **Two coverage shapes, by exchange vs. dataset.** Against a managed exchange, coverage is
|
|
269
|
+
* walked hour by hour: `totalHours`/`hoursWithData`/`hoursWithoutData`. Against a
|
|
270
|
+
* dataset-backed prepare (`exchangeId: user`), coverage is reported on the dataset's own
|
|
271
|
+
* cadence grid instead — hour-walking a daily dataset would report `1/24` and read as
|
|
272
|
+
* broken — via `cadence`/`gaps`/`largestGapSteps`; `totalHours`/`hoursWithData`/
|
|
273
|
+
* `hoursWithoutData` are absent in that case. `dataFrom`/`dataTo`/`coverageRatio` are present
|
|
274
|
+
* either way, computed accordingly.
|
|
244
275
|
*
|
|
245
276
|
*/
|
|
246
277
|
type PrepareJobState = JobState & {
|
|
@@ -253,21 +284,48 @@ type PrepareJobState = JobState & {
|
|
|
253
284
|
*/
|
|
254
285
|
dataTo?: string | null;
|
|
255
286
|
/**
|
|
256
|
-
* `hoursWithData / totalHours` in `[0,1]` (`1.0` when
|
|
257
|
-
* fraction of hours in the requested range that have served
|
|
287
|
+
* Against a managed exchange: `hoursWithData / totalHours` in `[0,1]` (`1.0` when
|
|
288
|
+
* `totalHours` is 0), the fraction of hours in the requested range that have served
|
|
289
|
+
* data. Against a dataset (`exchangeId: user`): `rows / expectedStepsAtCadence`
|
|
290
|
+
* over the dataset version's own range — echoing what ingest computed once, not
|
|
291
|
+
* recomputed against a narrower prepare request.
|
|
258
292
|
*
|
|
259
293
|
*/
|
|
260
294
|
coverageRatio?: number;
|
|
261
295
|
/**
|
|
262
|
-
* Number of whole hours in the requested prepare range.
|
|
296
|
+
* Number of whole hours in the requested prepare range. Managed exchanges only —
|
|
297
|
+
* absent for a dataset-backed prepare.
|
|
298
|
+
*
|
|
263
299
|
*/
|
|
264
300
|
totalHours?: number;
|
|
265
301
|
/**
|
|
266
|
-
* Number of hours in the range that have data.
|
|
302
|
+
* Number of hours in the range that have data. Managed exchanges only — absent for
|
|
303
|
+
* a dataset-backed prepare.
|
|
304
|
+
*
|
|
267
305
|
*/
|
|
268
306
|
hoursWithData?: number;
|
|
269
307
|
/**
|
|
270
|
-
*
|
|
308
|
+
* The dataset version's own discovered cadence (e.g. `1m`, `1h`). Only present for a
|
|
309
|
+
* dataset-backed prepare (`exchangeId: user`).
|
|
310
|
+
*
|
|
311
|
+
*/
|
|
312
|
+
cadence?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Number of gaps in the dataset version at its own cadence, as discovered at ingest
|
|
315
|
+
* time. Only present for a dataset-backed prepare.
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
gaps?: number;
|
|
319
|
+
/**
|
|
320
|
+
* The largest gap in the dataset version, in units of its own cadence step. Only
|
|
321
|
+
* present for a dataset-backed prepare.
|
|
322
|
+
*
|
|
323
|
+
*/
|
|
324
|
+
largestGapSteps?: number;
|
|
325
|
+
/**
|
|
326
|
+
* One entry per hour in the range that has no data, with a rationale. Managed
|
|
327
|
+
* exchanges only — absent for a dataset-backed prepare.
|
|
328
|
+
*
|
|
271
329
|
*/
|
|
272
330
|
hoursWithoutData?: Array<{
|
|
273
331
|
/**
|
|
@@ -871,6 +929,160 @@ type StrategyState = {
|
|
|
871
929
|
validationStalled?: boolean;
|
|
872
930
|
_links?: StrategyLinks;
|
|
873
931
|
};
|
|
932
|
+
/**
|
|
933
|
+
* A dataset's own metadata — not its data. `currentVersionId` is what a prepare against
|
|
934
|
+
* `exchangeId: user` reads by default; see `DatasetVersion` for what a version carries.
|
|
935
|
+
*
|
|
936
|
+
* `from`/`to`/`cadence` mirror that current version's own discovered range and cadence, so
|
|
937
|
+
* you don't need a second call to `GET /datasets/{datasetId}/uploads/{uploadId}` just to see
|
|
938
|
+
* what a dataset covers. Absent until a version exists.
|
|
939
|
+
*
|
|
940
|
+
*/
|
|
941
|
+
type Dataset = {
|
|
942
|
+
/**
|
|
943
|
+
* Opaque id, returned by `POST /datasets`.
|
|
944
|
+
*/
|
|
945
|
+
datasetId: string;
|
|
946
|
+
/**
|
|
947
|
+
* Unique among your datasets.
|
|
948
|
+
*/
|
|
949
|
+
name: string;
|
|
950
|
+
/**
|
|
951
|
+
* Always `ticker` in v1.
|
|
952
|
+
*/
|
|
953
|
+
type: "ticker";
|
|
954
|
+
instrument: Instrument;
|
|
955
|
+
/**
|
|
956
|
+
* When the dataset was created.
|
|
957
|
+
*/
|
|
958
|
+
createdAt: string;
|
|
959
|
+
/**
|
|
960
|
+
* The id of the most recently finalized, successfully ingested version. Absent until at
|
|
961
|
+
* least one upload has finished ingesting.
|
|
962
|
+
*
|
|
963
|
+
*/
|
|
964
|
+
currentVersionId?: string;
|
|
965
|
+
/**
|
|
966
|
+
* When `currentVersionId` last changed. Absent until it has a value.
|
|
967
|
+
*/
|
|
968
|
+
updatedAt?: string;
|
|
969
|
+
/**
|
|
970
|
+
* Start of `currentVersionId`'s own data range, as discovered at ingest time. Absent
|
|
971
|
+
* until a version exists.
|
|
972
|
+
*
|
|
973
|
+
*/
|
|
974
|
+
from?: string;
|
|
975
|
+
/**
|
|
976
|
+
* End of `currentVersionId`'s own data range, as discovered at ingest time. Absent until
|
|
977
|
+
* a version exists.
|
|
978
|
+
*
|
|
979
|
+
*/
|
|
980
|
+
to?: string;
|
|
981
|
+
/**
|
|
982
|
+
* `currentVersionId`'s own discovered bar cadence (e.g. `1s`, `1m`, `1h`). Absent until a
|
|
983
|
+
* version exists.
|
|
984
|
+
*
|
|
985
|
+
*/
|
|
986
|
+
cadence?: string;
|
|
987
|
+
};
|
|
988
|
+
/**
|
|
989
|
+
* A `Dataset` plus a self link. Returned by `GET /datasets/{datasetId}`.
|
|
990
|
+
*/
|
|
991
|
+
type DatasetWithLinks = Dataset & {
|
|
992
|
+
_links?: {
|
|
993
|
+
self?: {
|
|
994
|
+
href?: string;
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* A `Dataset` plus the first upload session — the presigned URL to PUT the file to.
|
|
1000
|
+
*
|
|
1001
|
+
*/
|
|
1002
|
+
type DatasetCreated = Dataset & {
|
|
1003
|
+
/**
|
|
1004
|
+
* Identifies this upload session. Pass to
|
|
1005
|
+
* `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the PUT completes.
|
|
1006
|
+
*
|
|
1007
|
+
*/
|
|
1008
|
+
uploadId: string;
|
|
1009
|
+
upload: {
|
|
1010
|
+
/**
|
|
1011
|
+
* Presigned URL. `PUT` the raw CSV file here directly — no `Authorization`
|
|
1012
|
+
* header, no other API credentials.
|
|
1013
|
+
*
|
|
1014
|
+
*/
|
|
1015
|
+
url: string;
|
|
1016
|
+
/**
|
|
1017
|
+
* How long `url` stays valid.
|
|
1018
|
+
*/
|
|
1019
|
+
expiresInMinutes: number;
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
/**
|
|
1023
|
+
* One successfully ingested upload. Cadence and timestamp unit are discovered from the file,
|
|
1024
|
+
* not declared by the caller (D-11).
|
|
1025
|
+
*
|
|
1026
|
+
*/
|
|
1027
|
+
type DatasetVersion = {
|
|
1028
|
+
datasetId: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* The version id. Pass as `datasetVersionId` on `POST .../prepare` to pin it.
|
|
1031
|
+
*/
|
|
1032
|
+
id?: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* Size of the uploaded file.
|
|
1035
|
+
*/
|
|
1036
|
+
bytes?: number;
|
|
1037
|
+
/**
|
|
1038
|
+
* Number of data rows.
|
|
1039
|
+
*/
|
|
1040
|
+
rows?: number;
|
|
1041
|
+
/**
|
|
1042
|
+
* The discovered bar cadence (e.g. `1s`, `1m`, `1h`).
|
|
1043
|
+
*/
|
|
1044
|
+
cadence?: string;
|
|
1045
|
+
/**
|
|
1046
|
+
* The unit the `timestamp` column was uploaded in — ISO-8601, or the epoch band its
|
|
1047
|
+
* numeric values fell in (seconds, millis, or micros).
|
|
1048
|
+
*
|
|
1049
|
+
*/
|
|
1050
|
+
timestampUnit?: "iso" | "s" | "ms" | "us";
|
|
1051
|
+
/**
|
|
1052
|
+
* Number of gaps at the discovered cadence.
|
|
1053
|
+
*/
|
|
1054
|
+
gaps?: number;
|
|
1055
|
+
/**
|
|
1056
|
+
* The largest gap, in units of the discovered cadence step.
|
|
1057
|
+
*/
|
|
1058
|
+
largestGapSteps?: number;
|
|
1059
|
+
};
|
|
1060
|
+
/**
|
|
1061
|
+
* Progress of one upload, from staged through ingest. Postgres-backed once a version exists,
|
|
1062
|
+
* so `ready`/`failed` are permanent answers; `uploading`/`ingesting` reflect in-flight state
|
|
1063
|
+
* that can itself age out — see the `404` case on `GET .../uploads/{uploadId}`.
|
|
1064
|
+
*
|
|
1065
|
+
*/
|
|
1066
|
+
type DatasetUploadState = {
|
|
1067
|
+
uploadId: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* * `uploading` — the file was PUT to the presigned URL, but `finalize` has not been
|
|
1070
|
+
* called yet.
|
|
1071
|
+
* * `ingesting` — `finalize` was called; the worker is parsing and validating the file.
|
|
1072
|
+
* * `ready` — ingested successfully. `version` carries the result.
|
|
1073
|
+
* * `failed` — ingest rejected the file (e.g. bad CSV contract, mixed timestamp units).
|
|
1074
|
+
*
|
|
1075
|
+
*/
|
|
1076
|
+
status: "uploading" | "ingesting" | "ready" | "failed";
|
|
1077
|
+
/**
|
|
1078
|
+
* The ingest job id, while `status` is `ingesting`.
|
|
1079
|
+
*/
|
|
1080
|
+
jobId?: string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Present when `status` is `ready` or `failed`.
|
|
1083
|
+
*/
|
|
1084
|
+
version?: DatasetVersion;
|
|
1085
|
+
};
|
|
874
1086
|
type AuthTokenResponse = {
|
|
875
1087
|
/**
|
|
876
1088
|
* Short-lived HS256 JWT. Send as `Authorization: Bearer <token>` on all other endpoints.
|
|
@@ -1288,7 +1500,9 @@ type PrepareBacktestData = {
|
|
|
1288
1500
|
body: PrepareRequest;
|
|
1289
1501
|
path: {
|
|
1290
1502
|
/**
|
|
1291
|
-
* ID of the exchange to prepare the backtesting for
|
|
1503
|
+
* ID of the exchange to prepare the backtesting for (e.g. `binance`), or the reserved
|
|
1504
|
+
* value `user` to prepare from a dataset you uploaded instead of a managed exchange.
|
|
1505
|
+
*
|
|
1292
1506
|
*/
|
|
1293
1507
|
exchangeId: string;
|
|
1294
1508
|
/**
|
|
@@ -1302,17 +1516,23 @@ type PrepareBacktestData = {
|
|
|
1302
1516
|
type PrepareBacktestErrors = {
|
|
1303
1517
|
/**
|
|
1304
1518
|
* Invalid request or parameters. Also returned when `from` is older than the configured
|
|
1305
|
-
* lookback window or `to` is in the future.
|
|
1519
|
+
* lookback window or `to` is in the future. For `exchangeId: user`, also returned when
|
|
1520
|
+
* the dataset's current upload has not finished ingesting, or `cadence` asks for a finer
|
|
1521
|
+
* granularity than the dataset's own discovered cadence, or the requested range exceeds
|
|
1522
|
+
* your tier's range limit.
|
|
1306
1523
|
*
|
|
1307
1524
|
*/
|
|
1308
1525
|
400: ResponseError;
|
|
1309
1526
|
/**
|
|
1310
|
-
* Exchange or data source type not found
|
|
1527
|
+
* Exchange or data source type not found. For `exchangeId: user`, also returned when
|
|
1528
|
+
* `datasetId` (or a pinned `datasetVersionId`) doesn't exist or isn't yours.
|
|
1529
|
+
*
|
|
1311
1530
|
*/
|
|
1312
1531
|
404: ResponseError;
|
|
1313
1532
|
/**
|
|
1314
1533
|
* Rate limited. Returned when the global queue exceeds capacity or the user has too many
|
|
1315
|
-
* active backtests.
|
|
1534
|
+
* active backtests. Does not apply to `exchangeId: user` — a dataset prepare reads an
|
|
1535
|
+
* already-ingested file rather than enqueueing worker capacity.
|
|
1316
1536
|
*
|
|
1317
1537
|
*/
|
|
1318
1538
|
429: ResponseError;
|
|
@@ -1329,7 +1549,9 @@ type GetPrepareStatusData = {
|
|
|
1329
1549
|
body?: never;
|
|
1330
1550
|
path: {
|
|
1331
1551
|
/**
|
|
1332
|
-
* ID of the exchange for the backtesting process
|
|
1552
|
+
* ID of the exchange for the backtesting process, or the reserved value `user` for a
|
|
1553
|
+
* dataset-backed prepare.
|
|
1554
|
+
*
|
|
1333
1555
|
*/
|
|
1334
1556
|
exchangeId: string;
|
|
1335
1557
|
/**
|
|
@@ -1509,7 +1731,9 @@ type ExecuteBacktestData = {
|
|
|
1509
1731
|
};
|
|
1510
1732
|
path: {
|
|
1511
1733
|
/**
|
|
1512
|
-
* ID of the exchange for the backtesting process
|
|
1734
|
+
* ID of the exchange for the backtesting process, or the reserved value `user` if
|
|
1735
|
+
* `prepareJobId` came from a dataset-backed prepare.
|
|
1736
|
+
*
|
|
1513
1737
|
*/
|
|
1514
1738
|
exchangeId: string;
|
|
1515
1739
|
/**
|
|
@@ -1624,6 +1848,179 @@ type GetBacktestResultResponses = {
|
|
|
1624
1848
|
};
|
|
1625
1849
|
};
|
|
1626
1850
|
type GetBacktestResultResponse = GetBacktestResultResponses[keyof GetBacktestResultResponses];
|
|
1851
|
+
type ListDatasetsData = {
|
|
1852
|
+
body?: never;
|
|
1853
|
+
path?: never;
|
|
1854
|
+
query?: never;
|
|
1855
|
+
url: "/datasets";
|
|
1856
|
+
};
|
|
1857
|
+
type ListDatasetsResponses = {
|
|
1858
|
+
/**
|
|
1859
|
+
* Your datasets
|
|
1860
|
+
*/
|
|
1861
|
+
200: {
|
|
1862
|
+
datasets: Array<Dataset>;
|
|
1863
|
+
};
|
|
1864
|
+
};
|
|
1865
|
+
type ListDatasetsResponse = ListDatasetsResponses[keyof ListDatasetsResponses];
|
|
1866
|
+
type CreateDatasetData = {
|
|
1867
|
+
/**
|
|
1868
|
+
* The dataset to create
|
|
1869
|
+
*/
|
|
1870
|
+
body: {
|
|
1871
|
+
/**
|
|
1872
|
+
* A name unique among your datasets. `409` if already taken.
|
|
1873
|
+
*/
|
|
1874
|
+
name: string;
|
|
1875
|
+
instrument: Instrument;
|
|
1876
|
+
};
|
|
1877
|
+
path?: never;
|
|
1878
|
+
query?: never;
|
|
1879
|
+
url: "/datasets";
|
|
1880
|
+
};
|
|
1881
|
+
type CreateDatasetErrors = {
|
|
1882
|
+
/**
|
|
1883
|
+
* Invalid request, or `instrument` is not a plain spot pair
|
|
1884
|
+
*/
|
|
1885
|
+
400: ResponseError;
|
|
1886
|
+
/**
|
|
1887
|
+
* You already have a dataset with this `name`
|
|
1888
|
+
*/
|
|
1889
|
+
409: ResponseError;
|
|
1890
|
+
/**
|
|
1891
|
+
* Your tier's dataset count limit is reached. Delete one, or upgrade.
|
|
1892
|
+
*/
|
|
1893
|
+
429: ResponseError;
|
|
1894
|
+
};
|
|
1895
|
+
type CreateDatasetError = CreateDatasetErrors[keyof CreateDatasetErrors];
|
|
1896
|
+
type CreateDatasetResponses = {
|
|
1897
|
+
/**
|
|
1898
|
+
* Dataset created, with an upload session ready for its first version
|
|
1899
|
+
*/
|
|
1900
|
+
201: DatasetCreated;
|
|
1901
|
+
};
|
|
1902
|
+
type CreateDatasetResponse = CreateDatasetResponses[keyof CreateDatasetResponses];
|
|
1903
|
+
type DeleteDatasetData = {
|
|
1904
|
+
body?: never;
|
|
1905
|
+
path: {
|
|
1906
|
+
/**
|
|
1907
|
+
* The id returned by `POST /datasets`
|
|
1908
|
+
*/
|
|
1909
|
+
datasetId: string;
|
|
1910
|
+
};
|
|
1911
|
+
query?: never;
|
|
1912
|
+
url: "/datasets/{datasetId}";
|
|
1913
|
+
};
|
|
1914
|
+
type DeleteDatasetErrors = {
|
|
1915
|
+
/**
|
|
1916
|
+
* No such dataset for this user, or already deleted
|
|
1917
|
+
*/
|
|
1918
|
+
404: ResponseError;
|
|
1919
|
+
};
|
|
1920
|
+
type DeleteDatasetError = DeleteDatasetErrors[keyof DeleteDatasetErrors];
|
|
1921
|
+
type DeleteDatasetResponses = {
|
|
1922
|
+
/**
|
|
1923
|
+
* Deleted
|
|
1924
|
+
*/
|
|
1925
|
+
200: {
|
|
1926
|
+
datasetId: string;
|
|
1927
|
+
deleted: true;
|
|
1928
|
+
};
|
|
1929
|
+
};
|
|
1930
|
+
type DeleteDatasetResponse = DeleteDatasetResponses[keyof DeleteDatasetResponses];
|
|
1931
|
+
type GetDatasetData = {
|
|
1932
|
+
body?: never;
|
|
1933
|
+
path: {
|
|
1934
|
+
/**
|
|
1935
|
+
* The id returned by `POST /datasets`
|
|
1936
|
+
*/
|
|
1937
|
+
datasetId: string;
|
|
1938
|
+
};
|
|
1939
|
+
query?: never;
|
|
1940
|
+
url: "/datasets/{datasetId}";
|
|
1941
|
+
};
|
|
1942
|
+
type GetDatasetErrors = {
|
|
1943
|
+
/**
|
|
1944
|
+
* No such dataset for this user
|
|
1945
|
+
*/
|
|
1946
|
+
404: ResponseError;
|
|
1947
|
+
};
|
|
1948
|
+
type GetDatasetError = GetDatasetErrors[keyof GetDatasetErrors];
|
|
1949
|
+
type GetDatasetResponses = {
|
|
1950
|
+
/**
|
|
1951
|
+
* Dataset detail
|
|
1952
|
+
*/
|
|
1953
|
+
200: DatasetWithLinks;
|
|
1954
|
+
};
|
|
1955
|
+
type GetDatasetResponse = GetDatasetResponses[keyof GetDatasetResponses];
|
|
1956
|
+
type FinalizeDatasetUploadData = {
|
|
1957
|
+
body?: never;
|
|
1958
|
+
path: {
|
|
1959
|
+
/**
|
|
1960
|
+
* The id returned by `POST /datasets`
|
|
1961
|
+
*/
|
|
1962
|
+
datasetId: string;
|
|
1963
|
+
/**
|
|
1964
|
+
* The `uploadId` returned by `POST /datasets`
|
|
1965
|
+
*/
|
|
1966
|
+
uploadId: string;
|
|
1967
|
+
};
|
|
1968
|
+
query?: never;
|
|
1969
|
+
url: "/datasets/{datasetId}/uploads/{uploadId}/finalize";
|
|
1970
|
+
};
|
|
1971
|
+
type FinalizeDatasetUploadErrors = {
|
|
1972
|
+
/**
|
|
1973
|
+
* No such dataset for this user, or nothing was PUT to `upload.url` yet — a finalize with
|
|
1974
|
+
* nothing to finalize.
|
|
1975
|
+
*
|
|
1976
|
+
*/
|
|
1977
|
+
404: ResponseError;
|
|
1978
|
+
/**
|
|
1979
|
+
* The uploaded file exceeds your tier's size limit for a dataset.
|
|
1980
|
+
*/
|
|
1981
|
+
413: ResponseError;
|
|
1982
|
+
};
|
|
1983
|
+
type FinalizeDatasetUploadError = FinalizeDatasetUploadErrors[keyof FinalizeDatasetUploadErrors];
|
|
1984
|
+
type FinalizeDatasetUploadResponses = {
|
|
1985
|
+
/**
|
|
1986
|
+
* Ingest queued
|
|
1987
|
+
*/
|
|
1988
|
+
202: {
|
|
1989
|
+
jobId: string;
|
|
1990
|
+
};
|
|
1991
|
+
};
|
|
1992
|
+
type FinalizeDatasetUploadResponse = FinalizeDatasetUploadResponses[keyof FinalizeDatasetUploadResponses];
|
|
1993
|
+
type GetDatasetUploadData = {
|
|
1994
|
+
body?: never;
|
|
1995
|
+
path: {
|
|
1996
|
+
/**
|
|
1997
|
+
* The id returned by `POST /datasets`
|
|
1998
|
+
*/
|
|
1999
|
+
datasetId: string;
|
|
2000
|
+
/**
|
|
2001
|
+
* The `uploadId` returned by `POST /datasets`
|
|
2002
|
+
*/
|
|
2003
|
+
uploadId: string;
|
|
2004
|
+
};
|
|
2005
|
+
query?: never;
|
|
2006
|
+
url: "/datasets/{datasetId}/uploads/{uploadId}";
|
|
2007
|
+
};
|
|
2008
|
+
type GetDatasetUploadErrors = {
|
|
2009
|
+
/**
|
|
2010
|
+
* No such dataset for this user, or genuinely nothing is known about this `uploadId` — no
|
|
2011
|
+
* version, no in-flight job, and nothing was ever PUT to its upload URL.
|
|
2012
|
+
*
|
|
2013
|
+
*/
|
|
2014
|
+
404: ResponseError;
|
|
2015
|
+
};
|
|
2016
|
+
type GetDatasetUploadError = GetDatasetUploadErrors[keyof GetDatasetUploadErrors];
|
|
2017
|
+
type GetDatasetUploadResponses = {
|
|
2018
|
+
/**
|
|
2019
|
+
* Current upload/ingest state
|
|
2020
|
+
*/
|
|
2021
|
+
200: DatasetUploadState;
|
|
2022
|
+
};
|
|
2023
|
+
type GetDatasetUploadResponse = GetDatasetUploadResponses[keyof GetDatasetUploadResponses];
|
|
1627
2024
|
type ClientOptions = {
|
|
1628
2025
|
baseUrl: "https://api.qtsurfer.net/v1" | "https://api.qtsurfer.com/v1" | (string & {});
|
|
1629
2026
|
};
|
|
@@ -1829,6 +2226,11 @@ declare const getStrategyCode: <ThrowOnError extends boolean = false>(options: O
|
|
|
1829
2226
|
* The same params always return the same `jobId` (idempotent). Repeated calls with identical
|
|
1830
2227
|
* params do not enqueue duplicate work — they reuse the existing job.
|
|
1831
2228
|
*
|
|
2229
|
+
* **`exchangeId: user` is reserved for your own uploaded data.** Instead of a managed
|
|
2230
|
+
* exchange, it prepares from a dataset you created via `POST /datasets` (see the **Dataset**
|
|
2231
|
+
* endpoints) — send `datasetId` in place of `instrument`. See `PrepareRequest` below for the
|
|
2232
|
+
* two request shapes.
|
|
2233
|
+
*
|
|
1832
2234
|
*/
|
|
1833
2235
|
declare const prepareBacktest: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
|
|
1834
2236
|
/**
|
|
@@ -1836,6 +2238,9 @@ declare const prepareBacktest: <ThrowOnError extends boolean = false>(options: O
|
|
|
1836
2238
|
* Retrieves the current state of the prepare job identified by `jobId`.
|
|
1837
2239
|
* Poll until `status` is `Completed`, `Failed`, or `Aborted`.
|
|
1838
2240
|
*
|
|
2241
|
+
* For a dataset prepare (`exchangeId: user`), coverage is reported against the dataset's own
|
|
2242
|
+
* cadence grid instead of hours — see `cadence`/`gaps`/`largestGapSteps` on `PrepareJobState`.
|
|
2243
|
+
*
|
|
1839
2244
|
*/
|
|
1840
2245
|
declare const getPrepareStatus: <ThrowOnError extends boolean = false>(options: Options<GetPrepareStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PrepareJobState, ResponseError, ThrowOnError>;
|
|
1841
2246
|
/**
|
|
@@ -1936,6 +2341,9 @@ declare const getSweepSensitivity: <ThrowOnError extends boolean = false>(option
|
|
|
1936
2341
|
* The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
|
|
1937
2342
|
* `jobId` (idempotent).
|
|
1938
2343
|
*
|
|
2344
|
+
* Works unchanged for a dataset-backed prepare (`exchangeId: user`) — the request body is
|
|
2345
|
+
* identical either way, since the instrument and range are recovered from `prepareJobId`.
|
|
2346
|
+
*
|
|
1939
2347
|
*/
|
|
1940
2348
|
declare const executeBacktest: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
|
|
1941
2349
|
/**
|
|
@@ -1961,7 +2369,71 @@ declare const cancelBacktest: <ThrowOnError extends boolean = false>(options: Op
|
|
|
1961
2369
|
*
|
|
1962
2370
|
*/
|
|
1963
2371
|
declare const getBacktestResult: <ThrowOnError extends boolean = false>(options: Options<GetBacktestResultData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetBacktestResultResponse, ResponseError, ThrowOnError>;
|
|
2372
|
+
/**
|
|
2373
|
+
* List your datasets
|
|
2374
|
+
* Every dataset you have created and not deleted, most recently created first. Never a `404`
|
|
2375
|
+
* — an empty array if you have none, same convention as `GET /strategies`.
|
|
2376
|
+
*
|
|
2377
|
+
*/
|
|
2378
|
+
declare const listDatasets: <ThrowOnError extends boolean = false>(options?: Options<ListDatasetsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
2379
|
+
datasets: Array<Dataset>;
|
|
2380
|
+
}, unknown, ThrowOnError>;
|
|
2381
|
+
/**
|
|
2382
|
+
* Create a dataset and get a URL to upload it to
|
|
2383
|
+
* Creates a dataset AND its first upload session in one call — a presigned URL your client
|
|
2384
|
+
* PUTs the file to directly, no API credentials involved in that PUT. Call
|
|
2385
|
+
* `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the upload completes to kick
|
|
2386
|
+
* off ingest.
|
|
2387
|
+
*
|
|
2388
|
+
* v1 is ticker data only — `type` is not a request field, it is always `"ticker"` in the
|
|
2389
|
+
* response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative
|
|
2390
|
+
* forms (e.g. `BTC/USDT:USDT`) are rejected.
|
|
2391
|
+
*
|
|
2392
|
+
* **Upload format.** A CSV with a header row. Required columns: `timestamp` (ISO-8601, or
|
|
2393
|
+
* numeric epoch seconds/millis/micros — detected from the first row, then enforced for every
|
|
2394
|
+
* later row), `close`. Optional columns: `open`, `high`, `low`, `volume`, `quoteVolume`,
|
|
2395
|
+
* `bid`, `bidSize`, `ask`, `askSize`. Cadence and timestamp unit are discovered from the data,
|
|
2396
|
+
* not declared.
|
|
2397
|
+
*
|
|
2398
|
+
*/
|
|
2399
|
+
declare const createDataset: <ThrowOnError extends boolean = false>(options: Options<CreateDatasetData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DatasetCreated, ResponseError, ThrowOnError>;
|
|
2400
|
+
/**
|
|
2401
|
+
* Delete a dataset
|
|
2402
|
+
* Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and
|
|
2403
|
+
* can no longer be prepared from, but its object data is reclaimed later rather than purged
|
|
2404
|
+
* inline, so a backtest already running against one of its versions is not disrupted.
|
|
2405
|
+
*
|
|
2406
|
+
*/
|
|
2407
|
+
declare const deleteDataset: <ThrowOnError extends boolean = false>(options: Options<DeleteDatasetData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
2408
|
+
datasetId: string;
|
|
2409
|
+
deleted: true;
|
|
2410
|
+
}, ResponseError, ThrowOnError>;
|
|
2411
|
+
/**
|
|
2412
|
+
* Get a dataset by id
|
|
2413
|
+
* Detail for one dataset, plus a self link.
|
|
2414
|
+
*/
|
|
2415
|
+
declare const getDataset: <ThrowOnError extends boolean = false>(options: Options<GetDatasetData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DatasetWithLinks, ResponseError, ThrowOnError>;
|
|
2416
|
+
/**
|
|
2417
|
+
* Finalize an uploaded file and start ingest
|
|
2418
|
+
* Call once the file has been PUT to the `upload.url` from `POST /datasets`. Enqueues ingest
|
|
2419
|
+
* and returns immediately; poll
|
|
2420
|
+
* `GET /datasets/{datasetId}/uploads/{uploadId}` for the result.
|
|
2421
|
+
*
|
|
2422
|
+
* Idempotent — a repeat finalize of the same upload returns the same `jobId` rather than
|
|
2423
|
+
* enqueueing a second ingest.
|
|
2424
|
+
*
|
|
2425
|
+
*/
|
|
2426
|
+
declare const finalizeDatasetUpload: <ThrowOnError extends boolean = false>(options: Options<FinalizeDatasetUploadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
|
|
2427
|
+
jobId: string;
|
|
2428
|
+
}, ResponseError, ThrowOnError>;
|
|
2429
|
+
/**
|
|
2430
|
+
* Get the state of an upload/ingest
|
|
2431
|
+
* Poll after `POST .../finalize` until `status` is `ready` or `failed`. Also reports
|
|
2432
|
+
* `uploading` (finalize not called yet, but the file was PUT) before you finalize at all.
|
|
2433
|
+
*
|
|
2434
|
+
*/
|
|
2435
|
+
declare const getDatasetUpload: <ThrowOnError extends boolean = false>(options: Options<GetDatasetUploadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DatasetUploadState, ResponseError, ThrowOnError>;
|
|
1964
2436
|
|
|
1965
2437
|
declare const client: _hey_api_client_fetch.Client;
|
|
1966
2438
|
|
|
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 };
|
|
2439
|
+
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 CreateDatasetData, type CreateDatasetError, type CreateDatasetErrors, type CreateDatasetResponse, type CreateDatasetResponses, type DataSourceType, type Dataset, type DatasetCreated, type DatasetUploadState, type DatasetVersion, type DatasetWithLinks, type DeleteDatasetData, type DeleteDatasetError, type DeleteDatasetErrors, type DeleteDatasetResponse, type DeleteDatasetResponses, 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 FinalizeDatasetUploadData, type FinalizeDatasetUploadError, type FinalizeDatasetUploadErrors, type FinalizeDatasetUploadResponse, type FinalizeDatasetUploadResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetResponse, type GetDatasetResponses, type GetDatasetUploadData, type GetDatasetUploadError, type GetDatasetUploadErrors, type GetDatasetUploadResponse, type GetDatasetUploadResponses, 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 ListDatasetsData, type ListDatasetsResponse, type ListDatasetsResponses, 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, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getBacktestResult, getDataset, getDatasetUpload, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepSensitivity, listDatasets, listExchanges, listInstruments, listSegmentInstruments, listStrategies, prepareBacktest, validateStrategy };
|