@qtsurfer/api-client 0.15.0 → 0.16.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 +219 -16
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +230 -9
- package/src/generated/sdk.gen.ts +70 -7
- package/src/generated/types.gen.ts +199 -8
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,107 @@ type HalLink = {
|
|
|
96
96
|
*/
|
|
97
97
|
templated?: boolean;
|
|
98
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Your identity and tier limits. No database call behind this one — safe to fetch on every
|
|
101
|
+
* page load. Live usage against these limits is a separate resource, `GET /account/usage`,
|
|
102
|
+
* deliberately: usage changes on every upload/execution and costs a query to compute, this
|
|
103
|
+
* one doesn't.
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
type Account = {
|
|
107
|
+
/**
|
|
108
|
+
* Your account id — the JWT `sub` claim.
|
|
109
|
+
*/
|
|
110
|
+
userId: string;
|
|
111
|
+
/**
|
|
112
|
+
* Your current subscription tier.
|
|
113
|
+
*/
|
|
114
|
+
tier: string;
|
|
115
|
+
/**
|
|
116
|
+
* Maximum number of active datasets your tier allows.
|
|
117
|
+
*/
|
|
118
|
+
maxDatasets: number;
|
|
119
|
+
/**
|
|
120
|
+
* Maximum size, in bytes, of a single dataset version.
|
|
121
|
+
*/
|
|
122
|
+
maxDatasetBytes: number;
|
|
123
|
+
/**
|
|
124
|
+
* Maximum combined storage, in bytes, across every dataset, strategy-execution signal,
|
|
125
|
+
* and registered strategy on your account — one shared pool, not a separate cap per
|
|
126
|
+
* resource type, since they all compete for the same underlying storage. See `GET
|
|
127
|
+
* /account/usage`'s `storageBytesUsed` for your current usage against this number.
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
130
|
+
maxTotalStorageBytes: number;
|
|
131
|
+
_links: AccountLinks;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* HAL `_links` for `GET /account`
|
|
135
|
+
*/
|
|
136
|
+
type AccountLinks = {
|
|
137
|
+
/**
|
|
138
|
+
* Link to this resource.
|
|
139
|
+
*/
|
|
140
|
+
self: HalLink;
|
|
141
|
+
/**
|
|
142
|
+
* Link to your live usage, `GET /account/usage`.
|
|
143
|
+
*/
|
|
144
|
+
usage: HalLink;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Your live usage of the shared storage pool `GET /account`'s `maxTotalStorageBytes` caps.
|
|
148
|
+
* Not guaranteed real-time — a just-completed upload or strategy execution may take a short
|
|
149
|
+
* moment to be reflected here.
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
type AccountUsage = {
|
|
153
|
+
/**
|
|
154
|
+
* Active datasets counted — the same set `GET /account`'s `maxDatasets` limits.
|
|
155
|
+
*/
|
|
156
|
+
datasetsUsed: number;
|
|
157
|
+
/**
|
|
158
|
+
* Combined bytes of every active dataset's current version.
|
|
159
|
+
*/
|
|
160
|
+
datasetBytesUsed: number;
|
|
161
|
+
/**
|
|
162
|
+
* Recorded strategy-execution signal uploads.
|
|
163
|
+
*/
|
|
164
|
+
signalsUsed: number;
|
|
165
|
+
/**
|
|
166
|
+
* Combined bytes of every recorded signal upload.
|
|
167
|
+
*/
|
|
168
|
+
signalBytesUsed: number;
|
|
169
|
+
/**
|
|
170
|
+
* Registered strategies (see `GET /strategies`).
|
|
171
|
+
*/
|
|
172
|
+
strategiesUsed: number;
|
|
173
|
+
/**
|
|
174
|
+
* Combined bytes of each registered strategy's source plus its latest compiled
|
|
175
|
+
* bytecode. Superseded (non-latest) compilations aren't counted.
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
strategyBytesUsed: number;
|
|
179
|
+
/**
|
|
180
|
+
* `datasetBytesUsed + signalBytesUsed + strategyBytesUsed` — the number checked
|
|
181
|
+
* against `GET /account`'s `maxTotalStorageBytes`.
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
storageBytesUsed: number;
|
|
185
|
+
_links: AccountUsageLinks;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* HAL `_links` for `GET /account/usage`
|
|
189
|
+
*/
|
|
190
|
+
type AccountUsageLinks = {
|
|
191
|
+
/**
|
|
192
|
+
* Link to this resource.
|
|
193
|
+
*/
|
|
194
|
+
self: HalLink;
|
|
195
|
+
/**
|
|
196
|
+
* Link to your tier limits, `GET /account`.
|
|
197
|
+
*/
|
|
198
|
+
account: HalLink;
|
|
199
|
+
};
|
|
99
200
|
/**
|
|
100
201
|
* Exchange instrument with per-data-type coverage and market info
|
|
101
202
|
*/
|
|
@@ -1117,9 +1218,10 @@ type StrategyState = {
|
|
|
1117
1218
|
* A dataset's own metadata — not its data. `currentVersionId` is what a prepare against
|
|
1118
1219
|
* `exchangeId: user` reads by default; see `DatasetVersion` for what a version carries.
|
|
1119
1220
|
*
|
|
1120
|
-
* `from`/`to`/`cadence` mirror that
|
|
1121
|
-
*
|
|
1122
|
-
*
|
|
1221
|
+
* `from`/`to`/`cadence`/`timestampUnit`/`bytes`/`rows`/`gaps`/`largestGapSteps` mirror that
|
|
1222
|
+
* current version's own discovered range, cadence, timestamp unit and metrics, so you don't
|
|
1223
|
+
* need a second call to `GET /datasets/{datasetId}/uploads/{uploadId}` just to see what a
|
|
1224
|
+
* dataset covers.
|
|
1123
1225
|
*
|
|
1124
1226
|
*/
|
|
1125
1227
|
type Dataset = {
|
|
@@ -1171,6 +1273,47 @@ type Dataset = {
|
|
|
1171
1273
|
*
|
|
1172
1274
|
*/
|
|
1173
1275
|
cadence?: string;
|
|
1276
|
+
/**
|
|
1277
|
+
* `currentVersionId`'s own timestamp unit (see `DatasetVersion.timestampUnit`) — decode
|
|
1278
|
+
* the `timestamp` column of `dataUrl`'s file accordingly. Present only when `status` is
|
|
1279
|
+
* `ready`.
|
|
1280
|
+
*
|
|
1281
|
+
*/
|
|
1282
|
+
timestampUnit?: "iso" | "s" | "ms" | "us";
|
|
1283
|
+
/**
|
|
1284
|
+
* * `ready` — `currentVersionId` is set; `from`/`to`/`cadence`/`bytes`/`rows`/`gaps`/
|
|
1285
|
+
* `largestGapSteps` describe it.
|
|
1286
|
+
* * `failed` — the most recent upload/import attempt failed. `currentVersionId` and the
|
|
1287
|
+
* fields above are absent — there is nothing to read yet. See `error`.
|
|
1288
|
+
* * `pending` — nothing has ever been attempted (just created, or an upload was never
|
|
1289
|
+
* finalized).
|
|
1290
|
+
*
|
|
1291
|
+
*/
|
|
1292
|
+
status: "ready" | "failed" | "pending";
|
|
1293
|
+
/**
|
|
1294
|
+
* Size of `currentVersionId`'s own stored file. Present only when `status` is `ready` —
|
|
1295
|
+
* see `DatasetVersion.bytes` for what it measures exactly.
|
|
1296
|
+
*
|
|
1297
|
+
*/
|
|
1298
|
+
bytes?: number;
|
|
1299
|
+
/**
|
|
1300
|
+
* `currentVersionId`'s own row count. Present only when `status` is `ready`.
|
|
1301
|
+
*/
|
|
1302
|
+
rows?: number;
|
|
1303
|
+
/**
|
|
1304
|
+
* `currentVersionId`'s own gap count at its discovered cadence. Present only when `status` is `ready`.
|
|
1305
|
+
*/
|
|
1306
|
+
gaps?: number;
|
|
1307
|
+
/**
|
|
1308
|
+
* `currentVersionId`'s own largest gap, in units of its discovered cadence step. Present only when `status` is `ready`.
|
|
1309
|
+
*/
|
|
1310
|
+
largestGapSteps?: number;
|
|
1311
|
+
/**
|
|
1312
|
+
* A human-readable reason the most recent upload/import attempt failed. Present only
|
|
1313
|
+
* when `status` is `failed`.
|
|
1314
|
+
*
|
|
1315
|
+
*/
|
|
1316
|
+
error?: string;
|
|
1174
1317
|
};
|
|
1175
1318
|
/**
|
|
1176
1319
|
* A `Dataset` plus a self link. Returned by `GET /datasets/{datasetId}`.
|
|
@@ -1188,8 +1331,9 @@ type DatasetWithLinks = Dataset & {
|
|
|
1188
1331
|
/**
|
|
1189
1332
|
* Which format `dataUrl` is actually in — check this rather than assuming it
|
|
1190
1333
|
* matches how you uploaded it. `lastra` — our native columnar format — for a CSV (or
|
|
1191
|
-
* gzip/zip of one) upload, always converted on ingest
|
|
1192
|
-
*
|
|
1334
|
+
* gzip/zip of one) upload, always converted on ingest, or for a lastra upload,
|
|
1335
|
+
* stored as-is (the value alone doesn't tell you which). `parquet` for a parquet
|
|
1336
|
+
* upload, also stored as-is today.
|
|
1193
1337
|
*
|
|
1194
1338
|
*/
|
|
1195
1339
|
dataFormat?: "lastra" | "parquet";
|
|
@@ -1306,8 +1450,9 @@ type DatasetVersion = {
|
|
|
1306
1450
|
/**
|
|
1307
1451
|
* Which format `dataUrl` is actually in — check this rather than assuming it matches
|
|
1308
1452
|
* how you uploaded it. `lastra` — our native columnar format — for a CSV (or gzip/zip
|
|
1309
|
-
* of one) upload, always converted on ingest
|
|
1310
|
-
*
|
|
1453
|
+
* of one) upload, always converted on ingest, or for a lastra upload, stored as-is
|
|
1454
|
+
* (the value alone doesn't tell you which). `parquet` for a parquet upload, also
|
|
1455
|
+
* stored as-is today.
|
|
1311
1456
|
*
|
|
1312
1457
|
*/
|
|
1313
1458
|
dataFormat?: "lastra" | "parquet";
|
|
@@ -1542,6 +1687,32 @@ type AuthenticateResponses = {
|
|
|
1542
1687
|
200: AuthTokenResponse;
|
|
1543
1688
|
};
|
|
1544
1689
|
type AuthenticateResponse = AuthenticateResponses[keyof AuthenticateResponses];
|
|
1690
|
+
type GetAccountData = {
|
|
1691
|
+
body?: never;
|
|
1692
|
+
path?: never;
|
|
1693
|
+
query?: never;
|
|
1694
|
+
url: "/account";
|
|
1695
|
+
};
|
|
1696
|
+
type GetAccountResponses = {
|
|
1697
|
+
/**
|
|
1698
|
+
* Your account
|
|
1699
|
+
*/
|
|
1700
|
+
200: Account;
|
|
1701
|
+
};
|
|
1702
|
+
type GetAccountResponse = GetAccountResponses[keyof GetAccountResponses];
|
|
1703
|
+
type GetAccountUsageData = {
|
|
1704
|
+
body?: never;
|
|
1705
|
+
path?: never;
|
|
1706
|
+
query?: never;
|
|
1707
|
+
url: "/account/usage";
|
|
1708
|
+
};
|
|
1709
|
+
type GetAccountUsageResponses = {
|
|
1710
|
+
/**
|
|
1711
|
+
* Your current usage
|
|
1712
|
+
*/
|
|
1713
|
+
200: AccountUsage;
|
|
1714
|
+
};
|
|
1715
|
+
type GetAccountUsageResponse = GetAccountUsageResponses[keyof GetAccountUsageResponses];
|
|
1545
1716
|
type ListExchangesData = {
|
|
1546
1717
|
body?: never;
|
|
1547
1718
|
path?: never;
|
|
@@ -2504,6 +2675,12 @@ type FinalizeDatasetUploadErrors = {
|
|
|
2504
2675
|
* The uploaded file exceeds your tier's size limit for a dataset.
|
|
2505
2676
|
*/
|
|
2506
2677
|
413: ResponseError;
|
|
2678
|
+
/**
|
|
2679
|
+
* Your account's total storage limit (`GET /account`'s `maxTotalStorageBytes`) is
|
|
2680
|
+
* reached or would be exceeded. Delete a dataset to free space, or upgrade.
|
|
2681
|
+
*
|
|
2682
|
+
*/
|
|
2683
|
+
429: ResponseError;
|
|
2507
2684
|
};
|
|
2508
2685
|
type FinalizeDatasetUploadError = FinalizeDatasetUploadErrors[keyof FinalizeDatasetUploadErrors];
|
|
2509
2686
|
type FinalizeDatasetUploadResponses = {
|
|
@@ -2573,7 +2750,10 @@ type ImportDatasetErrors = {
|
|
|
2573
2750
|
*/
|
|
2574
2751
|
409: ResponseError;
|
|
2575
2752
|
/**
|
|
2576
|
-
* Your tier's dataset count limit is reached
|
|
2753
|
+
* Your tier's dataset count limit is reached, or your account's total storage limit
|
|
2754
|
+
* (`GET /account`'s `maxTotalStorageBytes`) is already reached. Delete a dataset to free
|
|
2755
|
+
* a slot or space, or upgrade.
|
|
2756
|
+
*
|
|
2577
2757
|
*/
|
|
2578
2758
|
429: ResponseError;
|
|
2579
2759
|
};
|
|
@@ -2645,6 +2825,24 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
|
|
|
2645
2825
|
*
|
|
2646
2826
|
*/
|
|
2647
2827
|
declare const authenticate: <ThrowOnError extends boolean = false>(options?: Options<AuthenticateData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AuthTokenResponse, unknown, ThrowOnError>;
|
|
2828
|
+
/**
|
|
2829
|
+
* Get your account's identity and tier limits
|
|
2830
|
+
* Your userId, current tier, and that tier's limits — no database call, safe to fetch on
|
|
2831
|
+
* every page load. For live usage against these limits, see `_links.usage`
|
|
2832
|
+
* (`GET /account/usage`).
|
|
2833
|
+
*
|
|
2834
|
+
*/
|
|
2835
|
+
declare const getAccount: <ThrowOnError extends boolean = false>(options?: Options<GetAccountData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Account, unknown, ThrowOnError>;
|
|
2836
|
+
/**
|
|
2837
|
+
* Get your live storage usage
|
|
2838
|
+
* How much of your account's shared storage pool (`GET /account`'s `maxTotalStorageBytes`)
|
|
2839
|
+
* you're currently using. Datasets, strategy-execution signals, and registered strategies
|
|
2840
|
+
* all count against the same total — they compete for the same underlying storage, so
|
|
2841
|
+
* there's one number to watch, not one per resource type. Not guaranteed real-time — a
|
|
2842
|
+
* just-completed upload or strategy execution may take a short moment to be reflected here.
|
|
2843
|
+
*
|
|
2844
|
+
*/
|
|
2845
|
+
declare const getAccountUsage: <ThrowOnError extends boolean = false>(options?: Options<GetAccountUsageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AccountUsage, unknown, ThrowOnError>;
|
|
2648
2846
|
/**
|
|
2649
2847
|
* List the available exchanges
|
|
2650
2848
|
*/
|
|
@@ -3029,16 +3227,21 @@ declare const listDatasets: <ThrowOnError extends boolean = false>(options?: Opt
|
|
|
3029
3227
|
* response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative
|
|
3030
3228
|
* forms (e.g. `BTC/USDT:USDT`) are rejected.
|
|
3031
3229
|
*
|
|
3032
|
-
* **Upload format.** A CSV with a header row,
|
|
3033
|
-
* name
|
|
3034
|
-
*
|
|
3035
|
-
*
|
|
3036
|
-
*
|
|
3230
|
+
* **Upload format.** A CSV with a header row, a parquet file with the same columns by
|
|
3231
|
+
* name, or a lastra file — our own native columnar format, the same one a dataset's
|
|
3232
|
+
* `dataUrl` hands back by default, so a downloaded dataset can be handed to another user to
|
|
3233
|
+
* upload with no conversion in between. For CSV/parquet, required: `timestamp` (ISO-8601, or
|
|
3234
|
+
* numeric epoch seconds/millis/micros — detected from the first row, then enforced for every
|
|
3235
|
+
* later row), `close`. Optional: `open`, `high`, `low`, `volume`, `quoteVolume`, `bid`,
|
|
3236
|
+
* `bidSize`, `ask`, `askSize`. A lastra upload carries its own fixed column set instead and
|
|
3237
|
+
* only needs a timestamp series and a close series present. Cadence and timestamp unit are
|
|
3238
|
+
* discovered from the data, not declared, for all three.
|
|
3037
3239
|
*
|
|
3038
3240
|
* A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet
|
|
3039
|
-
* upload is stored as-is today. Either way, always check `dataFormat` on
|
|
3241
|
+
* or lastra upload is stored as-is today. Either way, always check `dataFormat` on
|
|
3040
3242
|
* `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which
|
|
3041
|
-
* one `dataUrl` actually is, rather than assuming from how you uploaded it
|
|
3243
|
+
* one `dataUrl` actually is, rather than assuming from how you uploaded it (a converted CSV
|
|
3244
|
+
* and an uploaded lastra file both report `dataFormat: "lastra"`).
|
|
3042
3245
|
*
|
|
3043
3246
|
* The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped
|
|
3044
3247
|
* (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels).
|
|
@@ -3137,4 +3340,4 @@ declare const getDatasetImport: <ThrowOnError extends boolean = false>(options:
|
|
|
3137
3340
|
|
|
3138
3341
|
declare const client: _hey_api_client_fetch.Client;
|
|
3139
3342
|
|
|
3140
|
-
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 DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, 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 EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, 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 GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, 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 GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, 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 OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type ScalarStrategyParamValue, 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, getDatasetImport, getDatasetUpload, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listSegmentInstruments, listStrategies, openDatasetUpload, prepareBacktest, validateStrategy };
|
|
3343
|
+
export { type AcceptedJob, type Account, type AccountLinks, type AccountUsage, type AccountUsageLinks, 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 DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, 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 EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, 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 GetAccountData, type GetAccountResponse, type GetAccountResponses, type GetAccountUsageData, type GetAccountUsageResponse, type GetAccountUsageResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, 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 GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, 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 OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type ScalarStrategyParamValue, 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, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listSegmentInstruments, listStrategies, openDatasetUpload, prepareBacktest, validateStrategy };
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,30 @@ var authenticate = (options) => {
|
|
|
22
22
|
...options
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
+
var getAccount = (options) => {
|
|
26
|
+
return (options?.client ?? client).get({
|
|
27
|
+
security: [
|
|
28
|
+
{
|
|
29
|
+
scheme: "bearer",
|
|
30
|
+
type: "http"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
url: "/account",
|
|
34
|
+
...options
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var getAccountUsage = (options) => {
|
|
38
|
+
return (options?.client ?? client).get({
|
|
39
|
+
security: [
|
|
40
|
+
{
|
|
41
|
+
scheme: "bearer",
|
|
42
|
+
type: "http"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
url: "/account/usage",
|
|
46
|
+
...options
|
|
47
|
+
});
|
|
48
|
+
};
|
|
25
49
|
var listExchanges = (options) => {
|
|
26
50
|
return (options?.client ?? client).get({
|
|
27
51
|
url: "/exchanges",
|
|
@@ -391,6 +415,8 @@ export {
|
|
|
391
415
|
executeBacktest,
|
|
392
416
|
executeSweep,
|
|
393
417
|
finalizeDatasetUpload,
|
|
418
|
+
getAccount,
|
|
419
|
+
getAccountUsage,
|
|
394
420
|
getBacktestResult,
|
|
395
421
|
getDataset,
|
|
396
422
|
getDatasetImport,
|
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.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 GetSweepRunEquityCurveData,\n GetSweepRunEquityCurveResponse,\n GetSweepRunEquityCurveError,\n ExecuteBacktestData,\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n CancelBacktestData,\n CancelBacktestResponse,\n CancelBacktestError,\n GetBacktestResultData,\n GetBacktestResultResponse,\n GetBacktestResultError,\n ListDatasetsData,\n ListDatasetsResponse,\n CreateDatasetData,\n CreateDatasetResponse,\n CreateDatasetError,\n DeleteDatasetData,\n DeleteDatasetResponse,\n DeleteDatasetError,\n GetDatasetData,\n GetDatasetResponse,\n GetDatasetError,\n OpenDatasetUploadData,\n OpenDatasetUploadResponse,\n OpenDatasetUploadError,\n FinalizeDatasetUploadData,\n FinalizeDatasetUploadResponse,\n FinalizeDatasetUploadError,\n GetDatasetUploadData,\n GetDatasetUploadResponse,\n GetDatasetUploadError,\n ImportDatasetData,\n ImportDatasetResponse,\n ImportDatasetError,\n GetDatasetImportData,\n GetDatasetImportResponse,\n GetDatasetImportError,\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 * The response also lists `declaredProperties` — the sweep/execute param keys this strategy\n * is known to accept, so a caller can catch a typo'd key before submitting a sweep instead of\n * only learning it from a rejected one. See `DeclaredProperty`: best-effort, not exhaustive.\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 * **`exchangeId: user` is reserved for your own uploaded data.** Instead of a managed\n * exchange, it prepares from a dataset you created via `POST /datasets` (see the **Dataset**\n * endpoints) — send `datasetId` in place of `instrument`. See `PrepareRequest` below for the\n * two request shapes.\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 * For a dataset prepare (`exchangeId: user`), coverage is reported against the dataset's own\n * cadence grid instead of hours — see `cadence`/`gaps`/`largestGapSteps` on `PrepareJobState`.\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 * Get one sweep trial's equity curve\n * The resource a leaderboard row's `equityCurve.url` points at — only reachable when that\n * trial's curve was actually selected (`equityCurve.mode: topN` or `topPct` on the sweep\n * submission, and this trial ranked among the winners). Returns the exact same\n * `{points|timestamps+equities, meta}` shape a plain backtest's inline `equityCurve` carries.\n *\n * Query params reshape the response the same way a plain backtest's `equityCurve` options do.\n * A param genuinely absent from the query string falls back to the `equityCurve` transform\n * preference the sweep was submitted with — a param\n * present but malformed does not fall back, it degrades the same way it always has. Above a\n * server-side size threshold, the shape is forced regardless of either — `meta.outMode` in\n * the response, not the query string or the submitted default, is the source of truth for\n * what shape actually came back.\n *\n */\nexport const getSweepRunEquityCurve = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepRunEquityCurveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepRunEquityCurveResponse,\n GetSweepRunEquityCurveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/runs/{runIx}/equityCurve\",\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 * Optionally takes `params`: strategy properties for this one run, applied without\n * recompiling. This is how a sweep leaderboard winner gets re-run for its `equityCurve` —\n * a sweep row carries the ten ranking metrics but never a curve, whatever its size. Compile\n * once, call this endpoint N times with different `params`, and each response is an ordinary\n * backtest result with the curve included.\n *\n * The same request (same `prepareJobId`, `strategyId`, `storeSignals`, `equityCurve`,\n * `baseConfig`, `params`) always returns the same `jobId` (idempotent) — a request that omits\n * `equityCurve`, `baseConfig` or `params` dedupes exactly as it did before those fields\n * existed. Two different `params` vectors over one prepare are two different jobs, and `9`\n * and `9.0` are the same one.\n *\n * The re-run is an independent execution rather than a replay of the sweep trial — the two\n * paths do not share a simulator — but they are pinned to agree: one vector run both ways\n * matches on every leaderboard metric, asserted as a regression test. Treat a difference as a\n * bug worth reporting, not as expected behaviour.\n *\n * Optionally takes `baseConfig`, the same `SweepBaseConfig` shape `executeSweep` accepts —\n * `initialFunding`, `feeRate`, `percentAmountToLock`, etc. — so the same object can be reused\n * against either endpoint. This endpoint has one effective fee rate rather than a sweep's\n * independent buy/sell legs: a `baseConfig` that resolves to different buy/sell rates, or sets\n * a non-default `feeLeg`, is rejected with `400` rather than silently collapsed to one side.\n *\n * Works unchanged for a dataset-backed prepare (`exchangeId: user`) — the request body is\n * identical either way, since the instrument and range are recovered from `prepareJobId`.\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\n/**\n * List your datasets\n * Every dataset you have created and not deleted, most recently created first. Never a `404`\n * — an empty array if you have none, same convention as `GET /strategies`.\n *\n */\nexport const listDatasets = <ThrowOnError extends boolean = false>(\n options?: Options<ListDatasetsData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListDatasetsResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets\",\n ...options,\n });\n};\n\n/**\n * Create a dataset and get a URL to upload it to\n * Creates a dataset AND its first upload session in one call — a presigned URL your client\n * PUTs the file to directly, no API credentials involved in that PUT. Call\n * `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the upload completes to kick\n * off ingest.\n *\n * Losing this response loses nothing: calling this dataset's\n * `POST /datasets/{datasetId}/uploads` returns the very same upload session again rather than\n * opening a new one, as long as nothing has been finalized against it yet.\n *\n * v1 is ticker data only — `type` is not a request field, it is always `\"ticker\"` in the\n * response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative\n * forms (e.g. `BTC/USDT:USDT`) are rejected.\n *\n * **Upload format.** A CSV with a header row, or a parquet file with the same columns by\n * name. Required: `timestamp` (ISO-8601, or numeric epoch seconds/millis/micros — detected\n * from the first row, then enforced for every later row), `close`. Optional: `open`, `high`,\n * `low`, `volume`, `quoteVolume`, `bid`, `bidSize`, `ask`, `askSize`. Cadence and timestamp\n * unit are discovered from the data, not declared.\n *\n * A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet\n * upload is stored as-is today. Either way, always check `dataFormat` on\n * `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which\n * one `dataUrl` actually is, rather than assuming from how you uploaded it.\n *\n * The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped\n * (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels).\n * Format is detected from the decompressed content itself: there is no filename or\n * `Content-Type` anywhere in this flow for a client to declare it with, so nothing needs to\n * be sent besides the bytes.\n *\n */\nexport const createDataset = <ThrowOnError extends boolean = false>(\n options: Options<CreateDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n CreateDatasetResponse,\n CreateDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Delete a dataset\n * Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and\n * can no longer be prepared from, but its object data is reclaimed later rather than purged\n * inline, so a backtest already running against one of its versions is not disrupted.\n *\n */\nexport const deleteDataset = <ThrowOnError extends boolean = false>(\n options: Options<DeleteDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n DeleteDatasetResponse,\n DeleteDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}\",\n ...options,\n });\n};\n\n/**\n * Get a dataset by id\n * Detail for one dataset, plus a self link.\n */\nexport const getDataset = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetResponse,\n GetDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}\",\n ...options,\n });\n};\n\n/**\n * Open a new upload session for an existing dataset\n * Get a fresh presigned URL to upload a new version into a dataset you already have — a\n * corrected file, or the next chunk of history. Behaves the same way `POST /datasets` does\n * for a brand-new dataset's own upload: at most one upload session is open per dataset at a\n * time, so calling this again before finalizing just hands back that same session rather\n * than opening a second one — safe to call repeatedly if a response gets lost.\n *\n * Once a session has been finalized (successfully or not), the next call here opens a\n * genuinely new one for that dataset's next version.\n *\n */\nexport const openDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<OpenDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n OpenDatasetUploadResponse,\n OpenDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads\",\n ...options,\n });\n};\n\n/**\n * Finalize an uploaded file and start ingest\n * Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from\n * `POST /datasets/{datasetId}/uploads`). Enqueues ingest and returns immediately; poll\n * `GET /datasets/{datasetId}/uploads/{uploadId}` for the result.\n *\n * Idempotent while the upload is still open — a repeat finalize before it has produced a\n * version returns the same `jobId` rather than enqueueing a second ingest. Once it HAS\n * produced a version, `uploadId` is spent: finalizing it again is a `409`, even with\n * different bytes freshly PUT to the same URL — open a new upload session instead\n * (`POST /datasets/{datasetId}/uploads`) rather than reusing a spent one.\n *\n */\nexport const finalizeDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<FinalizeDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n FinalizeDatasetUploadResponse,\n FinalizeDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads/{uploadId}/finalize\",\n ...options,\n });\n};\n\n/**\n * Get the state of an upload/ingest\n * Poll after `POST .../finalize` until `status` is `ready` or `failed`. Also reports\n * `uploading` (finalize not called yet, but the file was PUT) before you finalize at all.\n *\n */\nexport const getDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetUploadResponse,\n GetDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads/{uploadId}\",\n ...options,\n });\n};\n\n/**\n * Create a dataset by importing history instead of uploading it\n * A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a\n * file yourself, ask the API to go fetch history on your behalf. Creates the dataset and\n * starts the fetch in the same call — there is no separate upload step, and the result lands\n * as a dataset version indistinguishable from an uploaded one once it's ready. Poll\n * `GET /datasets/{datasetId}/imports/{importId}` for progress.\n *\n * `type` selects the source. `dex` — history over a pool/pair's own on-chain market — is the\n * only value today; other source types join this same endpoint later.\n *\n * A `dex` import has two data shapes, chosen by the top-level `cadence`:\n *\n * * Omitted/blank (default) — on-chain swap history, replayed directly from the pool/pair's\n * own chain. Cadence is native, not resampled: each swap keeps the timestamp it happened\n * at rather than being bucketed into candles, so the resulting version's `cadence` is `rt`\n * unless the swaps happen to sit on a fixed grid (see `DatasetVersion.cadence`).\n * * One of `1s` / `1m` / `5m` — pre-aggregated candles at that width instead of raw trades.\n * The resulting dataset's `type` is `klines`, not `ticker`. Not every network supports every\n * cadence yet — an unsupported combination fails asynchronously, same as an unresolvable\n * pool (see the `failed` status on the poll endpoint below).\n *\n */\nexport const importDataset = <ThrowOnError extends boolean = false>(\n options: Options<ImportDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ImportDatasetResponse,\n ImportDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/imports\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Get the state of an import/ingest\n * Poll after `POST /datasets/imports` until `status` is `ready` or `failed`. An import spends\n * real time fetching from its source before anything is even staged — `fetching` is the one\n * status only an import ever reports; `ingesting`/`ready`/`failed` mean exactly what they do\n * on `GET /datasets/{datasetId}/uploads/{uploadId}`, since an import re-enters that same\n * ingest chain once it has fetched and staged its data.\n *\n */\nexport const getDatasetImport = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetImportData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetImportResponse,\n GetDatasetImportError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/imports/{importId}\",\n ...options,\n });\n};\n"],"mappings":";AAGA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAeA,IAAM,SAAS;AAAA,EACpB,aAA4B;AAAA,IAC1B,SAAS;AAAA,EACX,CAAC;AACH;;;ACuGO,IAAM,eAAe,CAC1B,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,KAIxC;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC;AACH;AAKO,IAAM,gBAAgB,CAC3B,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,IAIxC;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC;AACH;AAUO,IAAM,kBAAkB,CAC7B,YACG;AACH,UAAQ,QAAQ,UAAU,QAA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|
+
{"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 GetAccountData,\n GetAccountResponse,\n GetAccountUsageData,\n GetAccountUsageResponse,\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 GetSweepRunEquityCurveData,\n GetSweepRunEquityCurveResponse,\n GetSweepRunEquityCurveError,\n ExecuteBacktestData,\n ExecuteBacktestResponse,\n ExecuteBacktestError,\n CancelBacktestData,\n CancelBacktestResponse,\n CancelBacktestError,\n GetBacktestResultData,\n GetBacktestResultResponse,\n GetBacktestResultError,\n ListDatasetsData,\n ListDatasetsResponse,\n CreateDatasetData,\n CreateDatasetResponse,\n CreateDatasetError,\n DeleteDatasetData,\n DeleteDatasetResponse,\n DeleteDatasetError,\n GetDatasetData,\n GetDatasetResponse,\n GetDatasetError,\n OpenDatasetUploadData,\n OpenDatasetUploadResponse,\n OpenDatasetUploadError,\n FinalizeDatasetUploadData,\n FinalizeDatasetUploadResponse,\n FinalizeDatasetUploadError,\n GetDatasetUploadData,\n GetDatasetUploadResponse,\n GetDatasetUploadError,\n ImportDatasetData,\n ImportDatasetResponse,\n ImportDatasetError,\n GetDatasetImportData,\n GetDatasetImportResponse,\n GetDatasetImportError,\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 * Get your account's identity and tier limits\n * Your userId, current tier, and that tier's limits — no database call, safe to fetch on\n * every page load. For live usage against these limits, see `_links.usage`\n * (`GET /account/usage`).\n *\n */\nexport const getAccount = <ThrowOnError extends boolean = false>(\n options?: Options<GetAccountData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n GetAccountResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/account\",\n ...options,\n });\n};\n\n/**\n * Get your live storage usage\n * How much of your account's shared storage pool (`GET /account`'s `maxTotalStorageBytes`)\n * you're currently using. Datasets, strategy-execution signals, and registered strategies\n * all count against the same total — they compete for the same underlying storage, so\n * there's one number to watch, not one per resource type. Not guaranteed real-time — a\n * just-completed upload or strategy execution may take a short moment to be reflected here.\n *\n */\nexport const getAccountUsage = <ThrowOnError extends boolean = false>(\n options?: Options<GetAccountUsageData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n GetAccountUsageResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/account/usage\",\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 * The response also lists `declaredProperties` — the sweep/execute param keys this strategy\n * is known to accept, so a caller can catch a typo'd key before submitting a sweep instead of\n * only learning it from a rejected one. See `DeclaredProperty`: best-effort, not exhaustive.\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 * **`exchangeId: user` is reserved for your own uploaded data.** Instead of a managed\n * exchange, it prepares from a dataset you created via `POST /datasets` (see the **Dataset**\n * endpoints) — send `datasetId` in place of `instrument`. See `PrepareRequest` below for the\n * two request shapes.\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 * For a dataset prepare (`exchangeId: user`), coverage is reported against the dataset's own\n * cadence grid instead of hours — see `cadence`/`gaps`/`largestGapSteps` on `PrepareJobState`.\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 * Get one sweep trial's equity curve\n * The resource a leaderboard row's `equityCurve.url` points at — only reachable when that\n * trial's curve was actually selected (`equityCurve.mode: topN` or `topPct` on the sweep\n * submission, and this trial ranked among the winners). Returns the exact same\n * `{points|timestamps+equities, meta}` shape a plain backtest's inline `equityCurve` carries.\n *\n * Query params reshape the response the same way a plain backtest's `equityCurve` options do.\n * A param genuinely absent from the query string falls back to the `equityCurve` transform\n * preference the sweep was submitted with — a param\n * present but malformed does not fall back, it degrades the same way it always has. Above a\n * server-side size threshold, the shape is forced regardless of either — `meta.outMode` in\n * the response, not the query string or the submitted default, is the source of truth for\n * what shape actually came back.\n *\n */\nexport const getSweepRunEquityCurve = <ThrowOnError extends boolean = false>(\n options: Options<GetSweepRunEquityCurveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetSweepRunEquityCurveResponse,\n GetSweepRunEquityCurveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}/runs/{runIx}/equityCurve\",\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 * Optionally takes `params`: strategy properties for this one run, applied without\n * recompiling. This is how a sweep leaderboard winner gets re-run for its `equityCurve` —\n * a sweep row carries the ten ranking metrics but never a curve, whatever its size. Compile\n * once, call this endpoint N times with different `params`, and each response is an ordinary\n * backtest result with the curve included.\n *\n * The same request (same `prepareJobId`, `strategyId`, `storeSignals`, `equityCurve`,\n * `baseConfig`, `params`) always returns the same `jobId` (idempotent) — a request that omits\n * `equityCurve`, `baseConfig` or `params` dedupes exactly as it did before those fields\n * existed. Two different `params` vectors over one prepare are two different jobs, and `9`\n * and `9.0` are the same one.\n *\n * The re-run is an independent execution rather than a replay of the sweep trial — the two\n * paths do not share a simulator — but they are pinned to agree: one vector run both ways\n * matches on every leaderboard metric, asserted as a regression test. Treat a difference as a\n * bug worth reporting, not as expected behaviour.\n *\n * Optionally takes `baseConfig`, the same `SweepBaseConfig` shape `executeSweep` accepts —\n * `initialFunding`, `feeRate`, `percentAmountToLock`, etc. — so the same object can be reused\n * against either endpoint. This endpoint has one effective fee rate rather than a sweep's\n * independent buy/sell legs: a `baseConfig` that resolves to different buy/sell rates, or sets\n * a non-default `feeLeg`, is rejected with `400` rather than silently collapsed to one side.\n *\n * Works unchanged for a dataset-backed prepare (`exchangeId: user`) — the request body is\n * identical either way, since the instrument and range are recovered from `prepareJobId`.\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\n/**\n * List your datasets\n * Every dataset you have created and not deleted, most recently created first. Never a `404`\n * — an empty array if you have none, same convention as `GET /strategies`.\n *\n */\nexport const listDatasets = <ThrowOnError extends boolean = false>(\n options?: Options<ListDatasetsData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListDatasetsResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets\",\n ...options,\n });\n};\n\n/**\n * Create a dataset and get a URL to upload it to\n * Creates a dataset AND its first upload session in one call — a presigned URL your client\n * PUTs the file to directly, no API credentials involved in that PUT. Call\n * `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the upload completes to kick\n * off ingest.\n *\n * Losing this response loses nothing: calling this dataset's\n * `POST /datasets/{datasetId}/uploads` returns the very same upload session again rather than\n * opening a new one, as long as nothing has been finalized against it yet.\n *\n * v1 is ticker data only — `type` is not a request field, it is always `\"ticker\"` in the\n * response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative\n * forms (e.g. `BTC/USDT:USDT`) are rejected.\n *\n * **Upload format.** A CSV with a header row, a parquet file with the same columns by\n * name, or a lastra file — our own native columnar format, the same one a dataset's\n * `dataUrl` hands back by default, so a downloaded dataset can be handed to another user to\n * upload with no conversion in between. For CSV/parquet, required: `timestamp` (ISO-8601, or\n * numeric epoch seconds/millis/micros — detected from the first row, then enforced for every\n * later row), `close`. Optional: `open`, `high`, `low`, `volume`, `quoteVolume`, `bid`,\n * `bidSize`, `ask`, `askSize`. A lastra upload carries its own fixed column set instead and\n * only needs a timestamp series and a close series present. Cadence and timestamp unit are\n * discovered from the data, not declared, for all three.\n *\n * A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet\n * or lastra upload is stored as-is today. Either way, always check `dataFormat` on\n * `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which\n * one `dataUrl` actually is, rather than assuming from how you uploaded it (a converted CSV\n * and an uploaded lastra file both report `dataFormat: \"lastra\"`).\n *\n * The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped\n * (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels).\n * Format is detected from the decompressed content itself: there is no filename or\n * `Content-Type` anywhere in this flow for a client to declare it with, so nothing needs to\n * be sent besides the bytes.\n *\n */\nexport const createDataset = <ThrowOnError extends boolean = false>(\n options: Options<CreateDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n CreateDatasetResponse,\n CreateDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Delete a dataset\n * Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and\n * can no longer be prepared from, but its object data is reclaimed later rather than purged\n * inline, so a backtest already running against one of its versions is not disrupted.\n *\n */\nexport const deleteDataset = <ThrowOnError extends boolean = false>(\n options: Options<DeleteDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n DeleteDatasetResponse,\n DeleteDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}\",\n ...options,\n });\n};\n\n/**\n * Get a dataset by id\n * Detail for one dataset, plus a self link.\n */\nexport const getDataset = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetResponse,\n GetDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}\",\n ...options,\n });\n};\n\n/**\n * Open a new upload session for an existing dataset\n * Get a fresh presigned URL to upload a new version into a dataset you already have — a\n * corrected file, or the next chunk of history. Behaves the same way `POST /datasets` does\n * for a brand-new dataset's own upload: at most one upload session is open per dataset at a\n * time, so calling this again before finalizing just hands back that same session rather\n * than opening a second one — safe to call repeatedly if a response gets lost.\n *\n * Once a session has been finalized (successfully or not), the next call here opens a\n * genuinely new one for that dataset's next version.\n *\n */\nexport const openDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<OpenDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n OpenDatasetUploadResponse,\n OpenDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads\",\n ...options,\n });\n};\n\n/**\n * Finalize an uploaded file and start ingest\n * Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from\n * `POST /datasets/{datasetId}/uploads`). Enqueues ingest and returns immediately; poll\n * `GET /datasets/{datasetId}/uploads/{uploadId}` for the result.\n *\n * Idempotent while the upload is still open — a repeat finalize before it has produced a\n * version returns the same `jobId` rather than enqueueing a second ingest. Once it HAS\n * produced a version, `uploadId` is spent: finalizing it again is a `409`, even with\n * different bytes freshly PUT to the same URL — open a new upload session instead\n * (`POST /datasets/{datasetId}/uploads`) rather than reusing a spent one.\n *\n */\nexport const finalizeDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<FinalizeDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n FinalizeDatasetUploadResponse,\n FinalizeDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads/{uploadId}/finalize\",\n ...options,\n });\n};\n\n/**\n * Get the state of an upload/ingest\n * Poll after `POST .../finalize` until `status` is `ready` or `failed`. Also reports\n * `uploading` (finalize not called yet, but the file was PUT) before you finalize at all.\n *\n */\nexport const getDatasetUpload = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetUploadData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetUploadResponse,\n GetDatasetUploadError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/uploads/{uploadId}\",\n ...options,\n });\n};\n\n/**\n * Create a dataset by importing history instead of uploading it\n * A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a\n * file yourself, ask the API to go fetch history on your behalf. Creates the dataset and\n * starts the fetch in the same call — there is no separate upload step, and the result lands\n * as a dataset version indistinguishable from an uploaded one once it's ready. Poll\n * `GET /datasets/{datasetId}/imports/{importId}` for progress.\n *\n * `type` selects the source. `dex` — history over a pool/pair's own on-chain market — is the\n * only value today; other source types join this same endpoint later.\n *\n * A `dex` import has two data shapes, chosen by the top-level `cadence`:\n *\n * * Omitted/blank (default) — on-chain swap history, replayed directly from the pool/pair's\n * own chain. Cadence is native, not resampled: each swap keeps the timestamp it happened\n * at rather than being bucketed into candles, so the resulting version's `cadence` is `rt`\n * unless the swaps happen to sit on a fixed grid (see `DatasetVersion.cadence`).\n * * One of `1s` / `1m` / `5m` — pre-aggregated candles at that width instead of raw trades.\n * The resulting dataset's `type` is `klines`, not `ticker`. Not every network supports every\n * cadence yet — an unsupported combination fails asynchronously, same as an unresolvable\n * pool (see the `failed` status on the poll endpoint below).\n *\n */\nexport const importDataset = <ThrowOnError extends boolean = false>(\n options: Options<ImportDatasetData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n ImportDatasetResponse,\n ImportDatasetError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/imports\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Get the state of an import/ingest\n * Poll after `POST /datasets/imports` until `status` is `ready` or `failed`. An import spends\n * real time fetching from its source before anything is even staged — `fetching` is the one\n * status only an import ever reports; `ingesting`/`ready`/`failed` mean exactly what they do\n * on `GET /datasets/{datasetId}/uploads/{uploadId}`, since an import re-enters that same\n * ingest chain once it has fetched and staged its data.\n *\n */\nexport const getDatasetImport = <ThrowOnError extends boolean = false>(\n options: Options<GetDatasetImportData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetDatasetImportResponse,\n GetDatasetImportError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/datasets/{datasetId}/imports/{importId}\",\n ...options,\n });\n};\n"],"mappings":";AAGA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAeA,IAAM,SAAS;AAAA,EACpB,aAA4B;AAAA,IAC1B,SAAS;AAAA,EACX,CAAC;AACH;;;AC2GO,IAAM,eAAe,CAC1B,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,KAIxC;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC;AACH;AASO,IAAM,aAAa,CACxB,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,IAIxC;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC;AACH;AAWO,IAAM,kBAAkB,CAC7B,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,IAIxC;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL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YACG;AACH,UAAQ,QAAQ,UAAU,QAAe,IAIvC;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -163,6 +163,174 @@ export const HalLinkSchema = {
|
|
|
163
163
|
},
|
|
164
164
|
} as const;
|
|
165
165
|
|
|
166
|
+
export const AccountSchema = {
|
|
167
|
+
type: "object",
|
|
168
|
+
description: `Your identity and tier limits. No database call behind this one — safe to fetch on every
|
|
169
|
+
page load. Live usage against these limits is a separate resource, \`GET /account/usage\`,
|
|
170
|
+
deliberately: usage changes on every upload/execution and costs a query to compute, this
|
|
171
|
+
one doesn't.
|
|
172
|
+
`,
|
|
173
|
+
required: [
|
|
174
|
+
"userId",
|
|
175
|
+
"tier",
|
|
176
|
+
"maxDatasets",
|
|
177
|
+
"maxDatasetBytes",
|
|
178
|
+
"maxTotalStorageBytes",
|
|
179
|
+
"_links",
|
|
180
|
+
],
|
|
181
|
+
properties: {
|
|
182
|
+
userId: {
|
|
183
|
+
type: "string",
|
|
184
|
+
description: "Your account id — the JWT `sub` claim.",
|
|
185
|
+
example: "00000000-0000-0000-0000-000000000000",
|
|
186
|
+
},
|
|
187
|
+
tier: {
|
|
188
|
+
type: "string",
|
|
189
|
+
description: "Your current subscription tier.",
|
|
190
|
+
example: "free",
|
|
191
|
+
},
|
|
192
|
+
maxDatasets: {
|
|
193
|
+
type: "integer",
|
|
194
|
+
description: "Maximum number of active datasets your tier allows.",
|
|
195
|
+
example: 3,
|
|
196
|
+
},
|
|
197
|
+
maxDatasetBytes: {
|
|
198
|
+
type: "integer",
|
|
199
|
+
format: "int64",
|
|
200
|
+
description: "Maximum size, in bytes, of a single dataset version.",
|
|
201
|
+
example: 52428800,
|
|
202
|
+
},
|
|
203
|
+
maxTotalStorageBytes: {
|
|
204
|
+
type: "integer",
|
|
205
|
+
format: "int64",
|
|
206
|
+
description: `Maximum combined storage, in bytes, across every dataset, strategy-execution signal,
|
|
207
|
+
and registered strategy on your account — one shared pool, not a separate cap per
|
|
208
|
+
resource type, since they all compete for the same underlying storage. See \`GET
|
|
209
|
+
/account/usage\`'s \`storageBytesUsed\` for your current usage against this number.
|
|
210
|
+
`,
|
|
211
|
+
example: 104857600,
|
|
212
|
+
},
|
|
213
|
+
_links: {
|
|
214
|
+
$ref: "#/components/schemas/AccountLinks",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
} as const;
|
|
218
|
+
|
|
219
|
+
export const AccountLinksSchema = {
|
|
220
|
+
description: "HAL `_links` for `GET /account`",
|
|
221
|
+
type: "object",
|
|
222
|
+
required: ["self", "usage"],
|
|
223
|
+
properties: {
|
|
224
|
+
self: {
|
|
225
|
+
allOf: [
|
|
226
|
+
{
|
|
227
|
+
$ref: "#/components/schemas/HalLink",
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
description: "Link to this resource.",
|
|
231
|
+
},
|
|
232
|
+
usage: {
|
|
233
|
+
allOf: [
|
|
234
|
+
{
|
|
235
|
+
$ref: "#/components/schemas/HalLink",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
description: "Link to your live usage, `GET /account/usage`.",
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
} as const;
|
|
242
|
+
|
|
243
|
+
export const AccountUsageSchema = {
|
|
244
|
+
type: "object",
|
|
245
|
+
description: `Your live usage of the shared storage pool \`GET /account\`'s \`maxTotalStorageBytes\` caps.
|
|
246
|
+
Not guaranteed real-time — a just-completed upload or strategy execution may take a short
|
|
247
|
+
moment to be reflected here.
|
|
248
|
+
`,
|
|
249
|
+
required: [
|
|
250
|
+
"datasetsUsed",
|
|
251
|
+
"datasetBytesUsed",
|
|
252
|
+
"signalsUsed",
|
|
253
|
+
"signalBytesUsed",
|
|
254
|
+
"strategiesUsed",
|
|
255
|
+
"strategyBytesUsed",
|
|
256
|
+
"storageBytesUsed",
|
|
257
|
+
"_links",
|
|
258
|
+
],
|
|
259
|
+
properties: {
|
|
260
|
+
datasetsUsed: {
|
|
261
|
+
type: "integer",
|
|
262
|
+
description:
|
|
263
|
+
"Active datasets counted — the same set `GET /account`'s `maxDatasets` limits.",
|
|
264
|
+
example: 2,
|
|
265
|
+
},
|
|
266
|
+
datasetBytesUsed: {
|
|
267
|
+
type: "integer",
|
|
268
|
+
format: "int64",
|
|
269
|
+
description: "Combined bytes of every active dataset's current version.",
|
|
270
|
+
example: 15728640,
|
|
271
|
+
},
|
|
272
|
+
signalsUsed: {
|
|
273
|
+
type: "integer",
|
|
274
|
+
description: "Recorded strategy-execution signal uploads.",
|
|
275
|
+
example: 1,
|
|
276
|
+
},
|
|
277
|
+
signalBytesUsed: {
|
|
278
|
+
type: "integer",
|
|
279
|
+
format: "int64",
|
|
280
|
+
description: "Combined bytes of every recorded signal upload.",
|
|
281
|
+
example: 524288,
|
|
282
|
+
},
|
|
283
|
+
strategiesUsed: {
|
|
284
|
+
type: "integer",
|
|
285
|
+
description: "Registered strategies (see `GET /strategies`).",
|
|
286
|
+
example: 4,
|
|
287
|
+
},
|
|
288
|
+
strategyBytesUsed: {
|
|
289
|
+
type: "integer",
|
|
290
|
+
format: "int64",
|
|
291
|
+
description: `Combined bytes of each registered strategy's source plus its latest compiled
|
|
292
|
+
bytecode. Superseded (non-latest) compilations aren't counted.
|
|
293
|
+
`,
|
|
294
|
+
example: 40960,
|
|
295
|
+
},
|
|
296
|
+
storageBytesUsed: {
|
|
297
|
+
type: "integer",
|
|
298
|
+
format: "int64",
|
|
299
|
+
description: `\`datasetBytesUsed + signalBytesUsed + strategyBytesUsed\` — the number checked
|
|
300
|
+
against \`GET /account\`'s \`maxTotalStorageBytes\`.
|
|
301
|
+
`,
|
|
302
|
+
example: 16293888,
|
|
303
|
+
},
|
|
304
|
+
_links: {
|
|
305
|
+
$ref: "#/components/schemas/AccountUsageLinks",
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
} as const;
|
|
309
|
+
|
|
310
|
+
export const AccountUsageLinksSchema = {
|
|
311
|
+
description: "HAL `_links` for `GET /account/usage`",
|
|
312
|
+
type: "object",
|
|
313
|
+
required: ["self", "account"],
|
|
314
|
+
properties: {
|
|
315
|
+
self: {
|
|
316
|
+
allOf: [
|
|
317
|
+
{
|
|
318
|
+
$ref: "#/components/schemas/HalLink",
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
description: "Link to this resource.",
|
|
322
|
+
},
|
|
323
|
+
account: {
|
|
324
|
+
allOf: [
|
|
325
|
+
{
|
|
326
|
+
$ref: "#/components/schemas/HalLink",
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
description: "Link to your tier limits, `GET /account`.",
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
} as const;
|
|
333
|
+
|
|
166
334
|
export const InstrumentDetailSchema = {
|
|
167
335
|
description:
|
|
168
336
|
"Exchange instrument with per-data-type coverage and market info",
|
|
@@ -369,7 +537,7 @@ export const JobStateSchema = {
|
|
|
369
537
|
description:
|
|
370
538
|
"Identifier for the job's execution context. Its current shape is a colon-delimited string encoding the data source type, an internal user id, the exchange, the job id, and the instrument — but that structure is not a committed contract and may change without notice. Treat it as an opaque token: store and pass it back, don't parse it.",
|
|
371
539
|
example:
|
|
372
|
-
"jctx:ticker:
|
|
540
|
+
"jctx:ticker:00000000-0000-0000-0000-000000000000:binance:5ikyamio8b3v9wcnfxztzg:btc/usdt:0vicnz3thzhrqvfczks1pu",
|
|
373
541
|
},
|
|
374
542
|
status: {
|
|
375
543
|
type: "string",
|
|
@@ -1964,11 +2132,12 @@ export const DatasetSchema = {
|
|
|
1964
2132
|
description: `A dataset's own metadata — not its data. \`currentVersionId\` is what a prepare against
|
|
1965
2133
|
\`exchangeId: user\` reads by default; see \`DatasetVersion\` for what a version carries.
|
|
1966
2134
|
|
|
1967
|
-
\`from\`/\`to\`/\`cadence\` mirror that
|
|
1968
|
-
|
|
1969
|
-
|
|
2135
|
+
\`from\`/\`to\`/\`cadence\`/\`timestampUnit\`/\`bytes\`/\`rows\`/\`gaps\`/\`largestGapSteps\` mirror that
|
|
2136
|
+
current version's own discovered range, cadence, timestamp unit and metrics, so you don't
|
|
2137
|
+
need a second call to \`GET /datasets/{datasetId}/uploads/{uploadId}\` just to see what a
|
|
2138
|
+
dataset covers.
|
|
1970
2139
|
`,
|
|
1971
|
-
required: ["datasetId", "name", "type", "instrument", "createdAt"],
|
|
2140
|
+
required: ["datasetId", "name", "type", "instrument", "createdAt", "status"],
|
|
1972
2141
|
properties: {
|
|
1973
2142
|
datasetId: {
|
|
1974
2143
|
type: "string",
|
|
@@ -2035,6 +2204,56 @@ a version exists.
|
|
|
2035
2204
|
`,
|
|
2036
2205
|
example: "1m",
|
|
2037
2206
|
},
|
|
2207
|
+
timestampUnit: {
|
|
2208
|
+
type: "string",
|
|
2209
|
+
enum: ["iso", "s", "ms", "us"],
|
|
2210
|
+
description: `\`currentVersionId\`'s own timestamp unit (see \`DatasetVersion.timestampUnit\`) — decode
|
|
2211
|
+
the \`timestamp\` column of \`dataUrl\`'s file accordingly. Present only when \`status\` is
|
|
2212
|
+
\`ready\`.
|
|
2213
|
+
`,
|
|
2214
|
+
example: "iso",
|
|
2215
|
+
},
|
|
2216
|
+
status: {
|
|
2217
|
+
type: "string",
|
|
2218
|
+
enum: ["ready", "failed", "pending"],
|
|
2219
|
+
description: `* \`ready\` — \`currentVersionId\` is set; \`from\`/\`to\`/\`cadence\`/\`bytes\`/\`rows\`/\`gaps\`/
|
|
2220
|
+
\`largestGapSteps\` describe it.
|
|
2221
|
+
* \`failed\` — the most recent upload/import attempt failed. \`currentVersionId\` and the
|
|
2222
|
+
fields above are absent — there is nothing to read yet. See \`error\`.
|
|
2223
|
+
* \`pending\` — nothing has ever been attempted (just created, or an upload was never
|
|
2224
|
+
finalized).
|
|
2225
|
+
`,
|
|
2226
|
+
example: "ready",
|
|
2227
|
+
},
|
|
2228
|
+
bytes: {
|
|
2229
|
+
type: "integer",
|
|
2230
|
+
description: `Size of \`currentVersionId\`'s own stored file. Present only when \`status\` is \`ready\` —
|
|
2231
|
+
see \`DatasetVersion.bytes\` for what it measures exactly.
|
|
2232
|
+
`,
|
|
2233
|
+
example: 4831022,
|
|
2234
|
+
},
|
|
2235
|
+
rows: {
|
|
2236
|
+
type: "integer",
|
|
2237
|
+
description: `\`currentVersionId\`'s own row count. Present only when \`status\` is \`ready\`.`,
|
|
2238
|
+
example: 86400,
|
|
2239
|
+
},
|
|
2240
|
+
gaps: {
|
|
2241
|
+
type: "integer",
|
|
2242
|
+
description: `\`currentVersionId\`'s own gap count at its discovered cadence. Present only when \`status\` is \`ready\`.`,
|
|
2243
|
+
example: 0,
|
|
2244
|
+
},
|
|
2245
|
+
largestGapSteps: {
|
|
2246
|
+
type: "integer",
|
|
2247
|
+
description: `\`currentVersionId\`'s own largest gap, in units of its discovered cadence step. Present only when \`status\` is \`ready\`.`,
|
|
2248
|
+
example: 0,
|
|
2249
|
+
},
|
|
2250
|
+
error: {
|
|
2251
|
+
type: "string",
|
|
2252
|
+
description: `A human-readable reason the most recent upload/import attempt failed. Present only
|
|
2253
|
+
when \`status\` is \`failed\`.
|
|
2254
|
+
`,
|
|
2255
|
+
example: "line 3: column 'close' is not a number: not-a-number",
|
|
2256
|
+
},
|
|
2038
2257
|
},
|
|
2039
2258
|
} as const;
|
|
2040
2259
|
|
|
@@ -2064,8 +2283,9 @@ session, not in one shot like a browser upload.
|
|
|
2064
2283
|
enum: ["lastra", "parquet"],
|
|
2065
2284
|
description: `Which format \`dataUrl\` is actually in — check this rather than assuming it
|
|
2066
2285
|
matches how you uploaded it. \`lastra\` — our native columnar format — for a CSV (or
|
|
2067
|
-
gzip/zip of one) upload, always converted on ingest
|
|
2068
|
-
|
|
2286
|
+
gzip/zip of one) upload, always converted on ingest, or for a lastra upload,
|
|
2287
|
+
stored as-is (the value alone doesn't tell you which). \`parquet\` for a parquet
|
|
2288
|
+
upload, also stored as-is today.
|
|
2069
2289
|
`,
|
|
2070
2290
|
example: "lastra",
|
|
2071
2291
|
},
|
|
@@ -2244,8 +2464,9 @@ an extended viewing session, not in one shot like a browser upload.
|
|
|
2244
2464
|
enum: ["lastra", "parquet"],
|
|
2245
2465
|
description: `Which format \`dataUrl\` is actually in — check this rather than assuming it matches
|
|
2246
2466
|
how you uploaded it. \`lastra\` — our native columnar format — for a CSV (or gzip/zip
|
|
2247
|
-
of one) upload, always converted on ingest
|
|
2248
|
-
|
|
2467
|
+
of one) upload, always converted on ingest, or for a lastra upload, stored as-is
|
|
2468
|
+
(the value alone doesn't tell you which). \`parquet\` for a parquet upload, also
|
|
2469
|
+
stored as-is today.
|
|
2249
2470
|
`,
|
|
2250
2471
|
example: "lastra",
|
|
2251
2472
|
},
|
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -9,6 +9,10 @@ import type {
|
|
|
9
9
|
AuthenticateData,
|
|
10
10
|
AuthenticateResponse,
|
|
11
11
|
AuthenticateError,
|
|
12
|
+
GetAccountData,
|
|
13
|
+
GetAccountResponse,
|
|
14
|
+
GetAccountUsageData,
|
|
15
|
+
GetAccountUsageResponse,
|
|
12
16
|
ListExchangesData,
|
|
13
17
|
ListExchangesResponse,
|
|
14
18
|
ListInstrumentsData,
|
|
@@ -147,6 +151,60 @@ export const authenticate = <ThrowOnError extends boolean = false>(
|
|
|
147
151
|
});
|
|
148
152
|
};
|
|
149
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Get your account's identity and tier limits
|
|
156
|
+
* Your userId, current tier, and that tier's limits — no database call, safe to fetch on
|
|
157
|
+
* every page load. For live usage against these limits, see `_links.usage`
|
|
158
|
+
* (`GET /account/usage`).
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
export const getAccount = <ThrowOnError extends boolean = false>(
|
|
162
|
+
options?: Options<GetAccountData, ThrowOnError>
|
|
163
|
+
) => {
|
|
164
|
+
return (options?.client ?? _heyApiClient).get<
|
|
165
|
+
GetAccountResponse,
|
|
166
|
+
unknown,
|
|
167
|
+
ThrowOnError
|
|
168
|
+
>({
|
|
169
|
+
security: [
|
|
170
|
+
{
|
|
171
|
+
scheme: "bearer",
|
|
172
|
+
type: "http",
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
url: "/account",
|
|
176
|
+
...options,
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Get your live storage usage
|
|
182
|
+
* How much of your account's shared storage pool (`GET /account`'s `maxTotalStorageBytes`)
|
|
183
|
+
* you're currently using. Datasets, strategy-execution signals, and registered strategies
|
|
184
|
+
* all count against the same total — they compete for the same underlying storage, so
|
|
185
|
+
* there's one number to watch, not one per resource type. Not guaranteed real-time — a
|
|
186
|
+
* just-completed upload or strategy execution may take a short moment to be reflected here.
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
export const getAccountUsage = <ThrowOnError extends boolean = false>(
|
|
190
|
+
options?: Options<GetAccountUsageData, ThrowOnError>
|
|
191
|
+
) => {
|
|
192
|
+
return (options?.client ?? _heyApiClient).get<
|
|
193
|
+
GetAccountUsageResponse,
|
|
194
|
+
unknown,
|
|
195
|
+
ThrowOnError
|
|
196
|
+
>({
|
|
197
|
+
security: [
|
|
198
|
+
{
|
|
199
|
+
scheme: "bearer",
|
|
200
|
+
type: "http",
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
url: "/account/usage",
|
|
204
|
+
...options,
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
150
208
|
/**
|
|
151
209
|
* List the available exchanges
|
|
152
210
|
*/
|
|
@@ -895,16 +953,21 @@ export const listDatasets = <ThrowOnError extends boolean = false>(
|
|
|
895
953
|
* response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative
|
|
896
954
|
* forms (e.g. `BTC/USDT:USDT`) are rejected.
|
|
897
955
|
*
|
|
898
|
-
* **Upload format.** A CSV with a header row,
|
|
899
|
-
* name
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
*
|
|
956
|
+
* **Upload format.** A CSV with a header row, a parquet file with the same columns by
|
|
957
|
+
* name, or a lastra file — our own native columnar format, the same one a dataset's
|
|
958
|
+
* `dataUrl` hands back by default, so a downloaded dataset can be handed to another user to
|
|
959
|
+
* upload with no conversion in between. For CSV/parquet, required: `timestamp` (ISO-8601, or
|
|
960
|
+
* numeric epoch seconds/millis/micros — detected from the first row, then enforced for every
|
|
961
|
+
* later row), `close`. Optional: `open`, `high`, `low`, `volume`, `quoteVolume`, `bid`,
|
|
962
|
+
* `bidSize`, `ask`, `askSize`. A lastra upload carries its own fixed column set instead and
|
|
963
|
+
* only needs a timestamp series and a close series present. Cadence and timestamp unit are
|
|
964
|
+
* discovered from the data, not declared, for all three.
|
|
903
965
|
*
|
|
904
966
|
* A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet
|
|
905
|
-
* upload is stored as-is today. Either way, always check `dataFormat` on
|
|
967
|
+
* or lastra upload is stored as-is today. Either way, always check `dataFormat` on
|
|
906
968
|
* `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which
|
|
907
|
-
* one `dataUrl` actually is, rather than assuming from how you uploaded it
|
|
969
|
+
* one `dataUrl` actually is, rather than assuming from how you uploaded it (a converted CSV
|
|
970
|
+
* and an uploaded lastra file both report `dataFormat: "lastra"`).
|
|
908
971
|
*
|
|
909
972
|
* The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped
|
|
910
973
|
* (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels).
|
|
@@ -103,6 +103,111 @@ export type HalLink = {
|
|
|
103
103
|
templated?: boolean;
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Your identity and tier limits. No database call behind this one — safe to fetch on every
|
|
108
|
+
* page load. Live usage against these limits is a separate resource, `GET /account/usage`,
|
|
109
|
+
* deliberately: usage changes on every upload/execution and costs a query to compute, this
|
|
110
|
+
* one doesn't.
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
export type Account = {
|
|
114
|
+
/**
|
|
115
|
+
* Your account id — the JWT `sub` claim.
|
|
116
|
+
*/
|
|
117
|
+
userId: string;
|
|
118
|
+
/**
|
|
119
|
+
* Your current subscription tier.
|
|
120
|
+
*/
|
|
121
|
+
tier: string;
|
|
122
|
+
/**
|
|
123
|
+
* Maximum number of active datasets your tier allows.
|
|
124
|
+
*/
|
|
125
|
+
maxDatasets: number;
|
|
126
|
+
/**
|
|
127
|
+
* Maximum size, in bytes, of a single dataset version.
|
|
128
|
+
*/
|
|
129
|
+
maxDatasetBytes: number;
|
|
130
|
+
/**
|
|
131
|
+
* Maximum combined storage, in bytes, across every dataset, strategy-execution signal,
|
|
132
|
+
* and registered strategy on your account — one shared pool, not a separate cap per
|
|
133
|
+
* resource type, since they all compete for the same underlying storage. See `GET
|
|
134
|
+
* /account/usage`'s `storageBytesUsed` for your current usage against this number.
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
maxTotalStorageBytes: number;
|
|
138
|
+
_links: AccountLinks;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* HAL `_links` for `GET /account`
|
|
143
|
+
*/
|
|
144
|
+
export type AccountLinks = {
|
|
145
|
+
/**
|
|
146
|
+
* Link to this resource.
|
|
147
|
+
*/
|
|
148
|
+
self: HalLink;
|
|
149
|
+
/**
|
|
150
|
+
* Link to your live usage, `GET /account/usage`.
|
|
151
|
+
*/
|
|
152
|
+
usage: HalLink;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Your live usage of the shared storage pool `GET /account`'s `maxTotalStorageBytes` caps.
|
|
157
|
+
* Not guaranteed real-time — a just-completed upload or strategy execution may take a short
|
|
158
|
+
* moment to be reflected here.
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
export type AccountUsage = {
|
|
162
|
+
/**
|
|
163
|
+
* Active datasets counted — the same set `GET /account`'s `maxDatasets` limits.
|
|
164
|
+
*/
|
|
165
|
+
datasetsUsed: number;
|
|
166
|
+
/**
|
|
167
|
+
* Combined bytes of every active dataset's current version.
|
|
168
|
+
*/
|
|
169
|
+
datasetBytesUsed: number;
|
|
170
|
+
/**
|
|
171
|
+
* Recorded strategy-execution signal uploads.
|
|
172
|
+
*/
|
|
173
|
+
signalsUsed: number;
|
|
174
|
+
/**
|
|
175
|
+
* Combined bytes of every recorded signal upload.
|
|
176
|
+
*/
|
|
177
|
+
signalBytesUsed: number;
|
|
178
|
+
/**
|
|
179
|
+
* Registered strategies (see `GET /strategies`).
|
|
180
|
+
*/
|
|
181
|
+
strategiesUsed: number;
|
|
182
|
+
/**
|
|
183
|
+
* Combined bytes of each registered strategy's source plus its latest compiled
|
|
184
|
+
* bytecode. Superseded (non-latest) compilations aren't counted.
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
187
|
+
strategyBytesUsed: number;
|
|
188
|
+
/**
|
|
189
|
+
* `datasetBytesUsed + signalBytesUsed + strategyBytesUsed` — the number checked
|
|
190
|
+
* against `GET /account`'s `maxTotalStorageBytes`.
|
|
191
|
+
*
|
|
192
|
+
*/
|
|
193
|
+
storageBytesUsed: number;
|
|
194
|
+
_links: AccountUsageLinks;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* HAL `_links` for `GET /account/usage`
|
|
199
|
+
*/
|
|
200
|
+
export type AccountUsageLinks = {
|
|
201
|
+
/**
|
|
202
|
+
* Link to this resource.
|
|
203
|
+
*/
|
|
204
|
+
self: HalLink;
|
|
205
|
+
/**
|
|
206
|
+
* Link to your tier limits, `GET /account`.
|
|
207
|
+
*/
|
|
208
|
+
account: HalLink;
|
|
209
|
+
};
|
|
210
|
+
|
|
106
211
|
/**
|
|
107
212
|
* Exchange instrument with per-data-type coverage and market info
|
|
108
213
|
*/
|
|
@@ -1165,9 +1270,10 @@ export type StrategyState = {
|
|
|
1165
1270
|
* A dataset's own metadata — not its data. `currentVersionId` is what a prepare against
|
|
1166
1271
|
* `exchangeId: user` reads by default; see `DatasetVersion` for what a version carries.
|
|
1167
1272
|
*
|
|
1168
|
-
* `from`/`to`/`cadence` mirror that
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1273
|
+
* `from`/`to`/`cadence`/`timestampUnit`/`bytes`/`rows`/`gaps`/`largestGapSteps` mirror that
|
|
1274
|
+
* current version's own discovered range, cadence, timestamp unit and metrics, so you don't
|
|
1275
|
+
* need a second call to `GET /datasets/{datasetId}/uploads/{uploadId}` just to see what a
|
|
1276
|
+
* dataset covers.
|
|
1171
1277
|
*
|
|
1172
1278
|
*/
|
|
1173
1279
|
export type Dataset = {
|
|
@@ -1219,6 +1325,47 @@ export type Dataset = {
|
|
|
1219
1325
|
*
|
|
1220
1326
|
*/
|
|
1221
1327
|
cadence?: string;
|
|
1328
|
+
/**
|
|
1329
|
+
* `currentVersionId`'s own timestamp unit (see `DatasetVersion.timestampUnit`) — decode
|
|
1330
|
+
* the `timestamp` column of `dataUrl`'s file accordingly. Present only when `status` is
|
|
1331
|
+
* `ready`.
|
|
1332
|
+
*
|
|
1333
|
+
*/
|
|
1334
|
+
timestampUnit?: "iso" | "s" | "ms" | "us";
|
|
1335
|
+
/**
|
|
1336
|
+
* * `ready` — `currentVersionId` is set; `from`/`to`/`cadence`/`bytes`/`rows`/`gaps`/
|
|
1337
|
+
* `largestGapSteps` describe it.
|
|
1338
|
+
* * `failed` — the most recent upload/import attempt failed. `currentVersionId` and the
|
|
1339
|
+
* fields above are absent — there is nothing to read yet. See `error`.
|
|
1340
|
+
* * `pending` — nothing has ever been attempted (just created, or an upload was never
|
|
1341
|
+
* finalized).
|
|
1342
|
+
*
|
|
1343
|
+
*/
|
|
1344
|
+
status: "ready" | "failed" | "pending";
|
|
1345
|
+
/**
|
|
1346
|
+
* Size of `currentVersionId`'s own stored file. Present only when `status` is `ready` —
|
|
1347
|
+
* see `DatasetVersion.bytes` for what it measures exactly.
|
|
1348
|
+
*
|
|
1349
|
+
*/
|
|
1350
|
+
bytes?: number;
|
|
1351
|
+
/**
|
|
1352
|
+
* `currentVersionId`'s own row count. Present only when `status` is `ready`.
|
|
1353
|
+
*/
|
|
1354
|
+
rows?: number;
|
|
1355
|
+
/**
|
|
1356
|
+
* `currentVersionId`'s own gap count at its discovered cadence. Present only when `status` is `ready`.
|
|
1357
|
+
*/
|
|
1358
|
+
gaps?: number;
|
|
1359
|
+
/**
|
|
1360
|
+
* `currentVersionId`'s own largest gap, in units of its discovered cadence step. Present only when `status` is `ready`.
|
|
1361
|
+
*/
|
|
1362
|
+
largestGapSteps?: number;
|
|
1363
|
+
/**
|
|
1364
|
+
* A human-readable reason the most recent upload/import attempt failed. Present only
|
|
1365
|
+
* when `status` is `failed`.
|
|
1366
|
+
*
|
|
1367
|
+
*/
|
|
1368
|
+
error?: string;
|
|
1222
1369
|
};
|
|
1223
1370
|
|
|
1224
1371
|
/**
|
|
@@ -1237,8 +1384,9 @@ export type DatasetWithLinks = Dataset & {
|
|
|
1237
1384
|
/**
|
|
1238
1385
|
* Which format `dataUrl` is actually in — check this rather than assuming it
|
|
1239
1386
|
* matches how you uploaded it. `lastra` — our native columnar format — for a CSV (or
|
|
1240
|
-
* gzip/zip of one) upload, always converted on ingest
|
|
1241
|
-
*
|
|
1387
|
+
* gzip/zip of one) upload, always converted on ingest, or for a lastra upload,
|
|
1388
|
+
* stored as-is (the value alone doesn't tell you which). `parquet` for a parquet
|
|
1389
|
+
* upload, also stored as-is today.
|
|
1242
1390
|
*
|
|
1243
1391
|
*/
|
|
1244
1392
|
dataFormat?: "lastra" | "parquet";
|
|
@@ -1359,8 +1507,9 @@ export type DatasetVersion = {
|
|
|
1359
1507
|
/**
|
|
1360
1508
|
* Which format `dataUrl` is actually in — check this rather than assuming it matches
|
|
1361
1509
|
* how you uploaded it. `lastra` — our native columnar format — for a CSV (or gzip/zip
|
|
1362
|
-
* of one) upload, always converted on ingest
|
|
1363
|
-
*
|
|
1510
|
+
* of one) upload, always converted on ingest, or for a lastra upload, stored as-is
|
|
1511
|
+
* (the value alone doesn't tell you which). `parquet` for a parquet upload, also
|
|
1512
|
+
* stored as-is today.
|
|
1364
1513
|
*
|
|
1365
1514
|
*/
|
|
1366
1515
|
dataFormat?: "lastra" | "parquet";
|
|
@@ -1609,6 +1758,39 @@ export type AuthenticateResponses = {
|
|
|
1609
1758
|
export type AuthenticateResponse =
|
|
1610
1759
|
AuthenticateResponses[keyof AuthenticateResponses];
|
|
1611
1760
|
|
|
1761
|
+
export type GetAccountData = {
|
|
1762
|
+
body?: never;
|
|
1763
|
+
path?: never;
|
|
1764
|
+
query?: never;
|
|
1765
|
+
url: "/account";
|
|
1766
|
+
};
|
|
1767
|
+
|
|
1768
|
+
export type GetAccountResponses = {
|
|
1769
|
+
/**
|
|
1770
|
+
* Your account
|
|
1771
|
+
*/
|
|
1772
|
+
200: Account;
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
export type GetAccountResponse = GetAccountResponses[keyof GetAccountResponses];
|
|
1776
|
+
|
|
1777
|
+
export type GetAccountUsageData = {
|
|
1778
|
+
body?: never;
|
|
1779
|
+
path?: never;
|
|
1780
|
+
query?: never;
|
|
1781
|
+
url: "/account/usage";
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1784
|
+
export type GetAccountUsageResponses = {
|
|
1785
|
+
/**
|
|
1786
|
+
* Your current usage
|
|
1787
|
+
*/
|
|
1788
|
+
200: AccountUsage;
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1791
|
+
export type GetAccountUsageResponse =
|
|
1792
|
+
GetAccountUsageResponses[keyof GetAccountUsageResponses];
|
|
1793
|
+
|
|
1612
1794
|
export type ListExchangesData = {
|
|
1613
1795
|
body?: never;
|
|
1614
1796
|
path?: never;
|
|
@@ -2738,6 +2920,12 @@ export type FinalizeDatasetUploadErrors = {
|
|
|
2738
2920
|
* The uploaded file exceeds your tier's size limit for a dataset.
|
|
2739
2921
|
*/
|
|
2740
2922
|
413: ResponseError;
|
|
2923
|
+
/**
|
|
2924
|
+
* Your account's total storage limit (`GET /account`'s `maxTotalStorageBytes`) is
|
|
2925
|
+
* reached or would be exceeded. Delete a dataset to free space, or upgrade.
|
|
2926
|
+
*
|
|
2927
|
+
*/
|
|
2928
|
+
429: ResponseError;
|
|
2741
2929
|
};
|
|
2742
2930
|
|
|
2743
2931
|
export type FinalizeDatasetUploadError =
|
|
@@ -2821,7 +3009,10 @@ export type ImportDatasetErrors = {
|
|
|
2821
3009
|
*/
|
|
2822
3010
|
409: ResponseError;
|
|
2823
3011
|
/**
|
|
2824
|
-
* Your tier's dataset count limit is reached
|
|
3012
|
+
* Your tier's dataset count limit is reached, or your account's total storage limit
|
|
3013
|
+
* (`GET /account`'s `maxTotalStorageBytes`) is already reached. Delete a dataset to free
|
|
3014
|
+
* a slot or space, or upgrade.
|
|
3015
|
+
*
|
|
2825
3016
|
*/
|
|
2826
3017
|
429: ResponseError;
|
|
2827
3018
|
};
|