@qtsurfer/api-client 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,98 +0,0 @@
1
- import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
2
- import type { GetExchangesData, GetInstrumentsData, PostStrategyData, PostStrategyResponse, GetStrategyStatusData, PrepareBacktestingData, GetPreparationStatusData, ExecuteBacktestingData, CancelExecutionData, GetExecutionResultData } from './types.gen';
3
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
- /**
5
- * You can provide a client instance returned by `createClient()` instead of
6
- * individual options. This might be also useful if you want to implement a
7
- * custom client.
8
- */
9
- client?: Client;
10
- /**
11
- * You can pass arbitrary values through the `meta` object. This can be
12
- * used to access values that aren't defined as part of the SDK function.
13
- */
14
- meta?: Record<string, unknown>;
15
- };
16
- /**
17
- * Get a list of available exchanges
18
- */
19
- export declare const getExchanges: <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Exchange[], unknown, ThrowOnError>;
20
- /**
21
- * Get a list of Instruments from a specific exchange
22
- */
23
- export declare const getInstruments: <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").InstrumentDetail[], import("./types.gen").ResponseError, ThrowOnError>;
24
- /**
25
- * Compile a strategy from source code
26
- * Submits raw strategy source for compilation. By default the call is synchronous and returns
27
- * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue
28
- * the compile task and return immediately with a `jobId` — poll
29
- * `GET /strategy/{strategyId}` to check status.
30
- *
31
- * The `strategyId` is deterministic: the same source for the same user always produces the
32
- * same id.
33
- *
34
- */
35
- export declare const postStrategy: <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<PostStrategyResponse, import("./types.gen").ResponseError, ThrowOnError>;
36
- /**
37
- * Get the status of an async compile task
38
- * Polls the status of a strategy compilation. Useful when the strategy was submitted with
39
- * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
40
- *
41
- */
42
- export declare const getStrategyStatus: <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
43
- jobId?: string;
44
- status: "New" | "Started" | "Completed" | "Aborted" | "Failed";
45
- strategyId?: import("./types.gen").StrategyId;
46
- statusDetail?: string | null;
47
- }, import("./types.gen").ResponseError, ThrowOnError>;
48
- /**
49
- * Prepare backtesting data
50
- * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
51
- * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
52
- *
53
- * The same params always return the same `jobId` (idempotent). Repeated calls with identical
54
- * params do not enqueue duplicate work — they reuse the existing job.
55
- *
56
- */
57
- export declare const prepareBacktesting: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").AcceptedJob, import("./types.gen").ResponseError, ThrowOnError>;
58
- /**
59
- * Get the status of a prepare job
60
- * Retrieves the current state of the prepare job identified by `jobId`.
61
- * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
62
- *
63
- */
64
- export declare const getPreparationStatus: <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").JobState, import("./types.gen").ResponseError, ThrowOnError>;
65
- /**
66
- * Execute a compiled strategy against a prepared dataset
67
- * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
68
- * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are
69
- * recovered from the prepare job — they do not need to be sent again.
70
- *
71
- * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
72
- * for the result.
73
- *
74
- * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
75
- * `jobId` (idempotent).
76
- *
77
- */
78
- export declare const executeBacktesting: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").AcceptedJob, import("./types.gen").ResponseError, ThrowOnError>;
79
- /**
80
- * Cancel a running backtest execution
81
- * Requests cancellation of the specified execution. The execution
82
- * status will transition to `Aborted` once the cancellation is
83
- * processed. Cancellation is asynchronous — poll the GET endpoint
84
- * to confirm the final status.
85
- *
86
- */
87
- export declare const cancelExecution: <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
88
- status?: "cancelling";
89
- jobId?: string;
90
- }, import("./types.gen").ResponseError, ThrowOnError>;
91
- /**
92
- * Get the result of a backtest execution job
93
- * Retrieves the current state and results of the execute job identified by `jobId`.
94
- * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
95
- *
96
- */
97
- export declare const getExecutionResult: <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").BacktestJobResult, import("./types.gen").ResponseError, ThrowOnError>;
98
- //# sourceMappingURL=sdk.gen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAwB,kBAAkB,EAA+C,gBAAgB,EAAE,oBAAoB,EAAqB,qBAAqB,EAAqD,sBAAsB,EAAuD,wBAAwB,EAA2D,sBAAsB,EAAuD,mBAAmB,EAAiD,sBAAsB,EAAuD,MAAM,aAAa,CAAC;AAG9oB,MAAM,MAAM,OAAO,CAAC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AsB,EAAE,YAAY,CAAC,wIAe9H,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,mBAAmB,EAAE,YAAY,CAAC;;;qDAWxH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,sBAAsB,EAAE,YAAY,CAAC,8IAW9H,CAAC"}
@@ -1,177 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- import { client as _heyApiClient } from './client.gen';
3
- /**
4
- * Get a list of available exchanges
5
- */
6
- export const getExchanges = (options) => {
7
- return (options?.client ?? _heyApiClient).get({
8
- url: '/exchanges',
9
- ...options
10
- });
11
- };
12
- /**
13
- * Get a list of Instruments from a specific exchange
14
- */
15
- export const getInstruments = (options) => {
16
- return (options.client ?? _heyApiClient).get({
17
- url: '/exchange/{exchangeId}/instruments',
18
- ...options
19
- });
20
- };
21
- /**
22
- * Compile a strategy from source code
23
- * Submits raw strategy source for compilation. By default the call is synchronous and returns
24
- * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue
25
- * the compile task and return immediately with a `jobId` — poll
26
- * `GET /strategy/{strategyId}` to check status.
27
- *
28
- * The `strategyId` is deterministic: the same source for the same user always produces the
29
- * same id.
30
- *
31
- */
32
- export const postStrategy = (options) => {
33
- return (options.client ?? _heyApiClient).post({
34
- bodySerializer: null,
35
- security: [
36
- {
37
- scheme: 'bearer',
38
- type: 'http'
39
- }
40
- ],
41
- url: '/strategy',
42
- ...options,
43
- headers: {
44
- 'Content-Type': 'text/plain',
45
- ...options?.headers
46
- }
47
- });
48
- };
49
- /**
50
- * Get the status of an async compile task
51
- * Polls the status of a strategy compilation. Useful when the strategy was submitted with
52
- * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
53
- *
54
- */
55
- export const getStrategyStatus = (options) => {
56
- return (options.client ?? _heyApiClient).get({
57
- security: [
58
- {
59
- scheme: 'bearer',
60
- type: 'http'
61
- }
62
- ],
63
- url: '/strategy/{strategyId}',
64
- ...options
65
- });
66
- };
67
- /**
68
- * Prepare backtesting data
69
- * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
70
- * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
71
- *
72
- * The same params always return the same `jobId` (idempotent). Repeated calls with identical
73
- * params do not enqueue duplicate work — they reuse the existing job.
74
- *
75
- */
76
- export const prepareBacktesting = (options) => {
77
- return (options.client ?? _heyApiClient).post({
78
- security: [
79
- {
80
- scheme: 'bearer',
81
- type: 'http'
82
- }
83
- ],
84
- url: '/backtest/{exchangeId}/{type}/prepare',
85
- ...options,
86
- headers: {
87
- 'Content-Type': 'application/json',
88
- ...options?.headers
89
- }
90
- });
91
- };
92
- /**
93
- * Get the status of a prepare job
94
- * Retrieves the current state of the prepare job identified by `jobId`.
95
- * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
96
- *
97
- */
98
- export const getPreparationStatus = (options) => {
99
- return (options.client ?? _heyApiClient).get({
100
- security: [
101
- {
102
- scheme: 'bearer',
103
- type: 'http'
104
- }
105
- ],
106
- url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',
107
- ...options
108
- });
109
- };
110
- /**
111
- * Execute a compiled strategy against a prepared dataset
112
- * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
113
- * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are
114
- * recovered from the prepare job — they do not need to be sent again.
115
- *
116
- * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
117
- * for the result.
118
- *
119
- * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same
120
- * `jobId` (idempotent).
121
- *
122
- */
123
- export const executeBacktesting = (options) => {
124
- return (options.client ?? _heyApiClient).post({
125
- security: [
126
- {
127
- scheme: 'bearer',
128
- type: 'http'
129
- }
130
- ],
131
- url: '/backtest/{exchangeId}/{type}/execute',
132
- ...options,
133
- headers: {
134
- 'Content-Type': 'application/json',
135
- ...options?.headers
136
- }
137
- });
138
- };
139
- /**
140
- * Cancel a running backtest execution
141
- * Requests cancellation of the specified execution. The execution
142
- * status will transition to `Aborted` once the cancellation is
143
- * processed. Cancellation is asynchronous — poll the GET endpoint
144
- * to confirm the final status.
145
- *
146
- */
147
- export const cancelExecution = (options) => {
148
- return (options.client ?? _heyApiClient).delete({
149
- security: [
150
- {
151
- scheme: 'bearer',
152
- type: 'http'
153
- }
154
- ],
155
- url: '/backtest/{exchangeId}/{type}/execute/{jobId}',
156
- ...options
157
- });
158
- };
159
- /**
160
- * Get the result of a backtest execution job
161
- * Retrieves the current state and results of the execute job identified by `jobId`.
162
- * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
163
- *
164
- */
165
- export const getExecutionResult = (options) => {
166
- return (options.client ?? _heyApiClient).get({
167
- security: [
168
- {
169
- scheme: 'bearer',
170
- type: 'http'
171
- }
172
- ],
173
- url: '/backtest/{exchangeId}/{type}/execute/{jobId}',
174
- ...options
175
- });
176
- };
177
- //# sourceMappingURL=sdk.gen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.gen.js","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAIrD,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAgBvD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAuC,OAAiD,EAAE,EAAE;IACpH,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,aAAa,CAAC,CAAC,GAAG,CAA8C;QACvF,GAAG,EAAE,YAAY;QACjB,GAAG,OAAO;KACb,CAAC,CAAC;AACP,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAuC,OAAkD,EAAE,EAAE;IACvH,OAAO,CAAC,OA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