snaptrade-typescript-sdk 12.2.17 → 12.2.19
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 +145 -1
- package/dist/browser.umd.js +10 -10
- package/dist/index.cjs +143 -9
- package/dist/index.d.cts +306 -74
- package/dist/index.d.mts +306 -74
- package/dist/index.d.ts +306 -74
- package/dist/index.mjs +143 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -418,7 +418,7 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
418
418
|
};
|
|
419
419
|
},
|
|
420
420
|
/**
|
|
421
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
421
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
422
422
|
* @summary List historical account total value
|
|
423
423
|
* @param {string} accountId
|
|
424
424
|
* @param {string} [userId]
|
|
@@ -1015,7 +1015,7 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1015
1015
|
};
|
|
1016
1016
|
},
|
|
1017
1017
|
/**
|
|
1018
|
-
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1018
|
+
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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. Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
|
|
1019
1019
|
* @summary List account holdings
|
|
1020
1020
|
* @param {string} accountId
|
|
1021
1021
|
* @param {string} [userId]
|
|
@@ -1265,7 +1265,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1265
1265
|
});
|
|
1266
1266
|
},
|
|
1267
1267
|
/**
|
|
1268
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1268
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1269
1269
|
* @summary List historical account total value
|
|
1270
1270
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1271
1271
|
* @param {*} [options] Override http request option.
|
|
@@ -1450,7 +1450,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1450
1450
|
});
|
|
1451
1451
|
},
|
|
1452
1452
|
/**
|
|
1453
|
-
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1453
|
+
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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. Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
|
|
1454
1454
|
* @summary List account holdings
|
|
1455
1455
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1456
1456
|
* @param {*} [options] Override http request option.
|
|
@@ -1539,7 +1539,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
|
|
|
1539
1539
|
return localVarFp.getAccountActivities(...args).then((request) => request(axios$8, basePath));
|
|
1540
1540
|
},
|
|
1541
1541
|
/**
|
|
1542
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1542
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1543
1543
|
* @summary List historical account total value
|
|
1544
1544
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1545
1545
|
* @param {*} [options] Override http request option.
|
|
@@ -1619,7 +1619,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
|
|
|
1619
1619
|
return localVarFp.getUserAccountReturnRates(...args).then((request) => request(axios$8, basePath));
|
|
1620
1620
|
},
|
|
1621
1621
|
/**
|
|
1622
|
-
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1622
|
+
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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. Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
|
|
1623
1623
|
* @summary List account holdings
|
|
1624
1624
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1625
1625
|
* @param {*} [options] Override http request option.
|
|
@@ -1670,7 +1670,7 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1670
1670
|
return AccountInformationApiFp(this.configuration).getAccountActivities(...args).then((request) => request(this.axios, this.basePath));
|
|
1671
1671
|
}
|
|
1672
1672
|
/**
|
|
1673
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1673
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1674
1674
|
* @summary List historical account total value
|
|
1675
1675
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1676
1676
|
* @param {*} [options] Override http request option.
|
|
@@ -1758,7 +1758,7 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1758
1758
|
return AccountInformationApiFp(this.configuration).getUserAccountReturnRates(...args).then((request) => request(this.axios, this.basePath));
|
|
1759
1759
|
}
|
|
1760
1760
|
/**
|
|
1761
|
-
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1761
|
+
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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. Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
|
|
1762
1762
|
* @summary List account holdings
|
|
1763
1763
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1764
1764
|
* @param {*} [options] Override http request option.
|
|
@@ -4132,6 +4132,84 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4132
4132
|
url: toPathString(localVarUrlObj),
|
|
4133
4133
|
options: localVarRequestOptions
|
|
4134
4134
|
};
|
|
4135
|
+
},
|
|
4136
|
+
/**
|
|
4137
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4138
|
+
* @summary Place a simple order (beta)
|
|
4139
|
+
* @param {string} accountId The ID of the account to execute the trade on.
|
|
4140
|
+
* @param {SimpleTradeForm} simpleTradeForm
|
|
4141
|
+
* @param {string} [userId]
|
|
4142
|
+
* @param {string} [userSecret]
|
|
4143
|
+
* @param {*} [options] Override http request option.
|
|
4144
|
+
* @throws {RequiredError}
|
|
4145
|
+
*/
|
|
4146
|
+
placeSimpleOrder: async (accountId, simpleTradeForm, userId, userSecret, options = {}) => {
|
|
4147
|
+
assertParamExists("placeSimpleOrder", "accountId", accountId);
|
|
4148
|
+
assertParamExists("placeSimpleOrder", "simpleTradeForm", simpleTradeForm);
|
|
4149
|
+
const localVarPath = `/accounts/{accountId}/trading/simple`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4150
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4151
|
+
let baseOptions;
|
|
4152
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4153
|
+
const localVarRequestOptions = {
|
|
4154
|
+
method: "POST",
|
|
4155
|
+
...baseOptions,
|
|
4156
|
+
...options
|
|
4157
|
+
};
|
|
4158
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4159
|
+
const localVarQueryParameter = {};
|
|
4160
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4161
|
+
await setApiKeyToObject({
|
|
4162
|
+
object: localVarQueryParameter,
|
|
4163
|
+
key: "clientId",
|
|
4164
|
+
keyParamName: "clientId",
|
|
4165
|
+
configuration
|
|
4166
|
+
});
|
|
4167
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4168
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4169
|
+
}
|
|
4170
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4171
|
+
object: localVarQueryParameter,
|
|
4172
|
+
key: "clientId",
|
|
4173
|
+
keyParamName: "clientId",
|
|
4174
|
+
configuration
|
|
4175
|
+
});
|
|
4176
|
+
const localVarOperationAuth = {
|
|
4177
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4178
|
+
requestSigningByAuthMode: {
|
|
4179
|
+
"commercialApiKey": {
|
|
4180
|
+
secretParameter: "consumerKey",
|
|
4181
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4182
|
+
},
|
|
4183
|
+
"personalApiKey": {
|
|
4184
|
+
secretParameter: "consumerKey",
|
|
4185
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4186
|
+
}
|
|
4187
|
+
},
|
|
4188
|
+
selectedAuthMode: configuration?.authMode
|
|
4189
|
+
};
|
|
4190
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
4191
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4192
|
+
localVarRequestOptions.headers = {
|
|
4193
|
+
...localVarHeaderParameter,
|
|
4194
|
+
...headersFromBaseOptions,
|
|
4195
|
+
...options.headers
|
|
4196
|
+
};
|
|
4197
|
+
requestBeforeHook({
|
|
4198
|
+
requestBody: simpleTradeForm,
|
|
4199
|
+
queryParameters: localVarQueryParameter,
|
|
4200
|
+
requestConfig: localVarRequestOptions,
|
|
4201
|
+
path: localVarPath,
|
|
4202
|
+
configuration,
|
|
4203
|
+
pathTemplate: "/accounts/{accountId}/trading/simple",
|
|
4204
|
+
httpMethod: "POST",
|
|
4205
|
+
operationAuth: localVarOperationAuth
|
|
4206
|
+
});
|
|
4207
|
+
localVarRequestOptions.data = serializeDataIfNeeded(simpleTradeForm, localVarRequestOptions, configuration);
|
|
4208
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4209
|
+
return {
|
|
4210
|
+
url: toPathString(localVarUrlObj),
|
|
4211
|
+
options: localVarRequestOptions
|
|
4212
|
+
};
|
|
4135
4213
|
}
|
|
4136
4214
|
};
|
|
4137
4215
|
};
|
|
@@ -4329,6 +4407,41 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4329
4407
|
}
|
|
4330
4408
|
}
|
|
4331
4409
|
});
|
|
4410
|
+
},
|
|
4411
|
+
/**
|
|
4412
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4413
|
+
* @summary Place a simple order (beta)
|
|
4414
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4415
|
+
* @param {*} [options] Override http request option.
|
|
4416
|
+
* @throws {RequiredError}
|
|
4417
|
+
*/
|
|
4418
|
+
async placeSimpleOrder(...args) {
|
|
4419
|
+
const [requestParameters = {}, options] = args;
|
|
4420
|
+
const simpleTradeForm = {
|
|
4421
|
+
order_type: requestParameters.order_type,
|
|
4422
|
+
time_in_force: requestParameters.time_in_force,
|
|
4423
|
+
legs: requestParameters.legs,
|
|
4424
|
+
limit_price: requestParameters.limit_price,
|
|
4425
|
+
stop_price: requestParameters.stop_price,
|
|
4426
|
+
price_effect: requestParameters.price_effect,
|
|
4427
|
+
client_order_id: requestParameters.client_order_id,
|
|
4428
|
+
expiry_date: requestParameters.expiry_date,
|
|
4429
|
+
notional_value: requestParameters.notional_value,
|
|
4430
|
+
trading_session: requestParameters.trading_session
|
|
4431
|
+
};
|
|
4432
|
+
return createRequestFunction(await localVarAxiosParamCreator.placeSimpleOrder(requestParameters.accountId, simpleTradeForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4433
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4434
|
+
requestSigningByAuthMode: {
|
|
4435
|
+
"commercialApiKey": {
|
|
4436
|
+
secretParameter: "consumerKey",
|
|
4437
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4438
|
+
},
|
|
4439
|
+
"personalApiKey": {
|
|
4440
|
+
secretParameter: "consumerKey",
|
|
4441
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
4444
|
+
});
|
|
4332
4445
|
}
|
|
4333
4446
|
};
|
|
4334
4447
|
};
|
|
@@ -4417,6 +4530,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4417
4530
|
*/
|
|
4418
4531
|
listSubscriptions(...args) {
|
|
4419
4532
|
return localVarFp.listSubscriptions(...args).then((request) => request(axios$4, basePath));
|
|
4533
|
+
},
|
|
4534
|
+
/**
|
|
4535
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4536
|
+
* @summary Place a simple order (beta)
|
|
4537
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4538
|
+
* @param {*} [options] Override http request option.
|
|
4539
|
+
* @throws {RequiredError}
|
|
4540
|
+
*/
|
|
4541
|
+
placeSimpleOrder(...args) {
|
|
4542
|
+
return localVarFp.placeSimpleOrder(...args).then((request) => request(axios$4, basePath));
|
|
4420
4543
|
}
|
|
4421
4544
|
};
|
|
4422
4545
|
};
|
|
@@ -4514,6 +4637,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4514
4637
|
listSubscriptions(...args) {
|
|
4515
4638
|
return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(...args).then((request) => request(this.axios, this.basePath));
|
|
4516
4639
|
}
|
|
4640
|
+
/**
|
|
4641
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4642
|
+
* @summary Place a simple order (beta)
|
|
4643
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4644
|
+
* @param {*} [options] Override http request option.
|
|
4645
|
+
* @throws {RequiredError}
|
|
4646
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4647
|
+
*/
|
|
4648
|
+
placeSimpleOrder(...args) {
|
|
4649
|
+
return ExperimentalEndpointsApiFp(this.configuration).placeSimpleOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
4650
|
+
}
|
|
4517
4651
|
};
|
|
4518
4652
|
//#endregion
|
|
4519
4653
|
//#region api/experimental-endpoints-api.ts
|
|
@@ -7383,7 +7517,7 @@ var Configuration = class {
|
|
|
7383
7517
|
}
|
|
7384
7518
|
this.basePath = param.basePath;
|
|
7385
7519
|
this.baseOptions = param.baseOptions ?? {};
|
|
7386
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.
|
|
7520
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.19/typescript" : param.userAgent;
|
|
7387
7521
|
this.formDataCtor = param.formDataCtor;
|
|
7388
7522
|
}
|
|
7389
7523
|
/**
|