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/README.md +143 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +139 -5
- package/dist/index.d.cts +216 -12
- package/dist/index.d.mts +216 -12
- package/dist/index.d.ts +216 -12
- package/dist/index.mjs +139 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -394,7 +394,7 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
394
394
|
};
|
|
395
395
|
},
|
|
396
396
|
/**
|
|
397
|
-
* 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)
|
|
397
|
+
* 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.
|
|
398
398
|
* @summary List historical account total value
|
|
399
399
|
* @param {string} accountId
|
|
400
400
|
* @param {string} [userId]
|
|
@@ -1241,7 +1241,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1241
1241
|
});
|
|
1242
1242
|
},
|
|
1243
1243
|
/**
|
|
1244
|
-
* 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)
|
|
1244
|
+
* 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.
|
|
1245
1245
|
* @summary List historical account total value
|
|
1246
1246
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1247
1247
|
* @param {*} [options] Override http request option.
|
|
@@ -1515,7 +1515,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1515
1515
|
return localVarFp.getAccountActivities(...args).then((request) => request(axios, basePath));
|
|
1516
1516
|
},
|
|
1517
1517
|
/**
|
|
1518
|
-
* 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)
|
|
1518
|
+
* 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.
|
|
1519
1519
|
* @summary List historical account total value
|
|
1520
1520
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1521
1521
|
* @param {*} [options] Override http request option.
|
|
@@ -1646,7 +1646,7 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1646
1646
|
return AccountInformationApiFp(this.configuration).getAccountActivities(...args).then((request) => request(this.axios, this.basePath));
|
|
1647
1647
|
}
|
|
1648
1648
|
/**
|
|
1649
|
-
* 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)
|
|
1649
|
+
* 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.
|
|
1650
1650
|
* @summary List historical account total value
|
|
1651
1651
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1652
1652
|
* @param {*} [options] Override http request option.
|
|
@@ -4108,6 +4108,84 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4108
4108
|
url: toPathString(localVarUrlObj),
|
|
4109
4109
|
options: localVarRequestOptions
|
|
4110
4110
|
};
|
|
4111
|
+
},
|
|
4112
|
+
/**
|
|
4113
|
+
* **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.
|
|
4114
|
+
* @summary Place a simple order (beta)
|
|
4115
|
+
* @param {string} accountId The ID of the account to execute the trade on.
|
|
4116
|
+
* @param {SimpleTradeForm} simpleTradeForm
|
|
4117
|
+
* @param {string} [userId]
|
|
4118
|
+
* @param {string} [userSecret]
|
|
4119
|
+
* @param {*} [options] Override http request option.
|
|
4120
|
+
* @throws {RequiredError}
|
|
4121
|
+
*/
|
|
4122
|
+
placeSimpleOrder: async (accountId, simpleTradeForm, userId, userSecret, options = {}) => {
|
|
4123
|
+
assertParamExists("placeSimpleOrder", "accountId", accountId);
|
|
4124
|
+
assertParamExists("placeSimpleOrder", "simpleTradeForm", simpleTradeForm);
|
|
4125
|
+
const localVarPath = `/accounts/{accountId}/trading/simple`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4126
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4127
|
+
let baseOptions;
|
|
4128
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4129
|
+
const localVarRequestOptions = {
|
|
4130
|
+
method: "POST",
|
|
4131
|
+
...baseOptions,
|
|
4132
|
+
...options
|
|
4133
|
+
};
|
|
4134
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4135
|
+
const localVarQueryParameter = {};
|
|
4136
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4137
|
+
await setApiKeyToObject({
|
|
4138
|
+
object: localVarQueryParameter,
|
|
4139
|
+
key: "clientId",
|
|
4140
|
+
keyParamName: "clientId",
|
|
4141
|
+
configuration
|
|
4142
|
+
});
|
|
4143
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4144
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4145
|
+
}
|
|
4146
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4147
|
+
object: localVarQueryParameter,
|
|
4148
|
+
key: "clientId",
|
|
4149
|
+
keyParamName: "clientId",
|
|
4150
|
+
configuration
|
|
4151
|
+
});
|
|
4152
|
+
const localVarOperationAuth = {
|
|
4153
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4154
|
+
requestSigningByAuthMode: {
|
|
4155
|
+
"commercialApiKey": {
|
|
4156
|
+
secretParameter: "consumerKey",
|
|
4157
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4158
|
+
},
|
|
4159
|
+
"personalApiKey": {
|
|
4160
|
+
secretParameter: "consumerKey",
|
|
4161
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4162
|
+
}
|
|
4163
|
+
},
|
|
4164
|
+
selectedAuthMode: configuration?.authMode
|
|
4165
|
+
};
|
|
4166
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
4167
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4168
|
+
localVarRequestOptions.headers = {
|
|
4169
|
+
...localVarHeaderParameter,
|
|
4170
|
+
...headersFromBaseOptions,
|
|
4171
|
+
...options.headers
|
|
4172
|
+
};
|
|
4173
|
+
requestBeforeHook({
|
|
4174
|
+
requestBody: simpleTradeForm,
|
|
4175
|
+
queryParameters: localVarQueryParameter,
|
|
4176
|
+
requestConfig: localVarRequestOptions,
|
|
4177
|
+
path: localVarPath,
|
|
4178
|
+
configuration,
|
|
4179
|
+
pathTemplate: "/accounts/{accountId}/trading/simple",
|
|
4180
|
+
httpMethod: "POST",
|
|
4181
|
+
operationAuth: localVarOperationAuth
|
|
4182
|
+
});
|
|
4183
|
+
localVarRequestOptions.data = serializeDataIfNeeded(simpleTradeForm, localVarRequestOptions, configuration);
|
|
4184
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4185
|
+
return {
|
|
4186
|
+
url: toPathString(localVarUrlObj),
|
|
4187
|
+
options: localVarRequestOptions
|
|
4188
|
+
};
|
|
4111
4189
|
}
|
|
4112
4190
|
};
|
|
4113
4191
|
};
|
|
@@ -4305,6 +4383,41 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4305
4383
|
}
|
|
4306
4384
|
}
|
|
4307
4385
|
});
|
|
4386
|
+
},
|
|
4387
|
+
/**
|
|
4388
|
+
* **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.
|
|
4389
|
+
* @summary Place a simple order (beta)
|
|
4390
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4391
|
+
* @param {*} [options] Override http request option.
|
|
4392
|
+
* @throws {RequiredError}
|
|
4393
|
+
*/
|
|
4394
|
+
async placeSimpleOrder(...args) {
|
|
4395
|
+
const [requestParameters = {}, options] = args;
|
|
4396
|
+
const simpleTradeForm = {
|
|
4397
|
+
order_type: requestParameters.order_type,
|
|
4398
|
+
time_in_force: requestParameters.time_in_force,
|
|
4399
|
+
legs: requestParameters.legs,
|
|
4400
|
+
limit_price: requestParameters.limit_price,
|
|
4401
|
+
stop_price: requestParameters.stop_price,
|
|
4402
|
+
price_effect: requestParameters.price_effect,
|
|
4403
|
+
client_order_id: requestParameters.client_order_id,
|
|
4404
|
+
expiry_date: requestParameters.expiry_date,
|
|
4405
|
+
notional_value: requestParameters.notional_value,
|
|
4406
|
+
trading_session: requestParameters.trading_session
|
|
4407
|
+
};
|
|
4408
|
+
return createRequestFunction(await localVarAxiosParamCreator.placeSimpleOrder(requestParameters.accountId, simpleTradeForm, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4409
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4410
|
+
requestSigningByAuthMode: {
|
|
4411
|
+
"commercialApiKey": {
|
|
4412
|
+
secretParameter: "consumerKey",
|
|
4413
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4414
|
+
},
|
|
4415
|
+
"personalApiKey": {
|
|
4416
|
+
secretParameter: "consumerKey",
|
|
4417
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
});
|
|
4308
4421
|
}
|
|
4309
4422
|
};
|
|
4310
4423
|
};
|
|
@@ -4393,6 +4506,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4393
4506
|
*/
|
|
4394
4507
|
listSubscriptions(...args) {
|
|
4395
4508
|
return localVarFp.listSubscriptions(...args).then((request) => request(axios, basePath));
|
|
4509
|
+
},
|
|
4510
|
+
/**
|
|
4511
|
+
* **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.
|
|
4512
|
+
* @summary Place a simple order (beta)
|
|
4513
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4514
|
+
* @param {*} [options] Override http request option.
|
|
4515
|
+
* @throws {RequiredError}
|
|
4516
|
+
*/
|
|
4517
|
+
placeSimpleOrder(...args) {
|
|
4518
|
+
return localVarFp.placeSimpleOrder(...args).then((request) => request(axios, basePath));
|
|
4396
4519
|
}
|
|
4397
4520
|
};
|
|
4398
4521
|
};
|
|
@@ -4490,6 +4613,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4490
4613
|
listSubscriptions(...args) {
|
|
4491
4614
|
return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(...args).then((request) => request(this.axios, this.basePath));
|
|
4492
4615
|
}
|
|
4616
|
+
/**
|
|
4617
|
+
* **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.
|
|
4618
|
+
* @summary Place a simple order (beta)
|
|
4619
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4620
|
+
* @param {*} [options] Override http request option.
|
|
4621
|
+
* @throws {RequiredError}
|
|
4622
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4623
|
+
*/
|
|
4624
|
+
placeSimpleOrder(...args) {
|
|
4625
|
+
return ExperimentalEndpointsApiFp(this.configuration).placeSimpleOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
4626
|
+
}
|
|
4493
4627
|
};
|
|
4494
4628
|
//#endregion
|
|
4495
4629
|
//#region api/experimental-endpoints-api.ts
|
|
@@ -7359,7 +7493,7 @@ var Configuration = class {
|
|
|
7359
7493
|
}
|
|
7360
7494
|
this.basePath = param.basePath;
|
|
7361
7495
|
this.baseOptions = param.baseOptions ?? {};
|
|
7362
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.
|
|
7496
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.18/typescript" : param.userAgent;
|
|
7363
7497
|
this.formDataCtor = param.formDataCtor;
|
|
7364
7498
|
}
|
|
7365
7499
|
/**
|