@qtsurfer/api-client 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +64 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +73 -5
- package/src/generated/sdk.gen.ts +15 -1
- package/src/generated/types.gen.ts +50 -8
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ pluggable token stores so callers don't reinvent that plumbing.
|
|
|
69
69
|
All operations are exported as standalone functions; every operation accepts an `Options` object and returns `{ data, error, response }`.
|
|
70
70
|
|
|
71
71
|
The table is exhaustive: `src/generated/` is produced from the OpenAPI spec, so **all 48 operations**
|
|
72
|
-
the spec declares are exported. The rows below describe **spec version 0.128.
|
|
72
|
+
the spec declares are exported. The rows below describe **spec version 0.128.20**, which is versioned
|
|
73
73
|
independently of this package.
|
|
74
74
|
|
|
75
75
|
| Function | Method | Path | Purpose |
|
|
@@ -107,7 +107,7 @@ independently of this package.
|
|
|
107
107
|
| `getDatasetUpload` | GET | `/datasets/{datasetId}/uploads/{uploadId}` | Get an upload's ingestion state |
|
|
108
108
|
| `importDataset` | POST | `/datasets/imports` | Create a dataset by importing external history |
|
|
109
109
|
| `getDatasetImport` | GET | `/datasets/{datasetId}/imports/{importId}` | Get an import's fetch and ingestion state |
|
|
110
|
-
| `startLive` | POST | `/strategy/{strategyId}/live` | Start a compiled strategy on a live feed; optionally simulate fills and equity with `paper`, or request a plain WebSocket stream URL |
|
|
110
|
+
| `startLive` | POST | `/strategy/{strategyId}/live` | Start a compiled strategy on a live feed; optionally set its warm-up replay window with `warmFrom`, simulate fills and equity with `paper`, or request a plain WebSocket stream URL |
|
|
111
111
|
| `getLive` | GET | `/strategy/{strategyId}/live` | Read a strategy's current or most recent live run |
|
|
112
112
|
| `stopLive` | DELETE | `/strategy/{strategyId}/live` | Request a strategy's active live run to stop |
|
|
113
113
|
| `listLive` | GET | `/live` | Page all live runs owned by the authenticated account |
|
package/dist/index.d.ts
CHANGED
|
@@ -1735,12 +1735,31 @@ type LiveSource = {
|
|
|
1735
1735
|
*/
|
|
1736
1736
|
type: "ticker" | "kline";
|
|
1737
1737
|
/**
|
|
1738
|
-
*
|
|
1738
|
+
* The instruments the run reads. For a run started with a list, that list as sent; for one started without `instruments`, or with `["*"]`, what the start resolved: the list of pairs the compilation of the strategy records as the instruments it accepts, when it records one, or `["*"]` for every instrument the exchange/segment offers (tier-gated). An entry is written `BASE/QUOTE` and either side can be `*` to mean any, such as any base paired with USDT. Symbols are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument.
|
|
1739
1739
|
*/
|
|
1740
1740
|
instruments: Array<string>;
|
|
1741
1741
|
};
|
|
1742
|
+
/**
|
|
1743
|
+
* One market feed to start a live run on. Exactly one entry per run today. It is `LiveSource` as you ask for it: the only difference is that `instruments` can be left out.
|
|
1744
|
+
*/
|
|
1745
|
+
type LiveSourceRequest = {
|
|
1746
|
+
/**
|
|
1747
|
+
* Venue category. `cx` (centralized exchange) is the only one live runs support today.
|
|
1748
|
+
*/
|
|
1749
|
+
venueType: string;
|
|
1750
|
+
exchange: string;
|
|
1751
|
+
segment: string;
|
|
1752
|
+
/**
|
|
1753
|
+
* Both `ticker` and `kline` connect to the lightest (fastest) cadence available for the exchange — today, 1 tick/second on every supported exchange. Choosing a specific cadence is not offered yet.
|
|
1754
|
+
*/
|
|
1755
|
+
type: "ticker" | "kline";
|
|
1756
|
+
/**
|
|
1757
|
+
* Which instruments the run reads. A QTScript strategy can declare which instruments it accepts with an `instruments` line in its source. When the compilation of the strategy records that selection as a list of pairs, leaving `instruments` out, or sending `["*"]`, takes that list; otherwise the run reads every instrument the exchange/segment offers. A list of instruments is taken as sent, and `[]` and `null` are refused with `400`. An entry is written `BASE/QUOTE`; either side can be `*` to mean any: any base can be paired with USDT, and BTC can be paired with any quote. Entries are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument. An entry that is not of that form (no `/`, an empty side, a `.` or a space inside a side, or a `*` mixed with other characters of a side) makes the run fail when it starts. Plan limits: a list with an entry that has a `*` on a side counts like `["*"]` and only plans that include the wildcard accept it; the other entries are counted one by one. The instruments the run actually reads come back in the run's `sources`.
|
|
1758
|
+
*/
|
|
1759
|
+
instruments?: Array<string>;
|
|
1760
|
+
};
|
|
1742
1761
|
type StartLiveRequest = {
|
|
1743
|
-
sources: [
|
|
1762
|
+
sources: [LiveSourceRequest];
|
|
1744
1763
|
/**
|
|
1745
1764
|
* Strategy parameters to start with. Opaque key/value pairs — see this strategy's own `declaredProperties` (from `POST /strategy`) for the keys it accepts.
|
|
1746
1765
|
*/
|
|
@@ -1765,6 +1784,21 @@ type StartLiveRequest = {
|
|
|
1765
1784
|
*
|
|
1766
1785
|
*/
|
|
1767
1786
|
stream?: boolean;
|
|
1787
|
+
/**
|
|
1788
|
+
* How many seconds before the run's start to replay the market feed from, so the strategy's indicators and
|
|
1789
|
+
* windows have history when its first live tick arrives. `0` replays nothing: the run delivers its first
|
|
1790
|
+
* signal as soon as it is running, but its indicators start empty and the first bar of a window can be
|
|
1791
|
+
* partial. Omitted, the platform replays from the start of the current 15-minute block: between 0 and 900
|
|
1792
|
+
* seconds before the run's start, depending on when it starts (0 if it starts exactly on a quarter hour),
|
|
1793
|
+
* so the first bar of a 15-minute window is complete. The value in effect, the one you sent or the one the
|
|
1794
|
+
* platform chose, is reported back as `warmFrom` on the run. Signals about the replayed time
|
|
1795
|
+
* are not pushed on the run's channel or stream: they describe events from before the run started.
|
|
1796
|
+
* It can be set **only when the run is started**: it is not a parameter of `PUT /live/{runId}/params`, and
|
|
1797
|
+
* changing it means stopping the run and starting it again. Anything that is not an integer from 0 to 3600
|
|
1798
|
+
* is `400`. See the "Live execution" guide, "Warming up".
|
|
1799
|
+
*
|
|
1800
|
+
*/
|
|
1801
|
+
warmFrom?: number;
|
|
1768
1802
|
name?: string;
|
|
1769
1803
|
description?: string;
|
|
1770
1804
|
paper?: LivePaperConfig;
|
|
@@ -1834,7 +1868,7 @@ type SendLiveCommandRequest = {
|
|
|
1834
1868
|
};
|
|
1835
1869
|
};
|
|
1836
1870
|
/**
|
|
1837
|
-
* A live run's full state, as returned by
|
|
1871
|
+
* A live run's full state, as returned by stopping it through its strategy, and the base of the representations returned by starting and by reading it. `warmFrom` is declared by those two (`LiveRunWithStream` and `LiveRunDetail`) and not here, because the response to stopping a run does not carry it.
|
|
1838
1872
|
*/
|
|
1839
1873
|
type LiveRun = {
|
|
1840
1874
|
strategyId: StrategyId;
|
|
@@ -1944,22 +1978,28 @@ type LiveRunStats = {
|
|
|
1944
1978
|
*/
|
|
1945
1979
|
stale: boolean;
|
|
1946
1980
|
};
|
|
1981
|
+
/**
|
|
1982
|
+
* The `warmFrom` in effect for this run, in seconds: the one requested when the run was started or, when none was, the one the platform chose (the distance from the run's start back to the start of the current 15-minute block, 0 to 900). It is never `null`. It is present on every run started since the field exists and absent from a run started before it existed. It never changes while the run exists.
|
|
1983
|
+
*/
|
|
1984
|
+
type WarmFrom = number;
|
|
1947
1985
|
/**
|
|
1948
1986
|
* A run as returned by `GET /live/{runId}`, the full state of `LiveRun` plus when it last changed.
|
|
1949
1987
|
*/
|
|
1950
1988
|
type LiveRunDetail = LiveRun & {
|
|
1989
|
+
warmFrom?: WarmFrom;
|
|
1951
1990
|
/**
|
|
1952
1991
|
* Epoch milliseconds of the run's last change, from any cause. It only moves forward, so of two reads of the same run the one with the larger value is the newer.
|
|
1953
1992
|
*/
|
|
1954
1993
|
updatedAtMs: number;
|
|
1955
1994
|
};
|
|
1956
1995
|
/**
|
|
1957
|
-
* A run as `LiveRun` describes it, plus its `streamUrl` when it has one. It is what **starting a run** and
|
|
1996
|
+
* A run as `LiveRun` describes it, plus its `warmFrom` (absent only for a run started before the field existed) and its `streamUrl` when it has one. It is what **starting a run** and
|
|
1958
1997
|
* `GET /strategy/{strategyId}/live` return: your own run, read with your own credentials. Stopping a run
|
|
1959
|
-
* and `GET /live/{runId}`
|
|
1998
|
+
* returns `LiveRun`, which carries neither `warmFrom` nor the URL, and `GET /live/{runId}` returns `LiveRunDetail`, which carries `warmFrom` and never the URL.
|
|
1960
1999
|
*
|
|
1961
2000
|
*/
|
|
1962
2001
|
type LiveRunWithStream = LiveRun & {
|
|
2002
|
+
warmFrom?: WarmFrom;
|
|
1963
2003
|
/**
|
|
1964
2004
|
* The run's secret stream URL (`wss://…`). **Treat it like a password**: anyone who holds it can read
|
|
1965
2005
|
* this run's signals, from the sandbox stage on. Present only when the run was started with
|
|
@@ -3511,7 +3551,7 @@ type StartLiveData = {
|
|
|
3511
3551
|
};
|
|
3512
3552
|
type StartLiveErrors = {
|
|
3513
3553
|
/**
|
|
3514
|
-
* Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet.
|
|
3554
|
+
* Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet. A `warmFrom` that is not an integer from 0 to 3600. An `instruments` that is empty or `null`.
|
|
3515
3555
|
*/
|
|
3516
3556
|
400: ResponseError;
|
|
3517
3557
|
/**
|
|
@@ -3796,8 +3836,8 @@ type GetLiveRunSignalsData = {
|
|
|
3796
3836
|
sinceMs?: number;
|
|
3797
3837
|
/**
|
|
3798
3838
|
* Narrow to one or more instruments. Omitted, or `*`, returns every instrument the run
|
|
3799
|
-
* covers. Accepts a single pair (`BTC/USDT`), either half as a wildcard (
|
|
3800
|
-
*
|
|
3839
|
+
* covers. Accepts a single pair (`BTC/USDT`), either half as a wildcard (any base paired
|
|
3840
|
+
* with that quote, or BTC paired with any quote), or a comma-separated
|
|
3801
3841
|
* list of pairs (`BTC/USDT,ETH/EUR`). Symbols are matched exactly, case included — pass
|
|
3802
3842
|
* them as this API reports them.
|
|
3803
3843
|
*
|
|
@@ -4054,7 +4094,7 @@ declare const listStrategies: <ThrowOnError extends boolean = false>(options?: O
|
|
|
4054
4094
|
*
|
|
4055
4095
|
* The source is either **Java** — a class extending a strategy base class — or **QTScript**
|
|
4056
4096
|
* (beta), a compact strategy language whose braced bodies are plain Java. QTScript source
|
|
4057
|
-
* begins with the `strategy` keyword — whitespace and
|
|
4097
|
+
* begins with the `strategy` keyword — whitespace and line or block comments before it
|
|
4058
4098
|
* are ignored — and that is how the two are told apart: there is no separate endpoint and
|
|
4059
4099
|
* no header to set. Once registered, a strategy is used the same way
|
|
4060
4100
|
* whichever language it was written in.
|
|
@@ -4536,6 +4576,12 @@ declare const getLive: <ThrowOnError extends boolean = false>(options: Options<G
|
|
|
4536
4576
|
* (fastest) cadence available for the exchange — today that is 1 tick/second on every
|
|
4537
4577
|
* supported exchange; choosing among several cadences is not offered yet.
|
|
4538
4578
|
*
|
|
4579
|
+
* `instruments` can be left out. A QTScript strategy can declare which instruments it accepts with an `instruments`
|
|
4580
|
+
* line in its source; when the compilation of the strategy records that selection as a list of pairs, a
|
|
4581
|
+
* start that leaves `instruments` out, or sends `["*"]`, takes that list, and otherwise the run reads every
|
|
4582
|
+
* instrument the exchange/segment offers. A list you send is taken as sent. Either side of an entry can be `*`
|
|
4583
|
+
* (any base paired with USDT). The instruments the run reads come back in `sources`. See the "Live execution" guide, "Sources".
|
|
4584
|
+
*
|
|
4539
4585
|
* `params` is passed straight through to the strategy at start — the same free-form object
|
|
4540
4586
|
* `POST /strategy/{strategyId}/validate` and the backtest endpoints already accept. To change
|
|
4541
4587
|
* a parameter **while the run is live**, use `PUT /live/{runId}/params` instead; this endpoint
|
|
@@ -4554,6 +4600,14 @@ declare const getLive: <ThrowOnError extends boolean = false>(options: Options<G
|
|
|
4554
4600
|
* (it overrides `getExecutionCallback()`) has no other execution venue, so it cannot start
|
|
4555
4601
|
* without a `paper` block.
|
|
4556
4602
|
*
|
|
4603
|
+
* **Warming up.** Pass `warmFrom` to choose how many seconds before its start the run replays the market
|
|
4604
|
+
* feed from, so that its indicators and windows have history when the first live tick arrives. `0` replays
|
|
4605
|
+
* nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the
|
|
4606
|
+
* first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute
|
|
4607
|
+
* block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is
|
|
4608
|
+
* complete. The value in effect, yours or the platform's, comes back as `warmFrom`. It can be set only here,
|
|
4609
|
+
* when the run is started. See the "Live execution" guide, "Warming up".
|
|
4610
|
+
*
|
|
4557
4611
|
* **A plain WebSocket stream.** Pass `stream: true` to get a secret URL for this run's signals that a simple
|
|
4558
4612
|
* client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage
|
|
4559
4613
|
* on. The URL is in the response (`streamUrl`) and in `GET /strategy/{strategyId}/live`; treat it like a
|
|
@@ -4735,4 +4789,4 @@ declare const mintLiveConnectionToken: <ThrowOnError extends boolean = false>(op
|
|
|
4735
4789
|
|
|
4736
4790
|
declare const client: _hey_api_client_fetch.Client;
|
|
4737
4791
|
|
|
4738
|
-
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 GetLiveData, type GetLiveError, type GetLiveErrors, type GetLiveResponse, type GetLiveResponses, type GetLiveRunData, type GetLiveRunError, type GetLiveRunErrors, type GetLiveRunPaperData, type GetLiveRunPaperEquityData, type GetLiveRunPaperEquityError, type GetLiveRunPaperEquityErrors, type GetLiveRunPaperEquityResponse, type GetLiveRunPaperEquityResponses, type GetLiveRunPaperError, type GetLiveRunPaperErrors, type GetLiveRunPaperResponse, type GetLiveRunPaperResponses, type GetLiveRunResponse, type GetLiveRunResponses, type GetLiveRunSignalsData, type GetLiveRunSignalsError, type GetLiveRunSignalsErrors, type GetLiveRunSignalsResponse, type GetLiveRunSignalsResponses, 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 ListLiveData, type ListLiveError, type ListLiveErrors, type ListLiveResponse, type ListLiveResponses, type ListPublicLiveData, type ListPublicLiveError, type ListPublicLiveErrors, type ListPublicLiveResponse, type ListPublicLiveResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type LiveCommandResult, type LiveConnectionToken, type LiveListResponse, type LivePaper, type LivePaperAccount, type LivePaperConfig, type LivePaperEquityPage, type LivePaperEquityPoint, type LivePaperKpi, type LivePaperPosition, type LiveParamsUpdateResult, type LiveRun, type LiveRunCompact, type LiveRunDetail, type LiveRunStats, type LiveRunSummary, type LiveRunWithStream, type LiveSignal, type LiveSignalInstrument, type LiveSignalOrder, type LiveSignalPage, type LiveSource, type LiveStreamRevoked, type LiveStreamUrl, type MintLiveConnectionTokenData, type MintLiveConnectionTokenResponse, type MintLiveConnectionTokenResponses, 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 PublicLiveListLinks, type PublicLiveListResponse, type PublicLiveNextLink, type PublicLiveRun, type ResponseError, type ResultMap, type RevokeLiveStreamData, type RevokeLiveStreamError, type RevokeLiveStreamErrors, type RevokeLiveStreamResponse, type RevokeLiveStreamResponses, type RotateLiveStreamData, type RotateLiveStreamError, type RotateLiveStreamErrors, type RotateLiveStreamResponse, type RotateLiveStreamResponses, type ScalarStrategyParamValue, type SendLiveCommandData, type SendLiveCommandError, type SendLiveCommandErrors, type SendLiveCommandRequest, type SendLiveCommandResponse, type SendLiveCommandResponses, type StartLiveData, type StartLiveError, type StartLiveErrors, type StartLiveRequest, type StartLiveResponse, type StartLiveResponses, type StopLiveData, type StopLiveError, type StopLiveErrors, type StopLiveResponse, type StopLiveResponses, 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 UpdateLiveData, type UpdateLiveError, type UpdateLiveErrors, type UpdateLiveParamsData, type UpdateLiveParamsError, type UpdateLiveParamsErrors, type UpdateLiveParamsRequest, type UpdateLiveParamsResponse, type UpdateLiveParamsResponses, type UpdateLiveRequest, type UpdateLiveResponse, type UpdateLiveResponses, 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, getLive, getLiveRun, getLiveRunPaper, getLiveRunPaperEquity, getLiveRunSignals, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listLive, listPublicLive, listSegmentInstruments, listStrategies, mintLiveConnectionToken, openDatasetUpload, prepareBacktest, revokeLiveStream, rotateLiveStream, sendLiveCommand, startLive, stopLive, updateLive, updateLiveParams, validateStrategy };
|
|
4792
|
+
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 GetLiveData, type GetLiveError, type GetLiveErrors, type GetLiveResponse, type GetLiveResponses, type GetLiveRunData, type GetLiveRunError, type GetLiveRunErrors, type GetLiveRunPaperData, type GetLiveRunPaperEquityData, type GetLiveRunPaperEquityError, type GetLiveRunPaperEquityErrors, type GetLiveRunPaperEquityResponse, type GetLiveRunPaperEquityResponses, type GetLiveRunPaperError, type GetLiveRunPaperErrors, type GetLiveRunPaperResponse, type GetLiveRunPaperResponses, type GetLiveRunResponse, type GetLiveRunResponses, type GetLiveRunSignalsData, type GetLiveRunSignalsError, type GetLiveRunSignalsErrors, type GetLiveRunSignalsResponse, type GetLiveRunSignalsResponses, 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 ListLiveData, type ListLiveError, type ListLiveErrors, type ListLiveResponse, type ListLiveResponses, type ListPublicLiveData, type ListPublicLiveError, type ListPublicLiveErrors, type ListPublicLiveResponse, type ListPublicLiveResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type LiveCommandResult, type LiveConnectionToken, type LiveListResponse, type LivePaper, type LivePaperAccount, type LivePaperConfig, type LivePaperEquityPage, type LivePaperEquityPoint, type LivePaperKpi, type LivePaperPosition, type LiveParamsUpdateResult, type LiveRun, type LiveRunCompact, type LiveRunDetail, type LiveRunStats, type LiveRunSummary, type LiveRunWithStream, type LiveSignal, type LiveSignalInstrument, type LiveSignalOrder, type LiveSignalPage, type LiveSource, type LiveSourceRequest, type LiveStreamRevoked, type LiveStreamUrl, type MintLiveConnectionTokenData, type MintLiveConnectionTokenResponse, type MintLiveConnectionTokenResponses, 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 PublicLiveListLinks, type PublicLiveListResponse, type PublicLiveNextLink, type PublicLiveRun, type ResponseError, type ResultMap, type RevokeLiveStreamData, type RevokeLiveStreamError, type RevokeLiveStreamErrors, type RevokeLiveStreamResponse, type RevokeLiveStreamResponses, type RotateLiveStreamData, type RotateLiveStreamError, type RotateLiveStreamErrors, type RotateLiveStreamResponse, type RotateLiveStreamResponses, type ScalarStrategyParamValue, type SendLiveCommandData, type SendLiveCommandError, type SendLiveCommandErrors, type SendLiveCommandRequest, type SendLiveCommandResponse, type SendLiveCommandResponses, type StartLiveData, type StartLiveError, type StartLiveErrors, type StartLiveRequest, type StartLiveResponse, type StartLiveResponses, type StopLiveData, type StopLiveError, type StopLiveErrors, type StopLiveResponse, type StopLiveResponses, 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 UpdateLiveData, type UpdateLiveError, type UpdateLiveErrors, type UpdateLiveParamsData, type UpdateLiveParamsError, type UpdateLiveParamsErrors, type UpdateLiveParamsRequest, type UpdateLiveParamsResponse, type UpdateLiveParamsResponses, type UpdateLiveRequest, type UpdateLiveResponse, type UpdateLiveResponses, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, type WarmFrom, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getLive, getLiveRun, getLiveRunPaper, getLiveRunPaperEquity, getLiveRunSignals, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listLive, listPublicLive, listSegmentInstruments, listStrategies, mintLiveConnectionToken, openDatasetUpload, prepareBacktest, revokeLiveStream, rotateLiveStream, sendLiveCommand, startLive, stopLive, updateLive, updateLiveParams, validateStrategy };
|
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 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 StopLiveData,\n StopLiveResponse,\n StopLiveError,\n GetLiveData,\n GetLiveResponse,\n GetLiveError,\n StartLiveData,\n StartLiveResponse,\n StartLiveError,\n ListLiveData,\n ListLiveResponse,\n ListLiveError,\n ListPublicLiveData,\n ListPublicLiveResponse,\n ListPublicLiveError,\n GetLiveRunData,\n GetLiveRunResponse,\n GetLiveRunError,\n UpdateLiveData,\n UpdateLiveResponse,\n UpdateLiveError,\n UpdateLiveParamsData,\n UpdateLiveParamsResponse,\n UpdateLiveParamsError,\n SendLiveCommandData,\n SendLiveCommandResponse,\n SendLiveCommandError,\n RevokeLiveStreamData,\n RevokeLiveStreamResponse,\n RevokeLiveStreamError,\n RotateLiveStreamData,\n RotateLiveStreamResponse,\n RotateLiveStreamError,\n GetLiveRunSignalsData,\n GetLiveRunSignalsResponse,\n GetLiveRunSignalsError,\n GetLiveRunPaperData,\n GetLiveRunPaperResponse,\n GetLiveRunPaperError,\n GetLiveRunPaperEquityData,\n GetLiveRunPaperEquityResponse,\n GetLiveRunPaperEquityError,\n MintLiveConnectionTokenData,\n MintLiveConnectionTokenResponse,\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 * With `includeDeleted=true`, strategies you have deleted are listed too, each with the\n * `deletedAt` it was deleted at — useful to keep a copy of your list in sync, telling a\n * deleted strategy apart from one that never existed.\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 * The source is either **Java** — a class extending a strategy base class — or **QTScript**\n * (beta), a compact strategy language whose braced bodies are plain Java. QTScript source\n * begins with the `strategy` keyword — whitespace and comments (`//` or `* *`) before it\n * are ignored — and that is how the two are told apart: there is no separate endpoint and\n * no header to set. Once registered, a strategy is used the same way\n * whichever language it was written in.\n *\n * **This answers one question: is the source valid.** 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 * A `200` means the source parsed and compiled, not that it will run. What only shows once the\n * strategy sets up its indicators is found by `validate`: for QTScript, a window on an indicator\n * name that is not registered (`window nosuch m1 { ... }`) registers, and `validate` ends `failed`\n * on that line.\n *\n * For **Java**, the `strategyId` is derived from what the code *means*, not from how it is\n * written. Adding a comment, inserting a blank line, re-indenting, reordering imports, or\n * moving a method around all return the **same** id — you have not created a second strategy.\n * Renaming a variable, changing an identifier's case, reordering fields, or reordering\n * statements inside a method return a **different** one.\n *\n * For **QTScript**, the id is derived from the text, because indentation is part of its\n * grammar. Only differences that cannot change the strategy are ignored: a byte-order mark, the\n * style of line endings, whitespace at the end of a line, and blank lines before the first and\n * after the last line. Anything else — a comment, the indentation, a blank line in between —\n * returns a **different** id.\n *\n * Two rules follow, and they are worth designing around:\n *\n * - re-submitting a Java strategy you have only reformatted is free, and gives you back the id\n * you 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 * Every source in `DataSourceType` can be prepared, but not every one can then be run: `funding`\n * data can be prepared and is rejected by `execute` and `executeSweep`. A `kline` prepare takes\n * the bar width from `cadence` — see `PrepareRequest`.\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 * `type` must be `ticker` or `kline`; a `kline` sweep, walk-forward included, runs over bars of\n * the cadence the request was prepared at. `funding` can be prepared but not swept yet: it is\n * rejected with `400` before anything is queued.\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 * `type` must be a source that can be executed: `ticker` or `kline`. A `kline` strategy is fed\n * bars of the cadence its `prepareJobId` was prepared at — chosen by you when preparing, not by\n * the strategy. `funding` can be prepared but not executed yet: it is rejected with `400`\n * before anything is queued.\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 * With `includeDeleted=true`, datasets you have deleted are listed too, each with the\n * `deletedAt` it was deleted at — useful to keep a copy of your list in sync, telling a\n * deleted dataset apart from one that never existed.\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\n/**\n * Stop this strategy's live run\n * Requests a stop. The run winds down at its own next check-in rather than instantly —\n * poll `GET`/`PATCH` `.../live` and expect `state` to remain `RUNNING` for a short window\n * after `desired` flips to `STOPPED`. Calling this again on an already-stopped run is not an\n * error; it returns the same (unchanged) state. A stopped run has no stream: its `streamUrl`, if it had one,\n * stops working and is not in this response.\n *\n */\nexport const stopLive = <ThrowOnError extends boolean = false>(\n options: Options<StopLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n StopLiveResponse,\n StopLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n });\n};\n\n/**\n * Get this strategy's current (or most recent) live run\n * The run you last started for this strategy — its most complete state, including `params`\n * and the promotion `gate` once the sandbox trial has one to report. Returns the run's last\n * known state even after it has stopped; this endpoint never disappears history. When the run was started\n * with a `stream`, `streamUrl` is here too while the run is running and your plan allows it.\n *\n * While the run is being executed it also carries `stats`, the run's latest counters (updates\n * processed, rate, instruments seen), refreshed about once a minute. Starting or stopping a run\n * does not return them; read them here.\n *\n */\nexport const getLive = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveResponse,\n GetLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n });\n};\n\n/**\n * Start a strategy on a live market feed\n * Starts your strategy against a live market feed. A new run always begins in the **sandbox**\n * stage — a short trial that compares an independent second execution against the first for\n * agreement — before it is eligible for promotion to the live stage where it actually\n * publishes signals other systems can act on. Poll `GET /strategy/{strategyId}/live` (or\n * `PATCH`/`DELETE` `/live/{runId}` once you have the `runId`) to watch `stage` move from\n * `SANDBOX` to `LIVE`.\n *\n * Only one run per strategy at a time — starting again while one is already running is `409`;\n * stop the current one first.\n *\n * `sources` takes exactly one entry today (multi-source strategies are not supported yet).\n * `type` is `ticker` or `kline`; anything else is rejected. Both connect to the lightest\n * (fastest) cadence available for the exchange — today that is 1 tick/second on every\n * supported exchange; choosing among several cadences is not offered yet.\n *\n * `params` is passed straight through to the strategy at start — the same free-form object\n * `POST /strategy/{strategyId}/validate` and the backtest endpoints already accept. To change\n * a parameter **while the run is live**, use `PUT /live/{runId}/params` instead; this endpoint\n * only sets the values a run starts with.\n *\n * Consuming a run's own output — its signals, and updating its parameters over a live\n * connection instead of polling — is a WebSocket protocol on top of these REST endpoints; see\n * the \"Live execution\" guide linked from this tag's description for the full flow (minting a\n * connection token, the channel and RPC method).\n *\n * **Paper trading.** Pass a `paper` block to have the run's hints executed in simulation from\n * its first tick, as a backtest would execute them: fills, closed trades, equity and KPIs,\n * with one simulated account per quote currency. Omitted, the run has no paper trading. It\n * takes the same economics as a backtest's `baseConfig` plus where its output goes; read it\n * back with `GET /live/{runId}/paper`. A strategy that listens to its own execution events\n * (it overrides `getExecutionCallback()`) has no other execution venue, so it cannot start\n * without a `paper` block.\n *\n * **A plain WebSocket stream.** Pass `stream: true` to get a secret URL for this run's signals that a simple\n * client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage\n * on. The URL is in the response (`streamUrl`) and in `GET /strategy/{strategyId}/live`; treat it like a\n * password. See the \"Live execution\" guide.\n *\n */\nexport const startLive = <ThrowOnError extends boolean = false>(\n options: Options<StartLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n StartLiveResponse,\n StartLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * List your own live runs\n * Every run you have started, in any `stage`, `desired` state, or `visibility` — newest\n * first. Unlike `GET /live/public`, this is not filtered to `RUNNING` public runs: it is\n * the complete list of runs you own, including `sandbox` trials and stopped ones.\n *\n */\nexport const listLive = <ThrowOnError extends boolean = false>(\n options?: Options<ListLiveData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListLiveResponse,\n ListLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live\",\n ...options,\n });\n};\n\n/**\n * Browse public live runs\n * Every run whose owner marked it `public`, that has been promoted to `live` and is running —\n * anyone's, yours included, and listed without revealing who owns it. A `public` run still in\n * its `sandbox` trial is not listed. Most recently started first.\n *\n * This is the only `Live Execution` endpoint that needs no `Authorization` header.\n *\n */\nexport const listPublicLive = <ThrowOnError extends boolean = false>(\n options?: Options<ListPublicLiveData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListPublicLiveResponse,\n ListPublicLiveError,\n ThrowOnError\n >({\n url: \"/live/public\",\n ...options,\n });\n};\n\n/**\n * Read one of your runs by its id\n * Owner only, addressed by `runId` directly rather than through its strategy: the run's own\n * canonical identity, which is what `POST`/`GET`/`DELETE` `.../live`, `GET /live` and\n * `GET /live/public` all hand out. Use it to re-read one specific run — including one you\n * stopped long ago or that is no longer your strategy's most recent — without paging through\n * `GET /live`.\n *\n * Returns the same state as `GET /strategy/{strategyId}/live` (`strategyId` is the strategy's\n * id, and `stats` is there too), plus `updatedAtMs`: when the run last changed, from any cause — a\n * state change, a promotion, a parameter update, a stop. A refresh of `stats` is not a change of\n * the run and does not move `updatedAtMs`. A run that is public is reachable by others through\n * `GET /live/public`, never through this route.\n *\n */\nexport const getLiveRun = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunResponse,\n GetLiveRunError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}\",\n ...options,\n });\n};\n\n/**\n * Change a run's visibility, name, or description\n * Owner only, addressed by `runId` directly rather than through its strategy — this is a\n * run's own canonical identity, independent of which strategy started it.\n *\n * Setting `visibility` from `public` back to `private` also evicts anyone currently connected\n * to the run's live signal channel who is not its owner — best-effort; the change to this\n * record is not rolled back if that eviction fails.\n *\n */\nexport const updateLive = <ThrowOnError extends boolean = false>(\n options: Options<UpdateLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).patch<\n UpdateLiveResponse,\n UpdateLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Change a running strategy's parameters\n * Updates one or more parameters of a run **while it stays live** — unlike `params` on\n * `POST /strategy/{strategyId}/live`, which only sets the starting values. Owner only.\n *\n * Every key in `params` must be one your strategy declares (see `declaredProperties` on\n * `POST /strategy`) as of the compilation this run is executing — recompiling the strategy\n * later never changes what an already-running instance accepts; start a new run for that.\n *\n * The change does not take effect the instant this call returns: `effectiveAtMs` is the\n * earliest moment it is guaranteed to apply, a few seconds out, so both the REST and\n * WebSocket paths to this same update (see the \"Live execution\" guide) land on the exact same\n * value at the exact same moment.\n *\n */\nexport const updateLiveParams = <ThrowOnError extends boolean = false>(\n options: Options<UpdateLiveParamsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).put<\n UpdateLiveParamsResponse,\n UpdateLiveParamsError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/params\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Tell a running strategy a command\n * Tells a running strategy something **while it stays live**, without restarting it — for a strategy that\n * implements the engine's `CommandRequestHandler`. Owner only.\n *\n * A command is an event, not a stored setting: it is delivered once to every execution behind the run, at\n * the same market position, and nothing about it is written to the run's state. **It is transient** — a\n * replica that restarts replays only its recent market history, so a command from before that only reaches\n * one that was already running when it arrived. Anything the strategy needs to remember across a restart\n * belongs in a parameter (`PUT /live/{runId}/params`), which does have a stored value; a command does not.\n *\n * The command's text is a plain string; an optional `properties` object of your own choosing travels\n * alongside it. Each entry lands as a top-level entry on the `CommandRequest` the handler receives —\n * `request.get(\"<key>\")` in Java, `$command.<key>` sugar in QTScript — no key is off limits, since the\n * command's own text is kept separately.\n *\n */\nexport const sendLiveCommand = <ThrowOnError extends boolean = false>(\n options: Options<SendLiveCommandData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n SendLiveCommandResponse,\n SendLiveCommandError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/commands\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Revoke a run's stream URL\n * Revokes a run's stream URL **for good**: connections open on it are closed within about 15 seconds and it\n * answers `404` from then on. The run itself is not touched, and a stream cannot be added to it again; start\n * the run again with `stream: true` for a new URL. Owner only, and always allowed, whatever your plan or the\n * run's state. Repeating it is not an error.\n *\n */\nexport const revokeLiveStream = <ThrowOnError extends boolean = false>(\n options: Options<RevokeLiveStreamData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n RevokeLiveStreamResponse,\n RevokeLiveStreamError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/stream\",\n ...options,\n });\n};\n\n/**\n * Rotate a run's stream URL\n * Gives a run a **new** stream URL and retires the old one: connections open on the old URL are closed\n * within about 15 seconds and the old URL answers `404` from then on. Use it when the URL may have leaked.\n * Owner only, and only for a run that is running and was started with `stream: true` (the URL cannot be added\n * to a run later, and a revoked one cannot be brought back). The plan is checked again: a plan that may not\n * broadcast gets `429`.\n *\n * See the \"Live execution\" guide, \"A plain WebSocket stream of a run\".\n *\n */\nexport const rotateLiveStream = <ThrowOnError extends boolean = false>(\n options: Options<RotateLiveStreamData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n RotateLiveStreamResponse,\n RotateLiveStreamError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/stream\",\n ...options,\n });\n};\n\n/**\n * Read a run's signals\n * Returns one page of the signals a run has already produced, newest-last, optionally from a\n * given time and narrowed to one or more instruments.\n *\n * This is the counterpart to the real-time WebSocket channel: that channel only carries what\n * happens while you are connected, and only for a run that asked for `relay`. A run's signals\n * are recorded either way, so this endpoint serves them whether or not `relay` was ever on,\n * in both the `sandbox` and `live` stages — use it to catch up after a disconnect, to read a\n * run you never relayed, or to page back over what has already happened.\n *\n * **The available window moves.** Signals are kept for a limited span, and the oldest are\n * continuously discarded as new ones arrive, so how far back you can read is not a fixed\n * number of hours: on a busy run it can be a good deal shorter. Every response carries\n * `availableSinceMs`, the oldest moment that can still be answered for. Asking for a\n * `sinceMs` older than that is not an error — you get everything from `availableSinceMs`\n * onwards, and that field tells you it happened.\n *\n * **A cursor can expire, and on a busy run it expires quickly.** If the position a cursor\n * points at has since been discarded, the next page answers `410` rather than silently\n * serving a shortened page that looks complete. Treat that as a normal outcome: read\n * `availableSinceMs` from the error and start again from there.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage — the same rule the signal channel applies to a subscription. A `sandbox` run is read\n * by its owner only, whatever visibility it asked for.\n *\n */\nexport const getLiveRunSignals = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunSignalsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunSignalsResponse,\n GetLiveRunSignalsError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/signals\",\n ...options,\n });\n};\n\n/**\n * Read a run's paper trading\n * The run's paper trading as last recorded: one entry per simulated account (one per quote\n * currency the run trades — never added together), with its starting capital, current\n * equity, realised PnL, open positions and KPIs. The KPIs are the same a backtest reports,\n * computed over the trades closed so far.\n *\n * `equity` is the account's latest recorded value: at the last closed trade (`equityKind:\n * equity`), or the last periodic mark-to-market while positions are open (`equityKind:\n * mark`, taken every minute of market time). Until either exists the account holds its\n * starting capital.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage. A run started without a `paper` block answers `404`.\n *\n */\nexport const getLiveRunPaper = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunPaperData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunPaperResponse,\n GetLiveRunPaperError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/paper\",\n ...options,\n });\n};\n\n/**\n * Read a run's paper equity curve\n * The run's paper equity curve, oldest first, page by page. It is kept for the life of the\n * run, so unlike signals it has no moving window. Points are `equity` at every closed trade,\n * `mark` every minute of market time while positions are open, and `gap` where the run was\n * restarted with positions open: those positions are not carried over, so the curve has no\n * value there.\n *\n * `currency` narrows to one account; without it, every account's points come interleaved by\n * time, each carrying its currency.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage.\n *\n */\nexport const getLiveRunPaperEquity = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunPaperEquityData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunPaperEquityResponse,\n GetLiveRunPaperEquityError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/paper/equity\",\n ...options,\n });\n};\n\n/**\n * Mint a WebSocket connection token\n * Mints a short-lived token for the WebSocket connection used to receive a run's signals in\n * real time and to call `live.params` (the WebSocket form of `PUT /live/{runId}/params`) —\n * see the \"Live execution\" guide linked from this tag's description for the full protocol.\n * Carries no request body.\n *\n */\nexport const mintLiveConnectionToken = <ThrowOnError extends boolean = false>(\n options?: Options<MintLiveConnectionTokenData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).post<\n MintLiveConnectionTokenResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/token\",\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;;;ACuJO,IAAM,eAAe,CAC1B,YACG;AACH,UAAQ,SAA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;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;AAUO,IAAM,0BAA0B,CACrC,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,KAIxC;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":[]}
|
|
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 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 StopLiveData,\n StopLiveResponse,\n StopLiveError,\n GetLiveData,\n GetLiveResponse,\n GetLiveError,\n StartLiveData,\n StartLiveResponse,\n StartLiveError,\n ListLiveData,\n ListLiveResponse,\n ListLiveError,\n ListPublicLiveData,\n ListPublicLiveResponse,\n ListPublicLiveError,\n GetLiveRunData,\n GetLiveRunResponse,\n GetLiveRunError,\n UpdateLiveData,\n UpdateLiveResponse,\n UpdateLiveError,\n UpdateLiveParamsData,\n UpdateLiveParamsResponse,\n UpdateLiveParamsError,\n SendLiveCommandData,\n SendLiveCommandResponse,\n SendLiveCommandError,\n RevokeLiveStreamData,\n RevokeLiveStreamResponse,\n RevokeLiveStreamError,\n RotateLiveStreamData,\n RotateLiveStreamResponse,\n RotateLiveStreamError,\n GetLiveRunSignalsData,\n GetLiveRunSignalsResponse,\n GetLiveRunSignalsError,\n GetLiveRunPaperData,\n GetLiveRunPaperResponse,\n GetLiveRunPaperError,\n GetLiveRunPaperEquityData,\n GetLiveRunPaperEquityResponse,\n GetLiveRunPaperEquityError,\n MintLiveConnectionTokenData,\n MintLiveConnectionTokenResponse,\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 * With `includeDeleted=true`, strategies you have deleted are listed too, each with the\n * `deletedAt` it was deleted at — useful to keep a copy of your list in sync, telling a\n * deleted strategy apart from one that never existed.\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 * The source is either **Java** — a class extending a strategy base class — or **QTScript**\n * (beta), a compact strategy language whose braced bodies are plain Java. QTScript source\n * begins with the `strategy` keyword — whitespace and line or block comments before it\n * are ignored — and that is how the two are told apart: there is no separate endpoint and\n * no header to set. Once registered, a strategy is used the same way\n * whichever language it was written in.\n *\n * **This answers one question: is the source valid.** 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 * A `200` means the source parsed and compiled, not that it will run. What only shows once the\n * strategy sets up its indicators is found by `validate`: for QTScript, a window on an indicator\n * name that is not registered (`window nosuch m1 { ... }`) registers, and `validate` ends `failed`\n * on that line.\n *\n * For **Java**, the `strategyId` is derived from what the code *means*, not from how it is\n * written. Adding a comment, inserting a blank line, re-indenting, reordering imports, or\n * moving a method around all return the **same** id — you have not created a second strategy.\n * Renaming a variable, changing an identifier's case, reordering fields, or reordering\n * statements inside a method return a **different** one.\n *\n * For **QTScript**, the id is derived from the text, because indentation is part of its\n * grammar. Only differences that cannot change the strategy are ignored: a byte-order mark, the\n * style of line endings, whitespace at the end of a line, and blank lines before the first and\n * after the last line. Anything else — a comment, the indentation, a blank line in between —\n * returns a **different** id.\n *\n * Two rules follow, and they are worth designing around:\n *\n * - re-submitting a Java strategy you have only reformatted is free, and gives you back the id\n * you 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 * Every source in `DataSourceType` can be prepared, but not every one can then be run: `funding`\n * data can be prepared and is rejected by `execute` and `executeSweep`. A `kline` prepare takes\n * the bar width from `cadence` — see `PrepareRequest`.\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 * `type` must be `ticker` or `kline`; a `kline` sweep, walk-forward included, runs over bars of\n * the cadence the request was prepared at. `funding` can be prepared but not swept yet: it is\n * rejected with `400` before anything is queued.\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 * `type` must be a source that can be executed: `ticker` or `kline`. A `kline` strategy is fed\n * bars of the cadence its `prepareJobId` was prepared at — chosen by you when preparing, not by\n * the strategy. `funding` can be prepared but not executed yet: it is rejected with `400`\n * before anything is queued.\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 * With `includeDeleted=true`, datasets you have deleted are listed too, each with the\n * `deletedAt` it was deleted at — useful to keep a copy of your list in sync, telling a\n * deleted dataset apart from one that never existed.\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\n/**\n * Stop this strategy's live run\n * Requests a stop. The run winds down at its own next check-in rather than instantly —\n * poll `GET`/`PATCH` `.../live` and expect `state` to remain `RUNNING` for a short window\n * after `desired` flips to `STOPPED`. Calling this again on an already-stopped run is not an\n * error; it returns the same (unchanged) state. A stopped run has no stream: its `streamUrl`, if it had one,\n * stops working and is not in this response.\n *\n */\nexport const stopLive = <ThrowOnError extends boolean = false>(\n options: Options<StopLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n StopLiveResponse,\n StopLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n });\n};\n\n/**\n * Get this strategy's current (or most recent) live run\n * The run you last started for this strategy — its most complete state, including `params`\n * and the promotion `gate` once the sandbox trial has one to report. Returns the run's last\n * known state even after it has stopped; this endpoint never disappears history. When the run was started\n * with a `stream`, `streamUrl` is here too while the run is running and your plan allows it.\n *\n * While the run is being executed it also carries `stats`, the run's latest counters (updates\n * processed, rate, instruments seen), refreshed about once a minute. Starting or stopping a run\n * does not return them; read them here.\n *\n */\nexport const getLive = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveResponse,\n GetLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n });\n};\n\n/**\n * Start a strategy on a live market feed\n * Starts your strategy against a live market feed. A new run always begins in the **sandbox**\n * stage — a short trial that compares an independent second execution against the first for\n * agreement — before it is eligible for promotion to the live stage where it actually\n * publishes signals other systems can act on. Poll `GET /strategy/{strategyId}/live` (or\n * `PATCH`/`DELETE` `/live/{runId}` once you have the `runId`) to watch `stage` move from\n * `SANDBOX` to `LIVE`.\n *\n * Only one run per strategy at a time — starting again while one is already running is `409`;\n * stop the current one first.\n *\n * `sources` takes exactly one entry today (multi-source strategies are not supported yet).\n * `type` is `ticker` or `kline`; anything else is rejected. Both connect to the lightest\n * (fastest) cadence available for the exchange — today that is 1 tick/second on every\n * supported exchange; choosing among several cadences is not offered yet.\n *\n * `instruments` can be left out. A QTScript strategy can declare which instruments it accepts with an `instruments`\n * line in its source; when the compilation of the strategy records that selection as a list of pairs, a\n * start that leaves `instruments` out, or sends `[\"*\"]`, takes that list, and otherwise the run reads every\n * instrument the exchange/segment offers. A list you send is taken as sent. Either side of an entry can be `*`\n * (any base paired with USDT). The instruments the run reads come back in `sources`. See the \"Live execution\" guide, \"Sources\".\n *\n * `params` is passed straight through to the strategy at start — the same free-form object\n * `POST /strategy/{strategyId}/validate` and the backtest endpoints already accept. To change\n * a parameter **while the run is live**, use `PUT /live/{runId}/params` instead; this endpoint\n * only sets the values a run starts with.\n *\n * Consuming a run's own output — its signals, and updating its parameters over a live\n * connection instead of polling — is a WebSocket protocol on top of these REST endpoints; see\n * the \"Live execution\" guide linked from this tag's description for the full flow (minting a\n * connection token, the channel and RPC method).\n *\n * **Paper trading.** Pass a `paper` block to have the run's hints executed in simulation from\n * its first tick, as a backtest would execute them: fills, closed trades, equity and KPIs,\n * with one simulated account per quote currency. Omitted, the run has no paper trading. It\n * takes the same economics as a backtest's `baseConfig` plus where its output goes; read it\n * back with `GET /live/{runId}/paper`. A strategy that listens to its own execution events\n * (it overrides `getExecutionCallback()`) has no other execution venue, so it cannot start\n * without a `paper` block.\n *\n * **Warming up.** Pass `warmFrom` to choose how many seconds before its start the run replays the market\n * feed from, so that its indicators and windows have history when the first live tick arrives. `0` replays\n * nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the\n * first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute\n * block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is\n * complete. The value in effect, yours or the platform's, comes back as `warmFrom`. It can be set only here,\n * when the run is started. See the \"Live execution\" guide, \"Warming up\".\n *\n * **A plain WebSocket stream.** Pass `stream: true` to get a secret URL for this run's signals that a simple\n * client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage\n * on. The URL is in the response (`streamUrl`) and in `GET /strategy/{strategyId}/live`; treat it like a\n * password. See the \"Live execution\" guide.\n *\n */\nexport const startLive = <ThrowOnError extends boolean = false>(\n options: Options<StartLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n StartLiveResponse,\n StartLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/strategy/{strategyId}/live\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * List your own live runs\n * Every run you have started, in any `stage`, `desired` state, or `visibility` — newest\n * first. Unlike `GET /live/public`, this is not filtered to `RUNNING` public runs: it is\n * the complete list of runs you own, including `sandbox` trials and stopped ones.\n *\n */\nexport const listLive = <ThrowOnError extends boolean = false>(\n options?: Options<ListLiveData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListLiveResponse,\n ListLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live\",\n ...options,\n });\n};\n\n/**\n * Browse public live runs\n * Every run whose owner marked it `public`, that has been promoted to `live` and is running —\n * anyone's, yours included, and listed without revealing who owns it. A `public` run still in\n * its `sandbox` trial is not listed. Most recently started first.\n *\n * This is the only `Live Execution` endpoint that needs no `Authorization` header.\n *\n */\nexport const listPublicLive = <ThrowOnError extends boolean = false>(\n options?: Options<ListPublicLiveData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).get<\n ListPublicLiveResponse,\n ListPublicLiveError,\n ThrowOnError\n >({\n url: \"/live/public\",\n ...options,\n });\n};\n\n/**\n * Read one of your runs by its id\n * Owner only, addressed by `runId` directly rather than through its strategy: the run's own\n * canonical identity, which is what `POST`/`GET`/`DELETE` `.../live`, `GET /live` and\n * `GET /live/public` all hand out. Use it to re-read one specific run — including one you\n * stopped long ago or that is no longer your strategy's most recent — without paging through\n * `GET /live`.\n *\n * Returns the same state as `GET /strategy/{strategyId}/live` (`strategyId` is the strategy's\n * id, and `stats` is there too), plus `updatedAtMs`: when the run last changed, from any cause — a\n * state change, a promotion, a parameter update, a stop. A refresh of `stats` is not a change of\n * the run and does not move `updatedAtMs`. A run that is public is reachable by others through\n * `GET /live/public`, never through this route.\n *\n */\nexport const getLiveRun = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunResponse,\n GetLiveRunError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}\",\n ...options,\n });\n};\n\n/**\n * Change a run's visibility, name, or description\n * Owner only, addressed by `runId` directly rather than through its strategy — this is a\n * run's own canonical identity, independent of which strategy started it.\n *\n * Setting `visibility` from `public` back to `private` also evicts anyone currently connected\n * to the run's live signal channel who is not its owner — best-effort; the change to this\n * record is not rolled back if that eviction fails.\n *\n */\nexport const updateLive = <ThrowOnError extends boolean = false>(\n options: Options<UpdateLiveData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).patch<\n UpdateLiveResponse,\n UpdateLiveError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Change a running strategy's parameters\n * Updates one or more parameters of a run **while it stays live** — unlike `params` on\n * `POST /strategy/{strategyId}/live`, which only sets the starting values. Owner only.\n *\n * Every key in `params` must be one your strategy declares (see `declaredProperties` on\n * `POST /strategy`) as of the compilation this run is executing — recompiling the strategy\n * later never changes what an already-running instance accepts; start a new run for that.\n *\n * The change does not take effect the instant this call returns: `effectiveAtMs` is the\n * earliest moment it is guaranteed to apply, a few seconds out, so both the REST and\n * WebSocket paths to this same update (see the \"Live execution\" guide) land on the exact same\n * value at the exact same moment.\n *\n */\nexport const updateLiveParams = <ThrowOnError extends boolean = false>(\n options: Options<UpdateLiveParamsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).put<\n UpdateLiveParamsResponse,\n UpdateLiveParamsError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/params\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Tell a running strategy a command\n * Tells a running strategy something **while it stays live**, without restarting it — for a strategy that\n * implements the engine's `CommandRequestHandler`. Owner only.\n *\n * A command is an event, not a stored setting: it is delivered once to every execution behind the run, at\n * the same market position, and nothing about it is written to the run's state. **It is transient** — a\n * replica that restarts replays only its recent market history, so a command from before that only reaches\n * one that was already running when it arrived. Anything the strategy needs to remember across a restart\n * belongs in a parameter (`PUT /live/{runId}/params`), which does have a stored value; a command does not.\n *\n * The command's text is a plain string; an optional `properties` object of your own choosing travels\n * alongside it. Each entry lands as a top-level entry on the `CommandRequest` the handler receives —\n * `request.get(\"<key>\")` in Java, `$command.<key>` sugar in QTScript — no key is off limits, since the\n * command's own text is kept separately.\n *\n */\nexport const sendLiveCommand = <ThrowOnError extends boolean = false>(\n options: Options<SendLiveCommandData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n SendLiveCommandResponse,\n SendLiveCommandError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/commands\",\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n });\n};\n\n/**\n * Revoke a run's stream URL\n * Revokes a run's stream URL **for good**: connections open on it are closed within about 15 seconds and it\n * answers `404` from then on. The run itself is not touched, and a stream cannot be added to it again; start\n * the run again with `stream: true` for a new URL. Owner only, and always allowed, whatever your plan or the\n * run's state. Repeating it is not an error.\n *\n */\nexport const revokeLiveStream = <ThrowOnError extends boolean = false>(\n options: Options<RevokeLiveStreamData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).delete<\n RevokeLiveStreamResponse,\n RevokeLiveStreamError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/stream\",\n ...options,\n });\n};\n\n/**\n * Rotate a run's stream URL\n * Gives a run a **new** stream URL and retires the old one: connections open on the old URL are closed\n * within about 15 seconds and the old URL answers `404` from then on. Use it when the URL may have leaked.\n * Owner only, and only for a run that is running and was started with `stream: true` (the URL cannot be added\n * to a run later, and a revoked one cannot be brought back). The plan is checked again: a plan that may not\n * broadcast gets `429`.\n *\n * See the \"Live execution\" guide, \"A plain WebSocket stream of a run\".\n *\n */\nexport const rotateLiveStream = <ThrowOnError extends boolean = false>(\n options: Options<RotateLiveStreamData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).post<\n RotateLiveStreamResponse,\n RotateLiveStreamError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/stream\",\n ...options,\n });\n};\n\n/**\n * Read a run's signals\n * Returns one page of the signals a run has already produced, newest-last, optionally from a\n * given time and narrowed to one or more instruments.\n *\n * This is the counterpart to the real-time WebSocket channel: that channel only carries what\n * happens while you are connected, and only for a run that asked for `relay`. A run's signals\n * are recorded either way, so this endpoint serves them whether or not `relay` was ever on,\n * in both the `sandbox` and `live` stages — use it to catch up after a disconnect, to read a\n * run you never relayed, or to page back over what has already happened.\n *\n * **The available window moves.** Signals are kept for a limited span, and the oldest are\n * continuously discarded as new ones arrive, so how far back you can read is not a fixed\n * number of hours: on a busy run it can be a good deal shorter. Every response carries\n * `availableSinceMs`, the oldest moment that can still be answered for. Asking for a\n * `sinceMs` older than that is not an error — you get everything from `availableSinceMs`\n * onwards, and that field tells you it happened.\n *\n * **A cursor can expire, and on a busy run it expires quickly.** If the position a cursor\n * points at has since been discarded, the next page answers `410` rather than silently\n * serving a shortened page that looks complete. Treat that as a normal outcome: read\n * `availableSinceMs` from the error and start again from there.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage — the same rule the signal channel applies to a subscription. A `sandbox` run is read\n * by its owner only, whatever visibility it asked for.\n *\n */\nexport const getLiveRunSignals = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunSignalsData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunSignalsResponse,\n GetLiveRunSignalsError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/signals\",\n ...options,\n });\n};\n\n/**\n * Read a run's paper trading\n * The run's paper trading as last recorded: one entry per simulated account (one per quote\n * currency the run trades — never added together), with its starting capital, current\n * equity, realised PnL, open positions and KPIs. The KPIs are the same a backtest reports,\n * computed over the trades closed so far.\n *\n * `equity` is the account's latest recorded value: at the last closed trade (`equityKind:\n * equity`), or the last periodic mark-to-market while positions are open (`equityKind:\n * mark`, taken every minute of market time). Until either exists the account holds its\n * starting capital.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage. A run started without a `paper` block answers `404`.\n *\n */\nexport const getLiveRunPaper = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunPaperData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunPaperResponse,\n GetLiveRunPaperError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/paper\",\n ...options,\n });\n};\n\n/**\n * Read a run's paper equity curve\n * The run's paper equity curve, oldest first, page by page. It is kept for the life of the\n * run, so unlike signals it has no moving window. Points are `equity` at every closed trade,\n * `mark` every minute of market time while positions are open, and `gap` where the run was\n * restarted with positions open: those positions are not carried over, so the curve has no\n * value there.\n *\n * `currency` narrows to one account; without it, every account's points come interleaved by\n * time, each carrying its currency.\n *\n * Readable by the run's owner, and by anyone if the run is `public` and has reached the `live`\n * stage.\n *\n */\nexport const getLiveRunPaperEquity = <ThrowOnError extends boolean = false>(\n options: Options<GetLiveRunPaperEquityData, ThrowOnError>\n) => {\n return (options.client ?? _heyApiClient).get<\n GetLiveRunPaperEquityResponse,\n GetLiveRunPaperEquityError,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/{runId}/paper/equity\",\n ...options,\n });\n};\n\n/**\n * Mint a WebSocket connection token\n * Mints a short-lived token for the WebSocket connection used to receive a run's signals in\n * real time and to call `live.params` (the WebSocket form of `PUT /live/{runId}/params`) —\n * see the \"Live execution\" guide linked from this tag's description for the full protocol.\n * Carries no request body.\n *\n */\nexport const mintLiveConnectionToken = <ThrowOnError extends boolean = false>(\n options?: Options<MintLiveConnectionTokenData, ThrowOnError>\n) => {\n return (options?.client ?? _heyApiClient).post<\n MintLiveConnectionTokenResponse,\n unknown,\n ThrowOnError\n >({\n security: [\n {\n scheme: \"bearer\",\n type: \"http\",\n },\n ],\n url: \"/live/token\",\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;;;ACuJO,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;AAC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AAAA,EACL,CAAC;AACH;AAUO,IAAM,0BAA0B,CACrC,YACG;AACH,UAAQ,SAAS,UAAU,QAAe,KAIxC;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
|
@@ -2871,7 +2871,44 @@ export const LiveSourceSchema = {
|
|
|
2871
2871
|
},
|
|
2872
2872
|
example: ["BTC/USDT"],
|
|
2873
2873
|
description:
|
|
2874
|
-
'
|
|
2874
|
+
'The instruments the run reads. For a run started with a list, that list as sent; for one started without `instruments`, or with `["*"]`, what the start resolved: the list of pairs the compilation of the strategy records as the instruments it accepts, when it records one, or `["*"]` for every instrument the exchange/segment offers (tier-gated). An entry is written `BASE/QUOTE` and either side can be `*` to mean any, such as any base paired with USDT. Symbols are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument.',
|
|
2875
|
+
},
|
|
2876
|
+
},
|
|
2877
|
+
} as const;
|
|
2878
|
+
|
|
2879
|
+
export const LiveSourceRequestSchema = {
|
|
2880
|
+
type: "object",
|
|
2881
|
+
required: ["venueType", "exchange", "segment", "type"],
|
|
2882
|
+
description:
|
|
2883
|
+
"One market feed to start a live run on. Exactly one entry per run today. It is `LiveSource` as you ask for it: the only difference is that `instruments` can be left out.",
|
|
2884
|
+
properties: {
|
|
2885
|
+
venueType: {
|
|
2886
|
+
type: "string",
|
|
2887
|
+
example: "cx",
|
|
2888
|
+
description:
|
|
2889
|
+
"Venue category. `cx` (centralized exchange) is the only one live runs support today.",
|
|
2890
|
+
},
|
|
2891
|
+
exchange: {
|
|
2892
|
+
type: "string",
|
|
2893
|
+
example: "binance",
|
|
2894
|
+
},
|
|
2895
|
+
segment: {
|
|
2896
|
+
type: "string",
|
|
2897
|
+
example: "spot",
|
|
2898
|
+
},
|
|
2899
|
+
type: {
|
|
2900
|
+
type: "string",
|
|
2901
|
+
enum: ["ticker", "kline"],
|
|
2902
|
+
description:
|
|
2903
|
+
"Both `ticker` and `kline` connect to the lightest (fastest) cadence available for the exchange — today, 1 tick/second on every supported exchange. Choosing a specific cadence is not offered yet.",
|
|
2904
|
+
},
|
|
2905
|
+
instruments: {
|
|
2906
|
+
type: "array",
|
|
2907
|
+
items: {
|
|
2908
|
+
type: "string",
|
|
2909
|
+
},
|
|
2910
|
+
example: ["BTC/USDT"],
|
|
2911
|
+
description: `Which instruments the run reads. A QTScript strategy can declare which instruments it accepts with an \`instruments\` line in its source. When the compilation of the strategy records that selection as a list of pairs, leaving \`instruments\` out, or sending \`["*"]\`, takes that list; otherwise the run reads every instrument the exchange/segment offers. A list of instruments is taken as sent, and \`[]\` and \`null\` are refused with \`400\`. An entry is written \`BASE/QUOTE\`; either side can be \`*\` to mean any: any base can be paired with USDT, and BTC can be paired with any quote. Entries are not case-sensitive and spaces around them are ignored, so \`btc/usdt\` and \`BTC/USDT\` are the same instrument. An entry that is not of that form (no \`/\`, an empty side, a \`.\` or a space inside a side, or a \`*\` mixed with other characters of a side) makes the run fail when it starts. Plan limits: a list with an entry that has a \`*\` on a side counts like \`["*"]\` and only plans that include the wildcard accept it; the other entries are counted one by one. The instruments the run actually reads come back in the run's \`sources\`.`,
|
|
2875
2912
|
},
|
|
2876
2913
|
},
|
|
2877
2914
|
} as const;
|
|
@@ -2885,7 +2922,7 @@ export const StartLiveRequestSchema = {
|
|
|
2885
2922
|
minItems: 1,
|
|
2886
2923
|
maxItems: 1,
|
|
2887
2924
|
items: {
|
|
2888
|
-
$ref: "#/components/schemas/
|
|
2925
|
+
$ref: "#/components/schemas/LiveSourceRequest",
|
|
2889
2926
|
},
|
|
2890
2927
|
},
|
|
2891
2928
|
params: {
|
|
@@ -2915,6 +2952,23 @@ text frame per signal, with none of the live-execution protocol around it. The U
|
|
|
2915
2952
|
\`streamUrl\` in the response to this call. Available from the \`sandbox\` stage on, on the plans that may
|
|
2916
2953
|
broadcast; any other plan gets \`429\`. It can be asked for **only when the run is started** (not added
|
|
2917
2954
|
later), and it also turns \`relay\` on. See the "Live execution" guide, "A plain WebSocket stream of a run".
|
|
2955
|
+
`,
|
|
2956
|
+
},
|
|
2957
|
+
warmFrom: {
|
|
2958
|
+
type: "integer",
|
|
2959
|
+
minimum: 0,
|
|
2960
|
+
maximum: 3600,
|
|
2961
|
+
description: `How many seconds before the run's start to replay the market feed from, so the strategy's indicators and
|
|
2962
|
+
windows have history when its first live tick arrives. \`0\` replays nothing: the run delivers its first
|
|
2963
|
+
signal as soon as it is running, but its indicators start empty and the first bar of a window can be
|
|
2964
|
+
partial. Omitted, the platform replays from the start of the current 15-minute block: between 0 and 900
|
|
2965
|
+
seconds before the run's start, depending on when it starts (0 if it starts exactly on a quarter hour),
|
|
2966
|
+
so the first bar of a 15-minute window is complete. The value in effect, the one you sent or the one the
|
|
2967
|
+
platform chose, is reported back as \`warmFrom\` on the run. Signals about the replayed time
|
|
2968
|
+
are not pushed on the run's channel or stream: they describe events from before the run started.
|
|
2969
|
+
It can be set **only when the run is started**: it is not a parameter of \`PUT /live/{runId}/params\`, and
|
|
2970
|
+
changing it means stopping the run and starting it again. Anything that is not an integer from 0 to 3600
|
|
2971
|
+
is \`400\`. See the "Live execution" guide, "Warming up".
|
|
2918
2972
|
`,
|
|
2919
2973
|
},
|
|
2920
2974
|
name: {
|
|
@@ -3055,7 +3109,7 @@ export const LiveRunSchema = {
|
|
|
3055
3109
|
"startedAtMs",
|
|
3056
3110
|
],
|
|
3057
3111
|
description:
|
|
3058
|
-
"A live run's full state, as returned by
|
|
3112
|
+
"A live run's full state, as returned by stopping it through its strategy, and the base of the representations returned by starting and by reading it. `warmFrom` is declared by those two (`LiveRunWithStream` and `LiveRunDetail`) and not here, because the response to stopping a run does not carry it.",
|
|
3059
3113
|
properties: {
|
|
3060
3114
|
strategyId: {
|
|
3061
3115
|
$ref: "#/components/schemas/strategyId",
|
|
@@ -3207,6 +3261,14 @@ worth checking against \`state\`. \`false\` otherwise. A run whose \`processed\`
|
|
|
3207
3261
|
},
|
|
3208
3262
|
} as const;
|
|
3209
3263
|
|
|
3264
|
+
export const WarmFromSchema = {
|
|
3265
|
+
type: "integer",
|
|
3266
|
+
minimum: 0,
|
|
3267
|
+
maximum: 3600,
|
|
3268
|
+
description:
|
|
3269
|
+
"The `warmFrom` in effect for this run, in seconds: the one requested when the run was started or, when none was, the one the platform chose (the distance from the run's start back to the start of the current 15-minute block, 0 to 900). It is never `null`. It is present on every run started since the field exists and absent from a run started before it existed. It never changes while the run exists.",
|
|
3270
|
+
} as const;
|
|
3271
|
+
|
|
3210
3272
|
export const LiveRunDetailSchema = {
|
|
3211
3273
|
description:
|
|
3212
3274
|
"A run as returned by `GET /live/{runId}`, the full state of `LiveRun` plus when it last changed.",
|
|
@@ -3218,6 +3280,9 @@ export const LiveRunDetailSchema = {
|
|
|
3218
3280
|
type: "object",
|
|
3219
3281
|
required: ["updatedAtMs"],
|
|
3220
3282
|
properties: {
|
|
3283
|
+
warmFrom: {
|
|
3284
|
+
$ref: "#/components/schemas/WarmFrom",
|
|
3285
|
+
},
|
|
3221
3286
|
updatedAtMs: {
|
|
3222
3287
|
type: "integer",
|
|
3223
3288
|
format: "int64",
|
|
@@ -3230,9 +3295,9 @@ export const LiveRunDetailSchema = {
|
|
|
3230
3295
|
} as const;
|
|
3231
3296
|
|
|
3232
3297
|
export const LiveRunWithStreamSchema = {
|
|
3233
|
-
description: `A run as \`LiveRun\` describes it, plus its \`streamUrl\` when it has one. It is what **starting a run** and
|
|
3298
|
+
description: `A run as \`LiveRun\` describes it, plus its \`warmFrom\` (absent only for a run started before the field existed) and its \`streamUrl\` when it has one. It is what **starting a run** and
|
|
3234
3299
|
\`GET /strategy/{strategyId}/live\` return: your own run, read with your own credentials. Stopping a run
|
|
3235
|
-
and \`GET /live/{runId}\`
|
|
3300
|
+
returns \`LiveRun\`, which carries neither \`warmFrom\` nor the URL, and \`GET /live/{runId}\` returns \`LiveRunDetail\`, which carries \`warmFrom\` and never the URL.
|
|
3236
3301
|
`,
|
|
3237
3302
|
allOf: [
|
|
3238
3303
|
{
|
|
@@ -3241,6 +3306,9 @@ and \`GET /live/{runId}\` return \`LiveRun\`, which never carries the URL.
|
|
|
3241
3306
|
{
|
|
3242
3307
|
type: "object",
|
|
3243
3308
|
properties: {
|
|
3309
|
+
warmFrom: {
|
|
3310
|
+
$ref: "#/components/schemas/WarmFrom",
|
|
3311
|
+
},
|
|
3244
3312
|
streamUrl: {
|
|
3245
3313
|
type: "string",
|
|
3246
3314
|
format: "uri",
|
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -416,7 +416,7 @@ export const listStrategies = <ThrowOnError extends boolean = false>(
|
|
|
416
416
|
*
|
|
417
417
|
* The source is either **Java** — a class extending a strategy base class — or **QTScript**
|
|
418
418
|
* (beta), a compact strategy language whose braced bodies are plain Java. QTScript source
|
|
419
|
-
* begins with the `strategy` keyword — whitespace and
|
|
419
|
+
* begins with the `strategy` keyword — whitespace and line or block comments before it
|
|
420
420
|
* are ignored — and that is how the two are told apart: there is no separate endpoint and
|
|
421
421
|
* no header to set. Once registered, a strategy is used the same way
|
|
422
422
|
* whichever language it was written in.
|
|
@@ -1369,6 +1369,12 @@ export const getLive = <ThrowOnError extends boolean = false>(
|
|
|
1369
1369
|
* (fastest) cadence available for the exchange — today that is 1 tick/second on every
|
|
1370
1370
|
* supported exchange; choosing among several cadences is not offered yet.
|
|
1371
1371
|
*
|
|
1372
|
+
* `instruments` can be left out. A QTScript strategy can declare which instruments it accepts with an `instruments`
|
|
1373
|
+
* line in its source; when the compilation of the strategy records that selection as a list of pairs, a
|
|
1374
|
+
* start that leaves `instruments` out, or sends `["*"]`, takes that list, and otherwise the run reads every
|
|
1375
|
+
* instrument the exchange/segment offers. A list you send is taken as sent. Either side of an entry can be `*`
|
|
1376
|
+
* (any base paired with USDT). The instruments the run reads come back in `sources`. See the "Live execution" guide, "Sources".
|
|
1377
|
+
*
|
|
1372
1378
|
* `params` is passed straight through to the strategy at start — the same free-form object
|
|
1373
1379
|
* `POST /strategy/{strategyId}/validate` and the backtest endpoints already accept. To change
|
|
1374
1380
|
* a parameter **while the run is live**, use `PUT /live/{runId}/params` instead; this endpoint
|
|
@@ -1387,6 +1393,14 @@ export const getLive = <ThrowOnError extends boolean = false>(
|
|
|
1387
1393
|
* (it overrides `getExecutionCallback()`) has no other execution venue, so it cannot start
|
|
1388
1394
|
* without a `paper` block.
|
|
1389
1395
|
*
|
|
1396
|
+
* **Warming up.** Pass `warmFrom` to choose how many seconds before its start the run replays the market
|
|
1397
|
+
* feed from, so that its indicators and windows have history when the first live tick arrives. `0` replays
|
|
1398
|
+
* nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the
|
|
1399
|
+
* first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute
|
|
1400
|
+
* block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is
|
|
1401
|
+
* complete. The value in effect, yours or the platform's, comes back as `warmFrom`. It can be set only here,
|
|
1402
|
+
* when the run is started. See the "Live execution" guide, "Warming up".
|
|
1403
|
+
*
|
|
1390
1404
|
* **A plain WebSocket stream.** Pass `stream: true` to get a secret URL for this run's signals that a simple
|
|
1391
1405
|
* client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage
|
|
1392
1406
|
* on. The URL is in the response (`streamUrl`) and in `GET /strategy/{strategyId}/live`; treat it like a
|
|
@@ -1800,13 +1800,33 @@ export type LiveSource = {
|
|
|
1800
1800
|
*/
|
|
1801
1801
|
type: "ticker" | "kline";
|
|
1802
1802
|
/**
|
|
1803
|
-
*
|
|
1803
|
+
* The instruments the run reads. For a run started with a list, that list as sent; for one started without `instruments`, or with `["*"]`, what the start resolved: the list of pairs the compilation of the strategy records as the instruments it accepts, when it records one, or `["*"]` for every instrument the exchange/segment offers (tier-gated). An entry is written `BASE/QUOTE` and either side can be `*` to mean any, such as any base paired with USDT. Symbols are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument.
|
|
1804
1804
|
*/
|
|
1805
1805
|
instruments: Array<string>;
|
|
1806
1806
|
};
|
|
1807
1807
|
|
|
1808
|
+
/**
|
|
1809
|
+
* One market feed to start a live run on. Exactly one entry per run today. It is `LiveSource` as you ask for it: the only difference is that `instruments` can be left out.
|
|
1810
|
+
*/
|
|
1811
|
+
export type LiveSourceRequest = {
|
|
1812
|
+
/**
|
|
1813
|
+
* Venue category. `cx` (centralized exchange) is the only one live runs support today.
|
|
1814
|
+
*/
|
|
1815
|
+
venueType: string;
|
|
1816
|
+
exchange: string;
|
|
1817
|
+
segment: string;
|
|
1818
|
+
/**
|
|
1819
|
+
* Both `ticker` and `kline` connect to the lightest (fastest) cadence available for the exchange — today, 1 tick/second on every supported exchange. Choosing a specific cadence is not offered yet.
|
|
1820
|
+
*/
|
|
1821
|
+
type: "ticker" | "kline";
|
|
1822
|
+
/**
|
|
1823
|
+
* Which instruments the run reads. A QTScript strategy can declare which instruments it accepts with an `instruments` line in its source. When the compilation of the strategy records that selection as a list of pairs, leaving `instruments` out, or sending `["*"]`, takes that list; otherwise the run reads every instrument the exchange/segment offers. A list of instruments is taken as sent, and `[]` and `null` are refused with `400`. An entry is written `BASE/QUOTE`; either side can be `*` to mean any: any base can be paired with USDT, and BTC can be paired with any quote. Entries are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument. An entry that is not of that form (no `/`, an empty side, a `.` or a space inside a side, or a `*` mixed with other characters of a side) makes the run fail when it starts. Plan limits: a list with an entry that has a `*` on a side counts like `["*"]` and only plans that include the wildcard accept it; the other entries are counted one by one. The instruments the run actually reads come back in the run's `sources`.
|
|
1824
|
+
*/
|
|
1825
|
+
instruments?: Array<string>;
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1808
1828
|
export type StartLiveRequest = {
|
|
1809
|
-
sources: [
|
|
1829
|
+
sources: [LiveSourceRequest];
|
|
1810
1830
|
/**
|
|
1811
1831
|
* Strategy parameters to start with. Opaque key/value pairs — see this strategy's own `declaredProperties` (from `POST /strategy`) for the keys it accepts.
|
|
1812
1832
|
*/
|
|
@@ -1831,6 +1851,21 @@ export type StartLiveRequest = {
|
|
|
1831
1851
|
*
|
|
1832
1852
|
*/
|
|
1833
1853
|
stream?: boolean;
|
|
1854
|
+
/**
|
|
1855
|
+
* How many seconds before the run's start to replay the market feed from, so the strategy's indicators and
|
|
1856
|
+
* windows have history when its first live tick arrives. `0` replays nothing: the run delivers its first
|
|
1857
|
+
* signal as soon as it is running, but its indicators start empty and the first bar of a window can be
|
|
1858
|
+
* partial. Omitted, the platform replays from the start of the current 15-minute block: between 0 and 900
|
|
1859
|
+
* seconds before the run's start, depending on when it starts (0 if it starts exactly on a quarter hour),
|
|
1860
|
+
* so the first bar of a 15-minute window is complete. The value in effect, the one you sent or the one the
|
|
1861
|
+
* platform chose, is reported back as `warmFrom` on the run. Signals about the replayed time
|
|
1862
|
+
* are not pushed on the run's channel or stream: they describe events from before the run started.
|
|
1863
|
+
* It can be set **only when the run is started**: it is not a parameter of `PUT /live/{runId}/params`, and
|
|
1864
|
+
* changing it means stopping the run and starting it again. Anything that is not an integer from 0 to 3600
|
|
1865
|
+
* is `400`. See the "Live execution" guide, "Warming up".
|
|
1866
|
+
*
|
|
1867
|
+
*/
|
|
1868
|
+
warmFrom?: number;
|
|
1834
1869
|
name?: string;
|
|
1835
1870
|
description?: string;
|
|
1836
1871
|
paper?: LivePaperConfig;
|
|
@@ -1905,7 +1940,7 @@ export type SendLiveCommandRequest = {
|
|
|
1905
1940
|
};
|
|
1906
1941
|
|
|
1907
1942
|
/**
|
|
1908
|
-
* A live run's full state, as returned by
|
|
1943
|
+
* A live run's full state, as returned by stopping it through its strategy, and the base of the representations returned by starting and by reading it. `warmFrom` is declared by those two (`LiveRunWithStream` and `LiveRunDetail`) and not here, because the response to stopping a run does not carry it.
|
|
1909
1944
|
*/
|
|
1910
1945
|
export type LiveRun = {
|
|
1911
1946
|
strategyId: StrategyId;
|
|
@@ -2017,10 +2052,16 @@ export type LiveRunStats = {
|
|
|
2017
2052
|
stale: boolean;
|
|
2018
2053
|
};
|
|
2019
2054
|
|
|
2055
|
+
/**
|
|
2056
|
+
* The `warmFrom` in effect for this run, in seconds: the one requested when the run was started or, when none was, the one the platform chose (the distance from the run's start back to the start of the current 15-minute block, 0 to 900). It is never `null`. It is present on every run started since the field exists and absent from a run started before it existed. It never changes while the run exists.
|
|
2057
|
+
*/
|
|
2058
|
+
export type WarmFrom = number;
|
|
2059
|
+
|
|
2020
2060
|
/**
|
|
2021
2061
|
* A run as returned by `GET /live/{runId}`, the full state of `LiveRun` plus when it last changed.
|
|
2022
2062
|
*/
|
|
2023
2063
|
export type LiveRunDetail = LiveRun & {
|
|
2064
|
+
warmFrom?: WarmFrom;
|
|
2024
2065
|
/**
|
|
2025
2066
|
* Epoch milliseconds of the run's last change, from any cause. It only moves forward, so of two reads of the same run the one with the larger value is the newer.
|
|
2026
2067
|
*/
|
|
@@ -2028,12 +2069,13 @@ export type LiveRunDetail = LiveRun & {
|
|
|
2028
2069
|
};
|
|
2029
2070
|
|
|
2030
2071
|
/**
|
|
2031
|
-
* A run as `LiveRun` describes it, plus its `streamUrl` when it has one. It is what **starting a run** and
|
|
2072
|
+
* A run as `LiveRun` describes it, plus its `warmFrom` (absent only for a run started before the field existed) and its `streamUrl` when it has one. It is what **starting a run** and
|
|
2032
2073
|
* `GET /strategy/{strategyId}/live` return: your own run, read with your own credentials. Stopping a run
|
|
2033
|
-
* and `GET /live/{runId}`
|
|
2074
|
+
* returns `LiveRun`, which carries neither `warmFrom` nor the URL, and `GET /live/{runId}` returns `LiveRunDetail`, which carries `warmFrom` and never the URL.
|
|
2034
2075
|
*
|
|
2035
2076
|
*/
|
|
2036
2077
|
export type LiveRunWithStream = LiveRun & {
|
|
2078
|
+
warmFrom?: WarmFrom;
|
|
2037
2079
|
/**
|
|
2038
2080
|
* The run's secret stream URL (`wss://…`). **Treat it like a password**: anyone who holds it can read
|
|
2039
2081
|
* this run's signals, from the sandbox stage on. Present only when the run was started with
|
|
@@ -3825,7 +3867,7 @@ export type StartLiveData = {
|
|
|
3825
3867
|
|
|
3826
3868
|
export type StartLiveErrors = {
|
|
3827
3869
|
/**
|
|
3828
|
-
* Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet.
|
|
3870
|
+
* Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet. A `warmFrom` that is not an integer from 0 to 3600. An `instruments` that is empty or `null`.
|
|
3829
3871
|
*/
|
|
3830
3872
|
400: ResponseError;
|
|
3831
3873
|
/**
|
|
@@ -4164,8 +4206,8 @@ export type GetLiveRunSignalsData = {
|
|
|
4164
4206
|
sinceMs?: number;
|
|
4165
4207
|
/**
|
|
4166
4208
|
* Narrow to one or more instruments. Omitted, or `*`, returns every instrument the run
|
|
4167
|
-
* covers. Accepts a single pair (`BTC/USDT`), either half as a wildcard (
|
|
4168
|
-
*
|
|
4209
|
+
* covers. Accepts a single pair (`BTC/USDT`), either half as a wildcard (any base paired
|
|
4210
|
+
* with that quote, or BTC paired with any quote), or a comma-separated
|
|
4169
4211
|
* list of pairs (`BTC/USDT,ETH/EUR`). Symbols are matched exactly, case included — pass
|
|
4170
4212
|
* them as this API reports them.
|
|
4171
4213
|
*
|