snaptrade-typescript-sdk 12.2.17 → 12.2.18

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/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]
@@ -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.
@@ -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.
@@ -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.
@@ -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.17/typescript" : param.userAgent;
7520
+ this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.18/typescript" : param.userAgent;
7387
7521
  this.formDataCtor = param.formDataCtor;
7388
7522
  }
7389
7523
  /**