@clear-street/studio-sdk 0.1.0-alpha.10
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 +135 -0
- package/LICENSE +201 -0
- package/README.md +290 -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 +89 -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 +242 -0
- package/core.d.ts.map +1 -0
- package/core.js +901 -0
- package/core.js.map +1 -0
- package/core.mjs +869 -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 +144 -0
- package/index.d.ts +144 -0
- package/index.d.ts.map +1 -0
- package/index.js +122 -0
- package/index.js.map +1 -0
- package/index.mjs +94 -0
- package/index.mjs.map +1 -0
- package/package.json +103 -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 +84 -0
- package/resources/accounts/accounts.d.ts.map +1 -0
- package/resources/accounts/accounts.js +79 -0
- package/resources/accounts/accounts.js.map +1 -0
- package/resources/accounts/accounts.mjs +52 -0
- package/resources/accounts/accounts.mjs.map +1 -0
- package/resources/accounts/bulk-orders.d.ts +134 -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/holdings.d.ts +73 -0
- package/resources/accounts/holdings.d.ts.map +1 -0
- package/resources/accounts/holdings.js +18 -0
- package/resources/accounts/holdings.js.map +1 -0
- package/resources/accounts/holdings.mjs +14 -0
- package/resources/accounts/holdings.mjs.map +1 -0
- package/resources/accounts/index.d.ts +12 -0
- package/resources/accounts/index.d.ts.map +1 -0
- package/resources/accounts/index.js +27 -0
- package/resources/accounts/index.js.map +1 -0
- package/resources/accounts/index.mjs +13 -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 +164 -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/pnl-sums.d.ts +138 -0
- package/resources/accounts/pnl-sums.d.ts.map +1 -0
- package/resources/accounts/pnl-sums.js +18 -0
- package/resources/accounts/pnl-sums.js.map +1 -0
- package/resources/accounts/pnl-sums.mjs +14 -0
- package/resources/accounts/pnl-sums.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 +332 -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 +30 -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 +81 -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 +1190 -0
- package/src/error.ts +146 -0
- package/src/index.ts +231 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/accounts/accounts.ts +97 -0
- package/src/resources/accounts/bulk-orders.ts +161 -0
- package/src/resources/accounts/easy-borrows.ts +23 -0
- package/src/resources/accounts/holdings.ts +103 -0
- package/src/resources/accounts/index.ts +27 -0
- package/src/resources/accounts/locate-orders.ts +94 -0
- package/src/resources/accounts/orders.ts +243 -0
- package/src/resources/accounts/pnl-details.ts +143 -0
- package/src/resources/accounts/pnl-summary.ts +14 -0
- package/src/resources/accounts/pnl-sums.ts +176 -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 +428 -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 +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -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
|
@@ -0,0 +1,176 @@
|
|
|
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 PnlSumsAPI from './pnl-sums';
|
|
6
|
+
|
|
7
|
+
export class PnlSums extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List historical PNL summations for a given account over a given date range,
|
|
10
|
+
* filtered on the given query parameters.
|
|
11
|
+
*/
|
|
12
|
+
list(
|
|
13
|
+
accountId: string,
|
|
14
|
+
query: PnlSumListParams,
|
|
15
|
+
options?: Core.RequestOptions,
|
|
16
|
+
): Core.APIPromise<PnlSumListResponse> {
|
|
17
|
+
return this._client.get(`/accounts/${accountId}/pnl-sums`, { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PnlSumListResponse {
|
|
22
|
+
/**
|
|
23
|
+
* Account ID for the account.
|
|
24
|
+
*/
|
|
25
|
+
account_id?: string;
|
|
26
|
+
|
|
27
|
+
data?: Array<PnlSumListResponse.Data>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Sum of profit and loss from intraday trading activities for the given date range
|
|
31
|
+
* across all symbols.
|
|
32
|
+
*/
|
|
33
|
+
day_pnl?: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Echoed back from the provided query param.
|
|
37
|
+
*/
|
|
38
|
+
ending_date?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The equity at the end of the date range. End of day equity of the ending date in
|
|
42
|
+
* the date range.
|
|
43
|
+
*/
|
|
44
|
+
ending_equity?: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Entity ID for the legal entity.
|
|
48
|
+
*/
|
|
49
|
+
entity_id?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Sum of profit and loss from previous trading date across all symbols.
|
|
53
|
+
*/
|
|
54
|
+
position_pnl?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Sum of profit and loss realized from position closing trading activity across
|
|
58
|
+
* all symbols.
|
|
59
|
+
*/
|
|
60
|
+
realized_pnl?: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Echoed back from the provided query param.
|
|
64
|
+
*/
|
|
65
|
+
starting_date?: number;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The equity at the start of the date range. Start of day equity of the starting
|
|
69
|
+
* date in the date range.
|
|
70
|
+
*/
|
|
71
|
+
starting_equity?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Echoed back from the provided query param.
|
|
75
|
+
*/
|
|
76
|
+
symbol?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* `realized_pnl + unrealized_pnl`
|
|
80
|
+
*/
|
|
81
|
+
total_pnl?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Echoed back from the provided query param.
|
|
85
|
+
*/
|
|
86
|
+
underlying_symbol?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Sum of profit and loss from market changes across all symbols.
|
|
90
|
+
*/
|
|
91
|
+
unrealized_pnl?: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export namespace PnlSumListResponse {
|
|
95
|
+
export interface Data {
|
|
96
|
+
/**
|
|
97
|
+
* The asset class of the symbol.
|
|
98
|
+
*/
|
|
99
|
+
asset_class?: 'other' | 'currency' | 'equity' | 'option' | 'debt' | 'fund';
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sum of the notional bought.
|
|
103
|
+
*/
|
|
104
|
+
bought_notional?: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Sum of quantity bought.
|
|
108
|
+
*/
|
|
109
|
+
bought_quantity?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Sum of profit and loss from intraday trading activities for the given date range
|
|
113
|
+
*/
|
|
114
|
+
day_pnl?: number;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Sum of profit and loss from previous trading date.
|
|
118
|
+
*/
|
|
119
|
+
position_pnl?: number;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sum of profit and loss realized from position closing trading activity.
|
|
123
|
+
*/
|
|
124
|
+
realized_pnl?: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Sum of the notional sold.
|
|
128
|
+
*/
|
|
129
|
+
sold_notional?: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Sum of quantity sold.
|
|
133
|
+
*/
|
|
134
|
+
sold_quantity?: string;
|
|
135
|
+
|
|
136
|
+
symbol?: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* `realized_pnl + unrealized_pnl`
|
|
140
|
+
*/
|
|
141
|
+
total_pnl?: number;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Sum of profit and loss from market changes.
|
|
145
|
+
*/
|
|
146
|
+
unrealized_pnl?: number;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface PnlSumListParams {
|
|
151
|
+
/**
|
|
152
|
+
* The ending date to accumulate PNL data for, inclusive.
|
|
153
|
+
*/
|
|
154
|
+
ending_date: number;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The starting date to accumulate PNL data for.
|
|
158
|
+
*/
|
|
159
|
+
starting_date: number;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Filters for a specific symbol.
|
|
163
|
+
*/
|
|
164
|
+
symbol?: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Filters for a specific underlying symbol, e.g. all options for a particular
|
|
168
|
+
* underlying.
|
|
169
|
+
*/
|
|
170
|
+
underlying_symbol?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export namespace PnlSums {
|
|
174
|
+
export import PnlSumListResponse = PnlSumsAPI.PnlSumListResponse;
|
|
175
|
+
export import PnlSumListParams = PnlSumsAPI.PnlSumListParams;
|
|
176
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as PositionsAPI from './positions';
|
|
7
|
+
import * as Shared from '../shared';
|
|
8
|
+
|
|
9
|
+
export class Positions extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get current positions for a given account for a given symbol.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(
|
|
14
|
+
accountId: string,
|
|
15
|
+
symbol: string,
|
|
16
|
+
options?: Core.RequestOptions,
|
|
17
|
+
): Core.APIPromise<Shared.Position> {
|
|
18
|
+
return this._client.get(`/accounts/${accountId}/positions/${symbol}`, options);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* List current positions for a given account.
|
|
23
|
+
*/
|
|
24
|
+
list(
|
|
25
|
+
accountId: string,
|
|
26
|
+
query?: PositionListParams,
|
|
27
|
+
options?: Core.RequestOptions,
|
|
28
|
+
): Core.APIPromise<PositionListResponse>;
|
|
29
|
+
list(accountId: string, options?: Core.RequestOptions): Core.APIPromise<PositionListResponse>;
|
|
30
|
+
list(
|
|
31
|
+
accountId: string,
|
|
32
|
+
query: PositionListParams | Core.RequestOptions = {},
|
|
33
|
+
options?: Core.RequestOptions,
|
|
34
|
+
): Core.APIPromise<PositionListResponse> {
|
|
35
|
+
if (isRequestOptions(query)) {
|
|
36
|
+
return this.list(accountId, {}, query);
|
|
37
|
+
}
|
|
38
|
+
return this._client.get(`/accounts/${accountId}/positions`, { query, ...options });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PositionListResponse {
|
|
43
|
+
data: Array<Shared.Position>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Cursor for the next page of results.
|
|
47
|
+
*/
|
|
48
|
+
next_page_token?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface PositionListParams {
|
|
52
|
+
/**
|
|
53
|
+
* Number of positions to return per page.
|
|
54
|
+
*/
|
|
55
|
+
page_size?: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Cursor for the page to return.
|
|
59
|
+
*/
|
|
60
|
+
page_token?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export namespace Positions {
|
|
64
|
+
export import PositionListResponse = PositionsAPI.PositionListResponse;
|
|
65
|
+
export import PositionListParams = PositionsAPI.PositionListParams;
|
|
66
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as TradesAPI from './trades';
|
|
7
|
+
import * as Shared from '../shared';
|
|
8
|
+
|
|
9
|
+
export class Trades extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get trade a trade by its unique trade ID.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(accountId: string, tradeId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Trade> {
|
|
14
|
+
return this._client.get(`/accounts/${accountId}/trades/${tradeId}`, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List trades for a given account for the current trading day.
|
|
19
|
+
*/
|
|
20
|
+
list(
|
|
21
|
+
accountId: string,
|
|
22
|
+
query?: TradeListParams,
|
|
23
|
+
options?: Core.RequestOptions,
|
|
24
|
+
): Core.APIPromise<TradeListResponse>;
|
|
25
|
+
list(accountId: string, options?: Core.RequestOptions): Core.APIPromise<TradeListResponse>;
|
|
26
|
+
list(
|
|
27
|
+
accountId: string,
|
|
28
|
+
query: TradeListParams | Core.RequestOptions = {},
|
|
29
|
+
options?: Core.RequestOptions,
|
|
30
|
+
): Core.APIPromise<TradeListResponse> {
|
|
31
|
+
if (isRequestOptions(query)) {
|
|
32
|
+
return this.list(accountId, {}, query);
|
|
33
|
+
}
|
|
34
|
+
return this._client.get(`/accounts/${accountId}/trades`, { query, ...options });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TradeListResponse {
|
|
39
|
+
data: Array<Shared.Trade>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Cursor for the next page of results.
|
|
43
|
+
*/
|
|
44
|
+
next_page_token?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TradeListParams {
|
|
48
|
+
/**
|
|
49
|
+
* Number of trades to return per page.
|
|
50
|
+
*/
|
|
51
|
+
page_size?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Cursor for the page to return.
|
|
55
|
+
*/
|
|
56
|
+
page_token?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export namespace Trades {
|
|
60
|
+
export import TradeListResponse = TradesAPI.TradeListResponse;
|
|
61
|
+
export import TradeListParams = TradesAPI.TradeListParams;
|
|
62
|
+
}
|