@clear-street/studio-sdk 0.1.0-alpha.4
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/CHANGELOG.md +47 -0
- package/LICENSE +201 -0
- package/README.md +288 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +239 -0
- package/core.d.ts.map +1 -0
- package/core.js +881 -0
- package/core.js.map +1 -0
- package/core.mjs +850 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +128 -0
- package/index.d.ts +128 -0
- package/index.d.ts.map +1 -0
- package/index.js +112 -0
- package/index.js.map +1 -0
- package/index.mjs +84 -0
- package/index.mjs.map +1 -0
- package/package.json +104 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/accounts/accounts.d.ts +74 -0
- package/resources/accounts/accounts.d.ts.map +1 -0
- package/resources/accounts/accounts.js +73 -0
- package/resources/accounts/accounts.js.map +1 -0
- package/resources/accounts/accounts.mjs +46 -0
- package/resources/accounts/accounts.mjs.map +1 -0
- package/resources/accounts/bulk-orders.d.ts +137 -0
- package/resources/accounts/bulk-orders.d.ts.map +1 -0
- package/resources/accounts/bulk-orders.js +29 -0
- package/resources/accounts/bulk-orders.js.map +1 -0
- package/resources/accounts/bulk-orders.mjs +25 -0
- package/resources/accounts/bulk-orders.mjs.map +1 -0
- package/resources/accounts/easy-borrows.d.ts +17 -0
- package/resources/accounts/easy-borrows.d.ts.map +1 -0
- package/resources/accounts/easy-borrows.js +18 -0
- package/resources/accounts/easy-borrows.js.map +1 -0
- package/resources/accounts/easy-borrows.mjs +14 -0
- package/resources/accounts/easy-borrows.mjs.map +1 -0
- package/resources/accounts/index.d.ts +10 -0
- package/resources/accounts/index.d.ts.map +1 -0
- package/resources/accounts/index.js +23 -0
- package/resources/accounts/index.js.map +1 -0
- package/resources/accounts/index.mjs +11 -0
- package/resources/accounts/index.mjs.map +1 -0
- package/resources/accounts/locate-orders.d.ts +56 -0
- package/resources/accounts/locate-orders.d.ts.map +1 -0
- package/resources/accounts/locate-orders.js +39 -0
- package/resources/accounts/locate-orders.js.map +1 -0
- package/resources/accounts/locate-orders.mjs +35 -0
- package/resources/accounts/locate-orders.mjs.map +1 -0
- package/resources/accounts/orders.d.ts +168 -0
- package/resources/accounts/orders.d.ts.map +1 -0
- package/resources/accounts/orders.js +53 -0
- package/resources/accounts/orders.js.map +1 -0
- package/resources/accounts/orders.mjs +49 -0
- package/resources/accounts/orders.mjs.map +1 -0
- package/resources/accounts/pnl-details.d.ts +113 -0
- package/resources/accounts/pnl-details.d.ts.map +1 -0
- package/resources/accounts/pnl-details.js +17 -0
- package/resources/accounts/pnl-details.js.map +1 -0
- package/resources/accounts/pnl-details.mjs +13 -0
- package/resources/accounts/pnl-details.mjs.map +1 -0
- package/resources/accounts/pnl-summary.d.ts +10 -0
- package/resources/accounts/pnl-summary.d.ts.map +1 -0
- package/resources/accounts/pnl-summary.js +15 -0
- package/resources/accounts/pnl-summary.js.map +1 -0
- package/resources/accounts/pnl-summary.mjs +11 -0
- package/resources/accounts/pnl-summary.mjs.map +1 -0
- package/resources/accounts/positions.d.ts +37 -0
- package/resources/accounts/positions.d.ts.map +1 -0
- package/resources/accounts/positions.js +24 -0
- package/resources/accounts/positions.js.map +1 -0
- package/resources/accounts/positions.mjs +20 -0
- package/resources/accounts/positions.mjs.map +1 -0
- package/resources/accounts/trades.d.ts +37 -0
- package/resources/accounts/trades.d.ts.map +1 -0
- package/resources/accounts/trades.js +24 -0
- package/resources/accounts/trades.js.map +1 -0
- package/resources/accounts/trades.mjs +20 -0
- package/resources/accounts/trades.mjs.map +1 -0
- package/resources/entities/entities.d.ts +458 -0
- package/resources/entities/entities.d.ts.map +1 -0
- package/resources/entities/entities.js +61 -0
- package/resources/entities/entities.js.map +1 -0
- package/resources/entities/entities.mjs +34 -0
- package/resources/entities/entities.mjs.map +1 -0
- package/resources/entities/index.d.ts +6 -0
- package/resources/entities/index.d.ts.map +1 -0
- package/resources/entities/index.js +15 -0
- package/resources/entities/index.js.map +1 -0
- package/resources/entities/index.mjs +7 -0
- package/resources/entities/index.mjs.map +1 -0
- package/resources/entities/pnl-summaries.d.ts +10 -0
- package/resources/entities/pnl-summaries.d.ts.map +1 -0
- package/resources/entities/pnl-summaries.js +15 -0
- package/resources/entities/pnl-summaries.js.map +1 -0
- package/resources/entities/pnl-summaries.mjs +11 -0
- package/resources/entities/pnl-summaries.mjs.map +1 -0
- package/resources/entities/portfolio-margins.d.ts +10 -0
- package/resources/entities/portfolio-margins.d.ts.map +1 -0
- package/resources/entities/portfolio-margins.js +15 -0
- package/resources/entities/portfolio-margins.js.map +1 -0
- package/resources/entities/portfolio-margins.mjs +11 -0
- package/resources/entities/portfolio-margins.mjs.map +1 -0
- package/resources/entities/regt-margin-simulations.d.ts +97 -0
- package/resources/entities/regt-margin-simulations.d.ts.map +1 -0
- package/resources/entities/regt-margin-simulations.js +30 -0
- package/resources/entities/regt-margin-simulations.js.map +1 -0
- package/resources/entities/regt-margin-simulations.mjs +26 -0
- package/resources/entities/regt-margin-simulations.mjs.map +1 -0
- package/resources/entities/regt-margins.d.ts +10 -0
- package/resources/entities/regt-margins.d.ts.map +1 -0
- package/resources/entities/regt-margins.js +15 -0
- package/resources/entities/regt-margins.js.map +1 -0
- package/resources/entities/regt-margins.mjs +11 -0
- package/resources/entities/regt-margins.mjs.map +1 -0
- package/resources/index.d.ts +5 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +26 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -0
- package/resources/instruments.d.ts +45 -0
- package/resources/instruments.d.ts.map +1 -0
- package/resources/instruments.js +18 -0
- package/resources/instruments.js.map +1 -0
- package/resources/instruments.mjs +14 -0
- package/resources/instruments.mjs.map +1 -0
- package/resources/shared.d.ts +251 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1165 -0
- package/src/error.ts +146 -0
- package/src/index.ts +206 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/accounts/accounts.ts +87 -0
- package/src/resources/accounts/bulk-orders.ts +163 -0
- package/src/resources/accounts/easy-borrows.ts +23 -0
- package/src/resources/accounts/index.ts +25 -0
- package/src/resources/accounts/locate-orders.ts +94 -0
- package/src/resources/accounts/orders.ts +246 -0
- package/src/resources/accounts/pnl-details.ts +143 -0
- package/src/resources/accounts/pnl-summary.ts +14 -0
- package/src/resources/accounts/positions.ts +66 -0
- package/src/resources/accounts/trades.ts +62 -0
- package/src/resources/entities/entities.ts +562 -0
- package/src/resources/entities/index.ts +12 -0
- package/src/resources/entities/pnl-summaries.ts +14 -0
- package/src/resources/entities/portfolio-margins.ts +14 -0
- package/src/resources/entities/regt-margin-simulations.ts +127 -0
- package/src/resources/entities/regt-margins.ts +14 -0
- package/src/resources/index.ts +13 -0
- package/src/resources/instruments.ts +70 -0
- package/src/resources/shared.ts +320 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +248 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +165 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +152 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
package/src/error.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { castToError, Headers } from './core';
|
|
4
|
+
|
|
5
|
+
export class StudioSDKError extends Error {}
|
|
6
|
+
|
|
7
|
+
export class APIError extends StudioSDKError {
|
|
8
|
+
readonly status: number | undefined;
|
|
9
|
+
readonly headers: Headers | undefined;
|
|
10
|
+
readonly error: Object | undefined;
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
status: number | undefined,
|
|
14
|
+
error: Object | undefined,
|
|
15
|
+
message: string | undefined,
|
|
16
|
+
headers: Headers | undefined,
|
|
17
|
+
) {
|
|
18
|
+
super(`${APIError.makeMessage(status, error, message)}`);
|
|
19
|
+
this.status = status;
|
|
20
|
+
this.headers = headers;
|
|
21
|
+
this.error = error;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private static makeMessage(status: number | undefined, error: any, message: string | undefined) {
|
|
25
|
+
const msg =
|
|
26
|
+
error?.message ?
|
|
27
|
+
typeof error.message === 'string' ?
|
|
28
|
+
error.message
|
|
29
|
+
: JSON.stringify(error.message)
|
|
30
|
+
: error ? JSON.stringify(error)
|
|
31
|
+
: message;
|
|
32
|
+
|
|
33
|
+
if (status && msg) {
|
|
34
|
+
return `${status} ${msg}`;
|
|
35
|
+
}
|
|
36
|
+
if (status) {
|
|
37
|
+
return `${status} status code (no body)`;
|
|
38
|
+
}
|
|
39
|
+
if (msg) {
|
|
40
|
+
return msg;
|
|
41
|
+
}
|
|
42
|
+
return '(no status code or body)';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static generate(
|
|
46
|
+
status: number | undefined,
|
|
47
|
+
errorResponse: Object | undefined,
|
|
48
|
+
message: string | undefined,
|
|
49
|
+
headers: Headers | undefined,
|
|
50
|
+
) {
|
|
51
|
+
if (!status) {
|
|
52
|
+
return new APIConnectionError({ cause: castToError(errorResponse) });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const error = errorResponse as Record<string, any>;
|
|
56
|
+
|
|
57
|
+
if (status === 400) {
|
|
58
|
+
return new BadRequestError(status, error, message, headers);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (status === 401) {
|
|
62
|
+
return new AuthenticationError(status, error, message, headers);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (status === 403) {
|
|
66
|
+
return new PermissionDeniedError(status, error, message, headers);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (status === 404) {
|
|
70
|
+
return new NotFoundError(status, error, message, headers);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (status === 409) {
|
|
74
|
+
return new ConflictError(status, error, message, headers);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (status === 422) {
|
|
78
|
+
return new UnprocessableEntityError(status, error, message, headers);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (status === 429) {
|
|
82
|
+
return new RateLimitError(status, error, message, headers);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (status >= 500) {
|
|
86
|
+
return new InternalServerError(status, error, message, headers);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return new APIError(status, error, message, headers);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class APIUserAbortError extends APIError {
|
|
94
|
+
override readonly status: undefined = undefined;
|
|
95
|
+
|
|
96
|
+
constructor({ message }: { message?: string } = {}) {
|
|
97
|
+
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export class APIConnectionError extends APIError {
|
|
102
|
+
override readonly status: undefined = undefined;
|
|
103
|
+
|
|
104
|
+
constructor({ message, cause }: { message?: string; cause?: Error | undefined }) {
|
|
105
|
+
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
106
|
+
// in some environments the 'cause' property is already declared
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
if (cause) this.cause = cause;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export class APIConnectionTimeoutError extends APIConnectionError {
|
|
113
|
+
constructor({ message }: { message?: string } = {}) {
|
|
114
|
+
super({ message: message ?? 'Request timed out.' });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class BadRequestError extends APIError {
|
|
119
|
+
override readonly status: 400 = 400;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class AuthenticationError extends APIError {
|
|
123
|
+
override readonly status: 401 = 401;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export class PermissionDeniedError extends APIError {
|
|
127
|
+
override readonly status: 403 = 403;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export class NotFoundError extends APIError {
|
|
131
|
+
override readonly status: 404 = 404;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export class ConflictError extends APIError {
|
|
135
|
+
override readonly status: 409 = 409;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class UnprocessableEntityError extends APIError {
|
|
139
|
+
override readonly status: 422 = 422;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export class RateLimitError extends APIError {
|
|
143
|
+
override readonly status: 429 = 429;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export class InternalServerError extends APIError {}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Errors from './error';
|
|
4
|
+
import * as Uploads from './uploads';
|
|
5
|
+
import { type Agent } from './_shims/index';
|
|
6
|
+
import * as Core from "./core";
|
|
7
|
+
import * as API from "./resources/index";
|
|
8
|
+
|
|
9
|
+
export interface ClientOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Defaults to process.env['STUDIO_SDK_BEARER_TOKEN'].
|
|
12
|
+
*/
|
|
13
|
+
bearerToken?: string | undefined;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
17
|
+
*
|
|
18
|
+
* Defaults to process.env['STUDIO_SDK_BASE_URL'].
|
|
19
|
+
*/
|
|
20
|
+
baseURL?: string | null | undefined;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
24
|
+
* from the server before timing out a single request.
|
|
25
|
+
*
|
|
26
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
27
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
28
|
+
*/
|
|
29
|
+
timeout?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An HTTP agent used to manage HTTP(S) connections.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
35
|
+
* otherwise no agent is used.
|
|
36
|
+
*/
|
|
37
|
+
httpAgent?: Agent;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Specify a custom `fetch` function implementation.
|
|
41
|
+
*
|
|
42
|
+
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
43
|
+
* defined globally.
|
|
44
|
+
*/
|
|
45
|
+
fetch?: Core.Fetch | undefined;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
49
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
50
|
+
*
|
|
51
|
+
* @default 2
|
|
52
|
+
*/
|
|
53
|
+
maxRetries?: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Default headers to include with every request to the API.
|
|
57
|
+
*
|
|
58
|
+
* These can be removed in individual requests by explicitly setting the
|
|
59
|
+
* header to `undefined` or `null` in request options.
|
|
60
|
+
*/
|
|
61
|
+
defaultHeaders?: Core.Headers;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Default query parameters to include with every request to the API.
|
|
65
|
+
*
|
|
66
|
+
* These can be removed in individual requests by explicitly setting the
|
|
67
|
+
* param to `undefined` in request options.
|
|
68
|
+
*/
|
|
69
|
+
defaultQuery?: Core.DefaultQuery;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* API Client for interfacing with the Studio SDK API.
|
|
74
|
+
*/
|
|
75
|
+
export class StudioSDK extends Core.APIClient {
|
|
76
|
+
bearerToken: string;
|
|
77
|
+
|
|
78
|
+
private _options: ClientOptions;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* API Client for interfacing with the Studio SDK API.
|
|
82
|
+
*
|
|
83
|
+
* @param {string | undefined} [opts.bearerToken=process.env['STUDIO_SDK_BEARER_TOKEN'] ?? undefined]
|
|
84
|
+
* @param {string} [opts.baseURL=process.env['STUDIO_SDK_BASE_URL'] ?? https://api.clearstreet.io/studio/v2] - Override the default base URL for the API.
|
|
85
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
86
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
87
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
88
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
89
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
90
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
91
|
+
*/
|
|
92
|
+
constructor({
|
|
93
|
+
baseURL = Core.readEnv('STUDIO_SDK_BASE_URL'),
|
|
94
|
+
bearerToken = Core.readEnv('STUDIO_SDK_BEARER_TOKEN'),
|
|
95
|
+
...opts
|
|
96
|
+
}: ClientOptions = {}) {
|
|
97
|
+
if (bearerToken === undefined) {
|
|
98
|
+
throw new Errors.StudioSDKError(
|
|
99
|
+
"The STUDIO_SDK_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the StudioSDK client with an bearerToken option, like new StudioSDK({ bearerToken: 'My Bearer Token' }).",
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const options: ClientOptions = {
|
|
104
|
+
bearerToken,
|
|
105
|
+
...opts,
|
|
106
|
+
baseURL: baseURL || `https://api.clearstreet.io/studio/v2`,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
super({
|
|
110
|
+
baseURL: options.baseURL!,
|
|
111
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
112
|
+
httpAgent: options.httpAgent,
|
|
113
|
+
maxRetries: options.maxRetries,
|
|
114
|
+
fetch: options.fetch,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
this._options = options;
|
|
118
|
+
|
|
119
|
+
this.bearerToken = bearerToken;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
entities: API.Entities = new API.Entities(this);
|
|
123
|
+
accounts: API.Accounts = new API.Accounts(this);
|
|
124
|
+
instruments: API.Instruments = new API.Instruments(this);
|
|
125
|
+
|
|
126
|
+
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
127
|
+
return this._options.defaultQuery;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
protected override defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
131
|
+
return {
|
|
132
|
+
...super.defaultHeaders(opts),
|
|
133
|
+
...this._options.defaultHeaders,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
138
|
+
return { Authorization: `Bearer ${this.bearerToken}` };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static StudioSDK = this;
|
|
142
|
+
|
|
143
|
+
static StudioSDKError = Errors.StudioSDKError;
|
|
144
|
+
static APIError = Errors.APIError;
|
|
145
|
+
static APIConnectionError = Errors.APIConnectionError;
|
|
146
|
+
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
147
|
+
static APIUserAbortError = Errors.APIUserAbortError;
|
|
148
|
+
static NotFoundError = Errors.NotFoundError;
|
|
149
|
+
static ConflictError = Errors.ConflictError;
|
|
150
|
+
static RateLimitError = Errors.RateLimitError;
|
|
151
|
+
static BadRequestError = Errors.BadRequestError;
|
|
152
|
+
static AuthenticationError = Errors.AuthenticationError;
|
|
153
|
+
static InternalServerError = Errors.InternalServerError;
|
|
154
|
+
static PermissionDeniedError = Errors.PermissionDeniedError;
|
|
155
|
+
static UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
156
|
+
|
|
157
|
+
static toFile = Uploads.toFile;
|
|
158
|
+
static fileFromPath = Uploads.fileFromPath;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const {
|
|
162
|
+
StudioSDKError,
|
|
163
|
+
APIError,
|
|
164
|
+
APIConnectionError,
|
|
165
|
+
APIConnectionTimeoutError,
|
|
166
|
+
APIUserAbortError,
|
|
167
|
+
NotFoundError,
|
|
168
|
+
ConflictError,
|
|
169
|
+
RateLimitError,
|
|
170
|
+
BadRequestError,
|
|
171
|
+
AuthenticationError,
|
|
172
|
+
InternalServerError,
|
|
173
|
+
PermissionDeniedError,
|
|
174
|
+
UnprocessableEntityError,
|
|
175
|
+
} = Errors;
|
|
176
|
+
|
|
177
|
+
export import toFile = Uploads.toFile;
|
|
178
|
+
export import fileFromPath = Uploads.fileFromPath;
|
|
179
|
+
|
|
180
|
+
export namespace StudioSDK {
|
|
181
|
+
export import RequestOptions = Core.RequestOptions;
|
|
182
|
+
|
|
183
|
+
export import Entities = API.Entities;
|
|
184
|
+
export import Entity = API.Entity;
|
|
185
|
+
export import PnlSummary = API.PnlSummary;
|
|
186
|
+
export import PortfolioMargin = API.PortfolioMargin;
|
|
187
|
+
export import RegtMargin = API.RegtMargin;
|
|
188
|
+
export import EntityListResponse = API.EntityListResponse;
|
|
189
|
+
|
|
190
|
+
export import Accounts = API.Accounts;
|
|
191
|
+
export import Account = API.Account;
|
|
192
|
+
export import AccountListResponse = API.AccountListResponse;
|
|
193
|
+
|
|
194
|
+
export import Instruments = API.Instruments;
|
|
195
|
+
export import Instrument = API.Instrument;
|
|
196
|
+
export import InstrumentRetrieveParams = API.InstrumentRetrieveParams;
|
|
197
|
+
|
|
198
|
+
export import LocateOrder = API.LocateOrder;
|
|
199
|
+
export import Order = API.Order;
|
|
200
|
+
export import PnlSummaryForAccount = API.PnlSummaryForAccount;
|
|
201
|
+
export import Position = API.Position;
|
|
202
|
+
export import RegtMarginSimulation = API.RegtMarginSimulation;
|
|
203
|
+
export import Trade = API.Trade;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export default StudioSDK;
|
package/src/lib/.keep
ADDED
package/src/resource.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import type { StudioSDK } from './index';
|
|
4
|
+
|
|
5
|
+
export class APIResource {
|
|
6
|
+
protected _client: StudioSDK;
|
|
7
|
+
|
|
8
|
+
constructor(client: StudioSDK) {
|
|
9
|
+
this._client = client;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as AccountsAPI from "./accounts";
|
|
6
|
+
import * as BulkOrdersAPI from "./bulk-orders";
|
|
7
|
+
import * as EasyBorrowsAPI from "./easy-borrows";
|
|
8
|
+
import * as LocateOrdersAPI from "./locate-orders";
|
|
9
|
+
import * as OrdersAPI from "./orders";
|
|
10
|
+
import * as PnlDetailsAPI from "./pnl-details";
|
|
11
|
+
import * as PnlSummaryAPI from "./pnl-summary";
|
|
12
|
+
import * as PositionsAPI from "./positions";
|
|
13
|
+
import * as TradesAPI from "./trades";
|
|
14
|
+
|
|
15
|
+
export class Accounts extends APIResource {
|
|
16
|
+
bulkOrders: BulkOrdersAPI.BulkOrders = new BulkOrdersAPI.BulkOrders(this._client);
|
|
17
|
+
orders: OrdersAPI.Orders = new OrdersAPI.Orders(this._client);
|
|
18
|
+
trades: TradesAPI.Trades = new TradesAPI.Trades(this._client);
|
|
19
|
+
positions: PositionsAPI.Positions = new PositionsAPI.Positions(this._client);
|
|
20
|
+
locateOrders: LocateOrdersAPI.LocateOrders = new LocateOrdersAPI.LocateOrders(this._client);
|
|
21
|
+
easyBorrows: EasyBorrowsAPI.EasyBorrows = new EasyBorrowsAPI.EasyBorrows(this._client);
|
|
22
|
+
pnlSummary: PnlSummaryAPI.PnlSummary = new PnlSummaryAPI.PnlSummary(this._client);
|
|
23
|
+
pnlDetails: PnlDetailsAPI.PnlDetails = new PnlDetailsAPI.PnlDetails(this._client);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get an account by its ID.
|
|
27
|
+
*/
|
|
28
|
+
retrieve(accountId: string, options?: Core.RequestOptions): Core.APIPromise<Account> {
|
|
29
|
+
return this._client.get(`/accounts/${accountId}`, options);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* List all available accounts.
|
|
34
|
+
*/
|
|
35
|
+
list(options?: Core.RequestOptions): Core.APIPromise<AccountListResponse> {
|
|
36
|
+
return this._client.get('/accounts', options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Account {
|
|
41
|
+
/**
|
|
42
|
+
* Account ID for the account.
|
|
43
|
+
*/
|
|
44
|
+
account_id: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Entity ID for the legal entity.
|
|
48
|
+
*/
|
|
49
|
+
entity_id: string;
|
|
50
|
+
|
|
51
|
+
name: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface AccountListResponse {
|
|
55
|
+
data?: Array<Account>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export namespace Accounts {
|
|
59
|
+
export import Account = AccountsAPI.Account;
|
|
60
|
+
export import AccountListResponse = AccountsAPI.AccountListResponse;
|
|
61
|
+
export import BulkOrders = BulkOrdersAPI.BulkOrders;
|
|
62
|
+
export import BulkOrderCreateResponse = BulkOrdersAPI.BulkOrderCreateResponse;
|
|
63
|
+
export import BulkOrderCreateParams = BulkOrdersAPI.BulkOrderCreateParams;
|
|
64
|
+
export import Orders = OrdersAPI.Orders;
|
|
65
|
+
export import OrderCreateResponse = OrdersAPI.OrderCreateResponse;
|
|
66
|
+
export import OrderRetrieveResponse = OrdersAPI.OrderRetrieveResponse;
|
|
67
|
+
export import OrderListResponse = OrdersAPI.OrderListResponse;
|
|
68
|
+
export import OrderDeleteResponse = OrdersAPI.OrderDeleteResponse;
|
|
69
|
+
export import OrderCreateParams = OrdersAPI.OrderCreateParams;
|
|
70
|
+
export import OrderListParams = OrdersAPI.OrderListParams;
|
|
71
|
+
export import OrderDeleteParams = OrdersAPI.OrderDeleteParams;
|
|
72
|
+
export import Trades = TradesAPI.Trades;
|
|
73
|
+
export import TradeListResponse = TradesAPI.TradeListResponse;
|
|
74
|
+
export import TradeListParams = TradesAPI.TradeListParams;
|
|
75
|
+
export import Positions = PositionsAPI.Positions;
|
|
76
|
+
export import PositionListResponse = PositionsAPI.PositionListResponse;
|
|
77
|
+
export import PositionListParams = PositionsAPI.PositionListParams;
|
|
78
|
+
export import LocateOrders = LocateOrdersAPI.LocateOrders;
|
|
79
|
+
export import LocateOrderListResponse = LocateOrdersAPI.LocateOrderListResponse;
|
|
80
|
+
export import LocateOrderCreateParams = LocateOrdersAPI.LocateOrderCreateParams;
|
|
81
|
+
export import LocateOrderUpdateParams = LocateOrdersAPI.LocateOrderUpdateParams;
|
|
82
|
+
export import EasyBorrows = EasyBorrowsAPI.EasyBorrows;
|
|
83
|
+
export import EasyBorrowListResponse = EasyBorrowsAPI.EasyBorrowListResponse;
|
|
84
|
+
export import PnlSummary = PnlSummaryAPI.PnlSummary;
|
|
85
|
+
export import PnlDetails = PnlDetailsAPI.PnlDetails;
|
|
86
|
+
export import PnlDetailListResponse = PnlDetailsAPI.PnlDetailListResponse;
|
|
87
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as BulkOrdersAPI from "./bulk-orders";
|
|
6
|
+
|
|
7
|
+
export class BulkOrders extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Creates multiple orders in a single request, up to 1000. Note that a successful
|
|
10
|
+
* call to this endpoint does not necessarily mean your orders have been accepted,
|
|
11
|
+
* e.g. a downstream venue might reject your order. You should therefore utilize
|
|
12
|
+
* our WebSocket APIs to listen for changes in order lifecycle events.
|
|
13
|
+
*
|
|
14
|
+
* The response will contain an array of objects, indicating whether your order was
|
|
15
|
+
* submitted. If the order was submitted, the `order_id` field will be populated
|
|
16
|
+
* with the order ID assigned to this order. If the order was rejected, the
|
|
17
|
+
* `reason` field will be populated with the reason for rejection. The data array
|
|
18
|
+
* returned in the response object is guaranteed to be ordered in the same order as
|
|
19
|
+
* the orders you provided in the request. Again, note that even if your order was
|
|
20
|
+
* submitted, that doesn't mean it was _accepted_, and may still be rejected by
|
|
21
|
+
* downstream venues.
|
|
22
|
+
*/
|
|
23
|
+
create(
|
|
24
|
+
accountId: string,
|
|
25
|
+
body: BulkOrderCreateParams,
|
|
26
|
+
options?: Core.RequestOptions,
|
|
27
|
+
): Core.APIPromise<BulkOrderCreateResponse> {
|
|
28
|
+
return this._client.post(`/accounts/${accountId}/bulk-orders`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface BulkOrderCreateResponse {
|
|
33
|
+
/**
|
|
34
|
+
* Array indicating whether each respective order was submitted or not. This array
|
|
35
|
+
* is guaranteed to be sorted in the same order as the orders you provided in your
|
|
36
|
+
* request.
|
|
37
|
+
*/
|
|
38
|
+
data: Array<BulkOrderCreateResponse.Data>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Total number of orders rejected
|
|
42
|
+
*/
|
|
43
|
+
rejected: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Total number of orders submitted
|
|
47
|
+
*/
|
|
48
|
+
submitted: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace BulkOrderCreateResponse {
|
|
52
|
+
export interface Data {
|
|
53
|
+
/**
|
|
54
|
+
* True if the order was submitted successfully, false otherwise.
|
|
55
|
+
*/
|
|
56
|
+
submitted: boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* If the order was submitted, the order ID assigned to this order. Empty if the
|
|
60
|
+
* order was rejected.
|
|
61
|
+
*/
|
|
62
|
+
order_id?: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* If the order rejected, the reason for rejection. Empty if the order was
|
|
66
|
+
* accepted.
|
|
67
|
+
*/
|
|
68
|
+
reason?: string;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface BulkOrderCreateParams {
|
|
73
|
+
/**
|
|
74
|
+
* An array of orders to create.
|
|
75
|
+
*/
|
|
76
|
+
orders: Array<BulkOrderCreateParams.Order>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export namespace BulkOrderCreateParams {
|
|
80
|
+
export interface Order {
|
|
81
|
+
/**
|
|
82
|
+
* The type of order, can be one of the following:
|
|
83
|
+
*
|
|
84
|
+
* - `limit`: A limit order will execute at-or-better than the limit price you
|
|
85
|
+
* specify
|
|
86
|
+
* - `market`: An order that will execute at the prevailing market prices
|
|
87
|
+
*/
|
|
88
|
+
order_type: 'limit' | 'market';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The maximum quantity to be executed.
|
|
92
|
+
*/
|
|
93
|
+
quantity: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Buy, sell, sell-short indicator.
|
|
97
|
+
*/
|
|
98
|
+
side: 'buy' | 'sell' | 'sell-short';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Strategy type used for execution, can be one of below. Note, we use sensible
|
|
102
|
+
* defaults for strategy parameters at the moment. In future, we will provide a way
|
|
103
|
+
* to provide specify these parameters.
|
|
104
|
+
*
|
|
105
|
+
* - `sor`: Smart order router
|
|
106
|
+
* - `dark`: Dark pool
|
|
107
|
+
* - `ap`: Arrival price
|
|
108
|
+
* - `pov`: Percentage of volume
|
|
109
|
+
* - `twap`: Time weighted average price
|
|
110
|
+
* - `vwap`: Volume weighted average price
|
|
111
|
+
*
|
|
112
|
+
* For more information on these strategies, please refer to our
|
|
113
|
+
* [documentation](https://docs.clearstreet.io/studio/docs/execution-strategies).
|
|
114
|
+
*/
|
|
115
|
+
strategy_type: 'sor' | 'dark' | 'ap' | 'pov' | 'twap' | 'vwap';
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The symbol this order is for. See `symbol_format` for supported symbol formats.
|
|
119
|
+
*/
|
|
120
|
+
symbol: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The lifecycle enforcement of this order.
|
|
124
|
+
*
|
|
125
|
+
* - `day`: The order will exist for the duration of the current trading session
|
|
126
|
+
* - `ioc`: The order will immediately be executed or cancelled
|
|
127
|
+
* - `day-plus`: The order will exist only for the duration the current trading
|
|
128
|
+
* session plus extended hours, if applicable
|
|
129
|
+
* - `at-open`: The order will exist only for the opening auction of the next
|
|
130
|
+
* session
|
|
131
|
+
* - `at-close`: The order will exist only for the closing auction of the current
|
|
132
|
+
* session
|
|
133
|
+
*/
|
|
134
|
+
time_in_force: 'day' | 'ioc' | 'day-plus' | 'at-open' | 'at-close';
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Name of the broker that provided you inventory for a short-sale. Required if
|
|
138
|
+
* `side` is `sell-short`. If you procured inventory through us, you can use
|
|
139
|
+
* `CLST`.
|
|
140
|
+
*/
|
|
141
|
+
locate_broker?: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The price to execute at-or-better.
|
|
145
|
+
*/
|
|
146
|
+
price?: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* An ID that you provide.
|
|
150
|
+
*/
|
|
151
|
+
reference_id?: string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Denotes the format of the provided `symbol` field.
|
|
155
|
+
*/
|
|
156
|
+
symbol_format?: 'cms' | 'osi';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export namespace BulkOrders {
|
|
161
|
+
export import BulkOrderCreateResponse = BulkOrdersAPI.BulkOrderCreateResponse;
|
|
162
|
+
export import BulkOrderCreateParams = BulkOrdersAPI.BulkOrderCreateParams;
|
|
163
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as EasyBorrowsAPI from "./easy-borrows";
|
|
6
|
+
|
|
7
|
+
export class EasyBorrows extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List all current easy-to-borrow stock symbols. This list changes dynamically
|
|
10
|
+
* daily.
|
|
11
|
+
*/
|
|
12
|
+
list(accountId: string, options?: Core.RequestOptions): Core.APIPromise<EasyBorrowListResponse> {
|
|
13
|
+
return this._client.get(`/accounts/${accountId}/easy-borrows`, options);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface EasyBorrowListResponse {
|
|
18
|
+
data: Array<string>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export namespace EasyBorrows {
|
|
22
|
+
export import EasyBorrowListResponse = EasyBorrowsAPI.EasyBorrowListResponse;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Account, AccountListResponse, Accounts } from './accounts';
|
|
4
|
+
export { BulkOrderCreateResponse, BulkOrderCreateParams, BulkOrders } from './bulk-orders';
|
|
5
|
+
export { EasyBorrowListResponse, EasyBorrows } from './easy-borrows';
|
|
6
|
+
export {
|
|
7
|
+
LocateOrderListResponse,
|
|
8
|
+
LocateOrderCreateParams,
|
|
9
|
+
LocateOrderUpdateParams,
|
|
10
|
+
LocateOrders,
|
|
11
|
+
} from './locate-orders';
|
|
12
|
+
export {
|
|
13
|
+
OrderCreateResponse,
|
|
14
|
+
OrderRetrieveResponse,
|
|
15
|
+
OrderListResponse,
|
|
16
|
+
OrderDeleteResponse,
|
|
17
|
+
OrderCreateParams,
|
|
18
|
+
OrderListParams,
|
|
19
|
+
OrderDeleteParams,
|
|
20
|
+
Orders,
|
|
21
|
+
} from './orders';
|
|
22
|
+
export { PnlDetailListResponse, PnlDetails } from './pnl-details';
|
|
23
|
+
export { PnlSummary } from './pnl-summary';
|
|
24
|
+
export { PositionListResponse, PositionListParams, Positions } from './positions';
|
|
25
|
+
export { TradeListResponse, TradeListParams, Trades } from './trades';
|