snaptrade-typescript-sdk 9.0.98 → 9.0.99
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 +80 -11
- package/dist/api/trading-api-generated.d.ts +63 -0
- package/dist/api/trading-api-generated.js +102 -0
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/dist/models/manual-trade-form-bracket.d.ts +1 -1
- package/dist/models/manual-trade-form-with-options.d.ts +1 -1
- package/dist/models/manual-trade-form.d.ts +1 -1
- package/dist/models/manual-trade-replace-form.d.ts +1 -1
- package/dist/models/manual-trade.d.ts +1 -1
- package/dist/models/mleg-action-strict.d.ts +6 -0
- package/dist/models/mleg-action-strict.js +2 -0
- package/dist/models/mleg-leg.d.ts +28 -0
- package/dist/models/mleg-leg.js +2 -0
- package/dist/models/mleg-order-response.d.ts +21 -0
- package/dist/models/mleg-order-response.js +2 -0
- package/dist/models/mleg-trading-instrument.d.ts +22 -0
- package/dist/models/mleg-trading-instrument.js +2 -0
- package/dist/models/options-place-option-strategy-request.d.ts +1 -1
- package/dist/models/time-in-force-strict.d.ts +2 -2
- package/dist/models/trading-place-mleg-order-request.d.ts +41 -0
- package/dist/models/trading-place-mleg-order-request.js +2 -0
- package/dist/operationParameterMap.js +28 -0
- package/package.json +1 -1
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.99)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -65,6 +65,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
65
65
|
* [`snaptrade.trading.getUserAccountQuotes`](#snaptradetradinggetuseraccountquotes)
|
|
66
66
|
* [`snaptrade.trading.placeBracketOrder`](#snaptradetradingplacebracketorder)
|
|
67
67
|
* [`snaptrade.trading.placeForceOrder`](#snaptradetradingplaceforceorder)
|
|
68
|
+
* [`snaptrade.trading.placeMlegOrder`](#snaptradetradingplacemlegorder)
|
|
68
69
|
* [`snaptrade.trading.placeOrder`](#snaptradetradingplaceorder)
|
|
69
70
|
* [`snaptrade.trading.placeSimpleOrder`](#snaptradetradingplacesimpleorder)
|
|
70
71
|
* [`snaptrade.trading.previewSimpleOrder`](#snaptradetradingpreviewsimpleorder)
|
|
@@ -1323,7 +1324,7 @@ const placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy(
|
|
|
1323
1324
|
accountId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1324
1325
|
optionStrategyId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1325
1326
|
order_type: "Market",
|
|
1326
|
-
time_in_force: "
|
|
1327
|
+
time_in_force: "Day",
|
|
1327
1328
|
price: 31.33,
|
|
1328
1329
|
}
|
|
1329
1330
|
);
|
|
@@ -1337,7 +1338,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price` f
|
|
|
1337
1338
|
|
|
1338
1339
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1339
1340
|
|
|
1340
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1341
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
1341
1342
|
|
|
1342
1343
|
##### userId: `string`<a id="userid-string"></a>
|
|
1343
1344
|
|
|
@@ -1819,7 +1820,7 @@ const getOrderImpactResponse = await snaptrade.trading.getOrderImpact({
|
|
|
1819
1820
|
action: "BUY",
|
|
1820
1821
|
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1821
1822
|
order_type: "Market",
|
|
1822
|
-
time_in_force: "
|
|
1823
|
+
time_in_force: "Day",
|
|
1823
1824
|
price: 31.33,
|
|
1824
1825
|
stop: 31.33,
|
|
1825
1826
|
units: 10.5,
|
|
@@ -1846,7 +1847,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price` f
|
|
|
1846
1847
|
|
|
1847
1848
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1848
1849
|
|
|
1849
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1850
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
1850
1851
|
|
|
1851
1852
|
##### userId: `string`<a id="userid-string"></a>
|
|
1852
1853
|
|
|
@@ -1942,7 +1943,7 @@ const placeBracketOrderResponse = await snaptrade.trading.placeBracketOrder({
|
|
|
1942
1943
|
type: "EQUITY",
|
|
1943
1944
|
},
|
|
1944
1945
|
order_type: "Market",
|
|
1945
|
-
time_in_force: "
|
|
1946
|
+
time_in_force: "Day",
|
|
1946
1947
|
price: 31.33,
|
|
1947
1948
|
stop: 31.33,
|
|
1948
1949
|
units: 10.5,
|
|
@@ -1970,7 +1971,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price` f
|
|
|
1970
1971
|
|
|
1971
1972
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1972
1973
|
|
|
1973
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1974
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
1974
1975
|
|
|
1975
1976
|
##### stop_loss: [`StopLoss`](./models/stop-loss.ts)<a id="stop_loss-stoplossmodelsstop-lossts"></a>
|
|
1976
1977
|
|
|
@@ -2033,7 +2034,7 @@ const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
|
|
|
2033
2034
|
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
2034
2035
|
symbol: "AAPL 131124C00240000",
|
|
2035
2036
|
order_type: "Market",
|
|
2036
|
-
time_in_force: "
|
|
2037
|
+
time_in_force: "Day",
|
|
2037
2038
|
price: 31.33,
|
|
2038
2039
|
stop: 31.33,
|
|
2039
2040
|
units: 10.5,
|
|
@@ -2056,7 +2057,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price` f
|
|
|
2056
2057
|
|
|
2057
2058
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2058
2059
|
|
|
2059
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
2060
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
2060
2061
|
|
|
2061
2062
|
##### userId: `string`<a id="userid-string"></a>
|
|
2062
2063
|
|
|
@@ -2097,6 +2098,74 @@ For Equity orders, this represents the number of shares for the order. This can
|
|
|
2097
2098
|
---
|
|
2098
2099
|
|
|
2099
2100
|
|
|
2101
|
+
### `snaptrade.trading.placeMlegOrder`<a id="snaptradetradingplacemlegorder"></a>
|
|
2102
|
+
|
|
2103
|
+
Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
2104
|
+
|
|
2105
|
+
|
|
2106
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2107
|
+
|
|
2108
|
+
```typescript
|
|
2109
|
+
const placeMlegOrderResponse = await snaptrade.trading.placeMlegOrder({
|
|
2110
|
+
userId: "snaptrade-user-123",
|
|
2111
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2112
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2113
|
+
type: "MARKET",
|
|
2114
|
+
time_in_force: "Day",
|
|
2115
|
+
limit_price: "",
|
|
2116
|
+
stop_price: "",
|
|
2117
|
+
legs: [
|
|
2118
|
+
{
|
|
2119
|
+
instrument: {
|
|
2120
|
+
symbol: "PBI 250718C00006000",
|
|
2121
|
+
type: "OPTION",
|
|
2122
|
+
},
|
|
2123
|
+
action: "BUY_TO_OPEN",
|
|
2124
|
+
units: 1,
|
|
2125
|
+
},
|
|
2126
|
+
],
|
|
2127
|
+
});
|
|
2128
|
+
```
|
|
2129
|
+
|
|
2130
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2131
|
+
|
|
2132
|
+
##### type: `string`<a id="type-string"></a>
|
|
2133
|
+
|
|
2134
|
+
The type of order to place.
|
|
2135
|
+
|
|
2136
|
+
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2137
|
+
|
|
2138
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
2139
|
+
|
|
2140
|
+
##### legs: [`MlegLeg`](./models/mleg-leg.ts)[]<a id="legs-mleglegmodelsmleg-legts"></a>
|
|
2141
|
+
|
|
2142
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
2143
|
+
|
|
2144
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
2145
|
+
|
|
2146
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
2147
|
+
|
|
2148
|
+
##### limit_price: `string`<a id="limit_price-string"></a>
|
|
2149
|
+
|
|
2150
|
+
The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT.
|
|
2151
|
+
|
|
2152
|
+
##### stop_price: `string`<a id="stop_price-string"></a>
|
|
2153
|
+
|
|
2154
|
+
The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.
|
|
2155
|
+
|
|
2156
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
2157
|
+
|
|
2158
|
+
[MlegOrderResponse](./models/mleg-order-response.ts)
|
|
2159
|
+
|
|
2160
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2161
|
+
|
|
2162
|
+
`/accounts/{accountId}/trading/options` `POST`
|
|
2163
|
+
|
|
2164
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2165
|
+
|
|
2166
|
+
---
|
|
2167
|
+
|
|
2168
|
+
|
|
2100
2169
|
### `snaptrade.trading.placeOrder`<a id="snaptradetradingplaceorder"></a>
|
|
2101
2170
|
|
|
2102
2171
|
Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
|
|
@@ -2324,7 +2393,7 @@ const replaceOrderResponse = await snaptrade.trading.replaceOrder({
|
|
|
2324
2393
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2325
2394
|
action: "BUY",
|
|
2326
2395
|
order_type: "Market",
|
|
2327
|
-
time_in_force: "
|
|
2396
|
+
time_in_force: "Day",
|
|
2328
2397
|
price: 31.33,
|
|
2329
2398
|
symbol: "AAPL",
|
|
2330
2399
|
stop: 31.33,
|
|
@@ -2344,7 +2413,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price` f
|
|
|
2344
2413
|
|
|
2345
2414
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2346
2415
|
|
|
2347
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
2416
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
|
|
2348
2417
|
|
|
2349
2418
|
##### accountId: `string`<a id="accountid-string"></a>
|
|
2350
2419
|
|
|
@@ -8,10 +8,12 @@ import { ManualTradeForm } from '../models';
|
|
|
8
8
|
import { ManualTradeFormBracket } from '../models';
|
|
9
9
|
import { ManualTradeFormWithOptions } from '../models';
|
|
10
10
|
import { ManualTradeReplaceForm } from '../models';
|
|
11
|
+
import { MlegOrderResponse } from '../models';
|
|
11
12
|
import { OrderUpdatedResponse } from '../models';
|
|
12
13
|
import { SimpleOrderPreview } from '../models';
|
|
13
14
|
import { SymbolsQuotesInner } from '../models';
|
|
14
15
|
import { TradingCancelUserAccountOrderRequest } from '../models';
|
|
16
|
+
import { TradingPlaceMlegOrderRequest } from '../models';
|
|
15
17
|
import { TradingPlaceSimpleOrderRequest } from '../models';
|
|
16
18
|
import { TradingSearchCryptocurrencyPairInstruments200Response } from '../models';
|
|
17
19
|
import { ValidatedTradeBody } from '../models';
|
|
@@ -96,6 +98,17 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
|
|
|
96
98
|
* @throws {RequiredError}
|
|
97
99
|
*/
|
|
98
100
|
placeForceOrder: (userId: string, userSecret: string, manualTradeFormWithOptions: ManualTradeFormWithOptions, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
101
|
+
/**
|
|
102
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
103
|
+
* @summary Place multi-leg option order
|
|
104
|
+
* @param {string} userId
|
|
105
|
+
* @param {string} userSecret
|
|
106
|
+
* @param {string} accountId
|
|
107
|
+
* @param {TradingPlaceMlegOrderRequest} tradingPlaceMlegOrderRequest
|
|
108
|
+
* @param {*} [options] Override http request option.
|
|
109
|
+
* @throws {RequiredError}
|
|
110
|
+
*/
|
|
111
|
+
placeMlegOrder: (userId: string, userSecret: string, accountId: string, tradingPlaceMlegOrderRequest: TradingPlaceMlegOrderRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
99
112
|
/**
|
|
100
113
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
101
114
|
* @summary Place checked order
|
|
@@ -215,6 +228,14 @@ export declare const TradingApiFp: (configuration?: Configuration) => {
|
|
|
215
228
|
* @throws {RequiredError}
|
|
216
229
|
*/
|
|
217
230
|
placeForceOrder(requestParameters: TradingApiPlaceForceOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountOrderRecord>>;
|
|
231
|
+
/**
|
|
232
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
233
|
+
* @summary Place multi-leg option order
|
|
234
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
235
|
+
* @param {*} [options] Override http request option.
|
|
236
|
+
* @throws {RequiredError}
|
|
237
|
+
*/
|
|
238
|
+
placeMlegOrder(requestParameters: TradingApiPlaceMlegOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MlegOrderResponse>>;
|
|
218
239
|
/**
|
|
219
240
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
220
241
|
* @summary Place checked order
|
|
@@ -317,6 +338,14 @@ export declare const TradingApiFactory: (configuration?: Configuration, basePath
|
|
|
317
338
|
* @throws {RequiredError}
|
|
318
339
|
*/
|
|
319
340
|
placeForceOrder(requestParameters: TradingApiPlaceForceOrderRequest, options?: AxiosRequestConfig): AxiosPromise<AccountOrderRecord>;
|
|
341
|
+
/**
|
|
342
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
343
|
+
* @summary Place multi-leg option order
|
|
344
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
345
|
+
* @param {*} [options] Override http request option.
|
|
346
|
+
* @throws {RequiredError}
|
|
347
|
+
*/
|
|
348
|
+
placeMlegOrder(requestParameters: TradingApiPlaceMlegOrderRequest, options?: AxiosRequestConfig): AxiosPromise<MlegOrderResponse>;
|
|
320
349
|
/**
|
|
321
350
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
322
351
|
* @summary Place checked order
|
|
@@ -545,6 +574,31 @@ export type TradingApiPlaceForceOrderRequest = {
|
|
|
545
574
|
*/
|
|
546
575
|
readonly userSecret: string;
|
|
547
576
|
} & ManualTradeFormWithOptions;
|
|
577
|
+
/**
|
|
578
|
+
* Request parameters for placeMlegOrder operation in TradingApi.
|
|
579
|
+
* @export
|
|
580
|
+
* @interface TradingApiPlaceMlegOrderRequest
|
|
581
|
+
*/
|
|
582
|
+
export type TradingApiPlaceMlegOrderRequest = {
|
|
583
|
+
/**
|
|
584
|
+
*
|
|
585
|
+
* @type {string}
|
|
586
|
+
* @memberof TradingApiPlaceMlegOrder
|
|
587
|
+
*/
|
|
588
|
+
readonly userId: string;
|
|
589
|
+
/**
|
|
590
|
+
*
|
|
591
|
+
* @type {string}
|
|
592
|
+
* @memberof TradingApiPlaceMlegOrder
|
|
593
|
+
*/
|
|
594
|
+
readonly userSecret: string;
|
|
595
|
+
/**
|
|
596
|
+
*
|
|
597
|
+
* @type {string}
|
|
598
|
+
* @memberof TradingApiPlaceMlegOrder
|
|
599
|
+
*/
|
|
600
|
+
readonly accountId: string;
|
|
601
|
+
} & TradingPlaceMlegOrderRequest;
|
|
548
602
|
/**
|
|
549
603
|
* Request parameters for placeOrder operation in TradingApi.
|
|
550
604
|
* @export
|
|
@@ -758,6 +812,15 @@ export declare class TradingApiGenerated extends BaseAPI {
|
|
|
758
812
|
* @memberof TradingApiGenerated
|
|
759
813
|
*/
|
|
760
814
|
placeForceOrder(requestParameters: TradingApiPlaceForceOrderRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountOrderRecord, any>>;
|
|
815
|
+
/**
|
|
816
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
817
|
+
* @summary Place multi-leg option order
|
|
818
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
819
|
+
* @param {*} [options] Override http request option.
|
|
820
|
+
* @throws {RequiredError}
|
|
821
|
+
* @memberof TradingApiGenerated
|
|
822
|
+
*/
|
|
823
|
+
placeMlegOrder(requestParameters: TradingApiPlaceMlegOrderRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<MlegOrderResponse, any>>;
|
|
761
824
|
/**
|
|
762
825
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
763
826
|
* @summary Place checked order
|
|
@@ -454,6 +454,67 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
454
454
|
options: localVarRequestOptions,
|
|
455
455
|
};
|
|
456
456
|
}),
|
|
457
|
+
/**
|
|
458
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
459
|
+
* @summary Place multi-leg option order
|
|
460
|
+
* @param {string} userId
|
|
461
|
+
* @param {string} userSecret
|
|
462
|
+
* @param {string} accountId
|
|
463
|
+
* @param {TradingPlaceMlegOrderRequest} tradingPlaceMlegOrderRequest
|
|
464
|
+
* @param {*} [options] Override http request option.
|
|
465
|
+
* @throws {RequiredError}
|
|
466
|
+
*/
|
|
467
|
+
placeMlegOrder: (userId, userSecret, accountId, tradingPlaceMlegOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
468
|
+
// verify required parameter 'userId' is not null or undefined
|
|
469
|
+
(0, common_1.assertParamExists)('placeMlegOrder', 'userId', userId);
|
|
470
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
471
|
+
(0, common_1.assertParamExists)('placeMlegOrder', 'userSecret', userSecret);
|
|
472
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
473
|
+
(0, common_1.assertParamExists)('placeMlegOrder', 'accountId', accountId);
|
|
474
|
+
// verify required parameter 'tradingPlaceMlegOrderRequest' is not null or undefined
|
|
475
|
+
(0, common_1.assertParamExists)('placeMlegOrder', 'tradingPlaceMlegOrderRequest', tradingPlaceMlegOrderRequest);
|
|
476
|
+
const localVarPath = `/accounts/{accountId}/trading/options`
|
|
477
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
478
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
479
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
480
|
+
let baseOptions;
|
|
481
|
+
if (configuration) {
|
|
482
|
+
baseOptions = configuration.baseOptions;
|
|
483
|
+
}
|
|
484
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
485
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
486
|
+
const localVarQueryParameter = {};
|
|
487
|
+
// authentication PartnerClientId required
|
|
488
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
489
|
+
// authentication PartnerSignature required
|
|
490
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
491
|
+
// authentication PartnerTimestamp required
|
|
492
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
493
|
+
if (userId !== undefined) {
|
|
494
|
+
localVarQueryParameter['userId'] = userId;
|
|
495
|
+
}
|
|
496
|
+
if (userSecret !== undefined) {
|
|
497
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
498
|
+
}
|
|
499
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
500
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
501
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
502
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
503
|
+
requestBody: tradingPlaceMlegOrderRequest,
|
|
504
|
+
queryParameters: localVarQueryParameter,
|
|
505
|
+
requestConfig: localVarRequestOptions,
|
|
506
|
+
path: localVarPath,
|
|
507
|
+
configuration,
|
|
508
|
+
pathTemplate: '/accounts/{accountId}/trading/options',
|
|
509
|
+
httpMethod: 'POST'
|
|
510
|
+
});
|
|
511
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingPlaceMlegOrderRequest, localVarRequestOptions, configuration);
|
|
512
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
513
|
+
return {
|
|
514
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
515
|
+
options: localVarRequestOptions,
|
|
516
|
+
};
|
|
517
|
+
}),
|
|
457
518
|
/**
|
|
458
519
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
459
520
|
* @summary Place checked order
|
|
@@ -902,6 +963,26 @@ const TradingApiFp = function (configuration) {
|
|
|
902
963
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
903
964
|
});
|
|
904
965
|
},
|
|
966
|
+
/**
|
|
967
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
968
|
+
* @summary Place multi-leg option order
|
|
969
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
970
|
+
* @param {*} [options] Override http request option.
|
|
971
|
+
* @throws {RequiredError}
|
|
972
|
+
*/
|
|
973
|
+
placeMlegOrder(requestParameters, options) {
|
|
974
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
975
|
+
const tradingPlaceMlegOrderRequest = {
|
|
976
|
+
type: requestParameters.type,
|
|
977
|
+
time_in_force: requestParameters.time_in_force,
|
|
978
|
+
limit_price: requestParameters.limit_price,
|
|
979
|
+
stop_price: requestParameters.stop_price,
|
|
980
|
+
legs: requestParameters.legs
|
|
981
|
+
};
|
|
982
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeMlegOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, tradingPlaceMlegOrderRequest, options);
|
|
983
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
984
|
+
});
|
|
985
|
+
},
|
|
905
986
|
/**
|
|
906
987
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
907
988
|
* @summary Place checked order
|
|
@@ -1081,6 +1162,16 @@ const TradingApiFactory = function (configuration, basePath, axios) {
|
|
|
1081
1162
|
placeForceOrder(requestParameters, options) {
|
|
1082
1163
|
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1083
1164
|
},
|
|
1165
|
+
/**
|
|
1166
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
1167
|
+
* @summary Place multi-leg option order
|
|
1168
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
1169
|
+
* @param {*} [options] Override http request option.
|
|
1170
|
+
* @throws {RequiredError}
|
|
1171
|
+
*/
|
|
1172
|
+
placeMlegOrder(requestParameters, options) {
|
|
1173
|
+
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1174
|
+
},
|
|
1084
1175
|
/**
|
|
1085
1176
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
1086
1177
|
* @summary Place checked order
|
|
@@ -1218,6 +1309,17 @@ class TradingApiGenerated extends base_1.BaseAPI {
|
|
|
1218
1309
|
placeForceOrder(requestParameters, options) {
|
|
1219
1310
|
return (0, exports.TradingApiFp)(this.configuration).placeForceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1220
1311
|
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support
|
|
1314
|
+
* @summary Place multi-leg option order
|
|
1315
|
+
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
1316
|
+
* @param {*} [options] Override http request option.
|
|
1317
|
+
* @throws {RequiredError}
|
|
1318
|
+
* @memberof TradingApiGenerated
|
|
1319
|
+
*/
|
|
1320
|
+
placeMlegOrder(requestParameters, options) {
|
|
1321
|
+
return (0, exports.TradingApiFp)(this.configuration).placeMlegOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1322
|
+
}
|
|
1221
1323
|
/**
|
|
1222
1324
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
1223
1325
|
* @summary Place checked order
|