snaptrade-typescript-sdk 9.0.187 → 9.0.189
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 +128 -1
- package/dist/api/experimental-endpoints-api-generated.d.ts +75 -0
- package/dist/api/experimental-endpoints-api-generated.js +97 -0
- package/dist/api/trading-api-generated.d.ts +63 -0
- package/dist/api/trading-api-generated.js +100 -0
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/account-order-record-quote-universal-symbol.d.ts +3 -3
- package/dist/models/account-order-record-universal-symbol.d.ts +3 -3
- package/dist/models/account-position.d.ts +52 -0
- package/dist/models/account-universal-activity-symbol.d.ts +3 -3
- package/dist/models/all-account-positions-response.d.ts +33 -0
- package/dist/models/all-account-positions-response.js +2 -0
- package/dist/models/complex-order-leg.d.ts +62 -0
- package/dist/models/complex-order-leg.js +2 -0
- package/dist/models/complex-order-response.d.ts +22 -0
- package/dist/models/complex-order-response.js +2 -0
- package/dist/models/crypto-instrument.d.ts +59 -0
- package/dist/models/crypto-instrument.js +2 -0
- package/dist/models/etf-instrument.d.ts +59 -0
- package/dist/models/etf-instrument.js +2 -0
- package/dist/models/future-instrument.d.ts +64 -0
- package/dist/models/future-instrument.js +2 -0
- package/dist/models/index.d.ts +14 -1
- package/dist/models/index.js +14 -1
- package/dist/models/instrument.d.ts +24 -0
- package/dist/models/instrument.js +2 -0
- package/dist/models/manual-trade-form-complex.d.ts +28 -0
- package/dist/models/manual-trade-form-complex.js +2 -0
- package/dist/models/option-instrument.d.ts +60 -0
- package/dist/models/option-instrument.js +2 -0
- package/dist/models/other-instrument.d.ts +59 -0
- package/dist/models/other-instrument.js +2 -0
- package/dist/models/{symbol-figi-instrument.d.ts → stock-instrument-figi-instrument.d.ts} +4 -4
- package/dist/models/stock-instrument-figi-instrument.js +2 -0
- package/dist/models/stock-instrument.d.ts +59 -0
- package/dist/models/stock-instrument.js +2 -0
- package/dist/models/symbol.d.ts +3 -3
- package/dist/models/underlying-option-instrument.d.ts +18 -0
- package/dist/models/underlying-option-instrument.js +2 -0
- package/dist/models/underlying-symbol.d.ts +3 -3
- package/dist/models/universal-symbol.d.ts +3 -3
- package/dist/operationParameterMap.js +41 -0
- package/package.json +1 -1
- /package/dist/models/{symbol-figi-instrument.js → account-position.js} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.189)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -45,6 +45,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
45
45
|
* [`snaptrade.connections.returnRates`](#snaptradeconnectionsreturnrates)
|
|
46
46
|
* [`snaptrade.connections.sessionEvents`](#snaptradeconnectionssessionevents)
|
|
47
47
|
* [`snaptrade.experimentalEndpoints.getAccountBalanceHistory`](#snaptradeexperimentalendpointsgetaccountbalancehistory)
|
|
48
|
+
* [`snaptrade.experimentalEndpoints.getAllAccountPositions`](#snaptradeexperimentalendpointsgetallaccountpositions)
|
|
48
49
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
49
50
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountordersv2)
|
|
50
51
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
@@ -70,6 +71,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
70
71
|
* [`snaptrade.trading.getUserAccountOptionQuotes`](#snaptradetradinggetuseraccountoptionquotes)
|
|
71
72
|
* [`snaptrade.trading.getUserAccountQuotes`](#snaptradetradinggetuseraccountquotes)
|
|
72
73
|
* [`snaptrade.trading.placeBracketOrder`](#snaptradetradingplacebracketorder)
|
|
74
|
+
* [`snaptrade.trading.placeComplexOrder`](#snaptradetradingplacecomplexorder)
|
|
73
75
|
* [`snaptrade.trading.placeCryptoOrder`](#snaptradetradingplacecryptoorder)
|
|
74
76
|
* [`snaptrade.trading.placeForceOrder`](#snaptradetradingplaceforceorder)
|
|
75
77
|
* [`snaptrade.trading.placeMlegOrder`](#snaptradetradingplacemlegorder)
|
|
@@ -1307,6 +1309,59 @@ const getAccountBalanceHistoryResponse =
|
|
|
1307
1309
|
---
|
|
1308
1310
|
|
|
1309
1311
|
|
|
1312
|
+
### `snaptrade.experimentalEndpoints.getAllAccountPositions`<a id="snaptradeexperimentalendpointsgetallaccountpositions"></a>
|
|
1313
|
+
|
|
1314
|
+
Returns a paginated list of all positions in the specified account.
|
|
1315
|
+
|
|
1316
|
+
The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
1317
|
+
|
|
1318
|
+
Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
1319
|
+
|
|
1320
|
+
If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1324
|
+
|
|
1325
|
+
```typescript
|
|
1326
|
+
const getAllAccountPositionsResponse =
|
|
1327
|
+
await snaptrade.experimentalEndpoints.getAllAccountPositions({
|
|
1328
|
+
userId: "snaptrade-user-123",
|
|
1329
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1330
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1331
|
+
page: 1,
|
|
1332
|
+
pageSize: 100,
|
|
1333
|
+
});
|
|
1334
|
+
```
|
|
1335
|
+
|
|
1336
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1337
|
+
|
|
1338
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1339
|
+
|
|
1340
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1341
|
+
|
|
1342
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
1343
|
+
|
|
1344
|
+
##### page: `number`<a id="page-number"></a>
|
|
1345
|
+
|
|
1346
|
+
The page number to return. Defaults to 1.
|
|
1347
|
+
|
|
1348
|
+
##### pageSize: `number`<a id="pagesize-number"></a>
|
|
1349
|
+
|
|
1350
|
+
The number of positions to return per page. Defaults to 100 with a maximum of 1000.
|
|
1351
|
+
|
|
1352
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1353
|
+
|
|
1354
|
+
[AllAccountPositionsResponse](./models/all-account-positions-response.ts)
|
|
1355
|
+
|
|
1356
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1357
|
+
|
|
1358
|
+
`/accounts/{accountId}/positions/all` `GET`
|
|
1359
|
+
|
|
1360
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1361
|
+
|
|
1362
|
+
---
|
|
1363
|
+
|
|
1364
|
+
|
|
1310
1365
|
### `snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`<a id="snaptradeexperimentalendpointsgetuseraccountorderdetailv2"></a>
|
|
1311
1366
|
|
|
1312
1367
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -2327,6 +2382,78 @@ Number of shares for the order. This can be a decimal for fractional orders. Mus
|
|
|
2327
2382
|
---
|
|
2328
2383
|
|
|
2329
2384
|
|
|
2385
|
+
### `snaptrade.trading.placeComplexOrder`<a id="snaptradetradingplacecomplexorder"></a>
|
|
2386
|
+
|
|
2387
|
+
Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable.
|
|
2388
|
+
Only supported on certain brokerages.
|
|
2389
|
+
|
|
2390
|
+
- **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled.
|
|
2391
|
+
- **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order.
|
|
2392
|
+
- **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2396
|
+
|
|
2397
|
+
```typescript
|
|
2398
|
+
const placeComplexOrderResponse = await snaptrade.trading.placeComplexOrder({
|
|
2399
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2400
|
+
userId: "snaptrade-user-123",
|
|
2401
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2402
|
+
type: "OTO",
|
|
2403
|
+
orders: [
|
|
2404
|
+
{
|
|
2405
|
+
order_role: "TRIGGER",
|
|
2406
|
+
action: "BUY",
|
|
2407
|
+
instrument: {
|
|
2408
|
+
symbol: "AAPL",
|
|
2409
|
+
type: "EQUITY",
|
|
2410
|
+
},
|
|
2411
|
+
order_type: "Market",
|
|
2412
|
+
units: 10.5,
|
|
2413
|
+
time_in_force: "Day",
|
|
2414
|
+
price: 31.33,
|
|
2415
|
+
stop: 29.5,
|
|
2416
|
+
},
|
|
2417
|
+
],
|
|
2418
|
+
client_order_id: "my-order-123",
|
|
2419
|
+
});
|
|
2420
|
+
```
|
|
2421
|
+
|
|
2422
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2423
|
+
|
|
2424
|
+
##### type: `string`<a id="type-string"></a>
|
|
2425
|
+
|
|
2426
|
+
The complex order type. - `OCO`: One Cancels the Other — two peer orders. - `OTO`: One Triggers the Other — a trigger order and a conditional order. - `OTOCO`: One Triggers a One Cancels the Other — a trigger order and two peer orders.
|
|
2427
|
+
|
|
2428
|
+
##### orders: [`ComplexOrderLeg`](./models/complex-order-leg.ts)[]<a id="orders-complexorderlegmodelscomplex-order-legts"></a>
|
|
2429
|
+
|
|
2430
|
+
The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
|
|
2431
|
+
|
|
2432
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
2433
|
+
|
|
2434
|
+
The ID of the account to execute the trade on.
|
|
2435
|
+
|
|
2436
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
2437
|
+
|
|
2438
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
2439
|
+
|
|
2440
|
+
##### client_order_id: `string`<a id="client_order_id-string"></a>
|
|
2441
|
+
|
|
2442
|
+
An optional client-provided identifier for this complex order. Passed through to the brokerage and returned in the response.
|
|
2443
|
+
|
|
2444
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
2445
|
+
|
|
2446
|
+
[ComplexOrderResponse](./models/complex-order-response.ts)
|
|
2447
|
+
|
|
2448
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2449
|
+
|
|
2450
|
+
`/accounts/{accountId}/trading/complex` `POST`
|
|
2451
|
+
|
|
2452
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2453
|
+
|
|
2454
|
+
---
|
|
2455
|
+
|
|
2456
|
+
|
|
2330
2457
|
### `snaptrade.trading.placeCryptoOrder`<a id="snaptradetradingplacecryptoorder"></a>
|
|
2331
2458
|
|
|
2332
2459
|
Places an order in the specified account.
|
|
@@ -4,6 +4,7 @@ import { RequestArgs, BaseAPI } from '../base';
|
|
|
4
4
|
import { AccountOrderRecordV2 } from '../models';
|
|
5
5
|
import { AccountOrdersV2Response } from '../models';
|
|
6
6
|
import { AccountValueHistoryResponse } from '../models';
|
|
7
|
+
import { AllAccountPositionsResponse } from '../models';
|
|
7
8
|
import { BrokerageAuthorizationTransactionsSyncConfirmation } from '../models';
|
|
8
9
|
/**
|
|
9
10
|
* ExperimentalEndpointsApi - axios parameter creator
|
|
@@ -20,6 +21,18 @@ export declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?:
|
|
|
20
21
|
* @throws {RequiredError}
|
|
21
22
|
*/
|
|
22
23
|
getAccountBalanceHistory: (userId: string, userSecret: string, accountId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
26
|
+
* @summary List all account positions
|
|
27
|
+
* @param {string} userId
|
|
28
|
+
* @param {string} userSecret
|
|
29
|
+
* @param {string} accountId
|
|
30
|
+
* @param {number} [page] The page number to return. Defaults to 1.
|
|
31
|
+
* @param {number} [pageSize] The number of positions to return per page. Defaults to 100 with a maximum of 1000.
|
|
32
|
+
* @param {*} [options] Override http request option.
|
|
33
|
+
* @throws {RequiredError}
|
|
34
|
+
*/
|
|
35
|
+
getAllAccountPositions: (userId: string, userSecret: string, accountId: string, page?: number, pageSize?: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
23
36
|
/**
|
|
24
37
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
25
38
|
* @summary Get account order detail (V2)
|
|
@@ -78,6 +91,14 @@ export declare const ExperimentalEndpointsApiFp: (configuration?: Configuration)
|
|
|
78
91
|
* @throws {RequiredError}
|
|
79
92
|
*/
|
|
80
93
|
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountValueHistoryResponse>>;
|
|
94
|
+
/**
|
|
95
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
96
|
+
* @summary List all account positions
|
|
97
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
98
|
+
* @param {*} [options] Override http request option.
|
|
99
|
+
* @throws {RequiredError}
|
|
100
|
+
*/
|
|
101
|
+
getAllAccountPositions(requestParameters: ExperimentalEndpointsApiGetAllAccountPositionsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AllAccountPositionsResponse>>;
|
|
81
102
|
/**
|
|
82
103
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
83
104
|
* @summary Get account order detail (V2)
|
|
@@ -124,6 +145,14 @@ export declare const ExperimentalEndpointsApiFactory: (configuration?: Configura
|
|
|
124
145
|
* @throws {RequiredError}
|
|
125
146
|
*/
|
|
126
147
|
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): AxiosPromise<AccountValueHistoryResponse>;
|
|
148
|
+
/**
|
|
149
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
150
|
+
* @summary List all account positions
|
|
151
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
152
|
+
* @param {*} [options] Override http request option.
|
|
153
|
+
* @throws {RequiredError}
|
|
154
|
+
*/
|
|
155
|
+
getAllAccountPositions(requestParameters: ExperimentalEndpointsApiGetAllAccountPositionsRequest, options?: AxiosRequestConfig): AxiosPromise<AllAccountPositionsResponse>;
|
|
127
156
|
/**
|
|
128
157
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
129
158
|
* @summary Get account order detail (V2)
|
|
@@ -182,6 +211,43 @@ export type ExperimentalEndpointsApiGetAccountBalanceHistoryRequest = {
|
|
|
182
211
|
*/
|
|
183
212
|
readonly accountId: string;
|
|
184
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* Request parameters for getAllAccountPositions operation in ExperimentalEndpointsApi.
|
|
216
|
+
* @export
|
|
217
|
+
* @interface ExperimentalEndpointsApiGetAllAccountPositionsRequest
|
|
218
|
+
*/
|
|
219
|
+
export type ExperimentalEndpointsApiGetAllAccountPositionsRequest = {
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
* @type {string}
|
|
223
|
+
* @memberof ExperimentalEndpointsApiGetAllAccountPositions
|
|
224
|
+
*/
|
|
225
|
+
readonly userId: string;
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @type {string}
|
|
229
|
+
* @memberof ExperimentalEndpointsApiGetAllAccountPositions
|
|
230
|
+
*/
|
|
231
|
+
readonly userSecret: string;
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* @type {string}
|
|
235
|
+
* @memberof ExperimentalEndpointsApiGetAllAccountPositions
|
|
236
|
+
*/
|
|
237
|
+
readonly accountId: string;
|
|
238
|
+
/**
|
|
239
|
+
* The page number to return. Defaults to 1.
|
|
240
|
+
* @type {number}
|
|
241
|
+
* @memberof ExperimentalEndpointsApiGetAllAccountPositions
|
|
242
|
+
*/
|
|
243
|
+
readonly page?: number;
|
|
244
|
+
/**
|
|
245
|
+
* The number of positions to return per page. Defaults to 100 with a maximum of 1000.
|
|
246
|
+
* @type {number}
|
|
247
|
+
* @memberof ExperimentalEndpointsApiGetAllAccountPositions
|
|
248
|
+
*/
|
|
249
|
+
readonly pageSize?: number;
|
|
250
|
+
};
|
|
185
251
|
/**
|
|
186
252
|
* Request parameters for getUserAccountOrderDetailV2 operation in ExperimentalEndpointsApi.
|
|
187
253
|
* @export
|
|
@@ -322,6 +388,15 @@ export declare class ExperimentalEndpointsApiGenerated extends BaseAPI {
|
|
|
322
388
|
* @memberof ExperimentalEndpointsApiGenerated
|
|
323
389
|
*/
|
|
324
390
|
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountValueHistoryResponse, any, {}>>;
|
|
391
|
+
/**
|
|
392
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
393
|
+
* @summary List all account positions
|
|
394
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
395
|
+
* @param {*} [options] Override http request option.
|
|
396
|
+
* @throws {RequiredError}
|
|
397
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
398
|
+
*/
|
|
399
|
+
getAllAccountPositions(requestParameters: ExperimentalEndpointsApiGetAllAccountPositionsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AllAccountPositionsResponse, any, {}>>;
|
|
325
400
|
/**
|
|
326
401
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
327
402
|
* @summary Get account order detail (V2)
|
|
@@ -90,6 +90,69 @@ const ExperimentalEndpointsApiAxiosParamCreator = function (configuration) {
|
|
|
90
90
|
options: localVarRequestOptions,
|
|
91
91
|
};
|
|
92
92
|
}),
|
|
93
|
+
/**
|
|
94
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
95
|
+
* @summary List all account positions
|
|
96
|
+
* @param {string} userId
|
|
97
|
+
* @param {string} userSecret
|
|
98
|
+
* @param {string} accountId
|
|
99
|
+
* @param {number} [page] The page number to return. Defaults to 1.
|
|
100
|
+
* @param {number} [pageSize] The number of positions to return per page. Defaults to 100 with a maximum of 1000.
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
*/
|
|
104
|
+
getAllAccountPositions: (userId, userSecret, accountId, page, pageSize, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
// verify required parameter 'userId' is not null or undefined
|
|
106
|
+
(0, common_1.assertParamExists)('getAllAccountPositions', 'userId', userId);
|
|
107
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
108
|
+
(0, common_1.assertParamExists)('getAllAccountPositions', 'userSecret', userSecret);
|
|
109
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
110
|
+
(0, common_1.assertParamExists)('getAllAccountPositions', 'accountId', accountId);
|
|
111
|
+
const localVarPath = `/accounts/{accountId}/positions/all`
|
|
112
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
113
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
114
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
115
|
+
let baseOptions;
|
|
116
|
+
if (configuration) {
|
|
117
|
+
baseOptions = configuration.baseOptions;
|
|
118
|
+
}
|
|
119
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
120
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
121
|
+
const localVarQueryParameter = {};
|
|
122
|
+
// authentication PartnerClientId required
|
|
123
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
124
|
+
// authentication PartnerSignature required
|
|
125
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
126
|
+
// authentication PartnerTimestamp required
|
|
127
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
128
|
+
if (userId !== undefined) {
|
|
129
|
+
localVarQueryParameter['userId'] = userId;
|
|
130
|
+
}
|
|
131
|
+
if (userSecret !== undefined) {
|
|
132
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
133
|
+
}
|
|
134
|
+
if (page !== undefined) {
|
|
135
|
+
localVarQueryParameter['page'] = page;
|
|
136
|
+
}
|
|
137
|
+
if (pageSize !== undefined) {
|
|
138
|
+
localVarQueryParameter['page_size'] = pageSize;
|
|
139
|
+
}
|
|
140
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
141
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
142
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
143
|
+
queryParameters: localVarQueryParameter,
|
|
144
|
+
requestConfig: localVarRequestOptions,
|
|
145
|
+
path: localVarPath,
|
|
146
|
+
configuration,
|
|
147
|
+
pathTemplate: '/accounts/{accountId}/positions/all',
|
|
148
|
+
httpMethod: 'GET'
|
|
149
|
+
});
|
|
150
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
151
|
+
return {
|
|
152
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
153
|
+
options: localVarRequestOptions,
|
|
154
|
+
};
|
|
155
|
+
}),
|
|
93
156
|
/**
|
|
94
157
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
95
158
|
* @summary Get account order detail (V2)
|
|
@@ -349,6 +412,19 @@ const ExperimentalEndpointsApiFp = function (configuration) {
|
|
|
349
412
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
350
413
|
});
|
|
351
414
|
},
|
|
415
|
+
/**
|
|
416
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
417
|
+
* @summary List all account positions
|
|
418
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
419
|
+
* @param {*} [options] Override http request option.
|
|
420
|
+
* @throws {RequiredError}
|
|
421
|
+
*/
|
|
422
|
+
getAllAccountPositions(requestParameters, options) {
|
|
423
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
424
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getAllAccountPositions(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.page, requestParameters.pageSize, options);
|
|
425
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
426
|
+
});
|
|
427
|
+
},
|
|
352
428
|
/**
|
|
353
429
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
354
430
|
* @summary Get account order detail (V2)
|
|
@@ -421,6 +497,16 @@ const ExperimentalEndpointsApiFactory = function (configuration, basePath, axios
|
|
|
421
497
|
getAccountBalanceHistory(requestParameters, options) {
|
|
422
498
|
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios, basePath));
|
|
423
499
|
},
|
|
500
|
+
/**
|
|
501
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
502
|
+
* @summary List all account positions
|
|
503
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
504
|
+
* @param {*} [options] Override http request option.
|
|
505
|
+
* @throws {RequiredError}
|
|
506
|
+
*/
|
|
507
|
+
getAllAccountPositions(requestParameters, options) {
|
|
508
|
+
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios, basePath));
|
|
509
|
+
},
|
|
424
510
|
/**
|
|
425
511
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
426
512
|
* @summary Get account order detail (V2)
|
|
@@ -482,6 +568,17 @@ class ExperimentalEndpointsApiGenerated extends base_1.BaseAPI {
|
|
|
482
568
|
getAccountBalanceHistory(requestParameters, options) {
|
|
483
569
|
return (0, exports.ExperimentalEndpointsApiFp)(this.configuration).getAccountBalanceHistory(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
484
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Returns a paginated list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response page, including stocks, ETFs, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
573
|
+
* @summary List all account positions
|
|
574
|
+
* @param {ExperimentalEndpointsApiGetAllAccountPositionsRequest} requestParameters Request parameters.
|
|
575
|
+
* @param {*} [options] Override http request option.
|
|
576
|
+
* @throws {RequiredError}
|
|
577
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
578
|
+
*/
|
|
579
|
+
getAllAccountPositions(requestParameters, options) {
|
|
580
|
+
return (0, exports.ExperimentalEndpointsApiFp)(this.configuration).getAllAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
581
|
+
}
|
|
485
582
|
/**
|
|
486
583
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
487
584
|
* @summary Get account order detail (V2)
|
|
@@ -4,12 +4,14 @@ import { RequestArgs, BaseAPI } from '../base';
|
|
|
4
4
|
import { AccountInformationGetUserAccountOrderDetailRequest } from '../models';
|
|
5
5
|
import { AccountOrderRecord } from '../models';
|
|
6
6
|
import { CancelOrderResponse } from '../models';
|
|
7
|
+
import { ComplexOrderResponse } from '../models';
|
|
7
8
|
import { CryptoOrderForm } from '../models';
|
|
8
9
|
import { CryptoOrderPreview } from '../models';
|
|
9
10
|
import { CryptocurrencyPairQuote } from '../models';
|
|
10
11
|
import { ManualTradeAndImpact } from '../models';
|
|
11
12
|
import { ManualTradeForm } from '../models';
|
|
12
13
|
import { ManualTradeFormBracket } from '../models';
|
|
14
|
+
import { ManualTradeFormComplex } from '../models';
|
|
13
15
|
import { ManualTradeFormWithOptions } from '../models';
|
|
14
16
|
import { ManualTradeReplaceForm } from '../models';
|
|
15
17
|
import { MlegOrderResponse } from '../models';
|
|
@@ -114,6 +116,17 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
|
|
|
114
116
|
* @throws {RequiredError}
|
|
115
117
|
*/
|
|
116
118
|
placeBracketOrder: (accountId: string, userId: string, userSecret: string, manualTradeFormBracket: ManualTradeFormBracket, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
119
|
+
/**
|
|
120
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
121
|
+
* @summary Place complex order
|
|
122
|
+
* @param {string} accountId The ID of the account to execute the trade on.
|
|
123
|
+
* @param {string} userId
|
|
124
|
+
* @param {string} userSecret
|
|
125
|
+
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
126
|
+
* @param {*} [options] Override http request option.
|
|
127
|
+
* @throws {RequiredError}
|
|
128
|
+
*/
|
|
129
|
+
placeComplexOrder: (accountId: string, userId: string, userSecret: string, manualTradeFormComplex: ManualTradeFormComplex, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
117
130
|
/**
|
|
118
131
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
119
132
|
* @summary Place crypto order
|
|
@@ -262,6 +275,14 @@ export declare const TradingApiFp: (configuration?: Configuration) => {
|
|
|
262
275
|
* @throws {RequiredError}
|
|
263
276
|
*/
|
|
264
277
|
placeBracketOrder(requestParameters: TradingApiPlaceBracketOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountOrderRecord>>;
|
|
278
|
+
/**
|
|
279
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
280
|
+
* @summary Place complex order
|
|
281
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
282
|
+
* @param {*} [options] Override http request option.
|
|
283
|
+
* @throws {RequiredError}
|
|
284
|
+
*/
|
|
285
|
+
placeComplexOrder(requestParameters: TradingApiPlaceComplexOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ComplexOrderResponse>>;
|
|
265
286
|
/**
|
|
266
287
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
267
288
|
* @summary Place crypto order
|
|
@@ -389,6 +410,14 @@ export declare const TradingApiFactory: (configuration?: Configuration, basePath
|
|
|
389
410
|
* @throws {RequiredError}
|
|
390
411
|
*/
|
|
391
412
|
placeBracketOrder(requestParameters: TradingApiPlaceBracketOrderRequest, options?: AxiosRequestConfig): AxiosPromise<AccountOrderRecord>;
|
|
413
|
+
/**
|
|
414
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
415
|
+
* @summary Place complex order
|
|
416
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
417
|
+
* @param {*} [options] Override http request option.
|
|
418
|
+
* @throws {RequiredError}
|
|
419
|
+
*/
|
|
420
|
+
placeComplexOrder(requestParameters: TradingApiPlaceComplexOrderRequest, options?: AxiosRequestConfig): AxiosPromise<ComplexOrderResponse>;
|
|
392
421
|
/**
|
|
393
422
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
394
423
|
* @summary Place crypto order
|
|
@@ -664,6 +693,31 @@ export type TradingApiPlaceBracketOrderRequest = {
|
|
|
664
693
|
*/
|
|
665
694
|
readonly userSecret: string;
|
|
666
695
|
} & ManualTradeFormBracket;
|
|
696
|
+
/**
|
|
697
|
+
* Request parameters for placeComplexOrder operation in TradingApi.
|
|
698
|
+
* @export
|
|
699
|
+
* @interface TradingApiPlaceComplexOrderRequest
|
|
700
|
+
*/
|
|
701
|
+
export type TradingApiPlaceComplexOrderRequest = {
|
|
702
|
+
/**
|
|
703
|
+
* The ID of the account to execute the trade on.
|
|
704
|
+
* @type {string}
|
|
705
|
+
* @memberof TradingApiPlaceComplexOrder
|
|
706
|
+
*/
|
|
707
|
+
readonly accountId: string;
|
|
708
|
+
/**
|
|
709
|
+
*
|
|
710
|
+
* @type {string}
|
|
711
|
+
* @memberof TradingApiPlaceComplexOrder
|
|
712
|
+
*/
|
|
713
|
+
readonly userId: string;
|
|
714
|
+
/**
|
|
715
|
+
*
|
|
716
|
+
* @type {string}
|
|
717
|
+
* @memberof TradingApiPlaceComplexOrder
|
|
718
|
+
*/
|
|
719
|
+
readonly userSecret: string;
|
|
720
|
+
} & ManualTradeFormComplex;
|
|
667
721
|
/**
|
|
668
722
|
* Request parameters for placeCryptoOrder operation in TradingApi.
|
|
669
723
|
* @export
|
|
@@ -925,6 +979,15 @@ export declare class TradingApiGenerated extends BaseAPI {
|
|
|
925
979
|
* @memberof TradingApiGenerated
|
|
926
980
|
*/
|
|
927
981
|
placeBracketOrder(requestParameters: TradingApiPlaceBracketOrderRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountOrderRecord, any, {}>>;
|
|
982
|
+
/**
|
|
983
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
984
|
+
* @summary Place complex order
|
|
985
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
986
|
+
* @param {*} [options] Override http request option.
|
|
987
|
+
* @throws {RequiredError}
|
|
988
|
+
* @memberof TradingApiGenerated
|
|
989
|
+
*/
|
|
990
|
+
placeComplexOrder(requestParameters: TradingApiPlaceComplexOrderRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ComplexOrderResponse, any, {}>>;
|
|
928
991
|
/**
|
|
929
992
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
930
993
|
* @summary Place crypto order
|
|
@@ -522,6 +522,67 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
522
522
|
options: localVarRequestOptions,
|
|
523
523
|
};
|
|
524
524
|
}),
|
|
525
|
+
/**
|
|
526
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
527
|
+
* @summary Place complex order
|
|
528
|
+
* @param {string} accountId The ID of the account to execute the trade on.
|
|
529
|
+
* @param {string} userId
|
|
530
|
+
* @param {string} userSecret
|
|
531
|
+
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
532
|
+
* @param {*} [options] Override http request option.
|
|
533
|
+
* @throws {RequiredError}
|
|
534
|
+
*/
|
|
535
|
+
placeComplexOrder: (accountId, userId, userSecret, manualTradeFormComplex, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
536
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
537
|
+
(0, common_1.assertParamExists)('placeComplexOrder', 'accountId', accountId);
|
|
538
|
+
// verify required parameter 'userId' is not null or undefined
|
|
539
|
+
(0, common_1.assertParamExists)('placeComplexOrder', 'userId', userId);
|
|
540
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
541
|
+
(0, common_1.assertParamExists)('placeComplexOrder', 'userSecret', userSecret);
|
|
542
|
+
// verify required parameter 'manualTradeFormComplex' is not null or undefined
|
|
543
|
+
(0, common_1.assertParamExists)('placeComplexOrder', 'manualTradeFormComplex', manualTradeFormComplex);
|
|
544
|
+
const localVarPath = `/accounts/{accountId}/trading/complex`
|
|
545
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
546
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
547
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
548
|
+
let baseOptions;
|
|
549
|
+
if (configuration) {
|
|
550
|
+
baseOptions = configuration.baseOptions;
|
|
551
|
+
}
|
|
552
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
553
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
554
|
+
const localVarQueryParameter = {};
|
|
555
|
+
// authentication PartnerClientId required
|
|
556
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
557
|
+
// authentication PartnerSignature required
|
|
558
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
559
|
+
// authentication PartnerTimestamp required
|
|
560
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
561
|
+
if (userId !== undefined) {
|
|
562
|
+
localVarQueryParameter['userId'] = userId;
|
|
563
|
+
}
|
|
564
|
+
if (userSecret !== undefined) {
|
|
565
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
566
|
+
}
|
|
567
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
568
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
569
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
570
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
571
|
+
requestBody: manualTradeFormComplex,
|
|
572
|
+
queryParameters: localVarQueryParameter,
|
|
573
|
+
requestConfig: localVarRequestOptions,
|
|
574
|
+
path: localVarPath,
|
|
575
|
+
configuration,
|
|
576
|
+
pathTemplate: '/accounts/{accountId}/trading/complex',
|
|
577
|
+
httpMethod: 'POST'
|
|
578
|
+
});
|
|
579
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormComplex, localVarRequestOptions, configuration);
|
|
580
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
581
|
+
return {
|
|
582
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
583
|
+
options: localVarRequestOptions,
|
|
584
|
+
};
|
|
585
|
+
}),
|
|
525
586
|
/**
|
|
526
587
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
527
588
|
* @summary Place crypto order
|
|
@@ -1096,6 +1157,24 @@ const TradingApiFp = function (configuration) {
|
|
|
1096
1157
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1097
1158
|
});
|
|
1098
1159
|
},
|
|
1160
|
+
/**
|
|
1161
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1162
|
+
* @summary Place complex order
|
|
1163
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1164
|
+
* @param {*} [options] Override http request option.
|
|
1165
|
+
* @throws {RequiredError}
|
|
1166
|
+
*/
|
|
1167
|
+
placeComplexOrder(requestParameters, options) {
|
|
1168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1169
|
+
const manualTradeFormComplex = {
|
|
1170
|
+
type: requestParameters.type,
|
|
1171
|
+
orders: requestParameters.orders,
|
|
1172
|
+
client_order_id: requestParameters.client_order_id
|
|
1173
|
+
};
|
|
1174
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeComplexOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeFormComplex, options);
|
|
1175
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1176
|
+
});
|
|
1177
|
+
},
|
|
1099
1178
|
/**
|
|
1100
1179
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
1101
1180
|
* @summary Place crypto order
|
|
@@ -1334,6 +1413,16 @@ const TradingApiFactory = function (configuration, basePath, axios) {
|
|
|
1334
1413
|
placeBracketOrder(requestParameters, options) {
|
|
1335
1414
|
return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1336
1415
|
},
|
|
1416
|
+
/**
|
|
1417
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1418
|
+
* @summary Place complex order
|
|
1419
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1420
|
+
* @param {*} [options] Override http request option.
|
|
1421
|
+
* @throws {RequiredError}
|
|
1422
|
+
*/
|
|
1423
|
+
placeComplexOrder(requestParameters, options) {
|
|
1424
|
+
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1425
|
+
},
|
|
1337
1426
|
/**
|
|
1338
1427
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
1339
1428
|
* @summary Place crypto order
|
|
@@ -1503,6 +1592,17 @@ class TradingApiGenerated extends base_1.BaseAPI {
|
|
|
1503
1592
|
placeBracketOrder(requestParameters, options) {
|
|
1504
1593
|
return (0, exports.TradingApiFp)(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1505
1594
|
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1597
|
+
* @summary Place complex order
|
|
1598
|
+
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1599
|
+
* @param {*} [options] Override http request option.
|
|
1600
|
+
* @throws {RequiredError}
|
|
1601
|
+
* @memberof TradingApiGenerated
|
|
1602
|
+
*/
|
|
1603
|
+
placeComplexOrder(requestParameters, options) {
|
|
1604
|
+
return (0, exports.TradingApiFp)(this.configuration).placeComplexOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1605
|
+
}
|
|
1506
1606
|
/**
|
|
1507
1607
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
1508
1608
|
* @summary Place crypto order
|